From 976b89bd2e31388389286e39d465c63659cddec6 Mon Sep 17 00:00:00 2001 From: swenzel Date: Wed, 10 Jul 2024 15:19:30 +0200 Subject: [PATCH] Remove superfluous seeding code for GeneratorPythia8 generators This commit harmonizes the seeding procedure of generators based on o2::eventgen::GeneratorPythia8, following a development done in O2 (https://github.com/AliceO2Group/AliceO2/pull/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. --- .../generator/GeneratorBeautyToJpsi_EvtGen.C | 17 +----- .../generator/GeneratorBeautyToMu_EvtGen.C | 7 --- .../GeneratorBeautyToPsiAndJpsi_EvtGen.C | 16 ----- .../generator/GeneratorBeautyToPsi_EvtGen.C | 14 ----- .../GeneratorBplusToJpsiKaon_EvtGen.C | 9 +-- .../generator/GeneratorCharmToMu_EvtGen.C | 7 --- ...pythia8_NonPromptSignals_gaptriggered_dq.C | 59 ++++--------------- .../generator/GeneratorBeautyToEle_EvtGen.C | 7 --- .../generator/GeneratorCharmToEle_EvtGen.C | 7 --- .../generator/GeneratorHFToEleFull_EvtGen.C | 7 --- .../Generator_pythia8_GapTriggered_LFee.C | 3 - .../Generator_pythia8_GapTriggered_LFgamma.C | 3 - .../Generator_pythia8_forcedDecays.C | 14 ++--- .../generator_pythia8_gaptriggered_hf.C | 12 ++-- .../pythia8/generator/pythia8_inel_136tev.cfg | 3 - .../generator/pythia8_inel_pp900gev.cfg | 5 +- .../generator/pythia8_inel_ropes_136tev.cfg | 3 - .../generator_pythia8_antid_and_highpt.C | 3 - .../pythia8/generator_pythia8_coalescence.C | 3 - .../PWGLF/pythia8/generator_pythia8_highpt.C | 3 - .../generator_pythia8_highpt_strangeness.C | 3 - ...generator_pythia8_longlived_gaptriggered.C | 6 -- 22 files changed, 23 insertions(+), 188 deletions(-) diff --git a/MC/config/PWGDQ/external/generator/GeneratorBeautyToJpsi_EvtGen.C b/MC/config/PWGDQ/external/generator/GeneratorBeautyToJpsi_EvtGen.C index bf8b1ea69..21b94ffc6 100644 --- a/MC/config/PWGDQ/external/generator/GeneratorBeautyToJpsi_EvtGen.C +++ b/MC/config/PWGDQ/external/generator/GeneratorBeautyToJpsi_EvtGen.C @@ -32,15 +32,7 @@ FairGenerator* printf("PDG %d \n", std::stoi(spdg)); } gen->SetForceDecay(kEvtBJpsiDiElectron); - - // set random seed - gen->readString("Random:setSeed on"); - uint random_seed; - unsigned long long int random_value = 0; - ifstream urandom("/dev/urandom", ios::in|ios::binary); - urandom.read(reinterpret_cast(&random_value), sizeof(random_seed)); - gen->readString(Form("Random:seed = %d", random_value % 900000001)); - + // print debug // gen->PrintDebug(); @@ -70,13 +62,6 @@ FairGenerator* printf("PDG %d \n", std::stoi(spdg)); } gen->SetForceDecay(kEvtBJpsiDiMuon); - // set random seed - gen->readString("Random:setSeed on"); - uint random_seed; - unsigned long long int random_value = 0; - ifstream urandom("/dev/urandom", ios::in|ios::binary); - urandom.read(reinterpret_cast(&random_value), sizeof(random_seed)); - gen->readString(Form("Random:seed = %d", random_value % 900000001)); // print debug // gen->PrintDebug(); diff --git a/MC/config/PWGDQ/external/generator/GeneratorBeautyToMu_EvtGen.C b/MC/config/PWGDQ/external/generator/GeneratorBeautyToMu_EvtGen.C index 3edfb93dc..b8e022385 100644 --- a/MC/config/PWGDQ/external/generator/GeneratorBeautyToMu_EvtGen.C +++ b/MC/config/PWGDQ/external/generator/GeneratorBeautyToMu_EvtGen.C @@ -32,13 +32,6 @@ GeneratorBeautyToMu_EvtGenFwdY(double rapidityMin = -4.3, double rapidityMax = - } if(forcedecay) gen->SetForceDecay(kEvtSemiMuonic); else gen->SetForceDecay(kEvtAll); - // set random seed - gen->readString("Random:setSeed on"); - uint random_seed; - unsigned long long int random_value = 0; - ifstream urandom("/dev/urandom", ios::in|ios::binary); - urandom.read(reinterpret_cast(&random_value), sizeof(random_seed)); - gen->readString(Form("Random:seed = %d", random_value % 900000001)); // print debug // gen->PrintDebug(); diff --git a/MC/config/PWGDQ/external/generator/GeneratorBeautyToPsiAndJpsi_EvtGen.C b/MC/config/PWGDQ/external/generator/GeneratorBeautyToPsiAndJpsi_EvtGen.C index 98a4763c6..1f63038b4 100644 --- a/MC/config/PWGDQ/external/generator/GeneratorBeautyToPsiAndJpsi_EvtGen.C +++ b/MC/config/PWGDQ/external/generator/GeneratorBeautyToPsiAndJpsi_EvtGen.C @@ -32,15 +32,6 @@ FairGenerator* printf("PDG %d \n", std::stoi(spdg)); } gen->SetForceDecay(kEvtBPsiAndJpsiDiElectron); - - // set random seed - gen->readString("Random:setSeed on"); - uint random_seed; - unsigned long long int random_value = 0; - ifstream urandom("/dev/urandom", ios::in|ios::binary); - urandom.read(reinterpret_cast(&random_value), sizeof(random_seed)); - gen->readString(Form("Random:seed = %d", random_value % 900000001)); - // print debug // gen->PrintDebug(); @@ -70,13 +61,6 @@ FairGenerator* printf("PDG %d \n", std::stoi(spdg)); } gen->SetForceDecay(kEvtBPsiAndJpsiDiMuon); - // set random seed - gen->readString("Random:setSeed on"); - uint random_seed; - unsigned long long int random_value = 0; - ifstream urandom("/dev/urandom", ios::in|ios::binary); - urandom.read(reinterpret_cast(&random_value), sizeof(random_seed)); - gen->readString(Form("Random:seed = %d", random_value % 900000001)); // print debug // gen->PrintDebug(); diff --git a/MC/config/PWGDQ/external/generator/GeneratorBeautyToPsi_EvtGen.C b/MC/config/PWGDQ/external/generator/GeneratorBeautyToPsi_EvtGen.C index f68cd3525..4fa138b8a 100644 --- a/MC/config/PWGDQ/external/generator/GeneratorBeautyToPsi_EvtGen.C +++ b/MC/config/PWGDQ/external/generator/GeneratorBeautyToPsi_EvtGen.C @@ -32,13 +32,6 @@ FairGenerator* printf("PDG %d \n", std::stoi(spdg)); } gen->SetForceDecay(kEvtBPsiDiElectron); - // set random seed - gen->readString("Random:setSeed on"); - uint random_seed; - unsigned long long int random_value = 0; - ifstream urandom("/dev/urandom", ios::in|ios::binary); - urandom.read(reinterpret_cast(&random_value), sizeof(random_seed)); - gen->readString(Form("Random:seed = %d", random_value % 900000001)); // print debug // gen->PrintDebug(); @@ -68,13 +61,6 @@ FairGenerator* printf("PDG %d \n", std::stoi(spdg)); } gen->SetForceDecay(kEvtBPsiDiMuon); - // set random seed - gen->readString("Random:setSeed on"); - uint random_seed; - unsigned long long int random_value = 0; - ifstream urandom("/dev/urandom", ios::in|ios::binary); - urandom.read(reinterpret_cast(&random_value), sizeof(random_seed)); - gen->readString(Form("Random:seed = %d", random_value % 900000001)); // print debug // gen->PrintDebug(); diff --git a/MC/config/PWGDQ/external/generator/GeneratorBplusToJpsiKaon_EvtGen.C b/MC/config/PWGDQ/external/generator/GeneratorBplusToJpsiKaon_EvtGen.C index 01d389f55..d11125753 100644 --- a/MC/config/PWGDQ/external/generator/GeneratorBplusToJpsiKaon_EvtGen.C +++ b/MC/config/PWGDQ/external/generator/GeneratorBplusToJpsiKaon_EvtGen.C @@ -33,13 +33,6 @@ FairGenerator* gen->SetDecayTable(Form("%s/BPLUSTOKAONJPSITOELE.DEC", pathO2.Data())); // print debug // gen->PrintDebug(); - // set random seed - gen->readString("Random:setSeed on"); - uint random_seed; - unsigned long long int random_value = 0; - ifstream urandom("/dev/urandom", ios::in|ios::binary); - urandom.read(reinterpret_cast(&random_value), sizeof(random_seed)); - gen->readString(Form("Random:seed = %d", random_value % 900000001)); - + return gen; } diff --git a/MC/config/PWGDQ/external/generator/GeneratorCharmToMu_EvtGen.C b/MC/config/PWGDQ/external/generator/GeneratorCharmToMu_EvtGen.C index 0f5f45d20..422ff087e 100644 --- a/MC/config/PWGDQ/external/generator/GeneratorCharmToMu_EvtGen.C +++ b/MC/config/PWGDQ/external/generator/GeneratorCharmToMu_EvtGen.C @@ -31,13 +31,6 @@ GeneratorCharmToMu_EvtGenFwdY(double rapidityMin = -4.3, double rapidityMax = -2 printf("PDG %d \n",std::stoi(spdg)); } gen->SetForceDecay(kEvtSemiMuonic); - // set random seed - gen->readString("Random:setSeed on"); - uint random_seed; - unsigned long long int random_value = 0; - ifstream urandom("/dev/urandom", ios::in|ios::binary); - urandom.read(reinterpret_cast(&random_value), sizeof(random_seed)); - gen->readString(Form("Random:seed = %d", random_value % 900000001)); // print debug // gen->PrintDebug(); diff --git a/MC/config/PWGDQ/external/generator/generator_pythia8_NonPromptSignals_gaptriggered_dq.C b/MC/config/PWGDQ/external/generator/generator_pythia8_NonPromptSignals_gaptriggered_dq.C index eac21670c..fe2aadc7a 100644 --- a/MC/config/PWGDQ/external/generator/generator_pythia8_NonPromptSignals_gaptriggered_dq.C +++ b/MC/config/PWGDQ/external/generator/generator_pythia8_NonPromptSignals_gaptriggered_dq.C @@ -64,7 +64,7 @@ public: protected: -Bool_t generateEvent() override + Bool_t generateEvent() override { // reset event bool genOk = false; @@ -90,13 +90,15 @@ Bool_t generateEvent() override return true; } -Bool_t Init() override + Bool_t Init() override { - if(mConfigMBdecays.Contains("cfg")) pythiaMBgen.readFile(mConfigMBdecays.Data()); - GeneratorPythia8::Init(); - pythiaMBgen.init(); - return true; - } + if(mConfigMBdecays.Contains("cfg")) { + pythiaMBgen.readFile(mConfigMBdecays.Data()); + } + GeneratorPythia8::Init(); + pythiaMBgen.init(); + return true; + } // search for q-qbar mother with at least one q in a selected rapidity window bool findHeavyQuarkPair(Pythia8::Event& event) @@ -181,14 +183,6 @@ FairGenerator* } gen->SetForceDecay(kEvtBJpsiDiElectron); - // set random seed - gen->readString("Random:setSeed on"); - uint random_seed; - unsigned long long int random_value = 0; - ifstream urandom("/dev/urandom", ios::in|ios::binary); - urandom.read(reinterpret_cast(&random_value), sizeof(random_seed)); - gen->readString(Form("Random:seed = %d", random_value % 900000001)); - // print debug // gen->PrintDebug(); @@ -219,14 +213,6 @@ FairGenerator* } gen->SetForceDecay(kEvtBPsiAndJpsiDiElectron); - // set random seed - gen->readString("Random:setSeed on"); - uint random_seed; - unsigned long long int random_value = 0; - ifstream urandom("/dev/urandom", ios::in|ios::binary); - urandom.read(reinterpret_cast(&random_value), sizeof(random_seed)); - gen->readString(Form("Random:seed = %d", random_value % 900000001)); - // print debug // gen->PrintDebug(); @@ -261,15 +247,7 @@ FairGenerator* //gen->SetDecayTable(Form("%s/BPLUSTOKAONJPSITOELE.DEC", pathO2.Data())); gen->SetDecayTable(Form("%s/BPLUSTOKAONJPSITOELEALLMODES.DEC", pathO2.Data())); // decay table including decay modes for correlated background // print debug - // gen->PrintDebug(); - // set random seed - gen->readString("Random:setSeed on"); - uint random_seed; - unsigned long long int random_value = 0; - ifstream urandom("/dev/urandom", ios::in|ios::binary); - urandom.read(reinterpret_cast(&random_value), sizeof(random_seed)); - gen->readString(Form("Random:seed = %d", random_value % 900000001)); - + // gen->PrintDebug(); return gen; } @@ -298,14 +276,6 @@ FairGenerator* } gen->SetForceDecay(kEvtBJpsiDiMuon); - // set random seed - gen->readString("Random:setSeed on"); - uint random_seed; - unsigned long long int random_value = 0; - ifstream urandom("/dev/urandom", ios::in|ios::binary); - urandom.read(reinterpret_cast(&random_value), sizeof(random_seed)); - gen->readString(Form("Random:seed = %d", random_value % 900000001)); - // print debug // gen->PrintDebug(); @@ -337,17 +307,8 @@ FairGenerator* } gen->SetForceDecay(kEvtBPsiAndJpsiDiMuon); - // set random seed - gen->readString("Random:setSeed on"); - uint random_seed; - unsigned long long int random_value = 0; - ifstream urandom("/dev/urandom", ios::in|ios::binary); - urandom.read(reinterpret_cast(&random_value), sizeof(random_seed)); - gen->readString(Form("Random:seed = %d", random_value % 900000001)); - // print debug // gen->PrintDebug(); - return gen; } diff --git a/MC/config/PWGEM/external/generator/GeneratorBeautyToEle_EvtGen.C b/MC/config/PWGEM/external/generator/GeneratorBeautyToEle_EvtGen.C index b33e44cf1..0e6050a27 100644 --- a/MC/config/PWGEM/external/generator/GeneratorBeautyToEle_EvtGen.C +++ b/MC/config/PWGEM/external/generator/GeneratorBeautyToEle_EvtGen.C @@ -34,13 +34,6 @@ GeneratorBeautyToEle_EvtGen(double rapidityMin = -2., double rapidityMax = 2., b if(forcedecay) gen->SetForceDecay(kEvtSemiElectronic); else gen->SetForceDecay(kEvtAll); //} - // set random seed - gen->readString("Random:setSeed on"); - uint random_seed; - unsigned long long int random_value = 0; - ifstream urandom("/dev/urandom", ios::in|ios::binary); - urandom.read(reinterpret_cast(&random_value), sizeof(random_seed)); - gen->readString(Form("Random:seed = %d", random_value % 900000001)); // print debug // gen->PrintDebug(); diff --git a/MC/config/PWGEM/external/generator/GeneratorCharmToEle_EvtGen.C b/MC/config/PWGEM/external/generator/GeneratorCharmToEle_EvtGen.C index 60082d27c..71b8f05f3 100644 --- a/MC/config/PWGEM/external/generator/GeneratorCharmToEle_EvtGen.C +++ b/MC/config/PWGEM/external/generator/GeneratorCharmToEle_EvtGen.C @@ -31,13 +31,6 @@ GeneratorCharmToEle_EvtGen(double rapidityMin = -2., double rapidityMax = 2., bo printf("PDG %d \n",std::stoi(spdg)); } gen->SetForceDecay(kEvtSemiElectronic); - // set random seed - gen->readString("Random:setSeed on"); - uint random_seed; - unsigned long long int random_value = 0; - ifstream urandom("/dev/urandom", ios::in|ios::binary); - urandom.read(reinterpret_cast(&random_value), sizeof(random_seed)); - gen->readString(Form("Random:seed = %d", random_value % 900000001)); // print debug // gen->PrintDebug(); diff --git a/MC/config/PWGEM/external/generator/GeneratorHFToEleFull_EvtGen.C b/MC/config/PWGEM/external/generator/GeneratorHFToEleFull_EvtGen.C index 0cebace65..d299ca675 100644 --- a/MC/config/PWGEM/external/generator/GeneratorHFToEleFull_EvtGen.C +++ b/MC/config/PWGEM/external/generator/GeneratorHFToEleFull_EvtGen.C @@ -33,13 +33,6 @@ GeneratorHFToEleFull_EvtGen(bool forcedecay = true, bool allHF = true) } if(forcedecay) gen->SetForceDecay(kEvtSemiElectronic); else gen->SetForceDecay(kEvtAll); - // set random seed - gen->readString("Random:setSeed on"); - uint random_seed; - unsigned long long int random_value = 0; - ifstream urandom("/dev/urandom", ios::in|ios::binary); - urandom.read(reinterpret_cast(&random_value), sizeof(random_seed)); - gen->readString(Form("Random:seed = %d", random_value % 900000001)); // print debug // gen->PrintDebug(); diff --git a/MC/config/PWGEM/external/generator/Generator_pythia8_GapTriggered_LFee.C b/MC/config/PWGEM/external/generator/Generator_pythia8_GapTriggered_LFee.C index ecf5f5de9..31d7b8dd2 100644 --- a/MC/config/PWGEM/external/generator/Generator_pythia8_GapTriggered_LFee.C +++ b/MC/config/PWGEM/external/generator/Generator_pythia8_GapTriggered_LFee.C @@ -449,8 +449,5 @@ class GeneratorPythia8GapTriggeredLFee : public GeneratorPythia8 { // Predefined generators: // this function should be called in ini file. FairGenerator *GeneratorPythia8GapTriggeredLFee_ForEM(int inputTriggerRatio = 5, float yMin=-1.2, float yMax=1.2, int nPart = 1, int mode = -1) { auto myGen = new GeneratorPythia8GapTriggeredLFee(inputTriggerRatio, yMin, yMax, nPart, mode); - auto seed = (gRandom->TRandom::GetSeed() % 900000000); - myGen->readString("Random:setSeed on"); - myGen->readString("Random:seed " + std::to_string(seed)); return myGen; } diff --git a/MC/config/PWGEM/external/generator/Generator_pythia8_GapTriggered_LFgamma.C b/MC/config/PWGEM/external/generator/Generator_pythia8_GapTriggered_LFgamma.C index 7287009b3..50792948f 100644 --- a/MC/config/PWGEM/external/generator/Generator_pythia8_GapTriggered_LFgamma.C +++ b/MC/config/PWGEM/external/generator/Generator_pythia8_GapTriggered_LFgamma.C @@ -162,8 +162,5 @@ class GeneratorPythia8GapTriggeredLFgamma : public GeneratorPythia8 { // Predefined generators: // this function should be called in ini file. FairGenerator *GeneratorPythia8GapTriggeredLFgamma_ForEM(int inputTriggerRatio = 5, float yMin=-1.2, float yMax=1.2, int nPart = 1) { auto myGen = new GeneratorPythia8GapTriggeredLFgamma(inputTriggerRatio, yMin, yMax, nPart); - auto seed = (gRandom->TRandom::GetSeed() % 900000000); - myGen->readString("Random:setSeed on"); - myGen->readString("Random:seed " + std::to_string(seed)); return myGen; } diff --git a/MC/config/PWGEM/external/generator/Generator_pythia8_forcedDecays.C b/MC/config/PWGEM/external/generator/Generator_pythia8_forcedDecays.C index d6117e0b8..275df9354 100644 --- a/MC/config/PWGEM/external/generator/Generator_pythia8_forcedDecays.C +++ b/MC/config/PWGEM/external/generator/Generator_pythia8_forcedDecays.C @@ -10,9 +10,8 @@ namespace eventgen { class DecayerPythia8ForceDecays : public DecayerPythia8 { public: DecayerPythia8ForceDecays(){ - mPythia.readString("Random:setSeed = on"); char* alien_proc_id = getenv("ALIEN_PROC_ID"); - int seed; + long seed; if (alien_proc_id != NULL) { seed = atoi(alien_proc_id); LOG(info) << "Seed for DecayerPythia8 set to ALIEN_PROC_ID: " << seed; @@ -21,7 +20,7 @@ public: LOG(info) << "Setting seed for DecayerPyhtia8 to 0 (random)"; seed = 0; } - mPythia.readString("Random:seed = "+std::to_string(seed)); + setInitialSeed(seed); } ~DecayerPythia8ForceDecays() = default; @@ -109,18 +108,17 @@ class GeneratorPythia8ForcedDecays : public GeneratorPythia8 { public: GeneratorPythia8ForcedDecays(){ - mPythia.readString("Random:setSeed = on"); char* alien_proc_id = getenv("ALIEN_PROC_ID"); - int seed; + long seed; if (alien_proc_id != NULL) { seed = atoi(alien_proc_id); - LOG(info) << "Seed for GeneratorPythia8 set to ALIEN_PROC_ID: " << seed; + LOG(info) << "Seed for DecayerPythia8 set to ALIEN_PROC_ID: " << seed; } else { LOG(info) << "Unable to retrieve ALIEN_PROC_ID"; - LOG(info) << "Setting seed for GeneratorPyhtia8 to 0 (random)"; + LOG(info) << "Setting seed for DecayerPyhtia8 to 0 (random)"; seed = 0; } - mPythia.readString("Random:seed = "+std::to_string(seed)); + setInitialSeed(seed); } ~GeneratorPythia8ForcedDecays() = default; diff --git a/MC/config/PWGHF/external/generator/generator_pythia8_gaptriggered_hf.C b/MC/config/PWGHF/external/generator/generator_pythia8_gaptriggered_hf.C index 2f7ae4226..18838fa8e 100644 --- a/MC/config/PWGHF/external/generator/generator_pythia8_gaptriggered_hf.C +++ b/MC/config/PWGHF/external/generator/generator_pythia8_gaptriggered_hf.C @@ -228,8 +228,7 @@ FairGenerator *GeneratorPythia8GapTriggeredCharm(int inputTriggerRatio, float yQ auto myGen = new GeneratorPythia8GapTriggeredHF(inputTriggerRatio, std::vector{4}, hadronPdgList); 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); myGen->setQuarkRapidity(yQuarkMin, yQuarkMax); if (hadronPdgList.size() != 0) { @@ -244,8 +243,7 @@ FairGenerator *GeneratorPythia8GapTriggeredBeauty(int inputTriggerRatio, float y auto myGen = new GeneratorPythia8GapTriggeredHF(inputTriggerRatio, std::vector{5}, hadronPdgList); 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): myGen->setQuarkRapidity(yQuarkMin, yQuarkMax); if (hadronPdgList.size() != 0) { @@ -260,8 +258,7 @@ FairGenerator *GeneratorPythia8GapTriggeredCharmAndBeauty(int inputTriggerRatio, auto myGen = new GeneratorPythia8GapTriggeredHF(inputTriggerRatio, std::vector{4, 5}, hadronPdgList); 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); myGen->setQuarkRapidity(yQuarkMin, yQuarkMax); if (hadronPdgList.size() != 0) { @@ -279,8 +276,7 @@ FairGenerator *GeneratorPythia8GapHF(int inputTriggerRatio, float yQuarkMin = -1 auto myGen = new GeneratorPythia8GapTriggeredHF(inputTriggerRatio, quarkPdgList, hadronPdgList); 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); myGen->setQuarkRapidity(yQuarkMin, yQuarkMax); myGen->setHadronRapidity(yHadronMin, yHadronMax); diff --git a/MC/config/PWGLF/pythia8/generator/pythia8_inel_136tev.cfg b/MC/config/PWGLF/pythia8/generator/pythia8_inel_136tev.cfg index 1a8453147..b976d1009 100644 --- a/MC/config/PWGLF/pythia8/generator/pythia8_inel_136tev.cfg +++ b/MC/config/PWGLF/pythia8/generator/pythia8_inel_136tev.cfg @@ -13,6 +13,3 @@ ParticleDecays:tau0Max = 10. ### phase space cuts PhaseSpace:pTHatMin = 0.000000 PhaseSpace:pTHatMax = -1.000000 - -Random:setSeed = on -Random:seed = 0 \ No newline at end of file diff --git a/MC/config/PWGLF/pythia8/generator/pythia8_inel_pp900gev.cfg b/MC/config/PWGLF/pythia8/generator/pythia8_inel_pp900gev.cfg index fdff89896..7fe9767ae 100644 --- a/MC/config/PWGLF/pythia8/generator/pythia8_inel_pp900gev.cfg +++ b/MC/config/PWGLF/pythia8/generator/pythia8_inel_pp900gev.cfg @@ -12,7 +12,4 @@ ParticleDecays:tau0Max 10. ### phase space cuts PhaseSpace:pTHatMin = 0.000000 -PhaseSpace:pTHatMax = -1.000000 - -Random:setSeed = on -Random:seed = 0 \ No newline at end of file +PhaseSpace:pTHatMax = -1.000000 \ No newline at end of file diff --git a/MC/config/PWGLF/pythia8/generator/pythia8_inel_ropes_136tev.cfg b/MC/config/PWGLF/pythia8/generator/pythia8_inel_ropes_136tev.cfg index e287ec4ce..7257f2d20 100644 --- a/MC/config/PWGLF/pythia8/generator/pythia8_inel_ropes_136tev.cfg +++ b/MC/config/PWGLF/pythia8/generator/pythia8_inel_ropes_136tev.cfg @@ -14,9 +14,6 @@ ParticleDecays:tau0Max = 10. PhaseSpace:pTHatMin = 0.000000 PhaseSpace:pTHatMax = -1.000000 -Random:setSeed = on -Random:seed = 0 - Ropewalk:RopeHadronization = on Ropewalk:doShoving = off Ropewalk:doFlavour = on diff --git a/MC/config/PWGLF/pythia8/generator_pythia8_antid_and_highpt.C b/MC/config/PWGLF/pythia8/generator_pythia8_antid_and_highpt.C index 327b5aa84..7152c6513 100644 --- a/MC/config/PWGLF/pythia8/generator_pythia8_antid_and_highpt.C +++ b/MC/config/PWGLF/pythia8/generator_pythia8_antid_and_highpt.C @@ -160,8 +160,5 @@ FairGenerator *generateAntidAndHighPt(double p0 = 0.3, double pt_leading = 5.0) { auto myGenerator = new GeneratorPythia8AntidAndHighPt(p0, pt_leading); - auto seed = (gRandom->TRandom::GetSeed() % 900000000); - myGenerator->readString("Random:setSeed on"); - myGenerator->readString("Random:seed " + std::to_string(seed)); return myGenerator; } diff --git a/MC/config/PWGLF/pythia8/generator_pythia8_coalescence.C b/MC/config/PWGLF/pythia8/generator_pythia8_coalescence.C index f679e4d7e..385e527d8 100644 --- a/MC/config/PWGLF/pythia8/generator_pythia8_coalescence.C +++ b/MC/config/PWGLF/pythia8/generator_pythia8_coalescence.C @@ -155,8 +155,5 @@ private: FairGenerator *generateCoalescence(int input_trigger_ratio, double coal_momentum = 0.4) { auto myGen = new GeneratorPythia8Coalescence(input_trigger_ratio, coal_momentum); - auto seed = (gRandom->TRandom::GetSeed() % 900000000); - myGen->readString("Random:setSeed on"); - myGen->readString("Random:seed " + std::to_string(seed)); return myGen; } diff --git a/MC/config/PWGLF/pythia8/generator_pythia8_highpt.C b/MC/config/PWGLF/pythia8/generator_pythia8_highpt.C index 13a2fbe0c..4d522fcc1 100644 --- a/MC/config/PWGLF/pythia8/generator_pythia8_highpt.C +++ b/MC/config/PWGLF/pythia8/generator_pythia8_highpt.C @@ -100,8 +100,5 @@ private: FairGenerator *generateHighPt(int pdg_of_interest = -2212, double pt_leading = 5.0) { auto myGenerator = new GeneratorPythia8HighPt(pdg_of_interest, pt_leading); - auto seed = (gRandom->TRandom::GetSeed() % 900000000); - myGenerator->readString("Random:setSeed on"); - myGenerator->readString("Random:seed " + std::to_string(seed)); return myGenerator; } diff --git a/MC/config/PWGLF/pythia8/generator_pythia8_highpt_strangeness.C b/MC/config/PWGLF/pythia8/generator_pythia8_highpt_strangeness.C index 0dd1984d9..a72911c7a 100644 --- a/MC/config/PWGLF/pythia8/generator_pythia8_highpt_strangeness.C +++ b/MC/config/PWGLF/pythia8/generator_pythia8_highpt_strangeness.C @@ -96,8 +96,5 @@ private: FairGenerator *generateHighPtAndStrangeHadron(double pt_leading = 5.0) { auto myGenerator = new GeneratorPythia8HighPtStrangeness(pt_leading); - auto seed = (gRandom->TRandom::GetSeed() % 900000000); - myGenerator->readString("Random:setSeed on"); - myGenerator->readString("Random:seed " + std::to_string(seed)); return myGenerator; } diff --git a/MC/config/PWGLF/pythia8/generator_pythia8_longlived_gaptriggered.C b/MC/config/PWGLF/pythia8/generator_pythia8_longlived_gaptriggered.C index ff67e41d9..42e0db608 100644 --- a/MC/config/PWGLF/pythia8/generator_pythia8_longlived_gaptriggered.C +++ b/MC/config/PWGLF/pythia8/generator_pythia8_longlived_gaptriggered.C @@ -182,9 +182,6 @@ FairGenerator *generateLongLivedGapTriggered(std::vector mPdg, int input_tr { auto myGen = new GeneratorPythia8LongLivedGapTriggered(mPdg, input_trigger_ratio, n_injected, pt_min, pt_max, y_min, y_max); myGen->setAlternatingPDGsign(alternate_sign); - auto seed = (gRandom->TRandom::GetSeed() % 900000000); - myGen->readString("Random:setSeed on"); - myGen->readString("Random:seed " + std::to_string(seed)); return myGen; } @@ -193,8 +190,5 @@ FairGenerator *generateLongLivedGapTriggered(std::string config_file_name, int i { auto myGen = new GeneratorPythia8LongLivedGapTriggered(config_file_name, input_trigger_ratio); myGen->setAlternatingPDGsign(alternate_sign); - auto seed = (gRandom->TRandom::GetSeed() % 900000000); - myGen->readString("Random:setSeed on"); - myGen->readString("Random:seed " + std::to_string(seed)); return myGen; }