From a532022c2b968851957c6aa58b7cc6cc24f2db11 Mon Sep 17 00:00:00 2001 From: Mattia Faggin Date: Tue, 8 Jul 2025 09:51:27 +0200 Subject: [PATCH 1/2] Fix swap flagging in candidate-creator-3-prong. --- PWGHF/TableProducer/candidateCreator3Prong.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index a9f3f1af19e..e34b714008f 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -1125,6 +1125,17 @@ struct HfCandidateCreator3ProngExpressions { if (indexRec > -1) { flagChannelMain = sign * channelMain; + /// swapping for D+, Ds->Kpipi and Lc->pKpi + if (std::abs(flagChannelMain) == DecayChannelMain::DplusToPiKK || std::abs(flagChannelMain) == DecayChannelMain::DsToPiKK) { + if (arrayDaughters[0].has_mcParticle()) { + swapping = static_cast(std::abs(arrayDaughters[0].mcParticle().pdgCode()) == kPiPlus); + } + } else if (std::abs(flagChannelMain) == DecayChannelMain::LcToPKPi) { + if (arrayDaughters[0].has_mcParticle()) { + swapping = static_cast(std::abs(arrayDaughters[0].mcParticle().pdgCode()) == kPiPlus); + } + } + // Flag the resonant decay channel std::vector arrResoDaughIndex = {}; if (pdgMother == Pdg::kDStar) { From 82bd12282c749365345ae0669c0bf4f773e25daa Mon Sep 17 00:00:00 2001 From: Mattia Faggin Date: Tue, 8 Jul 2025 09:57:43 +0200 Subject: [PATCH 2/2] Simplify. --- PWGHF/TableProducer/candidateCreator3Prong.cxx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index e34b714008f..c60300f41be 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -1126,11 +1126,7 @@ struct HfCandidateCreator3ProngExpressions { flagChannelMain = sign * channelMain; /// swapping for D+, Ds->Kpipi and Lc->pKpi - if (std::abs(flagChannelMain) == DecayChannelMain::DplusToPiKK || std::abs(flagChannelMain) == DecayChannelMain::DsToPiKK) { - if (arrayDaughters[0].has_mcParticle()) { - swapping = static_cast(std::abs(arrayDaughters[0].mcParticle().pdgCode()) == kPiPlus); - } - } else if (std::abs(flagChannelMain) == DecayChannelMain::LcToPKPi) { + if (std::abs(flagChannelMain) == DecayChannelMain::DplusToPiKK || std::abs(flagChannelMain) == DecayChannelMain::DsToPiKK || std::abs(flagChannelMain) == DecayChannelMain::LcToPKPi) { if (arrayDaughters[0].has_mcParticle()) { swapping = static_cast(std::abs(arrayDaughters[0].mcParticle().pdgCode()) == kPiPlus); }