From 7eb2174220500ccc0efb0f1aeedbe90c06549e76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Tue, 27 May 2025 16:12:28 +0200 Subject: [PATCH 01/18] Add header for flag enumeration --- PWGHF/Core/DecayChannels.h | 142 +++++++++++++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 PWGHF/Core/DecayChannels.h diff --git a/PWGHF/Core/DecayChannels.h b/PWGHF/Core/DecayChannels.h new file mode 100644 index 00000000000..face8e0b349 --- /dev/null +++ b/PWGHF/Core/DecayChannels.h @@ -0,0 +1,142 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file DecayChannels.h +/// \brief Definitions of constants for MC flagging of decay channels. +/// \author Vít Kučera , Inha University +/// \note Daughter ordering convention: (charm|strange|π±|K±|π0), (baryon|meson), (+|−) + +#ifndef PWGHF_CORE_DECAYCHANNELS_H_ +#define PWGHF_CORE_DECAYCHANNELS_H_ + +#include + +namespace o2::hf_decay +{ + +// TODO +// - HF cascades (Λc+ → p K0short) +// - HF cascades to LF cascades (Ωc0/Ξc0 → Ξ+ π−, Ξc+ → Ξ+ π− π+) + +namespace hf_cand_2prong +{ +/// @brief 2-prong candidates +enum DecayChannel : int8_t { + // D0 + D0ToPiK = 1, // π+ K− + D0ToPiKPi0, // π+ K− π0 + D0ToPiPi, // π+ π− + D0ToPiPiPi0, // π+ π− π0 + D0ToKK, // K+ K− + // + Last +}; +} // namespace hf_cand_2prong + +namespace hf_cand_3prong +{ +/// @brief 3-prong candidates +enum DecayChannel : int8_t { + // D+ + DplusToPiKPi = 1, // π+ K− π+ + DplusToPiKPiPi0, // π+ K− π+ π0 + DplusToPiPiPi, // π+ π− π+ + DplusToPiKK, // π+ K− K+ + DplusToPhiPi, // φ π+ + DplusToK0starK, // K0* K+ + // Ds+ + DsToPiKK, // π+ K− K+ + DsToPiKKPi0, // π+ K− K+ π0 + DsToPiPiK, // π+ π− K+ + DsToPiPiPiPi0, // π+ π− π+ π0 + DsToPhiPi, // φ π+ + DsToK0starK, // K0* K+ + // Λc+ + LcToPKPi, // p K− π+ + LcToPKPiPi0, // p K− π+ π0 + LcToPPiPi, // p π− π+ + LcToPKK, // p K− K+ + // Ξc+ + XicToPKPi, // p K− π+ + XicToPKK, // p K− K+ + XicToSPiPi, // Σ+ π− π+ + // + Last +}; +} // namespace hf_cand_3prong + +namespace hf_cand_dstar +{ +/// @brief D*+ candidates +enum DecayChannel : int8_t { + // D*+ + DstarToPiKPiPi0 = 1, // π+ K− π+ π0 (from [(D0 → π+ K− π0) π+] or [(D+ → π+ K− π+) π0]) + // + Last +}; +} // namespace hf_cand_dstar + +namespace hf_cand_b0 +{ +/// @brief B0 candidates +enum DecayChannel : int8_t { + // B0 + B0ToDminusPi = 1, // D− π+ + B0ToDminusK, // D− K+ + B0ToDminusRhoplus, // D− ρ+ + B0ToD0PiPi, // D0bar π+ π− + // + Last +}; +} // namespace hf_cand_b0 + +namespace hf_cand_bplus +{ +/// @brief B+ candidates +enum DecayChannel : int8_t { + // B+ + BplusToD0Pi = 1, // D0bar π+ + BplusToD0K, // D0bar K+ + BplusToD0Rhoplus, // D0bar ρ+ + BplusToD0starPi, // D0*bar π+ + // + Last +}; +} // namespace hf_cand_bplus + +namespace hf_cand_bs +{ +/// @brief Bs0 candidates +enum DecayChannel : int8_t { + // Bs0 + BsToDsPi = 1, // Ds− π+ + BsToDsRhoplus, // Ds− ρ+ + // + Last +}; +} // namespace hf_cand_bs + +namespace hf_cand_lb +{ +/// @brief Λb0 candidates +enum DecayChannel : int8_t { + // Λb0 + LbToLcPi = 1, // Λc+ π− + LbToLcK, // Λc+ K− + LbToScK, // Σc+ K− + // + Last +}; +} // namespace hf_cand_lb + +} // namespace o2::hf_decay + +#endif // PWGHF_CORE_DECAYCHANNELS_H_ From 5151ad18b562e53786efffeef2460cd327ebc9b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Tue, 27 May 2025 17:33:10 +0200 Subject: [PATCH 02/18] Include in 3-prong candidate creator --- PWGHF/TableProducer/candidateCreator3Prong.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index d8f5963b301..5e0a0f450bd 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -46,6 +46,7 @@ #include "PWGLF/DataModel/mcCentrality.h" #include "PWGHF/Core/CentralityEstimation.h" +#include "PWGHF/Core/DecayChannels.h" #include "PWGHF/Core/SelectorCuts.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/Utils/utilsBfieldCCDB.h" @@ -59,6 +60,7 @@ using namespace o2::analysis; using namespace o2::hf_evsel; using namespace o2::hf_trkcandsel; using namespace o2::aod::hf_cand_3prong; +using namespace o2::hf_decay::hf_cand_3prong; using namespace o2::hf_centrality; using namespace o2::hf_occupancy; using namespace o2::constants::physics; From 33b4e53ae2fba2e7ecfefa5e807caf2a01e733b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Tue, 27 May 2025 18:23:19 +0200 Subject: [PATCH 03/18] Replace flags --- PWGHF/Core/DecayChannels.h | 5 ++++- PWGHF/TableProducer/candidateCreator3Prong.cxx | 14 +++++++------- PWGHF/Utils/utilsMcGen.h | 17 +++++++++-------- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/PWGHF/Core/DecayChannels.h b/PWGHF/Core/DecayChannels.h index face8e0b349..5017352a899 100644 --- a/PWGHF/Core/DecayChannels.h +++ b/PWGHF/Core/DecayChannels.h @@ -59,6 +59,8 @@ enum DecayChannel : int8_t { DsToPiPiPiPi0, // π+ π− π+ π0 DsToPhiPi, // φ π+ DsToK0starK, // K0* K+ + // D*+ + DstarToPiKPi, // π+ K− π+ (from [(D0 → π+ K−) π+]) // Λc+ LcToPKPi, // p K− π+ LcToPKPiPi0, // p K− π+ π0 @@ -78,7 +80,8 @@ namespace hf_cand_dstar /// @brief D*+ candidates enum DecayChannel : int8_t { // D*+ - DstarToPiKPiPi0 = 1, // π+ K− π+ π0 (from [(D0 → π+ K− π0) π+] or [(D+ → π+ K− π+) π0]) + DstarToPiKPi = 1, // π+ K− π+ (from [(D0 → π+ K−) π+]) + DstarToPiKPiPi0, // π+ K− π+ π0 (from [(D0 → π+ K− π0) π+] or [(D+ → π+ K− π+) π0]) // Last }; diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index 5e0a0f450bd..44b86ad96f6 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -955,7 +955,7 @@ struct HfCandidateCreator3ProngExpressions { indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2); } if (indexRec > -1) { - flag = sign * (1 << DecayType::DplusToPiKPi); + flag = sign * DecayChannel::DplusToPiKPi; } } @@ -986,7 +986,7 @@ struct HfCandidateCreator3ProngExpressions { if (indexRec > -1) { // DecayType::DsToKKPi is used to flag both Ds± → K± K∓ π± and D± → K± K∓ π± // TODO: move to different and explicit flags - flag = sign * (1 << DecayType::DsToKKPi); + flag = sign * (isDplus ? DecayChannel::DplusToPiKK : DecayChannel::DsToPiKK); if (arrayDaughters[0].has_mcParticle()) { swapping = int8_t(std::abs(arrayDaughters[0].mcParticle().pdgCode()) == kPiPlus); } @@ -997,9 +997,9 @@ struct HfCandidateCreator3ProngExpressions { arrPDGDaugh[iProng] = std::abs(daughI.pdgCode()); } if ((arrPDGDaugh[0] == arrPDGResonantDPhiPi[0] && arrPDGDaugh[1] == arrPDGResonantDPhiPi[1]) || (arrPDGDaugh[0] == arrPDGResonantDPhiPi[1] && arrPDGDaugh[1] == arrPDGResonantDPhiPi[0])) { - channel = isDplus ? DecayChannelDToKKPi::DplusToPhiPi : DecayChannelDToKKPi::DsToPhiPi; + channel = isDplus ? DecayChannel::DplusToPhiPi : DecayChannel::DsToPhiPi; } else if ((arrPDGDaugh[0] == arrPDGResonantDKstarK[0] && arrPDGDaugh[1] == arrPDGResonantDKstarK[1]) || (arrPDGDaugh[0] == arrPDGResonantDKstarK[1] && arrPDGDaugh[1] == arrPDGResonantDKstarK[0])) { - channel = isDplus ? DecayChannelDToKKPi::DplusToK0starK : DecayChannelDToKKPi::DsToK0starK; + channel = isDplus ? DecayChannel::DplusToK0starK : DecayChannel::DsToK0starK; } } } @@ -1013,7 +1013,7 @@ struct HfCandidateCreator3ProngExpressions { indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDStar, std::array{+kPiPlus, +kPiPlus, -kKPlus}, true, &sign, 2); } if (indexRec > -1) { - flag = sign * (1 << DstarToPiKPiBkg); + flag = sign * DecayChannel::DstarToPiKPi; channel = 1; } } @@ -1030,7 +1030,7 @@ struct HfCandidateCreator3ProngExpressions { indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); } if (indexRec > -1) { - flag = sign * (1 << DecayType::LcToPKPi); + flag = sign * DecayChannel::LcToPKPi; // Flagging the different Λc± → p± K∓ π± decay channels if (arrayDaughters[0].has_mcParticle()) { @@ -1065,7 +1065,7 @@ struct HfCandidateCreator3ProngExpressions { indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); } if (indexRec > -1) { - flag = sign * (1 << DecayType::XicToPKPi); + flag = sign * DecayChannel::XicToPKPi; if (arrayDaughters[0].has_mcParticle()) { swapping = int8_t(std::abs(arrayDaughters[0].mcParticle().pdgCode()) == kPiPlus); } diff --git a/PWGHF/Utils/utilsMcGen.h b/PWGHF/Utils/utilsMcGen.h index bc0380bd198..7f687fb0be5 100644 --- a/PWGHF/Utils/utilsMcGen.h +++ b/PWGHF/Utils/utilsMcGen.h @@ -28,6 +28,7 @@ #include "Common/Core/RecoDecay.h" +#include "PWGHF/Core/DecayChannels.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" namespace hf_mc_gen @@ -109,7 +110,7 @@ void fillMcMatchGen3Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V // D± → π± K∓ π± if (flag == 0) { if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2)) { - flag = sign * (1 << o2::aod::hf_cand_3prong::DecayType::DplusToPiKPi); + flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannel::DplusToPiKPi; } } @@ -119,11 +120,11 @@ void fillMcMatchGen3Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2)) { // DecayType::DsToKKPi is used to flag both Ds± → K± K∓ π± and D± → K± K∓ π± // TODO: move to different and explicit flags - flag = sign * (1 << o2::aod::hf_cand_3prong::DecayType::DsToKKPi); + flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannel::DsToPiKK; } else if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDPlus, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2)) { // DecayType::DsToKKPi is used to flag both Ds± → K± K∓ π± and D± → K± K∓ π± // TODO: move to different and explicit flags - flag = sign * (1 << o2::aod::hf_cand_3prong::DecayType::DsToKKPi); + flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannel::DplusToPiKK; isDplus = true; } if (flag != 0) { @@ -134,9 +135,9 @@ void fillMcMatchGen3Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V arrPDGDaugh[jProng] = std::abs(daughJ.pdgCode()); } if ((arrPDGDaugh[0] == arrPDGResonantDPhiPi[0] && arrPDGDaugh[1] == arrPDGResonantDPhiPi[1]) || (arrPDGDaugh[0] == arrPDGResonantDPhiPi[1] && arrPDGDaugh[1] == arrPDGResonantDPhiPi[0])) { - channel = isDplus ? o2::aod::hf_cand_3prong::DecayChannelDToKKPi::DplusToPhiPi : o2::aod::hf_cand_3prong::DecayChannelDToKKPi::DsToPhiPi; + channel = isDplus ? o2::hf_decay::hf_cand_3prong::DecayChannel::DplusToPhiPi : o2::hf_decay::hf_cand_3prong::DecayChannel::DsToPhiPi; } else if ((arrPDGDaugh[0] == arrPDGResonantDKstarK[0] && arrPDGDaugh[1] == arrPDGResonantDKstarK[1]) || (arrPDGDaugh[0] == arrPDGResonantDKstarK[1] && arrPDGDaugh[1] == arrPDGResonantDKstarK[0])) { - channel = isDplus ? o2::aod::hf_cand_3prong::DecayChannelDToKKPi::DplusToK0starK : o2::aod::hf_cand_3prong::DecayChannelDToKKPi::DsToK0starK; + channel = isDplus ? o2::hf_decay::hf_cand_3prong::DecayChannel::DplusToK0starK : o2::hf_decay::hf_cand_3prong::DecayChannel::DsToK0starK; } } } @@ -145,14 +146,14 @@ void fillMcMatchGen3Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V // D*± → D0(bar) π± if (flag == 0) { if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDStar, std::array{+kPiPlus, +kPiPlus, -kKPlus}, true, &sign, 2)) { - flag = sign * (1 << o2::aod::hf_cand_3prong::DstarToPiKPiBkg); + flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannel::DstarToPiKPi; } } // Λc± → p± K∓ π± if (flag == 0) { if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { - flag = sign * (1 << o2::aod::hf_cand_3prong::DecayType::LcToPKPi); + flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannel::LcToPKPi; // Flagging the different Λc± → p± K∓ π± decay channels RecoDecay::getDaughters(particle, &arrDaughIndex, std::array{0}, 1); @@ -175,7 +176,7 @@ void fillMcMatchGen3Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V // Ξc± → p± K∓ π± if (flag == 0) { if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { - flag = sign * (1 << o2::aod::hf_cand_3prong::DecayType::XicToPKPi); + flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannel::XicToPKPi; } } From 4dcfbef0514d514f0da3ca69ebcbce609b5e4fb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Tue, 27 May 2025 19:02:16 +0200 Subject: [PATCH 04/18] Fix magic numbers --- PWGHF/Utils/utilsMcGen.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/PWGHF/Utils/utilsMcGen.h b/PWGHF/Utils/utilsMcGen.h index 7f687fb0be5..6b4821e79ad 100644 --- a/PWGHF/Utils/utilsMcGen.h +++ b/PWGHF/Utils/utilsMcGen.h @@ -86,6 +86,7 @@ template void fillMcMatchGen3Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V& rowMcMatchGen, bool rejectBackground) { using namespace o2::constants::physics; + constexpr std::size_t NDaughtersResonant{2u}; // Match generated particles. for (const auto& particle : mcParticlesPerMcColl) { @@ -95,12 +96,12 @@ void fillMcMatchGen3Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V int8_t sign = 0; std::vector arrDaughIndex; std::vector idxBhadMothers{}; - std::array arrPDGDaugh; - std::array arrPDGResonant1 = {kProton, 313}; // Λc± → p± K* - std::array arrPDGResonant2 = {2224, kKPlus}; // Λc± → Δ(1232)±± K∓ - std::array arrPDGResonant3 = {102134, kPiPlus}; // Λc± → Λ(1520) π± - std::array arrPDGResonantDPhiPi = {333, kPiPlus}; // Ds± → Phi π± and D± → Phi π± - std::array arrPDGResonantDKstarK = {313, kKPlus}; // Ds± → K*(892)0bar K± and D± → K*(892)0bar K± + std::array arrPDGDaugh; + std::array arrPDGResonant1 = {kProton, Pdg::kK0Star892}; // Λc± → p± K* + std::array arrPDGResonant2 = {2224, kKPlus}; // Λc± → Δ(1232)±± K∓ + std::array arrPDGResonant3 = {102134, kPiPlus}; // Λc± → Λ(1520) π± + std::array arrPDGResonantDPhiPi = {Pdg::kPhi, kPiPlus}; // Ds± → Phi π± and D± → Phi π± + std::array arrPDGResonantDKstarK = {Pdg::kK0Star892, kKPlus}; // Ds± → K*(892)0bar K± and D± → K*(892)0bar K± // Reject particles from background events if (particle.fromBackgroundEvent() && rejectBackground) { rowMcMatchGen(flag, origin, channel, -1); @@ -129,7 +130,7 @@ void fillMcMatchGen3Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V } if (flag != 0) { RecoDecay::getDaughters(particle, &arrDaughIndex, std::array{0}, 1); - if (arrDaughIndex.size() == 2) { + if (arrDaughIndex.size() == NDaughtersResonant) { for (auto jProng = 0u; jProng < arrDaughIndex.size(); ++jProng) { auto daughJ = mcParticles.rawIteratorAt(arrDaughIndex[jProng]); arrPDGDaugh[jProng] = std::abs(daughJ.pdgCode()); @@ -157,7 +158,7 @@ void fillMcMatchGen3Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V // Flagging the different Λc± → p± K∓ π± decay channels RecoDecay::getDaughters(particle, &arrDaughIndex, std::array{0}, 1); - if (arrDaughIndex.size() == 2) { + if (arrDaughIndex.size() == NDaughtersResonant) { for (auto jProng = 0u; jProng < arrDaughIndex.size(); ++jProng) { auto daughJ = mcParticles.rawIteratorAt(arrDaughIndex[jProng]); arrPDGDaugh[jProng] = std::abs(daughJ.pdgCode()); From a41ed95f92ca5ed1c3635995559d1cf9c613bf81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Tue, 27 May 2025 19:23:20 +0200 Subject: [PATCH 05/18] Remove wrong Lb channel --- PWGHF/Core/DecayChannels.h | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGHF/Core/DecayChannels.h b/PWGHF/Core/DecayChannels.h index 5017352a899..b9c1b0ca2a5 100644 --- a/PWGHF/Core/DecayChannels.h +++ b/PWGHF/Core/DecayChannels.h @@ -134,7 +134,6 @@ enum DecayChannel : int8_t { // Λb0 LbToLcPi = 1, // Λc+ π− LbToLcK, // Λc+ K− - LbToScK, // Σc+ K− // Last }; From d71123707e6b4641f6e29df03edbcd343aef8047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Mon, 2 Jun 2025 23:52:23 +0200 Subject: [PATCH 06/18] Make lists for resonant channels. Add more. --- PWGHF/Core/DecayChannels.h | 97 +++++++++++++++++++++----------------- 1 file changed, 53 insertions(+), 44 deletions(-) diff --git a/PWGHF/Core/DecayChannels.h b/PWGHF/Core/DecayChannels.h index b9c1b0ca2a5..2a878155415 100644 --- a/PWGHF/Core/DecayChannels.h +++ b/PWGHF/Core/DecayChannels.h @@ -12,6 +12,8 @@ /// \file DecayChannels.h /// \brief Definitions of constants for MC flagging of decay channels. /// \author Vít Kučera , Inha University +/// \note DecayChannel enums define unique combinations of the mother particle and final daughters. +/// \note DecayChannelResonant enums define unique combinations of the mother particle and intermediate daughters. /// \note Daughter ordering convention: (charm|strange|π±|K±|π0), (baryon|meson), (+|−) #ifndef PWGHF_CORE_DECAYCHANNELS_H_ @@ -37,7 +39,7 @@ enum DecayChannel : int8_t { D0ToPiPiPi0, // π+ π− π0 D0ToKK, // K+ K− // - Last + LastChannel }; } // namespace hf_cand_2prong @@ -50,15 +52,11 @@ enum DecayChannel : int8_t { DplusToPiKPiPi0, // π+ K− π+ π0 DplusToPiPiPi, // π+ π− π+ DplusToPiKK, // π+ K− K+ - DplusToPhiPi, // φ π+ - DplusToK0starK, // K0* K+ // Ds+ DsToPiKK, // π+ K− K+ DsToPiKKPi0, // π+ K− K+ π0 DsToPiPiK, // π+ π− K+ DsToPiPiPiPi0, // π+ π− π+ π0 - DsToPhiPi, // φ π+ - DsToK0starK, // K0* K+ // D*+ DstarToPiKPi, // π+ K− π+ (from [(D0 → π+ K−) π+]) // Λc+ @@ -71,7 +69,18 @@ enum DecayChannel : int8_t { XicToPKK, // p K− K+ XicToSPiPi, // Σ+ π− π+ // - Last + LastChannel +}; +/// @brief 3-prong candidates resonant +enum DecayChannelResonant : int8_t { + // D+ + DplusToPhiPi, // φ π+ + DplusToK0starK, // K0* K+ + // Ds+ + DsToPhiPi, // φ π+ + DsToK0starK, // K0* K+ + // + LastChannelResonant }; } // namespace hf_cand_3prong @@ -83,62 +92,62 @@ enum DecayChannel : int8_t { DstarToPiKPi = 1, // π+ K− π+ (from [(D0 → π+ K−) π+]) DstarToPiKPiPi0, // π+ K− π+ π0 (from [(D0 → π+ K− π0) π+] or [(D+ → π+ K− π+) π0]) // - Last + LastChannel }; } // namespace hf_cand_dstar -namespace hf_cand_b0 +namespace hf_cand_beauty_neutral { -/// @brief B0 candidates +/// @brief neutral beauty candidates enum DecayChannel : int8_t { // B0 - B0ToDminusPi = 1, // D− π+ - B0ToDminusK, // D− K+ - B0ToDminusRhoplus, // D− ρ+ - B0ToD0PiPi, // D0bar π+ π− + B0ToDminusPi = 1, // D− π+ + B0ToDminusK, // D− K+ + B0ToD0PiPi, // anti-D0 π+ π− + // Bs0 + BsToDsPi, // Ds− π+ + BsToDsK, // Ds− K+ + // Λb0 + LbToLcPi, // Λc+ π− + LbToLcK, // Λc+ K− + LbToScPi, // Σc+ π− + LbToScK, // Σc+ K− + // + LastChannel +}; +enum DecayChannelResonant : int8_t { + // B0 + B0ToDminusRhoplus = 1, // D− ρ+ + B0ToDstarminusPi, // D*− π+ + // Bs0 + BsToDsRhoplus, // Ds− ρ+ + BsToDsstarPi, // Ds*− π+ + // Λb0 + LbToLcRhoplus, // Λc+ ρ− // - Last + LastChannelResonant }; -} // namespace hf_cand_b0 +} // namespace hf_cand_beauty_neutral namespace hf_cand_bplus { /// @brief B+ candidates enum DecayChannel : int8_t { // B+ - BplusToD0Pi = 1, // D0bar π+ - BplusToD0K, // D0bar K+ - BplusToD0Rhoplus, // D0bar ρ+ - BplusToD0starPi, // D0*bar π+ + BplusToD0Pi = 1, // anti-D0 π+ + BplusToD0K, // anti-D0 K+ // - Last + LastChannel }; -} // namespace hf_cand_bplus - -namespace hf_cand_bs -{ -/// @brief Bs0 candidates -enum DecayChannel : int8_t { - // Bs0 - BsToDsPi = 1, // Ds− π+ - BsToDsRhoplus, // Ds− ρ+ - // - Last -}; -} // namespace hf_cand_bs - -namespace hf_cand_lb -{ -/// @brief Λb0 candidates -enum DecayChannel : int8_t { - // Λb0 - LbToLcPi = 1, // Λc+ π− - LbToLcK, // Λc+ K− +/// @brief B+ candidates resonant +enum DecayChannelResonant : int8_t { + // B+ + BplusToD0Rhoplus = 1, // anti-D0 ρ+ + BplusToD0starPi, // anti-D0* π+ // - Last + LastChannelResonant }; -} // namespace hf_cand_lb - +} // namespace hf_cand_bplus } // namespace o2::hf_decay #endif // PWGHF_CORE_DECAYCHANNELS_H_ From 2e67b57c6f65d0741b1c2bac458cf51d068e7abc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Tue, 3 Jun 2025 00:50:27 +0200 Subject: [PATCH 07/18] Improve comments --- PWGHF/Core/DecayChannels.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/PWGHF/Core/DecayChannels.h b/PWGHF/Core/DecayChannels.h index 2a878155415..f481dd0b380 100644 --- a/PWGHF/Core/DecayChannels.h +++ b/PWGHF/Core/DecayChannels.h @@ -10,10 +10,10 @@ // or submit itself to any jurisdiction. /// \file DecayChannels.h -/// \brief Definitions of constants for MC flagging of decay channels. +/// \brief Definitions of constants for MC flagging of HF decay channels. /// \author Vít Kučera , Inha University -/// \note DecayChannel enums define unique combinations of the mother particle and final daughters. -/// \note DecayChannelResonant enums define unique combinations of the mother particle and intermediate daughters. +/// \note DecayChannel enums define unique combinations of the mother particle and the daughters for non-resonant channels. +/// \note DecayChannelResonant enums define unique combinations of the mother particle and the daughters for resonant channels. /// \note Daughter ordering convention: (charm|strange|π±|K±|π0), (baryon|meson), (+|−) #ifndef PWGHF_CORE_DECAYCHANNELS_H_ @@ -30,7 +30,7 @@ namespace o2::hf_decay namespace hf_cand_2prong { -/// @brief 2-prong candidates +/// @brief 2-prong decay channels enum DecayChannel : int8_t { // D0 D0ToPiK = 1, // π+ K− @@ -45,7 +45,7 @@ enum DecayChannel : int8_t { namespace hf_cand_3prong { -/// @brief 3-prong candidates +/// @brief 3-prong decay channels enum DecayChannel : int8_t { // D+ DplusToPiKPi = 1, // π+ K− π+ @@ -71,7 +71,7 @@ enum DecayChannel : int8_t { // LastChannel }; -/// @brief 3-prong candidates resonant +/// @brief resonant 3-prong decay channels enum DecayChannelResonant : int8_t { // D+ DplusToPhiPi, // φ π+ @@ -86,7 +86,7 @@ enum DecayChannelResonant : int8_t { namespace hf_cand_dstar { -/// @brief D*+ candidates +/// @brief D*+ decay channels enum DecayChannel : int8_t { // D*+ DstarToPiKPi = 1, // π+ K− π+ (from [(D0 → π+ K−) π+]) @@ -98,7 +98,7 @@ enum DecayChannel : int8_t { namespace hf_cand_beauty_neutral { -/// @brief neutral beauty candidates +/// @brief neutral-beauty decay channels enum DecayChannel : int8_t { // B0 B0ToDminusPi = 1, // D− π+ @@ -115,6 +115,7 @@ enum DecayChannel : int8_t { // LastChannel }; +/// @brief resonant neutral-beauty decay channels enum DecayChannelResonant : int8_t { // B0 B0ToDminusRhoplus = 1, // D− ρ+ @@ -131,7 +132,7 @@ enum DecayChannelResonant : int8_t { namespace hf_cand_bplus { -/// @brief B+ candidates +/// @brief B+ decay channels enum DecayChannel : int8_t { // B+ BplusToD0Pi = 1, // anti-D0 π+ @@ -139,7 +140,7 @@ enum DecayChannel : int8_t { // LastChannel }; -/// @brief B+ candidates resonant +/// @brief resonant B+ decay channels enum DecayChannelResonant : int8_t { // B+ BplusToD0Rhoplus = 1, // anti-D0 ρ+ From f625480ba41ffe7a99c8a9cf740ffad088ea0c8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Tue, 3 Jun 2025 01:54:40 +0200 Subject: [PATCH 08/18] Add more channels. Fix comments. --- PWGHF/Core/DecayChannels.h | 53 +++++++++++++++++++++++++++++--------- 1 file changed, 41 insertions(+), 12 deletions(-) diff --git a/PWGHF/Core/DecayChannels.h b/PWGHF/Core/DecayChannels.h index f481dd0b380..64c704a3191 100644 --- a/PWGHF/Core/DecayChannels.h +++ b/PWGHF/Core/DecayChannels.h @@ -30,7 +30,7 @@ namespace o2::hf_decay namespace hf_cand_2prong { -/// @brief 2-prong decay channels +/// @brief 2-prong candidates: non-resonant channels enum DecayChannel : int8_t { // D0 D0ToPiK = 1, // π+ K− @@ -41,11 +41,21 @@ enum DecayChannel : int8_t { // LastChannel }; +/// @brief 2-prong candidates: resonant channels +enum DecayChannelResonant : int8_t { + // D0 + D0ToRhoplusPi = 1, // ρ+ π− + D0ToRhoplusK, // ρ+ K− + D0ToKstar0Pi0, // anti-K*0 π0 + D0ToKstarPi, // K*− π+ + // + LastChannelResonant +}; } // namespace hf_cand_2prong namespace hf_cand_3prong { -/// @brief 3-prong decay channels +/// @brief 3-prong candidates: non-resonant channels enum DecayChannel : int8_t { // D+ DplusToPiKPi = 1, // π+ K− π+ @@ -56,6 +66,7 @@ enum DecayChannel : int8_t { DsToPiKK, // π+ K− K+ DsToPiKKPi0, // π+ K− K+ π0 DsToPiPiK, // π+ π− K+ + DsToPiPiPi, // π+ π− π+ DsToPiPiPiPi0, // π+ π− π+ π0 // D*+ DstarToPiKPi, // π+ K− π+ (from [(D0 → π+ K−) π+]) @@ -71,14 +82,32 @@ enum DecayChannel : int8_t { // LastChannel }; -/// @brief resonant 3-prong decay channels +/// @brief 3-prong candidates: resonant channels enum DecayChannelResonant : int8_t { // D+ - DplusToPhiPi, // φ π+ - DplusToK0starK, // K0* K+ + DplusToPhiPi = 1, // φ π+ + DplusToKstar0K, // anti-K*0 K+ + DplusToAKstar0K, // anti-K*0(1430) K+ // FIXME: What to call this? + DplusToRho0Pi, // ρ0 π+ + DplusToF2Pi, // f2(1270) π+ // Ds+ - DsToPhiPi, // φ π+ - DsToK0starK, // K0* K+ + DsToPhiPi, // φ π+ + DsToPhiRhoplus, // φ ρ+ + DsToKstar0K, // anti-K*0 K+ + DsToKstar0Pi, // anti-K*0 π+ + DsToRho0Pi, // ρ0 π+ + DsToRho0K, // ρ0 K+ + DsToF2Pi, // f2(1270) π+ + DsToF0K, // f0(1370) K+ + DsToEtaPi, // η π+ + // Λc+ + LcToPKstar0, // p K*0(892) + LcToDeltaplusplusK, // Δ++ K− + LcToLPi, // Λ(1520) π+ + LcToLK, // Λ(1520) K+ + // Ξc+ + XicToPKstar0, // p anti-K*0(892) + XicToPPhi, // p φ // LastChannelResonant }; @@ -86,7 +115,7 @@ enum DecayChannelResonant : int8_t { namespace hf_cand_dstar { -/// @brief D*+ decay channels +/// @brief D*+ candidates: non-resonant channels enum DecayChannel : int8_t { // D*+ DstarToPiKPi = 1, // π+ K− π+ (from [(D0 → π+ K−) π+]) @@ -98,7 +127,7 @@ enum DecayChannel : int8_t { namespace hf_cand_beauty_neutral { -/// @brief neutral-beauty decay channels +/// @brief neutral-beauty candidates: non-resonant channels enum DecayChannel : int8_t { // B0 B0ToDminusPi = 1, // D− π+ @@ -115,7 +144,7 @@ enum DecayChannel : int8_t { // LastChannel }; -/// @brief resonant neutral-beauty decay channels +/// @brief neutral-beauty candidates: resonant channels enum DecayChannelResonant : int8_t { // B0 B0ToDminusRhoplus = 1, // D− ρ+ @@ -132,7 +161,7 @@ enum DecayChannelResonant : int8_t { namespace hf_cand_bplus { -/// @brief B+ decay channels +/// @brief B+ candidates: non-resonant channels enum DecayChannel : int8_t { // B+ BplusToD0Pi = 1, // anti-D0 π+ @@ -140,7 +169,7 @@ enum DecayChannel : int8_t { // LastChannel }; -/// @brief resonant B+ decay channels +/// @brief B+ candidates: resonant channels enum DecayChannelResonant : int8_t { // B+ BplusToD0Rhoplus = 1, // anti-D0 ρ+ From 3f97645c2c46bd05eb7f388335be1acdd161120b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Tue, 3 Jun 2025 01:57:33 +0200 Subject: [PATCH 09/18] Consistency --- PWGHF/Core/DecayChannels.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/Core/DecayChannels.h b/PWGHF/Core/DecayChannels.h index 64c704a3191..4579679820d 100644 --- a/PWGHF/Core/DecayChannels.h +++ b/PWGHF/Core/DecayChannels.h @@ -173,7 +173,7 @@ enum DecayChannel : int8_t { enum DecayChannelResonant : int8_t { // B+ BplusToD0Rhoplus = 1, // anti-D0 ρ+ - BplusToD0starPi, // anti-D0* π+ + BplusToDstar0Pi, // anti-D*0 π+ // LastChannelResonant }; From a281b7949d47bd21efc8f6f40e738613ec04b16f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Tue, 3 Jun 2025 02:10:12 +0200 Subject: [PATCH 10/18] Propagate changes --- PWGHF/TableProducer/candidateCreator3Prong.cxx | 6 ++---- PWGHF/Utils/utilsMcGen.h | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index 44b86ad96f6..06b42dd1bcd 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -47,7 +47,6 @@ #include "PWGHF/Core/CentralityEstimation.h" #include "PWGHF/Core/DecayChannels.h" -#include "PWGHF/Core/SelectorCuts.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/Utils/utilsBfieldCCDB.h" #include "PWGHF/Utils/utilsEvSelHf.h" @@ -56,7 +55,6 @@ #include "PWGHF/Utils/utilsTrkCandHf.h" using namespace o2; -using namespace o2::analysis; using namespace o2::hf_evsel; using namespace o2::hf_trkcandsel; using namespace o2::aod::hf_cand_3prong; @@ -997,9 +995,9 @@ struct HfCandidateCreator3ProngExpressions { arrPDGDaugh[iProng] = std::abs(daughI.pdgCode()); } if ((arrPDGDaugh[0] == arrPDGResonantDPhiPi[0] && arrPDGDaugh[1] == arrPDGResonantDPhiPi[1]) || (arrPDGDaugh[0] == arrPDGResonantDPhiPi[1] && arrPDGDaugh[1] == arrPDGResonantDPhiPi[0])) { - channel = isDplus ? DecayChannel::DplusToPhiPi : DecayChannel::DsToPhiPi; + channel = isDplus ? DecayChannelResonant::DplusToPhiPi : DecayChannelResonant::DsToPhiPi; } else if ((arrPDGDaugh[0] == arrPDGResonantDKstarK[0] && arrPDGDaugh[1] == arrPDGResonantDKstarK[1]) || (arrPDGDaugh[0] == arrPDGResonantDKstarK[1] && arrPDGDaugh[1] == arrPDGResonantDKstarK[0])) { - channel = isDplus ? DecayChannel::DplusToK0starK : DecayChannel::DsToK0starK; + channel = isDplus ? DecayChannelResonant::DplusToKstar0K : DecayChannelResonant::DsToKstar0K; } } } diff --git a/PWGHF/Utils/utilsMcGen.h b/PWGHF/Utils/utilsMcGen.h index 6b4821e79ad..83e327923c3 100644 --- a/PWGHF/Utils/utilsMcGen.h +++ b/PWGHF/Utils/utilsMcGen.h @@ -136,9 +136,9 @@ void fillMcMatchGen3Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V arrPDGDaugh[jProng] = std::abs(daughJ.pdgCode()); } if ((arrPDGDaugh[0] == arrPDGResonantDPhiPi[0] && arrPDGDaugh[1] == arrPDGResonantDPhiPi[1]) || (arrPDGDaugh[0] == arrPDGResonantDPhiPi[1] && arrPDGDaugh[1] == arrPDGResonantDPhiPi[0])) { - channel = isDplus ? o2::hf_decay::hf_cand_3prong::DecayChannel::DplusToPhiPi : o2::hf_decay::hf_cand_3prong::DecayChannel::DsToPhiPi; + channel = isDplus ? o2::hf_decay::hf_cand_3prong::DecayChannelResonant::DplusToPhiPi : o2::hf_decay::hf_cand_3prong::DecayChannelResonant::DsToPhiPi; } else if ((arrPDGDaugh[0] == arrPDGResonantDKstarK[0] && arrPDGDaugh[1] == arrPDGResonantDKstarK[1]) || (arrPDGDaugh[0] == arrPDGResonantDKstarK[1] && arrPDGDaugh[1] == arrPDGResonantDKstarK[0])) { - channel = isDplus ? o2::hf_decay::hf_cand_3prong::DecayChannel::DplusToK0starK : o2::hf_decay::hf_cand_3prong::DecayChannel::DsToK0starK; + channel = isDplus ? o2::hf_decay::hf_cand_3prong::DecayChannelResonant::DplusToKstar0K : o2::hf_decay::hf_cand_3prong::DecayChannelResonant::DsToKstar0K; } } } From 6aa126e6dc353c03a4052d49293ae6a7c6e12c0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Tue, 3 Jun 2025 15:22:42 +0200 Subject: [PATCH 11/18] Change name of enums of main channels. Add more channels. --- PWGHF/Core/DecayChannels.h | 81 ++++++++++--------- .../TableProducer/candidateCreator3Prong.cxx | 10 +-- PWGHF/Utils/utilsMcGen.h | 12 +-- 3 files changed, 56 insertions(+), 47 deletions(-) diff --git a/PWGHF/Core/DecayChannels.h b/PWGHF/Core/DecayChannels.h index 4579679820d..c6f4e1379f8 100644 --- a/PWGHF/Core/DecayChannels.h +++ b/PWGHF/Core/DecayChannels.h @@ -12,7 +12,7 @@ /// \file DecayChannels.h /// \brief Definitions of constants for MC flagging of HF decay channels. /// \author Vít Kučera , Inha University -/// \note DecayChannel enums define unique combinations of the mother particle and the daughters for non-resonant channels. +/// \note DecayChannelMain enums define unique combinations of the mother particle and the daughters for main channels. /// \note DecayChannelResonant enums define unique combinations of the mother particle and the daughters for resonant channels. /// \note Daughter ordering convention: (charm|strange|π±|K±|π0), (baryon|meson), (+|−) @@ -30,8 +30,8 @@ namespace o2::hf_decay namespace hf_cand_2prong { -/// @brief 2-prong candidates: non-resonant channels -enum DecayChannel : int8_t { +/// @brief 2-prong candidates: main channels +enum DecayChannelMain : int8_t { // D0 D0ToPiK = 1, // π+ K− D0ToPiKPi0, // π+ K− π0 @@ -39,7 +39,7 @@ enum DecayChannel : int8_t { D0ToPiPiPi0, // π+ π− π0 D0ToKK, // K+ K− // - LastChannel + LastChannelMain }; /// @brief 2-prong candidates: resonant channels enum DecayChannelResonant : int8_t { @@ -55,8 +55,8 @@ enum DecayChannelResonant : int8_t { namespace hf_cand_3prong { -/// @brief 3-prong candidates: non-resonant channels -enum DecayChannel : int8_t { +/// @brief 3-prong candidates: main channels +enum DecayChannelMain : int8_t { // D+ DplusToPiKPi = 1, // π+ K− π+ DplusToPiKPiPi0, // π+ K− π+ π0 @@ -80,16 +80,16 @@ enum DecayChannel : int8_t { XicToPKK, // p K− K+ XicToSPiPi, // Σ+ π− π+ // - LastChannel + LastChannelMain }; /// @brief 3-prong candidates: resonant channels enum DecayChannelResonant : int8_t { // D+ - DplusToPhiPi = 1, // φ π+ - DplusToKstar0K, // anti-K*0 K+ - DplusToAKstar0K, // anti-K*0(1430) K+ // FIXME: What to call this? - DplusToRho0Pi, // ρ0 π+ - DplusToF2Pi, // f2(1270) π+ + DplusToPhiPi = 1, // φ π+ + DplusToKstar0K, // anti-K*0 K+ + DplusToKstar1430_0K, // anti-K*0(1430) K+ + DplusToRho0Pi, // ρ0 π+ + DplusToF2_1270Pi, // f2(1270) π+ // Ds+ DsToPhiPi, // φ π+ DsToPhiRhoplus, // φ ρ+ @@ -97,14 +97,13 @@ enum DecayChannelResonant : int8_t { DsToKstar0Pi, // anti-K*0 π+ DsToRho0Pi, // ρ0 π+ DsToRho0K, // ρ0 K+ - DsToF2Pi, // f2(1270) π+ - DsToF0K, // f0(1370) K+ + DsToF2_1270Pi, // f2(1270) π+ + DsToF0_1370K, // f0(1370) K+ DsToEtaPi, // η π+ // Λc+ LcToPKstar0, // p K*0(892) LcToDeltaplusplusK, // Δ++ K− - LcToLPi, // Λ(1520) π+ - LcToLK, // Λ(1520) K+ + LcToL1520Pi, // Λ(1520) π+ // Ξc+ XicToPKstar0, // p anti-K*0(892) XicToPPhi, // p φ @@ -115,34 +114,39 @@ enum DecayChannelResonant : int8_t { namespace hf_cand_dstar { -/// @brief D*+ candidates: non-resonant channels -enum DecayChannel : int8_t { +/// @brief D*+ candidates: main channels +enum DecayChannelMain : int8_t { // D*+ DstarToPiKPi = 1, // π+ K− π+ (from [(D0 → π+ K−) π+]) DstarToPiKPiPi0, // π+ K− π+ π0 (from [(D0 → π+ K− π0) π+] or [(D+ → π+ K− π+) π0]) // - LastChannel + LastChannelMain }; } // namespace hf_cand_dstar namespace hf_cand_beauty_neutral { -/// @brief neutral-beauty candidates: non-resonant channels -enum DecayChannel : int8_t { +/// @brief neutral-beauty candidates: main channels +enum DecayChannelMain : int8_t { // B0 - B0ToDminusPi = 1, // D− π+ - B0ToDminusK, // D− K+ - B0ToD0PiPi, // anti-D0 π+ π− + B0ToDminusPi = 1, // D− π+ + B0ToDminusPiPi0, // D− π+ π0 + B0ToDminusPiGamma, // D− π+ γ0 + B0ToDminusK, // D− K+ + B0ToD0PiPi, // anti-D0 π+ π− // Bs0 - BsToDsPi, // Ds− π+ - BsToDsK, // Ds− K+ + BsToDsPi, // Ds− π+ + BsToDsPiPi0, // Ds− π+ π0 + BsToDsPiGamma, // Ds− π+ γ0 + BsToDsK, // Ds− K+ // Λb0 - LbToLcPi, // Λc+ π− - LbToLcK, // Λc+ K− - LbToScPi, // Σc+ π− - LbToScK, // Σc+ K− + LbToLcPi, // Λc+ π− + LbToLcPiPi0, // Λc+ π− π0 + LbToLcPiGamma, // Λc+ π− γ0 + LbToLcK, // Λc+ K− + LbToLcKPi0, // Λc+ K− π0 // - LastChannel + LastChannelMain }; /// @brief neutral-beauty candidates: resonant channels enum DecayChannelResonant : int8_t { @@ -154,6 +158,9 @@ enum DecayChannelResonant : int8_t { BsToDsstarPi, // Ds*− π+ // Λb0 LbToLcRhoplus, // Λc+ ρ− + LbToScPi, // Σc+ π− + LbToScK, // Σc+ K− + LbToSc0Pi0, // Σc0 π0 // LastChannelResonant }; @@ -161,13 +168,15 @@ enum DecayChannelResonant : int8_t { namespace hf_cand_bplus { -/// @brief B+ candidates: non-resonant channels -enum DecayChannel : int8_t { +/// @brief B+ candidates: main channels +enum DecayChannelMain : int8_t { // B+ - BplusToD0Pi = 1, // anti-D0 π+ - BplusToD0K, // anti-D0 K+ + BplusToD0Pi = 1, // anti-D0 π+ + BplusToD0PiPi0, // anti-D0 π+ π0 + BplusToD0PiGamma, // anti-D0 π+ γ0 + BplusToD0K, // anti-D0 K+ // - LastChannel + LastChannelMain }; /// @brief B+ candidates: resonant channels enum DecayChannelResonant : int8_t { diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index 06b42dd1bcd..4173b378e6d 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -953,7 +953,7 @@ struct HfCandidateCreator3ProngExpressions { indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2); } if (indexRec > -1) { - flag = sign * DecayChannel::DplusToPiKPi; + flag = sign * DecayChannelMain::DplusToPiKPi; } } @@ -984,7 +984,7 @@ struct HfCandidateCreator3ProngExpressions { if (indexRec > -1) { // DecayType::DsToKKPi is used to flag both Ds± → K± K∓ π± and D± → K± K∓ π± // TODO: move to different and explicit flags - flag = sign * (isDplus ? DecayChannel::DplusToPiKK : DecayChannel::DsToPiKK); + flag = sign * (isDplus ? DecayChannelMain::DplusToPiKK : DecayChannelMain::DsToPiKK); if (arrayDaughters[0].has_mcParticle()) { swapping = int8_t(std::abs(arrayDaughters[0].mcParticle().pdgCode()) == kPiPlus); } @@ -1011,7 +1011,7 @@ struct HfCandidateCreator3ProngExpressions { indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDStar, std::array{+kPiPlus, +kPiPlus, -kKPlus}, true, &sign, 2); } if (indexRec > -1) { - flag = sign * DecayChannel::DstarToPiKPi; + flag = sign * DecayChannelMain::DstarToPiKPi; channel = 1; } } @@ -1028,7 +1028,7 @@ struct HfCandidateCreator3ProngExpressions { indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); } if (indexRec > -1) { - flag = sign * DecayChannel::LcToPKPi; + flag = sign * DecayChannelMain::LcToPKPi; // Flagging the different Λc± → p± K∓ π± decay channels if (arrayDaughters[0].has_mcParticle()) { @@ -1063,7 +1063,7 @@ struct HfCandidateCreator3ProngExpressions { indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); } if (indexRec > -1) { - flag = sign * DecayChannel::XicToPKPi; + flag = sign * DecayChannelMain::XicToPKPi; if (arrayDaughters[0].has_mcParticle()) { swapping = int8_t(std::abs(arrayDaughters[0].mcParticle().pdgCode()) == kPiPlus); } diff --git a/PWGHF/Utils/utilsMcGen.h b/PWGHF/Utils/utilsMcGen.h index 83e327923c3..73dac888c8e 100644 --- a/PWGHF/Utils/utilsMcGen.h +++ b/PWGHF/Utils/utilsMcGen.h @@ -111,7 +111,7 @@ void fillMcMatchGen3Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V // D± → π± K∓ π± if (flag == 0) { if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2)) { - flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannel::DplusToPiKPi; + flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi; } } @@ -121,11 +121,11 @@ void fillMcMatchGen3Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2)) { // DecayType::DsToKKPi is used to flag both Ds± → K± K∓ π± and D± → K± K∓ π± // TODO: move to different and explicit flags - flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannel::DsToPiKK; + flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK; } else if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDPlus, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2)) { // DecayType::DsToKKPi is used to flag both Ds± → K± K∓ π± and D± → K± K∓ π± // TODO: move to different and explicit flags - flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannel::DplusToPiKK; + flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKK; isDplus = true; } if (flag != 0) { @@ -147,14 +147,14 @@ void fillMcMatchGen3Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V // D*± → D0(bar) π± if (flag == 0) { if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDStar, std::array{+kPiPlus, +kPiPlus, -kKPlus}, true, &sign, 2)) { - flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannel::DstarToPiKPi; + flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannelMain::DstarToPiKPi; } } // Λc± → p± K∓ π± if (flag == 0) { if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { - flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannel::LcToPKPi; + flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi; // Flagging the different Λc± → p± K∓ π± decay channels RecoDecay::getDaughters(particle, &arrDaughIndex, std::array{0}, 1); @@ -177,7 +177,7 @@ void fillMcMatchGen3Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V // Ξc± → p± K∓ π± if (flag == 0) { if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { - flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannel::XicToPKPi; + flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannelMain::XicToPKPi; } } From 950c317f744ad272b271291c7107cbd4e44ab501 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Wed, 4 Jun 2025 01:29:31 +0200 Subject: [PATCH 12/18] Propagate flags for 3-prongs and D*+ --- PWGHF/Core/DecayChannels.h | 6 ++- PWGHF/D2H/Tasks/taskCharmPolarisation.cxx | 16 ++++---- PWGHF/D2H/Tasks/taskDplus.cxx | 10 ++--- PWGHF/D2H/Tasks/taskDs.cxx | 38 +++++++++++++------ PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx | 6 +-- PWGHF/D2H/Tasks/taskLc.cxx | 4 +- PWGHF/D2H/Tasks/taskSigmac.cxx | 4 +- PWGHF/D2H/Tasks/taskXic.cxx | 4 +- .../DataModel/CandidateReconstructionTables.h | 1 + .../TableProducer/correlatorDplusDminus.cxx | 8 ++-- .../TableProducer/correlatorDplusHadrons.cxx | 8 ++-- .../HFC/TableProducer/correlatorDsHadrons.cxx | 22 +++++++---- .../HFC/TableProducer/correlatorLcHadrons.cxx | 8 ++-- .../HFC/TableProducer/femtoDreamProducer.cxx | 2 +- .../HFC/Tasks/taskCorrelationDplusHadrons.cxx | 4 +- PWGHF/HFC/Tasks/taskCorrelationDsHadrons.cxx | 8 ++-- PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx | 4 +- PWGHF/HFC/Tasks/taskFlow.cxx | 2 +- .../TableProducer/candidateCreator3Prong.cxx | 2 - PWGHF/TableProducer/candidateCreatorDstar.cxx | 20 +++++----- .../candidateCreatorSigmac0plusplus.cxx | 2 +- .../derivedDataCreatorDplusToPiKPi.cxx | 14 +++---- .../derivedDataCreatorDstarToD0Pi.cxx | 14 +++---- .../derivedDataCreatorLcToPKPi.cxx | 14 +++---- .../TableProducer/treeCreatorDplusToPiKPi.cxx | 8 ++-- PWGHF/TableProducer/treeCreatorDsToKKPi.cxx | 31 ++++++++++++--- .../TableProducer/treeCreatorDstarToD0Pi.cxx | 6 +-- PWGHF/TableProducer/treeCreatorLcToPKPi.cxx | 4 +- PWGHF/TableProducer/treeCreatorXicToPKPi.cxx | 6 +-- PWGHF/Tasks/taskCharmHadImpactPar.cxx | 2 +- PWGHF/Tasks/taskMcValidation.cxx | 14 +++---- PWGJE/Core/JetHFUtilities.h | 8 ++-- 32 files changed, 173 insertions(+), 127 deletions(-) diff --git a/PWGHF/Core/DecayChannels.h b/PWGHF/Core/DecayChannels.h index c6f4e1379f8..b52377d1b16 100644 --- a/PWGHF/Core/DecayChannels.h +++ b/PWGHF/Core/DecayChannels.h @@ -12,8 +12,9 @@ /// \file DecayChannels.h /// \brief Definitions of constants for MC flagging of HF decay channels. /// \author Vít Kučera , Inha University -/// \note DecayChannelMain enums define unique combinations of the mother particle and the daughters for main channels. -/// \note DecayChannelResonant enums define unique combinations of the mother particle and the daughters for resonant channels. +/// \note DecayChannelMain enums define unique combinations of the mother and the daughters for main channels. +/// \note DecayChannelResonant enums define unique combinations of the mother and the daughters for resonant channels. +/// \note Value 0 is reserved to indicate no match. /// \note Daughter ordering convention: (charm|strange|π±|K±|π0), (baryon|meson), (+|−) #ifndef PWGHF_CORE_DECAYCHANNELS_H_ @@ -27,6 +28,7 @@ namespace o2::hf_decay // TODO // - HF cascades (Λc+ → p K0short) // - HF cascades to LF cascades (Ωc0/Ξc0 → Ξ+ π−, Ξc+ → Ξ+ π− π+) +// - Σc namespace hf_cand_2prong { diff --git a/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx b/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx index 43b75756959..95cefe1ff0f 100644 --- a/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx +++ b/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx @@ -1086,8 +1086,8 @@ struct TaskPolarisationCharmHadrons { bool partRecoDstar{false}; if constexpr (doMc) { if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { - partRecoDstar = TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_dstar::DecayType::DstarToD0PiPi0) && TESTBIT(std::abs(candidate.flagMcMatchRecD0()), aod::hf_cand_dstar::DecayType::D0ToPiKPi0); - bool signalDstar = TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_dstar::DecayType::DstarToD0Pi) && TESTBIT(std::abs(candidate.flagMcMatchRecD0()), aod::hf_cand_dstar::DecayType::D0ToPiK); + partRecoDstar = std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPiPi0 && std::abs(candidate.flagMcMatchRecD0()) == hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiKPi0; + bool signalDstar = std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi && std::abs(candidate.flagMcMatchRecD0()) == hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK; if (!signalDstar && (!partRecoDstar || !activatePartRecoDstar)) { // this candidate is not signal and not partially reconstructed signal, skip return isCandidateInSignalRegion; } @@ -1099,8 +1099,8 @@ struct TaskPolarisationCharmHadrons { return isCandidateInSignalRegion; } } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { - if constexpr (!studyLcPKPiBkgMc) { // skip this if studyLcPKPiBkgMc is true, since we are interested in background - if (!TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_3prong::DecayType::LcToPKPi)) { // this candidate is not signal, skip + if constexpr (!studyLcPKPiBkgMc) { // skip this if studyLcPKPiBkgMc is true, since we are interested in background + if (std::abs(candidate.flagMcMatchRec()) != hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { // this candidate is not signal, skip return isCandidateInSignalRegion; } origin = candidate.originMcRec(); @@ -1501,7 +1501,7 @@ struct TaskPolarisationCharmHadrons { /// check if the pKpi triplet is a Lc->pKpi int8_t isRealLcPKPi = 0; - if (isRealPKPi && TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_3prong::DecayType::LcToPKPi)) { + if (isRealPKPi && (std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi)) { isRealLcPKPi = 1; } @@ -1607,8 +1607,8 @@ struct TaskPolarisationCharmHadrons { int8_t charge = -99; bool partRecoDstar{false}; if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { - partRecoDstar = TESTBIT(std::abs(mcParticle.flagMcMatchGen()), aod::hf_cand_dstar::DecayType::DstarToD0PiPi0) && TESTBIT(std::abs(mcParticle.flagMcMatchGenD0()), aod::hf_cand_dstar::DecayType::D0ToPiKPi0); - bool signalDstar = TESTBIT(std::abs(mcParticle.flagMcMatchGen()), aod::hf_cand_dstar::DecayType::DstarToD0Pi) && TESTBIT(std::abs(mcParticle.flagMcMatchGenD0()), aod::hf_cand_dstar::DecayType::D0ToPiK); + partRecoDstar = TESTBIT(std::abs(mcParticle.flagMcMatchGen()), hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPiPi0) && TESTBIT(std::abs(mcParticle.flagMcMatchGenD0()), hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiKPi0); + bool signalDstar = TESTBIT(std::abs(mcParticle.flagMcMatchGen()), hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi) && TESTBIT(std::abs(mcParticle.flagMcMatchGenD0()), hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK); if (!signalDstar && (!activatePartRecoDstar || !partRecoDstar)) { // this particle is not signal and not partially reconstructed signal, skip return; @@ -1629,7 +1629,7 @@ struct TaskPolarisationCharmHadrons { massDau = massPi; massCharmHad = massDstar; } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { - if (!TESTBIT(std::abs(mcParticle.flagMcMatchGen()), aod::hf_cand_3prong::DecayType::LcToPKPi)) { // this particle is not signal, skip + if (std::abs(mcParticle.flagMcMatchGen()) != hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { // this particle is not signal, skip return; } origin = mcParticle.originMcGen(); diff --git a/PWGHF/D2H/Tasks/taskDplus.cxx b/PWGHF/D2H/Tasks/taskDplus.cxx index ccbb6a2bd90..cbf6118ce68 100644 --- a/PWGHF/D2H/Tasks/taskDplus.cxx +++ b/PWGHF/D2H/Tasks/taskDplus.cxx @@ -74,12 +74,12 @@ struct HfTaskDplus { Partition selectedDPlusCandidatesWithMl = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; // Matched MC - Partition recoDPlusCandidates = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi)) && aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; - Partition recoDPlusCandidatesWithMl = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi)) && aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; + Partition recoDPlusCandidates = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) && aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; + Partition recoDPlusCandidatesWithMl = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) && aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; // MC Bkg - Partition recoBkgCandidates = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi)) && aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; - Partition recoBkgCandidatesWithMl = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi)) && aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; + Partition recoBkgCandidates = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) && aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; + Partition recoBkgCandidatesWithMl = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) && aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; ConfigurableAxis thnConfigAxisY{"thnConfigAxisY", {40, -1, 1}, "Cand. rapidity bins"}; ConfigurableAxis thnConfigAxisCent{"thnConfigAxisCent", {110, 0., 110.}, ""}; @@ -569,7 +569,7 @@ struct HfTaskDplus { ptGenB = -1; flagGenB = -1; auto yGen = RecoDecay::y(particle.pVector(), o2::constants::physics::MassDPlus); - if ((yCandGenMax >= 0. && std::abs(yGen) > yCandGenMax) || (std::abs(particle.flagMcMatchGen()) != 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi)) { + if ((yCandGenMax >= 0. && std::abs(yGen) > yCandGenMax) || (std::abs(particle.flagMcMatchGen()) != hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi)) { continue; } if (particle.originMcGen() == RecoDecay::OriginType::NonPrompt) { diff --git a/PWGHF/D2H/Tasks/taskDs.cxx b/PWGHF/D2H/Tasks/taskDs.cxx index f8d848e596f..2b94c93f6b8 100644 --- a/PWGHF/D2H/Tasks/taskDs.cxx +++ b/PWGHF/D2H/Tasks/taskDs.cxx @@ -57,6 +57,19 @@ enum DataType { Data = 0, McBkg, kDataTypes }; +enum Mother : int8_t { + Ds, + Dplus +}; + +enum ResonantChannel : int8_t { + PhiPi = 1, + Kstar0K = 2 +}; + +static std::unordered_map> channelsResonant = {{{Mother::Ds, {{ResonantChannel::PhiPi, hf_decay::hf_cand_3prong::DecayChannelResonant::DsToPhiPi}, {ResonantChannel::Kstar0K, hf_decay::hf_cand_3prong::DecayChannelResonant::DsToKstar0K}}}, + {Mother::Dplus, {{ResonantChannel::PhiPi, hf_decay::hf_cand_3prong::DecayChannelResonant::DplusToPhiPi}, {ResonantChannel::Kstar0K, hf_decay::hf_cand_3prong::DecayChannelResonant::DplusToKstar0K}}}}}; + template concept hasDsMlInfo = requires(T candidate) { candidate.mlProbDsToKKPi(); @@ -66,7 +79,7 @@ concept hasDsMlInfo = requires(T candidate) { /// Ds± analysis task struct HfTaskDs { - Configurable decayChannel{"decayChannel", 1, "Switch between decay channels: 1 for Ds/Dplus->PhiPi->KKpi, 2 for Ds/Dplus->K0*K->KKPi"}; + Configurable decayChannel{"decayChannel", 1, "Switch between resonant decay channels: 1 for Ds/Dplus->PhiPi->KKpi, 2 for Ds/Dplus->K0*K->KKPi"}; Configurable fillDplusMc{"fillDplusMc", true, "Switch to fill Dplus MC information"}; Configurable selectionFlagDs{"selectionFlagDs", 7, "Selection Flag for Ds"}; Configurable> classMl{"classMl", {0, 2, 3}, "Indexes of ML scores to be stored. Three indexes max."}; @@ -128,7 +141,6 @@ struct HfTaskDs { ConfigurableAxis axisCentrality{"axisCentrality", {100, 0., 1.}, "axis for centrality/multiplicity"}; ConfigurableAxis axisOccupancy{"axisOccupancy", {14, 0., 14000.}, "axis for occupancy"}; - int offsetDplusDecayChannel = aod::hf_cand_3prong::DecayChannelDToKKPi::DplusToPhiPi - aod::hf_cand_3prong::DecayChannelDToKKPi::DsToPhiPi; // Offset between Dplus and Ds to use the same decay channel. See aod::hf_cand_3prong::DecayChannelDToKKPi int mRunNumber{0}; bool lCalibLoaded; TList* lCalibObjects; @@ -162,6 +174,10 @@ struct HfTaskDs { LOGP(fatal, "No process function enabled"); } + if (decayChannel != ResonantChannel::PhiPi && decayChannel != ResonantChannel::Kstar0K) { + LOGP(fatal, "Invalid value of decayChannel"); + } + AxisSpec ptbins{axisPt, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec ptBHad{axisPtBHad, "#it{p}_{T}(B) (GeV/#it{c})"}; AxisSpec flagBHad{axisFlagBHad, "B Hadron flag"}; @@ -272,37 +288,37 @@ struct HfTaskDs { template bool isDsPrompt(const CandDs& candidate) { - return std::abs(candidate.flagMcMatchRec()) == static_cast(BIT(aod::hf_cand_3prong::DecayType::DsToKKPi)) && candidate.flagMcDecayChanRec() == decayChannel && candidate.originMcRec() == RecoDecay::OriginType::Prompt; + return std::abs(candidate.flagMcMatchRec()) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK) && candidate.flagMcDecayChanRec() == channelsResonant[Mother::Ds][decayChannel] && candidate.originMcRec() == RecoDecay::OriginType::Prompt; } template bool isDplusPrompt(const CandDs& candidate) { - return std::abs(candidate.flagMcMatchRec()) == static_cast(BIT(aod::hf_cand_3prong::DecayType::DsToKKPi)) && candidate.flagMcDecayChanRec() == decayChannel + offsetDplusDecayChannel && candidate.originMcRec() == RecoDecay::OriginType::Prompt; + return std::abs(candidate.flagMcMatchRec()) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKK) && candidate.flagMcDecayChanRec() == channelsResonant[Mother::Dplus][decayChannel] && candidate.originMcRec() == RecoDecay::OriginType::Prompt; } template bool isDsNonPrompt(const CandDs& candidate) { - return std::abs(candidate.flagMcMatchRec()) == static_cast(BIT(aod::hf_cand_3prong::DecayType::DsToKKPi)) && candidate.flagMcDecayChanRec() == decayChannel && candidate.originMcRec() == RecoDecay::OriginType::NonPrompt; + return std::abs(candidate.flagMcMatchRec()) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK) && candidate.flagMcDecayChanRec() == channelsResonant[Mother::Ds][decayChannel] && candidate.originMcRec() == RecoDecay::OriginType::NonPrompt; } template bool isDplusNonPrompt(const CandDs& candidate) { - return std::abs(candidate.flagMcMatchRec()) == static_cast(BIT(aod::hf_cand_3prong::DecayType::DsToKKPi)) && candidate.flagMcDecayChanRec() == decayChannel + offsetDplusDecayChannel && candidate.originMcRec() == RecoDecay::OriginType::NonPrompt; + return std::abs(candidate.flagMcMatchRec()) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKK) && candidate.flagMcDecayChanRec() == channelsResonant[Mother::Dplus][decayChannel] && candidate.originMcRec() == RecoDecay::OriginType::NonPrompt; } template bool isDplusBkg(const CandDs& candidate) { - return std::abs(candidate.flagMcMatchRec()) == static_cast(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi)); + return std::abs(candidate.flagMcMatchRec()) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi); } template bool isLcBkg(const CandDs& candidate) { - return std::abs(candidate.flagMcMatchRec()) == static_cast(BIT(aod::hf_cand_3prong::DecayType::LcToPKPi)); + return std::abs(candidate.flagMcMatchRec()) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi); } /// Checks whether the candidate is in the signal region of either the Ds or D+ decay @@ -673,9 +689,9 @@ struct HfTaskDs { // MC gen. for (const auto& particle : mcParticles) { - if (std::abs(particle.flagMcMatchGen()) == 1 << aod::hf_cand_3prong::DecayType::DsToKKPi) { + if (std::abs(particle.flagMcMatchGen()) == hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK || std::abs(particle.flagMcMatchGen()) == hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKK) { const auto& recoCollsPerMcColl = recoCollisions.sliceBy(colPerMcCollision, particle.mcCollision().globalIndex()); - if (particle.flagMcDecayChanGen() == decayChannel || (fillDplusMc && particle.flagMcDecayChanGen() == (decayChannel + offsetDplusDecayChannel))) { + if (particle.flagMcDecayChanGen() == channelsResonant[Mother::Ds][decayChannel] || (fillDplusMc && particle.flagMcDecayChanGen() == channelsResonant[Mother::Dplus][decayChannel])) { auto pt = particle.pt(); double y{0.f}; @@ -689,7 +705,7 @@ struct HfTaskDs { occ = o2::hf_occupancy::getOccupancyGenColl(recoCollsPerMcColl, occEstimator); } - if (particle.flagMcDecayChanGen() == decayChannel) { + if (particle.flagMcDecayChanGen() == channelsResonant[Mother::Ds][decayChannel]) { y = RecoDecay::y(particle.pVector(), o2::constants::physics::MassDS); if (yCandGenMax >= 0. && std::abs(y) > yCandGenMax) { continue; diff --git a/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx b/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx index eaadbab783c..0682c0584aa 100644 --- a/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx +++ b/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx @@ -313,8 +313,8 @@ struct HfTaskDstarToD0Pi { continue; } auto collision = candDstarMcRec.template collision_as(); - auto centrality = collision.centFT0M(); // 0-100% - if (TESTBIT(std::abs(candDstarMcRec.flagMcMatchRec()), aod::hf_cand_dstar::DecayType::DstarToD0Pi)) { // if MC matching is successful at Reconstruction Level + auto centrality = collision.centFT0M(); // 0-100% + if (std::abs(candDstarMcRec.flagMcMatchRec()) == hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi) { // if MC matching is successful at Reconstruction Level // LOGF(info, "MC Rec Dstar loop MC Matched"); // get MC Mother particle auto prong0 = candDstarMcRec.template prong0_as(); @@ -392,7 +392,7 @@ struct HfTaskDstarToD0Pi { { // MC Gen level for (auto const& mcParticle : rowsMcPartilces) { - if (TESTBIT(std::abs(mcParticle.flagMcMatchGen()), aod::hf_cand_dstar::DecayType::DstarToD0Pi)) { // MC Matching is successful at Generator Level + if (std::abs(mcParticle.flagMcMatchGen()) == hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi) { // MC Matching is successful at Generator Level auto ptGen = mcParticle.pt(); auto yGen = RecoDecay::y(mcParticle.pVector(), o2::constants::physics::MassDStar); if (yCandDstarGenMax >= 0. && std::abs(yGen) > yCandDstarGenMax) { diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index eca9a4a2672..cf3c070e6b7 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -376,7 +376,7 @@ struct HfTaskLc { continue; } - if (std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::LcToPKPi) { + if (std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { // Get the corresponding MC particle. auto mcParticleProng0 = candidate.template prong0_as().template mcParticle_as>(); auto pdgCodeProng0 = std::abs(mcParticleProng0.pdgCode()); @@ -589,7 +589,7 @@ struct HfTaskLc { { // MC gen. for (const auto& particle : mcParticles) { - if (std::abs(particle.flagMcMatchGen()) == 1 << aod::hf_cand_3prong::DecayType::LcToPKPi) { + if (std::abs(particle.flagMcMatchGen()) == hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { auto yGen = RecoDecay::y(particle.pVector(), o2::constants::physics::MassLambdaCPlus); if (yCandGenMax >= 0. && std::abs(yGen) > yCandGenMax) { continue; diff --git a/PWGHF/D2H/Tasks/taskSigmac.cxx b/PWGHF/D2H/Tasks/taskSigmac.cxx index 39011a4a44d..3ea06c80733 100644 --- a/PWGHF/D2H/Tasks/taskSigmac.cxx +++ b/PWGHF/D2H/Tasks/taskSigmac.cxx @@ -726,7 +726,7 @@ struct HfTaskSigmac { /// loop over Lc generated particles for (const auto& particle : mcParticlesLc) { - if (std::abs(particle.flagMcMatchGen()) != BIT(aod::hf_cand_3prong::DecayType::LcToPKPi)) { + if (std::abs(particle.flagMcMatchGen()) != hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { continue; } if (yCandGenMax >= 0. && std::abs(RecoDecay::y(particle.pVector(), o2::constants::physics::MassLambdaCPlus)) > yCandGenMax) { @@ -1149,7 +1149,7 @@ struct HfTaskSigmac { if (enableTHn) { /// loop over Λc+ candidates w/o Σc0,++ mass-window cut for (const auto& candidateLc : candidatesLc) { - if (!TESTBIT(std::abs(candidateLc.flagMcMatchRec()), aod::hf_cand_3prong::DecayType::LcToPKPi)) { + if (std::abs(candidateLc.flagMcMatchRec()) != hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { continue; } double massLc(-1.); diff --git a/PWGHF/D2H/Tasks/taskXic.cxx b/PWGHF/D2H/Tasks/taskXic.cxx index d2dc111d826..5c338f8b957 100644 --- a/PWGHF/D2H/Tasks/taskXic.cxx +++ b/PWGHF/D2H/Tasks/taskXic.cxx @@ -429,7 +429,7 @@ struct HfTaskXic { massXicToPiKP = hfHelper.invMassXicToPiKP(candidate); // mass conjugate } - if (std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::XicToPKPi) { + if (std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::XicToPKPi) { // Get the corresponding MC particle. auto mcParticleProng0 = candidate.template prong0_as().template mcParticle_as>(); auto pdgCodeProng0 = std::abs(mcParticleProng0.pdgCode()); @@ -572,7 +572,7 @@ struct HfTaskXic { // MC gen. for (const auto& particle : mcParticles) { - if (std::abs(particle.flagMcMatchGen()) == 1 << aod::hf_cand_3prong::DecayType::XicToPKPi) { + if (std::abs(particle.flagMcMatchGen()) == hf_decay::hf_cand_3prong::DecayChannelMain::XicToPKPi) { auto yGen = RecoDecay::y(particle.pVector(), o2::constants::physics::MassXiCPlus); if (yCandGenMax >= 0. && std::abs(yGen) > yCandGenMax) { continue; diff --git a/PWGHF/DataModel/CandidateReconstructionTables.h b/PWGHF/DataModel/CandidateReconstructionTables.h index 1f4e94b0e83..014bfa3e32e 100644 --- a/PWGHF/DataModel/CandidateReconstructionTables.h +++ b/PWGHF/DataModel/CandidateReconstructionTables.h @@ -35,6 +35,7 @@ #include "PWGLF/DataModel/LFStrangenessTables.h" #include "PWGHF/Utils/utilsPid.h" +#include "PWGHF/Core/DecayChannels.h" // FIXME: temporary until propagated where needed namespace o2::aod { diff --git a/PWGHF/HFC/TableProducer/correlatorDplusDminus.cxx b/PWGHF/HFC/TableProducer/correlatorDplusDminus.cxx index e6f40634641..3cbee2b072a 100644 --- a/PWGHF/HFC/TableProducer/correlatorDplusDminus.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDplusDminus.cxx @@ -298,7 +298,7 @@ struct HfCorrelatorDplusDminus { if (outerSecondTrack.sign() == 1) { outerParticleSign = -1; // Dminus (second daughter track is positive) } - if (std::abs(candidate1.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi) { + if (std::abs(candidate1.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) { // fill invariant mass plots and per-candidate distributions from Dplus/Dminus signal candidates if (outerParticleSign == 1) { // reco and matched as Dplus registry.fill(HIST("hMassDplusMCRecSig"), hfHelper.invMassDplusToPiKPi(candidate1), candidate1.pt(), efficiencyWeight); @@ -326,7 +326,7 @@ struct HfCorrelatorDplusDminus { if (outerParticleSign == -1) { continue; // reject Dminus in outer loop } - flagDplusSignal = std::abs(candidate1.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi; // flagDplusSignal 'true' if candidate1 matched to Dplus + flagDplusSignal = std::abs(candidate1.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi; // flagDplusSignal 'true' if candidate1 matched to Dplus for (const auto& candidate2 : selectedDPlusCandidatesGroupedMC) { if (!(candidate2.hfflag() & 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi)) { // check decay channel flag for candidate2 continue; @@ -335,7 +335,7 @@ struct HfCorrelatorDplusDminus { if (innerSecondTrack.sign() != 1) { // keep only Dminus (with second daughter track positive) continue; } - flagDminusSignal = std::abs(candidate2.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi; // flagDminusSignal 'true' if candidate2 matched to Dminus + flagDminusSignal = std::abs(candidate2.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi; // flagDminusSignal 'true' if candidate2 matched to Dminus if (yCandMax >= 0. && std::abs(hfHelper.yDplus(candidate2)) > yCandMax) { continue; } @@ -428,7 +428,7 @@ struct HfCorrelatorDplusDminus { // fill pairs vs etaCut plot bool rightDecayChannels = false; - if ((std::abs(particle1.flagMcMatchGen()) == 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi) && (std::abs(particle2.flagMcMatchGen()) == 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi)) { + if ((std::abs(particle1.flagMcMatchGen()) == hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) && (std::abs(particle2.flagMcMatchGen()) == hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi)) { rightDecayChannels = true; } do { diff --git a/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx index d40daca5410..a1a8941779b 100644 --- a/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx @@ -422,7 +422,7 @@ struct HfCorrelatorDplusHadrons { efficiencyWeightD = 1. / efficiencyD->at(effBinD); } // Dplus flag - isDplusSignal = TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_3prong::DecayType::DplusToPiKPi); + isDplusSignal = std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi; // prompt and non-prompt division isDplusPrompt = candidate.originMcRec() == RecoDecay::OriginType::Prompt; isDplusNonPrompt = candidate.originMcRec() == RecoDecay::OriginType::NonPrompt; @@ -531,7 +531,7 @@ struct HfCorrelatorDplusHadrons { if (std::abs(particle1.pdgCode()) != Pdg::kDPlus) { continue; } - if (!TESTBIT(std::abs(particle1.flagMcMatchGen()), aod::hf_cand_3prong::DecayType::DplusToPiKPi)) { + if (std::abs(particle1.flagMcMatchGen()) != hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) { continue; } double yD = RecoDecay::y(particle1.pVector(), MassDPlus); @@ -637,7 +637,7 @@ struct HfCorrelatorDplusHadrons { continue; } // Dplus flag - bool isDplusSignal = TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_3prong::DecayType::DplusToPiKPi); + bool isDplusSignal = std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi; // prompt and non-prompt division bool isDplusPrompt = candidate.originMcRec() == RecoDecay::OriginType::Prompt; bool isDplusNonPrompt = candidate.originMcRec() == RecoDecay::OriginType::NonPrompt; @@ -675,7 +675,7 @@ struct HfCorrelatorDplusHadrons { std::vector outputMl = {-1., -1., -1.}; bool isPhysicalPrimary = false; int trackOrigin = -1; - bool isDplusSignal = std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi; + bool isDplusSignal = std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi; // prompt and non-prompt division bool isDplusPrompt = candidate.originMcRec() == RecoDecay::OriginType::Prompt; if (pAssoc.has_mcParticle()) { diff --git a/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx index 3ba26af40a6..a69a77dd4d5 100644 --- a/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx @@ -15,6 +15,7 @@ /// \author Samuele Cattaruzzi #include +#include #include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" @@ -41,6 +42,13 @@ using namespace o2::constants::math; using namespace o2::framework; using namespace o2::framework::expressions; +enum ResonantChannel : int8_t { + PhiPi = 1, + Kstar0K = 2 +}; + +static std::unordered_map channelsResonant = {{{ResonantChannel::PhiPi, hf_decay::hf_cand_3prong::DecayChannelResonant::DsToPhiPi}, {ResonantChannel::Kstar0K, hf_decay::hf_cand_3prong::DecayChannelResonant::DsToKstar0K}}}; + /// Returns deltaPhi value in range [-pi/2., 3.*pi/2], typically used for correlation studies double getDeltaPhi(double phiHadron, double phiD) { @@ -462,8 +470,8 @@ struct HfCorrelatorDsHadrons { // prompt and non-prompt division isDsPrompt = candidate.originMcRec() == RecoDecay::OriginType::Prompt; // Ds Signal - isDsSignal = std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::DsToKKPi; - isDecayChan = candidate.flagMcDecayChanRec() == decayChannel; + isDsSignal = std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK; + isDecayChan = candidate.flagMcDecayChanRec() == channelsResonant[decayChannel]; if (std::abs(hfHelper.yDs(candidate)) > yCandMax || candidate.pt() < ptCandMin || candidate.pt() > ptCandMax) { continue; @@ -643,7 +651,7 @@ struct HfCorrelatorDsHadrons { // MC gen level for (const auto& particle : groupedMcParticles) { // check if the particle is Ds - if ((std::abs(particle.flagMcMatchGen()) == 1 << aod::hf_cand_3prong::DecayType::DsToKKPi) && (particle.flagMcDecayChanGen() == decayChannel)) { + if ((std::abs(particle.flagMcMatchGen()) == hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK) && (particle.flagMcDecayChanGen() == channelsResonant[decayChannel])) { double yD = RecoDecay::y(particle.pVector(), MassDS); if (std::abs(yD) > yCandGenMax || particle.pt() < ptCandMin || particle.pt() > ptCandMax) { continue; @@ -651,7 +659,7 @@ struct HfCorrelatorDsHadrons { fillMcGenHisto(particle); // prompt and non-prompt division isDsPrompt = particle.originMcGen() == RecoDecay::OriginType::Prompt; - isDecayChan = particle.flagMcDecayChanGen() == decayChannel; + isDecayChan = particle.flagMcDecayChanGen() == channelsResonant[decayChannel]; std::vector listDaughters{}; std::array arrDaughDsPDG = {+kKPlus, -kKPlus, kPiPlus}; std::array prongsId; @@ -823,7 +831,7 @@ struct HfCorrelatorDsHadrons { if (std::abs(hfHelper.yDs(candidate)) > yCandMax || candidate.pt() < ptCandMin || candidate.pt() > ptCandMax) { continue; } - if (std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::DsToKKPi) { + if (std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK) { // DsToKKPi and DsToPiKK division if (candidate.isSelDsToKKPi() >= selectionFlagDs) { fillHistoMcRecSig(candidate, 0.); @@ -860,7 +868,7 @@ struct HfCorrelatorDsHadrons { // prompt and non-prompt division isDsPrompt = candidate.originMcRec() == RecoDecay::OriginType::Prompt; // Ds Signal - isDsSignal = std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::DsToKKPi; + isDsSignal = std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK; isDecayChan = candidate.flagMcDecayChanRec() == decayChannel; if (pAssoc.has_mcParticle()) { auto mcParticle = pAssoc.template mcParticle_as(); @@ -911,7 +919,7 @@ struct HfCorrelatorDsHadrons { for (const auto& [c1, tracks1, c2, tracks2] : pairMcGen) { int poolBin = corrBinningMcGen.getBin(std::make_tuple(c1.posZ(), c1.multMCFT0A())); for (const auto& [candidate, particleAssoc] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { - if ((std::abs(candidate.flagMcMatchGen()) == 1 << aod::hf_cand_3prong::DecayType::DsToKKPi) && (candidate.flagMcDecayChanGen() == decayChannel)) { + if ((std::abs(candidate.flagMcMatchGen()) == hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK) && (candidate.flagMcDecayChanGen() == decayChannel)) { double yD = RecoDecay::y(candidate.pVector(), MassDS); if (std::abs(yD) > yCandGenMax || candidate.pt() < ptCandMin || candidate.pt() > ptCandMax) { continue; diff --git a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx index f8dd07c5fc4..c76ec3d62d2 100644 --- a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx @@ -532,7 +532,7 @@ struct HfCorrelatorLcHadrons { auto trackPos1 = candidate.template prong0_as(); // positive daughter (negative for the antiparticles) auto trackPos2 = candidate.template prong2_as(); int8_t chargeLc = trackPos1.sign(); // charge of 1st prong will be the charge of Lc candidate - isLcSignal = TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_3prong::DecayType::LcToPKPi); + isLcSignal = std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi; isLcPrompt = candidate.originMcRec() == RecoDecay::OriginType::Prompt; isLcNonPrompt = candidate.originMcRec() == RecoDecay::OriginType::NonPrompt; std::vector outputMl = {-1., -1., -1.}; @@ -778,7 +778,7 @@ struct HfCorrelatorLcHadrons { if (std::abs(particle.pdgCode()) != Pdg::kLambdaCPlus) { continue; } - if (!TESTBIT(std::abs(particle.flagMcMatchGen()), aod::hf_cand_3prong::DecayType::LcToPKPi)) { + if (std::abs(particle.flagMcMatchGen()) != hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { continue; } double yL = RecoDecay::y(particle.pVector(), MassLambdaCPlus); @@ -944,7 +944,7 @@ struct HfCorrelatorLcHadrons { continue; } // Lc flag - bool isLcSignal = TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_3prong::DecayType::LcToPKPi); + bool isLcSignal = std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi; // prompt and non-prompt division bool isLcPrompt = candidate.originMcRec() == RecoDecay::OriginType::Prompt; bool isLcNonPrompt = candidate.originMcRec() == RecoDecay::OriginType::NonPrompt; @@ -993,7 +993,7 @@ struct HfCorrelatorLcHadrons { std::vector outputMl = {-1., -1., -1.}; bool isPhysicalPrimary = false; int trackOrigin = -1; - bool isLcSignal = std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::LcToPKPi; + bool isLcSignal = std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi; bool isLcPrompt = candidate.originMcRec() == RecoDecay::OriginType::Prompt; if (pidTrkApplied) { if (!passPIDSelection(pAssoc, trkPIDspecies, pidTPCMax, pidTOFMax, tofPIDThreshold, forceTOF)) diff --git a/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx b/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx index 16a32177afd..ee8ec8aaa26 100644 --- a/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx +++ b/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx @@ -563,7 +563,7 @@ struct HfFemtoDreamProducer { // Filling particle properties rowCandCharmHadGen.reserve(particles.size()); for (const auto& particle : particles) { - if (std::abs(particle.flagMcMatchGen()) == 1 << aod::hf_cand_3prong::DecayType::LcToPKPi) { + if (std::abs(particle.flagMcMatchGen()) == hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { rowCandCharmHadGen( particle.mcCollisionId(), particle.flagMcMatchGen(), diff --git a/PWGHF/HFC/Tasks/taskCorrelationDplusHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationDplusHadrons.cxx index 43398e86043..339ab91a27c 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationDplusHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationDplusHadrons.cxx @@ -589,7 +589,7 @@ struct HfTaskCorrelationDplusHadrons { auto mcCollision = mcParticle.template mcCollision_as>(); multiplicity = mcCollision.multMCFT0A() + mcCollision.multMCFT0C(); // multFT0M = multFt0A + multFT0C hCandidates->Fill(kCandidateStepMcGenAll, mcParticle.pt(), multiplicity, mcParticle.originMcGen()); - if (std::abs(mcParticle.flagMcMatchGen()) == 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi) { + if (std::abs(mcParticle.flagMcMatchGen()) == hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) { hCandidates->Fill(kCandidateStepMcGenDplusToPiKPi, mcParticle.pt(), multiplicity, mcParticle.originMcGen()); auto yDplus = RecoDecay::y(mcParticle.pVector(), o2::constants::physics::MassDPlus); if (std::abs(yDplus) <= yCandGenMax) { @@ -636,7 +636,7 @@ struct HfTaskCorrelationDplusHadrons { continue; } multiplicity = collision.multFT0M(); - if (std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi) { + if (std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) { hCandidates->Fill(kCandidateStepMcReco, candidate.pt(), multiplicity, candidate.originMcRec()); if (std::abs(hfHelper.yDplus(candidate)) <= yCandMax) { hCandidates->Fill(kCandidateStepMcRecoInAcceptance, candidate.pt(), multiplicity, candidate.originMcRec()); diff --git a/PWGHF/HFC/Tasks/taskCorrelationDsHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationDsHadrons.cxx index f70f05b0691..3375d71b86d 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationDsHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationDsHadrons.cxx @@ -693,7 +693,7 @@ struct HfTaskCorrelationDsHadrons { // generated candidate loop for (const auto& mcParticle : groupedMcParticles) { - if ((std::abs(mcParticle.flagMcMatchGen()) == 1 << aod::hf_cand_3prong::DecayType::DsToKKPi) && (mcParticle.flagMcDecayChanGen() == decayChannel)) { + if ((std::abs(mcParticle.flagMcMatchGen()) == hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK) && (mcParticle.flagMcDecayChanGen() == decayChannel)) { hCandidates->Fill(kCandidateStepMcGenDsToKKPi, mcParticle.pt(), multiplicityGen, mcParticle.originMcGen()); auto yDs = RecoDecay::y(mcParticle.pVector(), o2::constants::physics::MassDS); if (std::abs(yDs) <= yCandGenMax) { @@ -738,7 +738,7 @@ struct HfTaskCorrelationDsHadrons { continue; } - if ((std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::DsToKKPi) && (candidate.flagMcDecayChanRec() == decayChannel)) { + if ((std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK) && (candidate.flagMcDecayChanRec() == decayChannel)) { auto prong0McPart = candidate.template prong0_as().template mcParticle_as(); // DsToKKPi and DsToPiKK division if (((std::abs(prong0McPart.pdgCode()) == kKPlus) && (candidate.isSelDsToKKPi() >= selectionFlagDs)) || ((std::abs(prong0McPart.pdgCode()) == kPiPlus) && (candidate.isSelDsToPiKK() >= selectionFlagDs))) { @@ -773,7 +773,7 @@ struct HfTaskCorrelationDsHadrons { float multiplicity = -1.; for (const auto& mcParticle : mcParticles) { // generated candidates - if ((std::abs(mcParticle.flagMcMatchGen()) == 1 << aod::hf_cand_3prong::DecayType::DsToKKPi) && (mcParticle.flagMcDecayChanGen() == decayChannel)) { + if ((std::abs(mcParticle.flagMcMatchGen()) == hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK) && (mcParticle.flagMcDecayChanGen() == decayChannel)) { auto mcCollision = mcParticle.template mcCollision_as>(); multiplicity = mcCollision.multMCFT0A() + mcCollision.multMCFT0C(); // multFT0M = multFt0A + multFT0C hCandidates->Fill(kCandidateStepMcGenDsToKKPi, mcParticle.pt(), multiplicity, mcParticle.originMcGen()); @@ -824,7 +824,7 @@ struct HfTaskCorrelationDsHadrons { continue; } multiplicity = collision.multFT0M(); - if ((std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::DsToKKPi) && (candidate.flagMcDecayChanRec() == decayChannel)) { + if ((std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK) && (candidate.flagMcDecayChanRec() == decayChannel)) { auto prong0McPart = candidate.template prong0_as().template mcParticle_as(); // DsToKKPi and DsToPiKK division if (((std::abs(prong0McPart.pdgCode()) == kKPlus) && (candidate.isSelDsToKKPi() >= selectionFlagDs)) || ((std::abs(prong0McPart.pdgCode()) == kPiPlus) && (candidate.isSelDsToPiKK() >= selectionFlagDs))) { diff --git a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx index 2d123acde31..791dd045f99 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx @@ -811,7 +811,7 @@ struct HfTaskCorrelationLcHadrons { auto mcCollision = mcParticle.template mcCollision_as>(); multiplicity = mcCollision.multMCFT0A() + mcCollision.multMCFT0C(); // multFT0M = multFt0A + multFT0C hCandidates->Fill(kCandidateStepMcGenAll, mcParticle.pt(), multiplicity, mcParticle.originMcGen()); - if (std::abs(mcParticle.flagMcMatchGen()) == 1 << aod::hf_cand_3prong::DecayType::LcToPKPi) { + if (std::abs(mcParticle.flagMcMatchGen()) == hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { hCandidates->Fill(kCandidateStepMcGenLcToPKPi, mcParticle.pt(), multiplicity, mcParticle.originMcGen()); auto yL = RecoDecay::y(mcParticle.pVector(), o2::constants::physics::MassLambdaCPlus); if (std::abs(yL) <= yCandGenMax) { @@ -862,7 +862,7 @@ struct HfTaskCorrelationLcHadrons { continue; } multiplicity = collision.multFT0M(); - if (std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::LcToPKPi) { + if (std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { hCandidates->Fill(kCandidateStepMcReco, candidate.pt(), multiplicity, candidate.originMcRec()); if (std::abs(hfHelper.yLc(candidate)) <= yCandMax) { hCandidates->Fill(kCandidateStepMcRecoInAcceptance, candidate.pt(), multiplicity, candidate.originMcRec()); diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index 840357b0b3e..981ce78e7ca 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -809,7 +809,7 @@ struct HfTaskFlow { // } } } else { // For now, that means we do LambdaC - if (std::abs(mcCandidate.flagMcMatchGen()) == 1 << aod::hf_cand_3prong::DecayType::LcToPKPi) { + if (std::abs(mcCandidate.flagMcMatchGen()) == hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { if (etaCandidateMax >= 0. && std::abs(etaCandidate) > etaCandidateMax) { return false; diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index 4173b378e6d..145e84513db 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -982,8 +982,6 @@ struct HfCandidateCreator3ProngExpressions { } } if (indexRec > -1) { - // DecayType::DsToKKPi is used to flag both Ds± → K± K∓ π± and D± → K± K∓ π± - // TODO: move to different and explicit flags flag = sign * (isDplus ? DecayChannelMain::DplusToPiKK : DecayChannelMain::DsToPiKK); if (arrayDaughters[0].has_mcParticle()) { swapping = int8_t(std::abs(arrayDaughters[0].mcParticle().pdgCode()) == kPiPlus); diff --git a/PWGHF/TableProducer/candidateCreatorDstar.cxx b/PWGHF/TableProducer/candidateCreatorDstar.cxx index b5b67db87ab..f25a09dbbb3 100644 --- a/PWGHF/TableProducer/candidateCreatorDstar.cxx +++ b/PWGHF/TableProducer/candidateCreatorDstar.cxx @@ -638,10 +638,10 @@ struct HfCandidateCreatorDstarExpressions { } if (indexRecDstar > -1) { - flagDstar = signDstar * (BIT(aod::hf_cand_dstar::DecayType::DstarToD0Pi)); + flagDstar = signDstar * hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi; } if (indexRecD0 > -1) { - flagD0 = signD0 * (BIT(aod::hf_cand_dstar::DecayType::D0ToPiK)); + flagD0 = signD0 * hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK; } // check partly reconstructed decays, namely D0->Kpipi0 @@ -673,11 +673,11 @@ struct HfCandidateCreatorDstarExpressions { auto motherParticleDstar = mcParticles.rawIteratorAt(indexRecDstar); if (signDstar > 0) { if (RecoDecay::isMatchedMCGen(mcParticles, motherParticleDstar, Pdg::kDStar, std::array{+kPiPlus, +kPiPlus, -kKPlus, +kPi0}, false, &signDstar, 2)) { - flagDstar = signDstar * (BIT(aod::hf_cand_dstar::DecayType::DstarToD0PiPi0)); + flagDstar = signDstar * hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPiPi0; } } else { if (RecoDecay::isMatchedMCGen(mcParticles, motherParticleDstar, -Pdg::kDStar, std::array{-kPiPlus, -kPiPlus, +kKPlus, +kPi0}, false, &signDstar, 2)) { - flagDstar = signDstar * (BIT(aod::hf_cand_dstar::DecayType::DstarToD0PiPi0)); + flagDstar = signDstar * hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPiPi0; } } } @@ -686,11 +686,11 @@ struct HfCandidateCreatorDstarExpressions { auto motherParticleD0 = mcParticles.rawIteratorAt(indexRecD0); if (signD0 > 0) { if (RecoDecay::isMatchedMCGen(mcParticles, motherParticleD0, Pdg::kD0, std::array{+kPiPlus, -kKPlus, +kPi0}, false, &signD0)) { - flagD0 = signD0 * (BIT(aod::hf_cand_dstar::DecayType::D0ToPiKPi0)); + flagD0 = signD0 * hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiKPi0; } } else { if (RecoDecay::isMatchedMCGen(mcParticles, motherParticleD0, -Pdg::kD0, std::array{-kPiPlus, +kKPlus, +kPi0}, false, &signD0)) { - flagD0 = signD0 * (BIT(aod::hf_cand_dstar::DecayType::D0ToPiKPi0)); + flagD0 = signD0 * hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiKPi0; } } } @@ -764,11 +764,11 @@ struct HfCandidateCreatorDstarExpressions { } } if (RecoDecay::isMatchedMCGen(mcParticles, particleD0, Pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &signD0)) { - flagDstar = signDstar * (BIT(aod::hf_cand_dstar::DecayType::DstarToD0Pi)); - flagD0 = signD0 * (BIT(aod::hf_cand_dstar::DecayType::D0ToPiK)); + flagDstar = signDstar * hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi; + flagD0 = signD0 * hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK; } else if (RecoDecay::isMatchedMCGen(mcParticles, particleD0, Pdg::kD0, std::array{+kPiPlus, -kKPlus, +kPi0}, false, &signD0) || RecoDecay::isMatchedMCGen(mcParticles, particleD0, -Pdg::kD0, std::array{-kPiPlus, +kKPlus, +kPi0}, false, &signD0)) { - flagDstar = signDstar * (BIT(aod::hf_cand_dstar::DecayType::DstarToD0PiPi0)); - flagD0 = signD0 * (BIT(aod::hf_cand_dstar::DecayType::D0ToPiKPi0)); + flagDstar = signDstar * hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPiPi0; + flagD0 = signD0 * hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiKPi0; } } diff --git a/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx b/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx index 8ab7e92d5ce..c8dbbf04b2b 100644 --- a/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx +++ b/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx @@ -472,7 +472,7 @@ struct HfCandidateSigmac0plusplusMc { /// skip immediately the candidate Σc0,++ w/o a Λc+ matched to MC auto candLc = candSigmac.prongLc_as(); - if (!(std::abs(candLc.flagMcMatchRec()) == BIT(aod::hf_cand_3prong::DecayType::LcToPKPi))) { /// (*) + if (std::abs(candLc.flagMcMatchRec()) != hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { /// (*) rowMCMatchScRec(flag, origin, -1.f, 0, -1); continue; } diff --git a/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx index c5c26270b79..6897b30ec0e 100644 --- a/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx @@ -87,7 +87,7 @@ struct HfDerivedDataCreatorDplusToPiKPi { using TypeMcCollisions = soa::Join; Filter filterSelectCandidates = (aod::hf_sel_candidate_dplus::isSelDplusToPiKPi & static_cast(BIT(aod::SelectionStep::RecoMl - 1))) != 0; // select candidates which passed all cuts at least up to RecoMl - 1 - Filter filterMcGenMatching = nabs(aod::hf_cand_3prong::flagMcMatchGen) == static_cast(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi)); + Filter filterMcGenMatching = nabs(aod::hf_cand_3prong::flagMcMatchGen) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi); Preslice candidatesPerCollision = aod::hf_cand::collisionId; Preslice candidatesMcPerCollision = aod::hf_cand::collisionId; @@ -101,10 +101,10 @@ struct HfDerivedDataCreatorDplusToPiKPi { Partition candidatesMlAll = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= 0; Partition candidatesMcMlAll = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= 0; // partitions for signal and background - Partition candidatesMcSig = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi)); - Partition candidatesMcBkg = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi)); - Partition candidatesMcMlSig = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi)); - Partition candidatesMcMlBkg = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi)); + Partition candidatesMcSig = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi); + Partition candidatesMcBkg = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi); + Partition candidatesMcMlSig = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi); + Partition candidatesMcMlBkg = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi); void init(InitContext const&) { @@ -253,7 +253,7 @@ struct HfDerivedDataCreatorDplusToPiKPi { swapping = candidate.isCandidateSwapped(); flagDecayChanRec = candidate.flagMcDecayChanRec(); if constexpr (onlyBkg) { - if (TESTBIT(std::abs(flagMcRec), aod::hf_cand_3prong::DecayType::DplusToPiKPi)) { + if (std::abs(flagMcRec) == hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) { continue; } if (downSampleBkgFactor < 1.) { @@ -264,7 +264,7 @@ struct HfDerivedDataCreatorDplusToPiKPi { } } if constexpr (onlySig) { - if (!TESTBIT(std::abs(flagMcRec), aod::hf_cand_3prong::DecayType::DplusToPiKPi)) { + if (std::abs(flagMcRec) != hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) { continue; } } diff --git a/PWGHF/TableProducer/derivedDataCreatorDstarToD0Pi.cxx b/PWGHF/TableProducer/derivedDataCreatorDstarToD0Pi.cxx index 084605c2f3b..7c592e9ccb1 100644 --- a/PWGHF/TableProducer/derivedDataCreatorDstarToD0Pi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorDstarToD0Pi.cxx @@ -83,7 +83,7 @@ struct HfDerivedDataCreatorDstarToD0Pi { using TypeMcCollisions = soa::Join; Filter filterSelectCandidates = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == true; - Filter filterMcGenMatching = nabs(aod::hf_cand_dstar::flagMcMatchGen) == static_cast(BIT(aod::hf_cand_dstar::DecayType::DstarToD0Pi)); + Filter filterMcGenMatching = nabs(aod::hf_cand_dstar::flagMcMatchGen) == static_cast(hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi); Preslice candidatesPerCollision = aod::hf_cand::collisionId; Preslice candidatesMcPerCollision = aod::hf_cand::collisionId; @@ -97,10 +97,10 @@ struct HfDerivedDataCreatorDstarToD0Pi { Partition candidatesMlAll = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == true; Partition candidatesMcMlAll = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == true; // partitions for signal and background - Partition candidatesMcSig = nabs(aod::hf_cand_dstar::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_dstar::DecayType::DstarToD0Pi)); - Partition candidatesMcBkg = nabs(aod::hf_cand_dstar::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_dstar::DecayType::DstarToD0Pi)); - Partition candidatesMcMlSig = nabs(aod::hf_cand_dstar::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_dstar::DecayType::DstarToD0Pi)); - Partition candidatesMcMlBkg = nabs(aod::hf_cand_dstar::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_dstar::DecayType::DstarToD0Pi)); + Partition candidatesMcSig = nabs(aod::hf_cand_dstar::flagMcMatchRec) == static_cast(hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi); + Partition candidatesMcBkg = nabs(aod::hf_cand_dstar::flagMcMatchRec) != static_cast(hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi); + Partition candidatesMcMlSig = nabs(aod::hf_cand_dstar::flagMcMatchRec) == static_cast(hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi); + Partition candidatesMcMlBkg = nabs(aod::hf_cand_dstar::flagMcMatchRec) != static_cast(hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi); void init(InitContext const&) { @@ -229,7 +229,7 @@ struct HfDerivedDataCreatorDstarToD0Pi { flagMcRec = candidate.flagMcMatchRec(); origin = candidate.originMcRec(); if constexpr (onlyBkg) { - if (TESTBIT(std::abs(flagMcRec), aod::hf_cand_dstar::DecayType::DstarToD0Pi)) { + if (std::abs(flagMcRec) == hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi) { continue; } if (downSampleBkgFactor < 1.) { @@ -240,7 +240,7 @@ struct HfDerivedDataCreatorDstarToD0Pi { } } if constexpr (onlySig) { - if (!TESTBIT(std::abs(flagMcRec), aod::hf_cand_dstar::DecayType::DstarToD0Pi)) { + if (std::abs(flagMcRec) != hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi) { continue; } } diff --git a/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx index 7078087a222..a956d4ff202 100644 --- a/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx @@ -87,7 +87,7 @@ struct HfDerivedDataCreatorLcToPKPi { using TypeMcCollisions = soa::Join; Filter filterSelectCandidates = aod::hf_sel_candidate_lc::isSelLcToPKPi >= 1 || aod::hf_sel_candidate_lc::isSelLcToPiKP >= 1; - Filter filterMcGenMatching = nabs(aod::hf_cand_3prong::flagMcMatchGen) == static_cast(BIT(aod::hf_cand_3prong::DecayType::LcToPKPi)); + Filter filterMcGenMatching = nabs(aod::hf_cand_3prong::flagMcMatchGen) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi); Preslice candidatesPerCollision = aod::hf_cand::collisionId; Preslice candidatesMcPerCollision = aod::hf_cand::collisionId; @@ -101,10 +101,10 @@ struct HfDerivedDataCreatorLcToPKPi { Partition candidatesMlAll = aod::hf_sel_candidate_lc::isSelLcToPKPi >= 0; Partition candidatesMcMlAll = aod::hf_sel_candidate_lc::isSelLcToPKPi >= 0; // partitions for signal and background - Partition candidatesMcSig = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_3prong::DecayType::LcToPKPi)); - Partition candidatesMcBkg = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_3prong::DecayType::LcToPKPi)); - Partition candidatesMcMlSig = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_3prong::DecayType::LcToPKPi)); - Partition candidatesMcMlBkg = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_3prong::DecayType::LcToPKPi)); + Partition candidatesMcSig = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi); + Partition candidatesMcBkg = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi); + Partition candidatesMcMlSig = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi); + Partition candidatesMcMlBkg = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi); void init(InitContext const&) { @@ -252,7 +252,7 @@ struct HfDerivedDataCreatorLcToPKPi { origin = candidate.originMcRec(); swapping = candidate.isCandidateSwapped(); if constexpr (onlyBkg) { - if (TESTBIT(std::abs(flagMcRec), aod::hf_cand_3prong::DecayType::LcToPKPi)) { + if (std::abs(flagMcRec) == hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { continue; } if (downSampleBkgFactor < 1.) { @@ -263,7 +263,7 @@ struct HfDerivedDataCreatorLcToPKPi { } } if constexpr (onlySig) { - if (!TESTBIT(std::abs(flagMcRec), aod::hf_cand_3prong::DecayType::LcToPKPi)) { + if (std::abs(flagMcRec) != hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { continue; } } diff --git a/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx b/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx index 7e482985c0d..caf119e851d 100644 --- a/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx @@ -268,11 +268,11 @@ struct HfTreeCreatorDplusToPiKPi { using CollisionsCent = soa::Join; Filter filterSelectCandidates = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; - Filter filterMcGenMatching = nabs(o2::aod::hf_cand_3prong::flagMcMatchGen) == static_cast(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi)); + Filter filterMcGenMatching = nabs(o2::aod::hf_cand_3prong::flagMcMatchGen) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi); - Partition reconstructedCandSig = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi)) || nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_3prong::DecayType::DsToKKPi)); // DecayType::DsToKKPi is used to flag both Ds± → K± K∓ π± and D± → K± K∓ π± - Partition reconstructedCandBkg = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi)); - Partition reconstructedCandSigMl = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi)) || nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_3prong::DecayType::DsToKKPi)) || nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_3prong::DstarToPiKPiBkg)); // DecayType::DsToKKPi is used to flag both Ds± → K± K∓ π± and D± → K± K∓ π± + Partition reconstructedCandSig = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) || nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK); // DecayChannelMain::DsToPiKK is used to flag both Ds± → K± K∓ π± and D± → K± K∓ π± + Partition reconstructedCandBkg = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi); + Partition reconstructedCandSigMl = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) || nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK) || nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DstarToPiKPi); // DecayChannelMain::DsToPiKK is used to flag both Ds± → K± K∓ π± and D± → K± K∓ π± void init(InitContext const&) { diff --git a/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx b/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx index cf2f595f44b..7a8547cf32a 100644 --- a/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx @@ -17,6 +17,8 @@ /// \author Stefano Politanò , Politecnico & INFN, Torino /// \author Fabio Catalano , CERN +#include + #include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -229,6 +231,19 @@ DECLARE_SOA_TABLE(HfCandDsFullPs, "AOD", "HFCANDDSFULLP", hf_cand_3prong::OriginMcGen); } // namespace o2::aod +enum Mother : int8_t { + Ds, + Dplus +}; + +enum ResonantChannel : int8_t { + PhiPi = 1, + Kstar0K = 2 +}; + +static std::unordered_map> channelsResonant = {{{Mother::Ds, {{ResonantChannel::PhiPi, hf_decay::hf_cand_3prong::DecayChannelResonant::DsToPhiPi}, {ResonantChannel::Kstar0K, hf_decay::hf_cand_3prong::DecayChannelResonant::DsToKstar0K}}}, + {Mother::Dplus, {{ResonantChannel::PhiPi, hf_decay::hf_cand_3prong::DecayChannelResonant::DplusToPhiPi}, {ResonantChannel::Kstar0K, hf_decay::hf_cand_3prong::DecayChannelResonant::DplusToKstar0K}}}}}; + /// Writes the full information in an output TTree struct HfTreeCreatorDsToKKPi { Produces rowCandidateFull; @@ -236,7 +251,7 @@ struct HfTreeCreatorDsToKKPi { Produces rowCandidateFullParticles; Produces rowCandidateLite; - Configurable decayChannel{"decayChannel", 1, "Switch between decay channels: 1 for Ds/Dplus->PhiPi->KKpi, 2 for Ds/Dplus->K0*K->KKPi"}; + Configurable decayChannel{"decayChannel", 1, "Switch between resonant decay channels: 1 for Ds/Dplus->PhiPi->KKpi, 2 for Ds/Dplus->K0*K->KKPi"}; Configurable fillDplusMc{"fillDplusMc", false, "Switch to fill Dplus MC information"}; Configurable selectionFlagDs{"selectionFlagDs", 1, "Selection flag for Ds"}; Configurable fillCandidateLiteTable{"fillCandidateLiteTable", false, "Switch to fill lite table with candidate properties"}; @@ -260,16 +275,22 @@ struct HfTreeCreatorDsToKKPi { int offsetDplusDecayChannel = aod::hf_cand_3prong::DecayChannelDToKKPi::DplusToPhiPi - aod::hf_cand_3prong::DecayChannelDToKKPi::DsToPhiPi; // Offset between Dplus and Ds to use the same decay channel. See aod::hf_cand_3prong::DecayChannelDToKKPi Filter filterSelectCandidates = aod::hf_sel_candidate_ds::isSelDsToKKPi >= selectionFlagDs || aod::hf_sel_candidate_ds::isSelDsToPiKK >= selectionFlagDs; - Filter filterMcGenMatching = nabs(o2::aod::hf_cand_3prong::flagMcMatchGen) == static_cast(BIT(aod::hf_cand_3prong::DecayType::DsToKKPi)) && (aod::hf_cand_3prong::flagMcDecayChanGen == decayChannel || (fillDplusMc && aod::hf_cand_3prong::flagMcDecayChanGen == (decayChannel + offsetDplusDecayChannel))); // Do not store Dplus MC if fillDplusMc is false + Filter filterMcGenMatching = + nabs(o2::aod::hf_cand_3prong::flagMcMatchGen) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK) && + (aod::hf_cand_3prong::flagMcDecayChanGen == channelsResonant[Mother::Ds][decayChannel] || + (fillDplusMc && aod::hf_cand_3prong::flagMcDecayChanGen == channelsResonant[Mother::Dplus][decayChannel])); // Do not store Dplus MC if fillDplusMc is false Partition selectedDsToKKPiCand = aod::hf_sel_candidate_ds::isSelDsToKKPi >= selectionFlagDs; Partition selectedDsToPiKKCand = aod::hf_sel_candidate_ds::isSelDsToPiKK >= selectionFlagDs; - Partition reconstructedCandSig = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_3prong::DecayType::DsToKKPi)) && (aod::hf_cand_3prong::flagMcDecayChanRec == decayChannel || (fillDplusMc && aod::hf_cand_3prong::flagMcDecayChanRec == (decayChannel + offsetDplusDecayChannel))); // Do not store Dplus MC if fillDplusMc is false - Partition reconstructedCandBkg = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_3prong::DecayType::DsToKKPi)); + Partition reconstructedCandSig = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK) && (aod::hf_cand_3prong::flagMcDecayChanRec == channelsResonant[Mother::Ds][decayChannel] || (fillDplusMc && aod::hf_cand_3prong::flagMcDecayChanRec == channelsResonant[Mother::Dplus][decayChannel])); // Do not store Dplus MC if fillDplusMc is false + Partition reconstructedCandBkg = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK); void init(InitContext const&) { + if (decayChannel != ResonantChannel::PhiPi && decayChannel != ResonantChannel::Kstar0K) { + LOGP(fatal, "Invalid value of decayChannel"); + } } template @@ -305,7 +326,7 @@ struct HfTreeCreatorDsToKKPi { originMc = candidate.originMcRec(); channelMc = candidate.flagMcDecayChanRec(); isSwapped = candidate.isCandidateSwapped(); - if (fillDplusMc && candidate.flagMcDecayChanRec() == (decayChannel + offsetDplusDecayChannel)) { + if (fillDplusMc && candidate.flagMcDecayChanRec() == channelsResonant[Mother::Dplus][decayChannel]) { yCand = hfHelper.yDplus(candidate); eCand = hfHelper.eDplus(candidate); ctCand = hfHelper.ctDplus(candidate); diff --git a/PWGHF/TableProducer/treeCreatorDstarToD0Pi.cxx b/PWGHF/TableProducer/treeCreatorDstarToD0Pi.cxx index 00d2bea174f..2b838d774b1 100644 --- a/PWGHF/TableProducer/treeCreatorDstarToD0Pi.cxx +++ b/PWGHF/TableProducer/treeCreatorDstarToD0Pi.cxx @@ -261,10 +261,10 @@ struct HfTreeCreatorDstarToD0Pi { using CandDstarMcGen = soa::Filtered>; Filter filterSelectCandidates = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == selectionFlagDstarToD0Pi; - Filter filterMcGenMatching = nabs(aod::hf_cand_dstar::flagMcMatchGen) == static_cast(BIT(aod::hf_cand_dstar::DecayType::DstarToD0Pi)); + Filter filterMcGenMatching = nabs(aod::hf_cand_dstar::flagMcMatchGen) == static_cast(hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi); - Partition reconstructedCandSig = nabs(aod::hf_cand_dstar::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_dstar::DecayType::DstarToD0Pi)); - Partition reconstructedCandBkg = nabs(aod::hf_cand_dstar::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_dstar::DecayType::DstarToD0Pi)); + Partition reconstructedCandSig = nabs(aod::hf_cand_dstar::flagMcMatchRec) == static_cast(hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi); + Partition reconstructedCandBkg = nabs(aod::hf_cand_dstar::flagMcMatchRec) != static_cast(hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi); void init(InitContext const&) { diff --git a/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx b/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx index 398bf3fc57a..5ad144e472e 100644 --- a/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx @@ -410,7 +410,7 @@ struct HfTreeCreatorLcToPKPi { SigBgStatus status{Default}; - if (std::abs(flag) == (1 << o2::aod::hf_cand_3prong::DecayType::LcToPKPi)) { + if (std::abs(flag) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { if (swapped == 0) { if (candFlag == 0) { if (origin == RecoDecay::OriginType::Prompt) @@ -917,7 +917,7 @@ struct HfTreeCreatorLcToPKPi { // Filling particle properties rowCandidateFullParticles.reserve(particles.size()); for (const auto& particle : particles) { - if (std::abs(particle.flagMcMatchGen()) == 1 << aod::hf_cand_3prong::DecayType::LcToPKPi) { + if (std::abs(particle.flagMcMatchGen()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { auto mcDaughter0 = particle.template daughters_as>().begin(); auto mcCollision = particle.template mcCollision_as(); auto p = particle.p(); diff --git a/PWGHF/TableProducer/treeCreatorXicToPKPi.cxx b/PWGHF/TableProducer/treeCreatorXicToPKPi.cxx index 279dbc797fc..b038f28c80e 100644 --- a/PWGHF/TableProducer/treeCreatorXicToPKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorXicToPKPi.cxx @@ -231,13 +231,13 @@ struct HfTreeCreatorXicToPKPi { using CandXicMcGen = soa::Filtered>; Filter filterSelectCandidates = aod::hf_sel_candidate_xic::isSelXicToPKPi >= selectionFlagXic || aod::hf_sel_candidate_xic::isSelXicToPiKP >= selectionFlagXic; - Filter filterMcGenMatching = nabs(o2::aod::hf_cand_3prong::flagMcMatchGen) == static_cast(BIT(aod::hf_cand_3prong::DecayType::XicToPKPi)); + Filter filterMcGenMatching = nabs(o2::aod::hf_cand_3prong::flagMcMatchGen) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::XicToPKPi); Partition selectedXicToPKPiCand = aod::hf_sel_candidate_xic::isSelXicToPKPi >= selectionFlagXic; Partition selectedXicToPiKPCand = aod::hf_sel_candidate_xic::isSelXicToPiKP >= selectionFlagXic; - Partition reconstructedCandSig = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_3prong::DecayType::XicToPKPi)); - Partition reconstructedCandBkg = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_3prong::DecayType::XicToPKPi)); + Partition reconstructedCandSig = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::XicToPKPi); + Partition reconstructedCandBkg = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::XicToPKPi); void init(InitContext const&) { diff --git a/PWGHF/Tasks/taskCharmHadImpactPar.cxx b/PWGHF/Tasks/taskCharmHadImpactPar.cxx index 051fdd0b7a2..9671501387f 100644 --- a/PWGHF/Tasks/taskCharmHadImpactPar.cxx +++ b/PWGHF/Tasks/taskCharmHadImpactPar.cxx @@ -162,7 +162,7 @@ struct HfTaskCharmHadImpactPar { if constexpr (channel == Channel::DplusToKPiPi) { // D+ -> Kpipi if constexpr (doMc) { if (fillOnlySignal) { - if (std::abs(candidate.flagMcMatchRec()) != 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi) { + if (std::abs(candidate.flagMcMatchRec()) != o2::hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) { return; } } diff --git a/PWGHF/Tasks/taskMcValidation.cxx b/PWGHF/Tasks/taskMcValidation.cxx index eea7aa4c4ab..269cd7b21ea 100644 --- a/PWGHF/Tasks/taskMcValidation.cxx +++ b/PWGHF/Tasks/taskMcValidation.cxx @@ -1106,21 +1106,21 @@ struct HfTaskMcValidationRec { continue; } int whichHad = -1; - if (isDPlusSel && TESTBIT(std::abs(cand3Prong.flagMcMatchRec()), hf_cand_3prong::DecayType::DplusToPiKPi)) { + if (isDPlusSel && std::abs(cand3Prong.flagMcMatchRec()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) { whichHad = DplusToPiKPi; - } else if (isDsSel && TESTBIT(std::abs(cand3Prong.flagMcMatchRec()), hf_cand_3prong::DecayType::DsToKKPi)) { - if (cand3Prong.flagMcDecayChanRec() == hf_cand_3prong::DecayChannelDToKKPi::DsToPhiPi) { + } else if (isDsSel && std::abs(cand3Prong.flagMcMatchRec()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK) { + if (cand3Prong.flagMcDecayChanRec() == o2::hf_decay::hf_cand_3prong::DecayChannelResonant::DsToPhiPi) { whichHad = DsToPhiPiToKKPi; } - if (cand3Prong.flagMcDecayChanRec() == hf_cand_3prong::DecayChannelDToKKPi::DsToK0starK) { + if (cand3Prong.flagMcDecayChanRec() == o2::hf_decay::hf_cand_3prong::DecayChannelResonant::DsToKstar0K) { whichHad = DsToK0starKToKKPi; } - if (cand3Prong.flagMcDecayChanRec() == hf_cand_3prong::DecayChannelDToKKPi::DplusToPhiPi) { + if (cand3Prong.flagMcDecayChanRec() == o2::hf_decay::hf_cand_3prong::DecayChannelResonant::DplusToPhiPi) { whichHad = DplusToPhiPiToKKPi; } - } else if (isLcSel && TESTBIT(std::abs(cand3Prong.flagMcMatchRec()), hf_cand_3prong::DecayType::LcToPKPi)) { + } else if (isLcSel && std::abs(cand3Prong.flagMcMatchRec()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { whichHad = LcToPKPi; - } else if (isXicSel && TESTBIT(std::abs(cand3Prong.flagMcMatchRec()), hf_cand_3prong::DecayType::XicToPKPi)) { + } else if (isXicSel && std::abs(cand3Prong.flagMcMatchRec()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::XicToPKPi) { whichHad = XiCplusToPKPi; } int whichOrigin; diff --git a/PWGJE/Core/JetHFUtilities.h b/PWGJE/Core/JetHFUtilities.h index 97394dd6a70..a5ec07fe157 100644 --- a/PWGJE/Core/JetHFUtilities.h +++ b/PWGJE/Core/JetHFUtilities.h @@ -283,13 +283,13 @@ constexpr bool isMatchedHFCandidate(T const& candidate) return false; } } else if constexpr (isDplusCandidate()) { - if (std::abs(candidate.flagMcMatchRec()) == 1 << o2::aod::hf_cand_3prong::DecayType::DplusToPiKPi) { + if (std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) { return true; } else { return false; } } else if constexpr (isLcCandidate()) { - if (std::abs(candidate.flagMcMatchRec()) == 1 << o2::aod::hf_cand_3prong::DecayType::LcToPKPi) { + if (std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { return true; } else { return false; @@ -307,13 +307,13 @@ constexpr bool isMatchedHFCandidate(T const& candidate) return false; } } else if constexpr (isDplusMcCandidate()) { - if (std::abs(candidate.flagMcMatchGen()) == 1 << o2::aod::hf_cand_3prong::DecayType::DplusToPiKPi) { + if (std::abs(candidate.flagMcMatchGen()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) { return true; } else { return false; } } else if constexpr (isLcMcCandidate()) { - if (std::abs(candidate.flagMcMatchGen()) == 1 << o2::aod::hf_cand_3prong::DecayType::LcToPKPi) { + if (std::abs(candidate.flagMcMatchGen()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { return true; } else { return false; From e1dea2ce7c41a1ce684a840e0bc94c9cf9c9c2aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Wed, 4 Jun 2025 01:37:58 +0200 Subject: [PATCH 13/18] Merge beauty channels --- PWGHF/Core/DecayChannels.h | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/PWGHF/Core/DecayChannels.h b/PWGHF/Core/DecayChannels.h index b52377d1b16..f56e8ce1005 100644 --- a/PWGHF/Core/DecayChannels.h +++ b/PWGHF/Core/DecayChannels.h @@ -126,9 +126,9 @@ enum DecayChannelMain : int8_t { }; } // namespace hf_cand_dstar -namespace hf_cand_beauty_neutral +namespace hf_cand_beauty { -/// @brief neutral-beauty candidates: main channels +/// @brief beauty candidates: main channels enum DecayChannelMain : int8_t { // B0 B0ToDminusPi = 1, // D− π+ @@ -147,10 +147,15 @@ enum DecayChannelMain : int8_t { LbToLcPiGamma, // Λc+ π− γ0 LbToLcK, // Λc+ K− LbToLcKPi0, // Λc+ K− π0 + // B+ + BplusToD0Pi, // anti-D0 π+ + BplusToD0PiPi0, // anti-D0 π+ π0 + BplusToD0PiGamma, // anti-D0 π+ γ0 + BplusToD0K, // anti-D0 K+ // LastChannelMain }; -/// @brief neutral-beauty candidates: resonant channels +/// @brief beauty candidates: resonant channels enum DecayChannelResonant : int8_t { // B0 B0ToDminusRhoplus = 1, // D− ρ+ @@ -163,32 +168,13 @@ enum DecayChannelResonant : int8_t { LbToScPi, // Σc+ π− LbToScK, // Σc+ K− LbToSc0Pi0, // Σc0 π0 - // - LastChannelResonant -}; -} // namespace hf_cand_beauty_neutral - -namespace hf_cand_bplus -{ -/// @brief B+ candidates: main channels -enum DecayChannelMain : int8_t { - // B+ - BplusToD0Pi = 1, // anti-D0 π+ - BplusToD0PiPi0, // anti-D0 π+ π0 - BplusToD0PiGamma, // anti-D0 π+ γ0 - BplusToD0K, // anti-D0 K+ - // - LastChannelMain -}; -/// @brief B+ candidates: resonant channels -enum DecayChannelResonant : int8_t { // B+ - BplusToD0Rhoplus = 1, // anti-D0 ρ+ - BplusToDstar0Pi, // anti-D*0 π+ + BplusToD0Rhoplus, // anti-D0 ρ+ + BplusToDstar0Pi, // anti-D*0 π+ // LastChannelResonant }; -} // namespace hf_cand_bplus +} // namespace hf_cand_beauty } // namespace o2::hf_decay #endif // PWGHF_CORE_DECAYCHANNELS_H_ From 18d6c943e9eb767e76db6158cc713e3b086ebe58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Wed, 4 Jun 2025 01:46:44 +0200 Subject: [PATCH 14/18] Add missing type --- PWGHF/TableProducer/candidateCreatorXicc.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreatorXicc.cxx b/PWGHF/TableProducer/candidateCreatorXicc.cxx index 214c2cea891..e4455828b8d 100644 --- a/PWGHF/TableProducer/candidateCreatorXicc.cxx +++ b/PWGHF/TableProducer/candidateCreatorXicc.cxx @@ -105,7 +105,7 @@ struct HfCandidateCreatorXicc { aod::TracksWCov const& tracks) { for (const auto& xicCand : xicCands) { - if (!(xicCand.hfflag() & 1 << o2::aod::hf_cand_3prong::XicToPKPi)) { + if (!(xicCand.hfflag() & 1 << o2::aod::hf_cand_3prong::DecayType::XicToPKPi)) { continue; } if (xicCand.isSelXicToPKPi() >= selectionFlagXic) { @@ -195,9 +195,9 @@ struct HfCandidateCreatorXicc { xicCand.globalIndex(), trackpion.globalIndex(), hfFlag); } // if on selected Xicc - } // loop over candidates - } // end of process -}; // end of struct + } // loop over candidates + } // end of process +}; // end of struct /// Extends the base table with expression columns. struct HfCandidateCreatorXiccExpressions { From 54b3216e8aac3cfa9f38285489a6ed1591c74691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Wed, 4 Jun 2025 01:58:32 +0200 Subject: [PATCH 15/18] Add comment --- PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx index a69a77dd4d5..2b9ea57bfd5 100644 --- a/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx @@ -164,7 +164,7 @@ struct HfCorrelatorDsHadrons { Configurable selNoSameBunchPileUpColl{"selNoSameBunchPileUpColl", true, "Flag for rejecting the collisions associated with the same bunch crossing (used only in MC processes)"}; Configurable selectionFlagDs{"selectionFlagDs", 7, "Selection Flag for Ds (avoid the case of flag = 0, no outputMlScore)"}; Configurable numberEventsMixed{"numberEventsMixed", 5, "Number of events mixed in ME process"}; - Configurable decayChannel{"decayChannel", 1, "Decay channels: 1 for Ds->PhiPi->KKpi, 2 for Ds->K0*K->KKPi"}; + Configurable decayChannel{"decayChannel", 1, "Resonant decay channels: 1 for Ds->PhiPi->KKpi, 2 for Ds->K0*K->KKPi"}; Configurable applyEfficiency{"applyEfficiency", true, "Flag for applying D-meson efficiency weights"}; Configurable yCandMax{"yCandMax", 0.8, "max. cand. rapidity"}; Configurable yCandGenMax{"yCandGenMax", 0.5, "max. gen. cand. rapidity"}; From 010a1b2fda6a9a97f74d3eff8cafe4a37756351e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Wed, 4 Jun 2025 02:22:04 +0200 Subject: [PATCH 16/18] Fix taskLcCentrality.cxx --- PWGHF/Tasks/taskLcCentrality.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/Tasks/taskLcCentrality.cxx b/PWGHF/Tasks/taskLcCentrality.cxx index 091b70b66ec..d5cf9b35251 100644 --- a/PWGHF/Tasks/taskLcCentrality.cxx +++ b/PWGHF/Tasks/taskLcCentrality.cxx @@ -162,7 +162,7 @@ struct HfTaskLcCentralityMc { if (yCandMax >= 0. && std::abs(hfHelper.yLc(candidate)) > yCandMax) { continue; } - if (std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::LcToPKPi) { + if (std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { // Get the corresponding MC particle. auto indexMother = RecoDecay::getMother(mcParticles, candidate.prong0_as().mcParticle_as>(), o2::constants::physics::Pdg::kLambdaCPlus, true); auto particleMother = mcParticles.rawIteratorAt(indexMother); @@ -184,7 +184,7 @@ struct HfTaskLcCentralityMc { } // MC gen. for (const auto& particle : mcParticles) { - if (std::abs(particle.flagMcMatchGen()) == 1 << aod::hf_cand_3prong::DecayType::LcToPKPi) { + if (std::abs(particle.flagMcMatchGen()) == hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { if (yCandMax >= 0. && std::abs(RecoDecay::y(particle.pVector(), o2::constants::physics::MassLambdaCPlus)) > yCandMax) { continue; } From eddc92b4de37b4869ff6a8c8f10847314d3c04c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Wed, 4 Jun 2025 10:41:18 +0200 Subject: [PATCH 17/18] Fix missing include --- PWGHF/Tasks/taskLcCentrality.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGHF/Tasks/taskLcCentrality.cxx b/PWGHF/Tasks/taskLcCentrality.cxx index d5cf9b35251..274421f8093 100644 --- a/PWGHF/Tasks/taskLcCentrality.cxx +++ b/PWGHF/Tasks/taskLcCentrality.cxx @@ -25,6 +25,7 @@ #include "Common/DataModel/Centrality.h" #include "PWGHF/Core/HfHelper.h" +#include "PWGHF/Core/SelectorCuts.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" From 84da7b763677360748171178ad8e5c85a316291c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Wed, 4 Jun 2025 10:41:59 +0200 Subject: [PATCH 18/18] Fix missing DplusToPiKK in partitions --- PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx b/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx index caf119e851d..3d23c0b30ca 100644 --- a/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx @@ -270,9 +270,9 @@ struct HfTreeCreatorDplusToPiKPi { Filter filterSelectCandidates = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; Filter filterMcGenMatching = nabs(o2::aod::hf_cand_3prong::flagMcMatchGen) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi); - Partition reconstructedCandSig = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) || nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK); // DecayChannelMain::DsToPiKK is used to flag both Ds± → K± K∓ π± and D± → K± K∓ π± + Partition reconstructedCandSig = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) || nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK) || nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKK); Partition reconstructedCandBkg = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi); - Partition reconstructedCandSigMl = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) || nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK) || nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DstarToPiKPi); // DecayChannelMain::DsToPiKK is used to flag both Ds± → K± K∓ π± and D± → K± K∓ π± + Partition reconstructedCandSigMl = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) || nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK) || nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKK) || nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DstarToPiKPi); void init(InitContext const&) {