diff --git a/PWGHF/HFC/TableProducer/producerCharmHadronsTrackFemtoDream.cxx b/PWGHF/HFC/TableProducer/producerCharmHadronsTrackFemtoDream.cxx index a114191cc9f..16f719a25f0 100644 --- a/PWGHF/HFC/TableProducer/producerCharmHadronsTrackFemtoDream.cxx +++ b/PWGHF/HFC/TableProducer/producerCharmHadronsTrackFemtoDream.cxx @@ -287,8 +287,9 @@ struct HfProducerCharmHadronsTrackFemtoDream { doprocessMcXicToXiPiPi, doprocessMcXicToXiPiPiKf, doprocessMcXicToXiPiPiWithML, doprocessMcXicToXiPiPiWithMLKf, doprocessMcXicToXiPiPiGen}; const int nProcesses = std::accumulate(processes.begin(), processes.end(), 0); const bool isSingleProcess = (nProcesses == 1); - const bool isMatchingGenRecPair = (nProcesses == 2 && ((doprocessMcDstarToD0PiGen && (doprocessMcDstarToD0Pi || doprocessMcDstarToD0PiWithML)) || - (doprocessMcDplusToPiKPiGen && (doprocessMcDplusToPiKPi || doprocessMcDplusToPiKPiWithML)))); + constexpr int GenRecProcessCount{2}; + const bool isMatchingGenRecPair = (nProcesses == GenRecProcessCount && ((doprocessMcDstarToD0PiGen && (doprocessMcDstarToD0Pi || doprocessMcDstarToD0PiWithML)) || + (doprocessMcDplusToPiKPiGen && (doprocessMcDplusToPiKPi || doprocessMcDplusToPiKPiWithML)))); if (!isSingleProcess && !isMatchingGenRecPair) { LOGP(fatal, "Enable one process, or corresponding reconstructed and generated MC processes together."); } @@ -501,10 +502,11 @@ struct HfProducerCharmHadronsTrackFemtoDream { template static bool hasPhiAncestor(T const& particles, typename T::iterator const& particle) { + constexpr int MaxElementaryPdg{100}; std::vector pending; std::vector visited{particle.globalIndex()}; if (particle.has_mothers()) { - for (const auto id : particle.mothersIds()) { + for (const auto& id : particle.mothersIds()) { pending.push_back(id); } } @@ -519,15 +521,15 @@ struct HfProducerCharmHadronsTrackFemtoDream { visited.push_back(id); const auto mother = particles.rawIteratorAt(id - particles.offset()); const int absPdg = std::abs(mother.pdgCode()); - if (absPdg == 333) { + if (absPdg == o2::constants::physics::Pdg::kPhi) { return true; } // Stop at the partonic boundary of the hadron decay chain. - if (absPdg <= 100 || RecoDecay::isDiquark(absPdg)) { + if (absPdg <= MaxElementaryPdg || RecoDecay::isDiquark(absPdg)) { continue; } if (mother.has_mothers()) { - for (const auto parentId : mother.mothersIds()) { + for (const auto& parentId : mother.mothersIds()) { pending.push_back(parentId); } }