diff --git a/MC/config/PWGEM/external/generator/Generator_pythia8_embed_HFLepton.C b/MC/config/PWGEM/external/generator/Generator_pythia8_embed_HFLepton.C index f82693d89..9b5207d04 100644 --- a/MC/config/PWGEM/external/generator/Generator_pythia8_embed_HFLepton.C +++ b/MC/config/PWGEM/external/generator/Generator_pythia8_embed_HFLepton.C @@ -11,6 +11,9 @@ using namespace Pythia8; #include + +#include + namespace hf_generators { enum GenType : int { @@ -285,12 +288,14 @@ Bool_t importParticles() override if(idFirstMother >=0) { /// the 1st mother is from charm or beauty, i.e. is not a light-flavoured parton if(idLastMother != idFirstMotherOrig) { - if(idLastMother != -1) { - /// idLastMother is >= 0 + idLastMother = findKey(mapHfParticles, idLastMother); + if(idLastMother < 0) { + // second mother not found, we set it to -1 + idLastMother = -1; } } else { /// idLastMother is equal to idFirstMother - idLastMother = idFirstMother; + idLastMother = idFirstMother; } isFirstMotherOk = true; } @@ -311,15 +316,17 @@ Bool_t importParticles() override const int idMother = findKey(mapHfParticles, idMotherOrig); if(idMother >= 0) { /// this should mean that the mother is from HF, i.e. that we found the correct one - idFirstMother = idMother; - idLastMother = idFirstMother; + if (idFirstMother < 0) { + idFirstMother = idMother; + } + idLastMother = idMother; foundAnyMother = true; - break; } } // set last mother to -1 if no mother has been found so far if (!foundAnyMother) { idLastMother = -1; + idFirstMother = -1; } } @@ -330,8 +337,8 @@ Bool_t importParticles() override /// adjust the particle mother and daughter indices particle.SetFirstMother((idFirstMother >= 0) ? idFirstMother + offset : idFirstMother); particle.SetLastMother((idLastMother >= 0) ? idLastMother + offset : idLastMother); - particle.SetFirstDaughter((idFirstDaughter >= 0) ? idFirstDaughter + offset : idFirstDaughter); - particle.SetLastDaughter((idLastDaughter >= 0) ? idLastDaughter + offset : idLastDaughter); + particle.SetFirstDaughter((idFirstDaughter >= 0) ? idFirstDaughter + offset : idFirstDaughter); + particle.SetLastDaughter((idLastDaughter >= 0) ? idLastDaughter + offset : idLastDaughter); /// copy inside this.mParticles from mGeneratorEvHF.mParticles, i.e. the particles generated in mGeneratorEvHF mParticles.push_back(particle); diff --git a/MC/config/PWGEM/pythia8/generator/pythia8_pp_cr2_forceddecayscharm.cfg b/MC/config/PWGEM/pythia8/generator/pythia8_pp_cr2_forceddecayscharm.cfg index 17b977a62..4ef45709e 100644 --- a/MC/config/PWGEM/pythia8/generator/pythia8_pp_cr2_forceddecayscharm.cfg +++ b/MC/config/PWGEM/pythia8/generator/pythia8_pp_cr2_forceddecayscharm.cfg @@ -38,24 +38,25 @@ BeamRemnants:saturation =5 ### only semileptonic decays ### D+ -411:oneChannel = 1 0.087 0 -311 -11 12 -411:addChannel = 1 0.040 0 -321 211 -11 12 -411:addChannel = 1 0.037 0 -313 -11 12 +411:oneChannel = 1 0.087 22 -11 12 -311 +411:addChannel = 1 0.040 22 -11 12 -321 211 +411:addChannel = 1 0.037 22 -11 12 -313 ### D0 -421:oneChannel = 1 0.035 0 -321 -11 12 -421:addChannel = 1 0.022 0 -323 -11 12 -421:addChannel = 1 0.016 0 -321 111 -11 12 +421:oneChannel = 1 0.035 22 -11 12 -321 +421:addChannel = 1 0.022 22 -11 12 -323 +421:addChannel = 1 0.016 22 -11 12 -321 111 +421:addChannel = 1 0.014 22 -11 12 -311 -211 ### Ds -431:oneChannel = 1 0.025 0 333 -11 12 -431:addChannel = 1 0.027 0 221 -11 12 +431:oneChannel = 1 0.025 22 -11 12 333 +431:addChannel = 1 0.027 22 -11 12 221 ### Lambdac -4122:oneChannel = 1 0.036 0 3122 -11 12 +4122:oneChannel = 1 0.036 22 -11 12 3122 ### chi_{c}^{+} -4232:oneChannel = 1 0.07 0 3322 -11 12 +4232:oneChannel = 1 0.07 22 -11 12 3322 ### chi_{c}^{0} -4132:oneChannel = 1 0.014 0 3312 -11 12 +4132:oneChannel = 1 0.014 22 -11 12 3312 ### Omega_{c} -4332:oneChannel = 1 0.01224 0 3334 -11 12 +4332:oneChannel = 1 0.01224 22 -11 12 3334 # Correct OmegaC decay length (wrong in PYTHIA8 decay table) (mm/c) 4332:tau0 = 0.08000000000