-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pythia8 seeding improvements #1695
base: master
Are you sure you want to change the base?
Pythia8 seeding improvements #1695
Conversation
REQUEST FOR PRODUCTION RELEASES:
This will add The following labels are available |
976b89b
to
5eeeec4
Compare
auto seed = (gRandom->TRandom::GetSeed() % 900000000); | ||
myGen->setUsedSeed(seed); | ||
myGen->readString("Random:setSeed on"); | ||
myGen->readString("Random:seed " + std::to_string(seed)); | ||
myGen->setInitialSeed(seed); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @sawenzel, if I understood correctly the implementation in AliceO2Group/AliceO2#13281, this part is now redundant and can be removed, since it does exactly the steps performed when no specific seed is provided (i.e. takes it from ROOT)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @fcatalan92 : Yes, I think we could simplify this further by taking away even the auto seed = ; ... setInitialSeed()
steps. But I wasn't sure if this breaks something because of setUsedSeed
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, after some recent developments for Pb-Pb HF productions, setUsedSeed
is used to store the seed in our custom generator. This seed is later accessed by generator_pythia8_embed_hf.C
to select a pT-hard bin.
auto seed = dynamic_cast<GeneratorPythia8GapTriggeredHF*>(mGeneratorEvHF)->getUsedSeed(); |
I wonder if a getter to the used seed could be added to GeneratorPythia8
, this will allow us to simplify our custom generators. In this case, I think the seed should be updated when calling GeneratorPythia8::seedGenerator()
.
At this point, all looks good to me for this PR. I can take care of updating the HF generators later on, if the development I proposed is done.
5eeeec4
to
f82b452
Compare
This commit harmonizes the seeding procedure of generators based on o2::eventgen::GeneratorPythia8, following a development done in O2 (AliceO2Group/AliceO2#13281) In principle, o2::eventgen::GeneratorPythia8 now performs it's own seeding within the Init function. This seeding makes sure to integrate with the `--seed` command line option of our event generation executable. The commit: * Removes seeding code in O2DPG when it would override the default behaviour from O2. * Uses a new dedicated function `setInitialSeed` instead of manipulating Pythia8 with config strings (in situations in which the user targets seeding based on ALIEN_PROC_ID for instance). * Ensures that event generation becomes more repeatable in situations when the same `--seed` is given to the event generation executable. This may help to debug crashes on the GRID etc.
f82b452
to
81f99b3
Compare
auto seed = (gRandom->TRandom::GetSeed() % 900000000); | ||
myGen->setUsedSeed(seed); | ||
myGen->readString("Random:setSeed on"); | ||
myGen->readString("Random:seed " + std::to_string(seed)); | ||
myGen->setInitialSeed(seed); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, after some recent developments for Pb-Pb HF productions, setUsedSeed
is used to store the seed in our custom generator. This seed is later accessed by generator_pythia8_embed_hf.C
to select a pT-hard bin.
auto seed = dynamic_cast<GeneratorPythia8GapTriggeredHF*>(mGeneratorEvHF)->getUsedSeed(); |
I wonder if a getter to the used seed could be added to GeneratorPythia8
, this will allow us to simplify our custom generators. In this case, I think the seed should be updated when calling GeneratorPythia8::seedGenerator()
.
At this point, all looks good to me for this PR. I can take care of updating the HF generators later on, if the development I proposed is done.
simplification of seeding code and harmonization thereof