diff --git a/PWGHF/Core/DecayChannels.h b/PWGHF/Core/DecayChannels.h index 21bb6509033..ea52cb68bf1 100644 --- a/PWGHF/Core/DecayChannels.h +++ b/PWGHF/Core/DecayChannels.h @@ -60,21 +60,21 @@ enum DecayChannelResonant : int8_t { LastChannelResonant }; -std::unordered_map > finalStates2Prongs = -{ - {DecayChannelMain::D0ToPiK, std::vector{+kKMinus, +kPiPlus}}, - {DecayChannelMain::D0ToPiKPi0, std::vector{+kKMinus, +kPiPlus, +kPi0}}, - {DecayChannelMain::D0ToPiPi, std::vector{+kPiMinus, +kPiPlus}}, - {DecayChannelMain::D0ToPiPiPi0, std::vector{+kPiMinus, +kPiPlus, +kPi0}}, - {DecayChannelMain::D0ToKK, std::vector{+kKMinus, +kKPlus}}, +std::unordered_map> finalStates2Prongs = + { + {DecayChannelMain::D0ToPiK, std::vector{+kKMinus, +kPiPlus}}, + {DecayChannelMain::D0ToPiKPi0, std::vector{+kKMinus, +kPiPlus, +kPi0}}, + {DecayChannelMain::D0ToPiPi, std::vector{+kPiMinus, +kPiPlus}}, + {DecayChannelMain::D0ToPiPiPi0, std::vector{+kPiMinus, +kPiPlus, +kPi0}}, + {DecayChannelMain::D0ToKK, std::vector{+kKMinus, +kKPlus}}, }; -std::unordered_map > resoStatesD0 = -{ - {DecayChannelResonant::D0ToRhoplusPi, std::array{213, +kPiMinus}}, - {DecayChannelResonant::D0ToRhoplusK, std::array{213, +kKMinus}}, - {DecayChannelResonant::D0ToKstar0Pi0, std::array{-kK0Star892, +kPi0}}, - {DecayChannelResonant::D0ToKstarPi, std::array{-kKPlusStar892, +kPiPlus}}, +std::unordered_map> resoStatesD0 = + { + {DecayChannelResonant::D0ToRhoplusPi, std::array{213, +kPiMinus}}, + {DecayChannelResonant::D0ToRhoplusK, std::array{213, +kKMinus}}, + {DecayChannelResonant::D0ToKstar0Pi0, std::array{-kK0Star892, +kPi0}}, + {DecayChannelResonant::D0ToKstarPi, std::array{-kKPlusStar892, +kPiPlus}}, }; } // namespace hf_cand_2prong @@ -95,13 +95,13 @@ enum DecayChannelMain : int8_t { DsToPiPiPi, // 8, π+ π− π+ DsToPiPiPiPi0, // 9, π+ π− π+ π0 // D*+ - DstarToPiKPi, // 10, π+ K− π+ (from [(D0 → π+ K−) π+]) - DstarToPiKPiPi0, // 11, π+ K− π+ π0 - DstarToPiKPiPi0Pi0, // 12, π+ K− π+ π0 π0 - DstarToPiKK, // 13, π+ K− K+ - DstarToPiKKPi0, // 14, π+ K− K+ π0 - DstarToPiPiPi, // 15, π+ π− π+ - DstarToPiPiPiPi0, // 16, π+ π− π+ π0 + DstarToPiKPi, // 10, π+ K− π+ (from [(D0 → π+ K−) π+]) + DstarToPiKPiPi0, // 11, π+ K− π+ π0 + DstarToPiKPiPi0Pi0, // 12, π+ K− π+ π0 π0 + DstarToPiKK, // 13, π+ K− K+ + DstarToPiKKPi0, // 14, π+ K− K+ π0 + DstarToPiPiPi, // 15, π+ π− π+ + DstarToPiPiPiPi0, // 16, π+ π− π+ π0 // Λc+ LcToPKPi, // 17, p K− π+ LcToPKPiPi0, // 18, p K− π+ π0 @@ -153,99 +153,98 @@ enum DecayChannelResonant : int8_t { LastChannelResonant }; -std::unordered_map > resoStatesDPlus = -{ - {DecayChannelResonant::DplusToPhiPi, std::array{+kPhi, +kPiPlus}}, - {DecayChannelResonant::DplusToKstar0K, std::array{-kK0Star892, +kKPlus}}, - {DecayChannelResonant::DplusToKstar1430_0K, std::array{+10311, +kKPlus}}, - {DecayChannelResonant::DplusToRho0Pi, std::array{+113, +kPiPlus}}, - {DecayChannelResonant::DplusToF2_1270Pi, std::array{+225, +kPiPlus}}, +std::unordered_map> resoStatesDPlus = + { + {DecayChannelResonant::DplusToPhiPi, std::array{+kPhi, +kPiPlus}}, + {DecayChannelResonant::DplusToKstar0K, std::array{-kK0Star892, +kKPlus}}, + {DecayChannelResonant::DplusToKstar1430_0K, std::array{+10311, +kKPlus}}, + {DecayChannelResonant::DplusToRho0Pi, std::array{+113, +kPiPlus}}, + {DecayChannelResonant::DplusToF2_1270Pi, std::array{+225, +kPiPlus}}, }; -std::unordered_map > finalStatesDPlus = -{ - {DecayChannelMain::DplusToPiKPi, std::vector{+kKMinus, +kKPlus, +kPiPlus}}, - {DecayChannelMain::DplusToPiKK, std::vector{+kKMinus, +kPiPlus, +kPiPlus}}, - {DecayChannelMain::DplusToPiKPiPi0, std::vector{+kKMinus, +kPiPlus, +kPiPlus, +kPi0}}, - {DecayChannelMain::DplusToPiPiPi, std::vector{+kPiMinus, +kPiPlus, +kPiPlus}}, +std::unordered_map> finalStatesDPlus = + { + {DecayChannelMain::DplusToPiKPi, std::vector{+kKMinus, +kKPlus, +kPiPlus}}, + {DecayChannelMain::DplusToPiKK, std::vector{+kKMinus, +kPiPlus, +kPiPlus}}, + {DecayChannelMain::DplusToPiKPiPi0, std::vector{+kKMinus, +kPiPlus, +kPiPlus, +kPi0}}, + {DecayChannelMain::DplusToPiPiPi, std::vector{+kPiMinus, +kPiPlus, +kPiPlus}}, }; - + // Ds± → K± K∓ π± -std::unordered_map > resoStatesDs = -{ - {DecayChannelResonant::DsToPhiPi, std::array{+kPhi, +kPiPlus}}, - {DecayChannelResonant::DsToPhiRhoplus, std::array{+kPhi, +213}}, - {DecayChannelResonant::DsToKstar0K, std::array{-kK0Star892, +kKPlus}}, - {DecayChannelResonant::DsToKstar0Pi, std::array{+kK0Star892, +kPiPlus}}, - {DecayChannelResonant::DsToRho0Pi, std::array{113, +kPiPlus}}, - {DecayChannelResonant::DsToRho0K, std::array{113, +kKPlus}}, - {DecayChannelResonant::DsToF2_1270Pi, std::array{225, +kPiPlus}}, - {DecayChannelResonant::DsToF0_1370K, std::array{10221, +kKPlus}}, - {DecayChannelResonant::DsToEtaPi, std::array{221, +kPiPlus}}, +std::unordered_map> resoStatesDs = + { + {DecayChannelResonant::DsToPhiPi, std::array{+kPhi, +kPiPlus}}, + {DecayChannelResonant::DsToPhiRhoplus, std::array{+kPhi, +213}}, + {DecayChannelResonant::DsToKstar0K, std::array{-kK0Star892, +kKPlus}}, + {DecayChannelResonant::DsToKstar0Pi, std::array{+kK0Star892, +kPiPlus}}, + {DecayChannelResonant::DsToRho0Pi, std::array{113, +kPiPlus}}, + {DecayChannelResonant::DsToRho0K, std::array{113, +kKPlus}}, + {DecayChannelResonant::DsToF2_1270Pi, std::array{225, +kPiPlus}}, + {DecayChannelResonant::DsToF0_1370K, std::array{10221, +kKPlus}}, + {DecayChannelResonant::DsToEtaPi, std::array{221, +kPiPlus}}, }; -std::unordered_map > finalStatesDs = -{ - {DecayChannelMain::DsToPiKK, std::vector{+kKMinus, +kKPlus, +kPiPlus}}, - {DecayChannelMain::DsToPiKKPi0, std::vector{+kKMinus, +kKPlus, +kPiPlus, +kPi0}}, - {DecayChannelMain::DsToPiPiK, std::vector{+kKPlus, +kPiPlus, +kPiMinus}}, - {DecayChannelMain::DsToPiPiPi, std::vector{+kPiMinus, +kPiPlus, +kPiPlus}}, - {DecayChannelMain::DsToPiPiPiPi0, std::vector{+kPiMinus, +kPiPlus, +kPiPlus, +kPi0}}, +std::unordered_map> finalStatesDs = + { + {DecayChannelMain::DsToPiKK, std::vector{+kKMinus, +kKPlus, +kPiPlus}}, + {DecayChannelMain::DsToPiKKPi0, std::vector{+kKMinus, +kKPlus, +kPiPlus, +kPi0}}, + {DecayChannelMain::DsToPiPiK, std::vector{+kKPlus, +kPiPlus, +kPiMinus}}, + {DecayChannelMain::DsToPiPiPi, std::vector{+kPiMinus, +kPiPlus, +kPiPlus}}, + {DecayChannelMain::DsToPiPiPiPi0, std::vector{+kPiMinus, +kPiPlus, +kPiPlus, +kPi0}}, }; // Dstar → K± K∓ π± -std::unordered_map > resoStatesDstar = -{ - {DecayChannelResonant::DstarToD0ToRhoplusPi, std::array{213, +kPiMinus}}, - {DecayChannelResonant::DstarToD0ToRhoplusK, std::array{213, +kKMinus}}, - {DecayChannelResonant::DstarToD0ToKstar0Pi0, std::array{-kK0Star892, +kPi0}}, - {DecayChannelResonant::DstarToD0ToKstarPi, std::array{-kKPlusStar892, +kPiPlus}}, - {DecayChannelResonant::DstarToDplusToPhiPi, std::array{+kPhi, +kPiPlus}}, - {DecayChannelResonant::DstarToDplusToKstar0K, std::array{-kK0Star892, +kKPlus}}, - {DecayChannelResonant::DstarToDplusToKstar1430_0K, std::array{+10311, +kKPlus}}, - {DecayChannelResonant::DstarToDplusToRho0Pi, std::array{+113, +kPiPlus}}, - {DecayChannelResonant::DstarToDplusToF2_1270Pi, std::array{+225, +kPiPlus}}, +std::unordered_map> resoStatesDstar = + { + {DecayChannelResonant::DstarToD0ToRhoplusPi, std::array{213, +kPiMinus}}, + {DecayChannelResonant::DstarToD0ToRhoplusK, std::array{213, +kKMinus}}, + {DecayChannelResonant::DstarToD0ToKstar0Pi0, std::array{-kK0Star892, +kPi0}}, + {DecayChannelResonant::DstarToD0ToKstarPi, std::array{-kKPlusStar892, +kPiPlus}}, + {DecayChannelResonant::DstarToDplusToPhiPi, std::array{+kPhi, +kPiPlus}}, + {DecayChannelResonant::DstarToDplusToKstar0K, std::array{-kK0Star892, +kKPlus}}, + {DecayChannelResonant::DstarToDplusToKstar1430_0K, std::array{+10311, +kKPlus}}, + {DecayChannelResonant::DstarToDplusToRho0Pi, std::array{+113, +kPiPlus}}, + {DecayChannelResonant::DstarToDplusToF2_1270Pi, std::array{+225, +kPiPlus}}, }; -std::unordered_map > finalStatesDstar = -{ - {DecayChannelMain::DstarToPiKPi, std::vector{+kKMinus, +kPiPlus, +kPiPlus}}, - {DecayChannelMain::DstarToPiKPiPi0, std::vector{+kKMinus, +kPiPlus, +kPiPlus, +kPi0}}, - {DecayChannelMain::DstarToPiKPiPi0Pi0, std::vector{+kKMinus, +kPiPlus, +kPiPlus, +kPi0, +kPi0}}, - {DecayChannelMain::DstarToPiKK, std::vector{+kKMinus, +kKPlus, +kPiPlus}}, - {DecayChannelMain::DstarToPiKKPi0, std::vector{+kKMinus, +kKPlus, +kPiPlus, +kPi0}}, - {DecayChannelMain::DstarToPiPiPi, std::vector{+kPiMinus, +kPiPlus, +kPiPlus}}, - {DecayChannelMain::DstarToPiPiPiPi0, std::vector{+kPiMinus, +kPiPlus, +kPiPlus, +kPi0}}, +std::unordered_map> finalStatesDstar = + { + {DecayChannelMain::DstarToPiKPi, std::vector{+kKMinus, +kPiPlus, +kPiPlus}}, + {DecayChannelMain::DstarToPiKPiPi0, std::vector{+kKMinus, +kPiPlus, +kPiPlus, +kPi0}}, + {DecayChannelMain::DstarToPiKPiPi0Pi0, std::vector{+kKMinus, +kPiPlus, +kPiPlus, +kPi0, +kPi0}}, + {DecayChannelMain::DstarToPiKK, std::vector{+kKMinus, +kKPlus, +kPiPlus}}, + {DecayChannelMain::DstarToPiKKPi0, std::vector{+kKMinus, +kKPlus, +kPiPlus, +kPi0}}, + {DecayChannelMain::DstarToPiPiPi, std::vector{+kPiMinus, +kPiPlus, +kPiPlus}}, + {DecayChannelMain::DstarToPiPiPiPi0, std::vector{+kPiMinus, +kPiPlus, +kPiPlus, +kPi0}}, }; // Lc → p K∓ π± -std::unordered_map > resoStatesLambdaC = -{ - {DecayChannelResonant::LcToPKstar0, std::array{+kK0Star892, +kProton}}, - {DecayChannelResonant::LcToDeltaplusplusK, std::array{+2224, +kKMinus}}, - {DecayChannelResonant::LcToL1520Pi, std::array{+102134, +kPiPlus}}, +std::unordered_map> resoStatesLambdaC = + { + {DecayChannelResonant::LcToPKstar0, std::array{+kK0Star892, +kProton}}, + {DecayChannelResonant::LcToDeltaplusplusK, std::array{+2224, +kKMinus}}, + {DecayChannelResonant::LcToL1520Pi, std::array{+102134, +kPiPlus}}, }; -std::unordered_map > finalStatesLc = -{ - {DecayChannelMain::LcToPKPi, std::vector{+kProton, +kKMinus, +kPiPlus}}, - {DecayChannelMain::LcToPKPiPi0, std::vector{+kProton, +kKMinus, +kPiPlus, +kPi0}}, - {DecayChannelMain::LcToPPiPi, std::vector{+kProton, +kPiMinus, +kPiPlus}}, - {DecayChannelMain::LcToPKK, std::vector{+kProton, +kKMinus, +kKPlus}} -}; - +std::unordered_map> finalStatesLc = + { + {DecayChannelMain::LcToPKPi, std::vector{+kProton, +kKMinus, +kPiPlus}}, + {DecayChannelMain::LcToPKPiPi0, std::vector{+kProton, +kKMinus, +kPiPlus, +kPi0}}, + {DecayChannelMain::LcToPPiPi, std::vector{+kProton, +kPiMinus, +kPiPlus}}, + {DecayChannelMain::LcToPKK, std::vector{+kProton, +kKMinus, +kKPlus}}}; + // Xic → p K∓ π± -std::unordered_map > resoStatesXiC = -{ - {DecayChannelResonant::XicToPKstar0, std::array{-kK0Star892, +kProton}}, - {DecayChannelResonant::XicToPPhi, std::array{+kProton, +kPhi}}, +std::unordered_map> resoStatesXiC = + { + {DecayChannelResonant::XicToPKstar0, std::array{-kK0Star892, +kProton}}, + {DecayChannelResonant::XicToPPhi, std::array{+kProton, +kPhi}}, }; -std::unordered_map > finalStatesXic = -{ - {DecayChannelMain::XicToPKPi, std::vector{+kProton, +kKMinus, +kPiPlus}}, - {DecayChannelMain::XicToPKK, std::vector{+kProton, +kKMinus, +kKPlus}}, - {DecayChannelMain::XicToSPiPi, std::vector{+kSigmaPlus, +kPiMinus, +kPiPlus}}, +std::unordered_map> finalStatesXic = + { + {DecayChannelMain::XicToPKPi, std::vector{+kProton, +kKMinus, +kPiPlus}}, + {DecayChannelMain::XicToPKK, std::vector{+kProton, +kKMinus, +kKPlus}}, + {DecayChannelMain::XicToSPiPi, std::vector{+kSigmaPlus, +kPiMinus, +kPiPlus}}, }; } // namespace hf_cand_3prong @@ -314,102 +313,106 @@ enum DecayChannelResonant : int8_t { namespace o2::hf_corrbkg { - using namespace o2::hf_decay; +using namespace o2::hf_decay; - /// Returns a map of the possible final states for a specific 3-prong particle specie - /// \param pdgMother PDG code of the mother particle - /// \return a map of final states with their corresponding PDG codes - std::unordered_map > getDecayChannel3Prong(int pdgMother) { - switch (pdgMother) { - case Pdg::kDPlus: - return hf_cand_3prong::finalStatesDPlus; - case Pdg::kDS: - return hf_cand_3prong::finalStatesDs; - case Pdg::kDStar: - return hf_cand_3prong::finalStatesDstar; - case Pdg::kLambdaCPlus: - return hf_cand_3prong::finalStatesLc; - case Pdg::kXiCPlus: - return hf_cand_3prong::finalStatesXic; - default: - LOG(error) << "Unknown PDG code for 3-prong final states: " << pdgMother; - return {}; - } +/// Returns a map of the possible final states for a specific 3-prong particle specie +/// \param pdgMother PDG code of the mother particle +/// \return a map of final states with their corresponding PDG codes +std::unordered_map> getDecayChannel3Prong(int pdgMother) +{ + switch (pdgMother) { + case Pdg::kDPlus: + return hf_cand_3prong::finalStatesDPlus; + case Pdg::kDS: + return hf_cand_3prong::finalStatesDs; + case Pdg::kDStar: + return hf_cand_3prong::finalStatesDstar; + case Pdg::kLambdaCPlus: + return hf_cand_3prong::finalStatesLc; + case Pdg::kXiCPlus: + return hf_cand_3prong::finalStatesXic; + default: + LOG(error) << "Unknown PDG code for 3-prong final states: " << pdgMother; + return {}; } +} - /// Returns a map of the resonant decay channels for a specific 3-prong particle specie - /// \param pdgMother PDG code of the mother particle - /// \return a map of resonant decay channels with their corresponding PDG codes - std::unordered_map > getResoChannels3Prong(int pdgMother) { - switch (pdgMother) { - case Pdg::kDPlus: - return hf_cand_3prong::resoStatesDPlus; - case Pdg::kDS: - return hf_cand_3prong::resoStatesDs; - case Pdg::kDStar: - return hf_cand_3prong::resoStatesDstar; - case Pdg::kLambdaCPlus: - return hf_cand_3prong::resoStatesLambdaC; - case Pdg::kXiCPlus: - return hf_cand_3prong::resoStatesXiC; - default: - LOG(error) << "Unknown PDG code for 3-prong final states: " << pdgMother; - return {}; - } +/// Returns a map of the resonant decay channels for a specific 3-prong particle specie +/// \param pdgMother PDG code of the mother particle +/// \return a map of resonant decay channels with their corresponding PDG codes +std::unordered_map> getResoChannels3Prong(int pdgMother) +{ + switch (pdgMother) { + case Pdg::kDPlus: + return hf_cand_3prong::resoStatesDPlus; + case Pdg::kDS: + return hf_cand_3prong::resoStatesDs; + case Pdg::kDStar: + return hf_cand_3prong::resoStatesDstar; + case Pdg::kLambdaCPlus: + return hf_cand_3prong::resoStatesLambdaC; + case Pdg::kXiCPlus: + return hf_cand_3prong::resoStatesXiC; + default: + LOG(error) << "Unknown PDG code for 3-prong final states: " << pdgMother; + return {}; } +} - /// Perform the matching for a single resonant channel - /// \tparam N size of the array of daughter PDG codes - /// \param arrPdgResoChn array of daughter indices - /// \param arrPdgDaugs array of PDG codes for the resonant decay - /// \return true if the resonant channel is matched, false otherwise - template - bool checkResonantDecay(std::array arrPdgResoChn, std::array arrPdgDaugs) { - for (size_t i = 0; i < N; i++) { - bool findDaug = false; - for (size_t j = 0; j < N; j++) { - if (std::abs(arrPdgResoChn[i]) == std::abs(arrPdgDaugs[j])) { - arrPdgDaugs[j] = -1; // Mark as found - findDaug = true; - break; - } - } - if (!findDaug) { - return false; +/// Perform the matching for a single resonant channel +/// \tparam N size of the array of daughter PDG codes +/// \param arrPdgResoChn array of daughter indices +/// \param arrPdgDaugs array of PDG codes for the resonant decay +/// \return true if the resonant channel is matched, false otherwise +template +bool checkResonantDecay(std::array arrPdgResoChn, std::array arrPdgDaugs) +{ + for (size_t i = 0; i < N; i++) { + bool findDaug = false; + for (size_t j = 0; j < N; j++) { + if (std::abs(arrPdgResoChn[i]) == std::abs(arrPdgDaugs[j])) { + arrPdgDaugs[j] = -1; // Mark as found + findDaug = true; + break; } } - return true; + if (!findDaug) { + return false; + } } + return true; +} - /// Flag the resonant decays - /// Function documentation: - /// \tparam is3Prong bool to specify if the mother decays with a 3-prong decay - /// \tparam N size of the array of daughter PDG codes - /// \param motherPdg PDG code of the mother particle - /// \param channel decay channel flag to be set - /// \param arrDaughPdgs array of daughter PDG codes - template - void flagResonantDecay(int motherPdg, int8_t* channel, std::array arrDaughPdgs) { - if constexpr (is3Prong) { - std::unordered_map > resoStates = getResoChannels3Prong(motherPdg); - for (const auto& [flag, pdgCodes] : resoStates) { - if (checkResonantDecay(arrDaughPdgs, pdgCodes)) { - *channel = flag; - break; - } - } - } else { - if (motherPdg != Pdg::kD0) { - return; +/// Flag the resonant decays +/// Function documentation: +/// \tparam is3Prong bool to specify if the mother decays with a 3-prong decay +/// \tparam N size of the array of daughter PDG codes +/// \param motherPdg PDG code of the mother particle +/// \param channel decay channel flag to be set +/// \param arrDaughPdgs array of daughter PDG codes +template +void flagResonantDecay(int motherPdg, int8_t* channel, std::array arrDaughPdgs) +{ + if constexpr (is3Prong) { + std::unordered_map> resoStates = getResoChannels3Prong(motherPdg); + for (const auto& [flag, pdgCodes] : resoStates) { + if (checkResonantDecay(arrDaughPdgs, pdgCodes)) { + *channel = flag; + break; } - for (const auto& [flag, pdgCodes] : hf_cand_2prong::resoStatesD0) { - if (checkResonantDecay(arrDaughPdgs, pdgCodes)) { - *channel = flag; - break; - } + } + } else { + if (motherPdg != Pdg::kD0) { + return; + } + for (const auto& [flag, pdgCodes] : hf_cand_2prong::resoStatesD0) { + if (checkResonantDecay(arrDaughPdgs, pdgCodes)) { + *channel = flag; + break; } } } +} } // namespace o2::hf_corrbkg #endif // PWGHF_CORE_DECAYCHANNELS_H_ diff --git a/PWGHF/TableProducer/candidateCreator2Prong.cxx b/PWGHF/TableProducer/candidateCreator2Prong.cxx index 48705953b1d..5ef9bd1b736 100644 --- a/PWGHF/TableProducer/candidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator2Prong.cxx @@ -780,9 +780,9 @@ struct HfCandidateCreator2ProngExpressions { int depth = 2; for (const auto& [chn, finalState] : finalStates2Prongs) { std::array finalStateParts2Prong = std::array{finalState[0], finalState[1]}; - if (finalState.size() == 3) { // Partly Reco 2-prong decays + if (finalState.size() == 3) { // Partly Reco 2-prong decays if (matchKinkedDecayTopology && matchInteractionsWithMaterial) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, finalStateParts2Prong, true, &sign, depth, &nKinkedTracks, &nInteractionsWithMaterial); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, finalStateParts2Prong, true, &sign, depth, &nKinkedTracks, &nInteractionsWithMaterial); } else if (matchKinkedDecayTopology && !matchInteractionsWithMaterial) { indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, finalStateParts2Prong, true, &sign, depth, &nKinkedTracks); } else if (!matchKinkedDecayTopology && matchInteractionsWithMaterial) { @@ -790,7 +790,7 @@ struct HfCandidateCreator2ProngExpressions { } else { indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, finalStateParts2Prong, true, &sign, depth); } - + if (indexRec > -1) { auto motherParticle = mcParticles.rawIteratorAt(indexRec); std::array finalStateParts2ProngAll = std::array{finalState[0], finalState[1], finalState[2]}; @@ -805,15 +805,15 @@ struct HfCandidateCreator2ProngExpressions { indexRec = -1; // Reset indexRec if the generated decay does not match the reconstructed one does not match the reconstructed one } } - } else if (finalState.size() == 2) { // Fully Reco 2-prong decays + } else if (finalState.size() == 2) { // Fully Reco 2-prong decays if (matchKinkedDecayTopology && matchInteractionsWithMaterial) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, finalStateParts2Prong, true, &sign, depth, &nKinkedTracks, &nInteractionsWithMaterial); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, finalStateParts2Prong, true, &sign, depth, &nKinkedTracks, &nInteractionsWithMaterial); } else if (matchKinkedDecayTopology && !matchInteractionsWithMaterial) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, finalStateParts2Prong, true, &sign, depth, &nKinkedTracks); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, finalStateParts2Prong, true, &sign, depth, &nKinkedTracks); } else if (!matchKinkedDecayTopology && matchInteractionsWithMaterial) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, finalStateParts2Prong, true, &sign, depth, nullptr, &nInteractionsWithMaterial); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, finalStateParts2Prong, true, &sign, depth, nullptr, &nInteractionsWithMaterial); } else { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, finalStateParts2Prong, true, &sign, depth); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, finalStateParts2Prong, true, &sign, depth); } } else { LOG(info) << "Final state size not supported: " << finalStateParts2Prong.size(); diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index 2d7e66c9652..f4fd058589b 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -957,9 +957,9 @@ struct HfCandidateCreator3ProngExpressions { auto finalStates = getDecayChannel3Prong(pdg); for (const auto& [chn, finalState] : finalStates) { std::array finalStateParts3Prong = std::array{finalState[0], finalState[1], finalState[2]}; - if (finalState.size() > 3) { // Partly Reco 4-prong decays + if (finalState.size() > 3) { // Partly Reco 4-prong decays if (matchKinkedDecayTopology && matchInteractionsWithMaterial) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg, finalStateParts3Prong, true, &sign, depth, &nKinkedTracks, &nInteractionsWithMaterial); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg, finalStateParts3Prong, true, &sign, depth, &nKinkedTracks, &nInteractionsWithMaterial); } else if (matchKinkedDecayTopology && !matchInteractionsWithMaterial) { indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg, finalStateParts3Prong, true, &sign, depth, &nKinkedTracks); } else if (!matchKinkedDecayTopology && matchInteractionsWithMaterial) { @@ -996,7 +996,7 @@ struct HfCandidateCreator3ProngExpressions { } } } - } else if (finalState.size() == 3) { // Fully Reco 3-prong decays + } else if (finalState.size() == 3) { // Fully Reco 3-prong decays if (matchKinkedDecayTopology && matchInteractionsWithMaterial) { indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg, finalStateParts3Prong, true, &sign, depth, &nKinkedTracks, &nInteractionsWithMaterial); } else if (matchKinkedDecayTopology && !matchInteractionsWithMaterial) { @@ -1015,8 +1015,8 @@ struct HfCandidateCreator3ProngExpressions { // Flag the resonant decay channel int resoMaxDepth = 1; - if (std::abs(mcParticles.rawIteratorAt(indexRec).pdgCode()) == Pdg::kDStar) { - resoMaxDepth = 2; // Flag D0 resonances + if (std::abs(mcParticles.rawIteratorAt(indexRec).pdgCode()) == Pdg::kDStar) { + resoMaxDepth = 2; // Flag D0 resonances } std::vector arrResoDaughIndex = {}; RecoDecay::getDaughters(mcParticles.rawIteratorAt(indexRec), &arrResoDaughIndex, std::array{0}, resoMaxDepth); @@ -1176,7 +1176,7 @@ struct HfCandidateCreator3ProngExpressions { rowMcMatchRec(flag, origin, swapping, channel, -1.f, 0, nKinkedTracks, nInteractionsWithMaterial); } } - + for (const auto& mcCollision : mcCollisions) { // Slice the particles table to get the particles for the current MC collision diff --git a/PWGHF/TableProducer/treeCreatorD0ToKPi.cxx b/PWGHF/TableProducer/treeCreatorD0ToKPi.cxx index 91199261c53..59bf26581c5 100644 --- a/PWGHF/TableProducer/treeCreatorD0ToKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorD0ToKPi.cxx @@ -512,7 +512,7 @@ struct HfTreeCreatorD0ToKPi { } for (const auto& candidate : candidates) { if constexpr (onlyBkg) { - if ( TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_2prong::DecayType::D0ToPiK) || (fillCorrBkgs && (candidate.flagMcMatchRec() != 0)) ) { + if (TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_2prong::DecayType::D0ToPiK) || (fillCorrBkgs && (candidate.flagMcMatchRec() != 0))) { continue; } if (downSampleBkgFactor < 1.) { @@ -523,7 +523,7 @@ struct HfTreeCreatorD0ToKPi { } } if constexpr (onlySig) { - if ( !(TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_2prong::DecayType::D0ToPiK)) || (fillCorrBkgs && (candidate.flagMcMatchRec() != 0)) ) { + if (!(TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_2prong::DecayType::D0ToPiK)) || (fillCorrBkgs && (candidate.flagMcMatchRec() != 0))) { continue; } } @@ -551,7 +551,7 @@ struct HfTreeCreatorD0ToKPi { // Filling particle properties rowCandidateFullParticles.reserve(mcParticles.size()); for (const auto& particle : mcParticles) { - if ( TESTBIT(std::abs(particle.flagMcMatchGen()), aod::hf_cand_2prong::DecayType::D0ToPiK) || (fillCorrBkgs && particle.flagMcMatchGen() != 0) ) { + if (TESTBIT(std::abs(particle.flagMcMatchGen()), aod::hf_cand_2prong::DecayType::D0ToPiK) || (fillCorrBkgs && particle.flagMcMatchGen() != 0)) { rowCandidateFullParticles( particle.mcCollisionId(), particle.pt(), diff --git a/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx b/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx index 2b7b429d7f3..9f7e544ad74 100644 --- a/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx @@ -245,7 +245,7 @@ DECLARE_SOA_TABLE(HfCandDpFullPs, "AOD", "HFCANDDPFULLP", /// Writes the full information in an output TTree struct HfTreeCreatorDplusToPiKPi { Produces rowCandidateFull; - Produces rowCandidateFullEvents; + Produces rowCandidateFullEvents; Produces rowCandidateFullParticles; Produces rowCandidateLite; Produces rowCandidateMl; @@ -611,7 +611,6 @@ struct HfTreeCreatorDplusToPiKPi { } PROCESS_SWITCH(HfTreeCreatorDplusToPiKPi, processMcSgnWCentMl, "Process MC signal with cent and ML info", false); - }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGHF/Utils/utilsMcGen.h b/PWGHF/Utils/utilsMcGen.h index d32ddc191ce..383fc1d4fa6 100644 --- a/PWGHF/Utils/utilsMcGen.h +++ b/PWGHF/Utils/utilsMcGen.h @@ -61,7 +61,7 @@ void fillMcMatchGen2Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V bool matched = false; for (const auto& [chn, finalState] : finalStates2Prongs) { - if (finalState.size() == 3) { // Partly Reco 3-prong decays + if (finalState.size() == 3) { // Partly Reco 3-prong decays std::array finalStateParts = std::array{finalState[0], finalState[1], finalState[2]}; if (particle.pdgCode() < 0) { for (const auto& part : finalStateParts) { @@ -71,7 +71,7 @@ void fillMcMatchGen2Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V } } matched = RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kD0, finalStateParts, true, &sign, maxDepth); - } else if (finalState.size() == 2) { // Fully Reco 2-prong decays + } else if (finalState.size() == 2) { // Fully Reco 2-prong decays std::array finalStateParts = std::array{finalState[0], finalState[1]}; matched = RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kD0, finalStateParts, true, &sign, maxDepth); } else { @@ -165,12 +165,12 @@ void fillMcMatchGen3Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V int maxDepth = 2; bool matched = false; if (motherPdgCode == Pdg::kDStar) { - maxDepth = 3; // D0 resonant decays are switched on + maxDepth = 3; // D0 resonant decays are switched on } - + std::vector arrAllDaughtersIndex; for (const auto& [chn, finalState] : finalStates) { - if (finalState.size() == 5) { // Partly Reco 3-prong decays + if (finalState.size() == 5) { // Partly Reco 3-prong decays std::array finalStateParts = std::array{finalState[0], finalState[1], finalState[2], finalState[3], finalState[4]}; if (particle.pdgCode() < 0) { for (const auto& part : finalStateParts) { @@ -181,7 +181,7 @@ void fillMcMatchGen3Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V } RecoDecay::getDaughters(particle, &arrAllDaughtersIndex, finalStateParts, maxDepth); matched = RecoDecay::isMatchedMCGen(mcParticles, particle, motherPdgCode, finalStateParts, true, &sign, -1); - } else if (finalState.size() == 4) { // Partly Reco 3-prong decays + } else if (finalState.size() == 4) { // Partly Reco 3-prong decays std::array finalStateParts = std::array{finalState[0], finalState[1], finalState[2], finalState[3]}; if (particle.pdgCode() < 0) { for (const auto& part : finalStateParts) { @@ -192,7 +192,7 @@ void fillMcMatchGen3Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V } RecoDecay::getDaughters(particle, &arrAllDaughtersIndex, finalStateParts, maxDepth); matched = RecoDecay::isMatchedMCGen(mcParticles, particle, motherPdgCode, finalStateParts, true, &sign, -1); - } else if (finalState.size() == 3) { // Fully Reco 3-prong decays + } else if (finalState.size() == 3) { // Fully Reco 3-prong decays std::array finalStateParts = std::array{finalState[0], finalState[1], finalState[2]}; RecoDecay::getDaughters(particle, &arrAllDaughtersIndex, finalStateParts, maxDepth); matched = RecoDecay::isMatchedMCGen(mcParticles, particle, motherPdgCode, finalStateParts, true, &sign, maxDepth); @@ -205,7 +205,7 @@ void fillMcMatchGen3Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V // Flag the resonant decay channel int resoMaxDepth = 1; std::vector arrResoDaughIndex = {}; - if (std::abs(motherPdgCode) == Pdg::kDStar) { + if (std::abs(motherPdgCode) == Pdg::kDStar) { std::vector arrResoDaughIndexDStar = {}; RecoDecay::getDaughters(particle, &arrResoDaughIndexDStar, std::array{0}, resoMaxDepth); for (size_t iDaug = 0; iDaug < arrResoDaughIndexDStar.size(); iDaug++) {