-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check if the proper seed is saved in file
ROOT changes the return value of the GetSeed function of TRandom3. FairRoot uses this function to write the seed value used in the simulation to the FairBaseParSet parameter container for later usage. With ROOT > 6.24 the saved value is wrong due to the change in the ROOT code. Add a test which fails if the used seed value isn't properly stored in the parameter container. (cherry picked from commit 812db13)
- Loading branch information
1 parent
e0a1514
commit 4cd6215
Showing
3 changed files
with
34 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
int compare_seed_value(TString filename, UInt_t initial_seed) { | ||
|
||
// Open parameter file and get the stored random seed from the | ||
// FairBaseParSet parameter container | ||
// Compare the random seed with the expected one set during the | ||
// transport run | ||
|
||
std::unique_ptr<TFile> myFile( TFile::Open(filename) ); | ||
std::unique_ptr<FairBaseParSet> par(myFile->Get<FairBaseParSet>("FairBaseParSet")); | ||
UInt_t seed = par->GetRndSeed(); | ||
|
||
if ( seed == initial_seed ) { | ||
return 0; | ||
} | ||
else { | ||
std::cout << "Expected seed value : " << initial_seed << std::endl; | ||
std::cout << "Seed value from file : " << seed << std::endl; | ||
return 1; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters