diff --git a/PWGJE/Core/JetHFUtilities.h b/PWGJE/Core/JetHFUtilities.h index dcdf022a849..7dc84055cd6 100644 --- a/PWGJE/Core/JetHFUtilities.h +++ b/PWGJE/Core/JetHFUtilities.h @@ -625,7 +625,33 @@ auto matchedHFParticleId(const T& candidate, const U& /*tracks*/, const V& /*par template auto matchedHFParticle(const T& candidate, const U& /*tracks*/, const V& /*particles*/) { - const auto candidateDaughterParticle = candidate.template prong1_as().template mcParticle_as(); + + const typename V::iterator candidateDaughterParticle; + if (std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { + candidateDaughterParticle = candidate.template prong1_as().template mcParticle_as(); + } + if (std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) { + candidateDaughterParticle = candidate.template prong1_as().template mcParticle_as(); + } + if (std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK) { + candidateDaughterParticle = candidate.template prong1_as().template mcParticle_as(); + } + if (std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi) { + candidateDaughterParticle = candidate.template prong3_as().template mcParticle_as(); + } + if (std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { + candidateDaughterParticle = candidate.template prong1_as().template mcParticle_as(); + } + if (std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_beauty::DecayChannelMain::B0ToDminusPi) { + candidateDaughterParticle = candidate.template prong4_as().template mcParticle_as(); + } + if (std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_beauty::DecayChannelMain::BplusToD0Pi) { + candidateDaughterParticle = candidate.template prong3_as().template mcParticle_as(); + } + if (std::abs(candidate.flagMcMatchRec()) == o2::aod::hf_cand_xic_to_xi_pi_pi::DecayType::XicToXiPiPi) { + candidateDaughterParticle = candidate.template prong1_as().template mcParticle_as(); + } + return candidateDaughterParticle.template mothers_first_as(); }