From 535436c010f8dec764c6ff7a177b494b6f7bd760 Mon Sep 17 00:00:00 2001 From: Fabrizio Grosa Date: Mon, 2 Jun 2025 18:09:33 +0200 Subject: [PATCH] PWGHF: Make the HF generator backward compatible in case of replacement --- .../external/generator/generator_pythia8_gaptriggered_hf.C | 4 ++-- .../ini/GeneratorHF_D2H_ccbar_and_bbbar_gap5_DResoTrigger.ini | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) 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 961723971..0a42500da 100644 --- a/MC/config/PWGHF/external/generator/generator_pythia8_gaptriggered_hf.C +++ b/MC/config/PWGHF/external/generator/generator_pythia8_gaptriggered_hf.C @@ -1,5 +1,6 @@ #include "FairGenerator.h" #include "Generators/GeneratorPythia8.h" +#include "Generators/GeneratorPythia8Param.h" #include "Pythia8/Pythia.h" #include "TRandom.h" #include "TDatabasePDG.h" @@ -304,7 +305,7 @@ protected: // we restore the daughter indices of the mothers after the removal int newPartIdx{0}; std::array newMothers = {0, 0}; - if (mGenConfig.includePartonEvent) { // only necessary in case of parton event, otherwise we keep no mother + if (o2::eventgen::GeneratorPythia8Param::Instance().includePartonEvent) { // only necessary in case of parton event, otherwise we keep no mother newMothers[0] = mothers.front(); newMothers[1] = mothers.back(); newPartIdx = mPythia.event.size(); @@ -334,7 +335,6 @@ protected: } } } - auto dauOfMomUp = mPythia.event[mothers[iMom]].daughterList(); } mPythia.event.append(charge * pdgCodeNew, status, newMothers[0], newMothers[1], 0, 0, 0, 0, px, py, pz, energy, mass); diff --git a/MC/config/PWGHF/ini/GeneratorHF_D2H_ccbar_and_bbbar_gap5_DResoTrigger.ini b/MC/config/PWGHF/ini/GeneratorHF_D2H_ccbar_and_bbbar_gap5_DResoTrigger.ini index 8c5f26dd1..493a53901 100644 --- a/MC/config/PWGHF/ini/GeneratorHF_D2H_ccbar_and_bbbar_gap5_DResoTrigger.ini +++ b/MC/config/PWGHF/ini/GeneratorHF_D2H_ccbar_and_bbbar_gap5_DResoTrigger.ini @@ -5,4 +5,5 @@ funcName=GeneratorPythia8GapTriggeredCharmAndBeauty(5, -1.5, 1.5, -1.5, 1.5, {10 [GeneratorPythia8] config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGHF/pythia8/generator/pythia8_charmhadronic_with_decays_DResoTrigger.cfg -includePartonEvent=false # not needed for jet studies, hence no need to keep parton event +includePartonEvent=false +### not needed for jet studies, hence no need to keep parton event