diff --git a/MC/config/PWGHF/external/generator/generator_pythia8_embed_hf.C b/MC/config/PWGHF/external/generator/generator_pythia8_embed_hf.C index c44f6b5ab..d45e4ad72 100644 --- a/MC/config/PWGHF/external/generator/generator_pythia8_embed_hf.C +++ b/MC/config/PWGHF/external/generator/generator_pythia8_embed_hf.C @@ -78,6 +78,20 @@ public: LOG(fatal) << "********** [GeneratorPythia8EmbedHF] bad configuration, fix it! **********"; break; } + + // we set pT hard bins + auto seed = dynamic_cast(mGeneratorEvHF)->getUsedSeed(); + float ptHardBins[4] = {2.76, 20., 50., 1000.}; + int iPt{0}; + if (seed % 10 < 7) { + iPt = 0; + } else if (seed % 10 < 9) { + iPt = 1; + } else { + iPt = 2; + } + dynamic_cast(mGeneratorEvHF)->readString(Form("PhaseSpace:pTHatMin = %f", ptHardBins[iPt])); + dynamic_cast(mGeneratorEvHF)->readString(Form("PhaseSpace:pTHatMax = %f", ptHardBins[iPt+1])); mGeneratorEvHF->Init(); } @@ -393,4 +407,5 @@ FairGenerator * GeneratorPythia8EmbedHFCharmAndBeauty(float yQuarkMin = -1.5, fl myGen->setupGeneratorEvHF(hf_generators::GapTriggeredCharmAndBeauty, yQuarkMin, yQuarkMax, yHadronMin, yHadronMax, hadronPdgList); return myGen; -} \ No newline at end of file +} + 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 462ae589b..2f7ae4226 100644 --- a/MC/config/PWGHF/external/generator/generator_pythia8_gaptriggered_hf.C +++ b/MC/config/PWGHF/external/generator/generator_pythia8_gaptriggered_hf.C @@ -75,6 +75,14 @@ public: mHadRapidityMin = yMin; mHadRapidityMax = yMax; }; + void setUsedSeed(unsigned int seed) + { + mUsedSeed = seed; + }; + unsigned int getUsedSeed() const + { + return mUsedSeed; + }; protected: //__________________________________________________________________ @@ -200,6 +208,7 @@ private: int mHadronPdg; float mHadRapidityMin; float mHadRapidityMax; + unsigned int mUsedSeed; // Control gap-triggering unsigned long long mGeneratedEvents; @@ -218,6 +227,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->setQuarkRapidity(yQuarkMin, yQuarkMax); @@ -233,6 +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->setQuarkRapidity(yQuarkMin, yQuarkMax); @@ -248,6 +259,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->setQuarkRapidity(yQuarkMin, yQuarkMax); @@ -266,6 +278,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->setQuarkRapidity(yQuarkMin, yQuarkMax);