2424#include < cstdint>
2525#include < unordered_map>
2626#include < array>
27- #include < variant>
2827
2928using namespace o2 ::constants::physics;
3029
@@ -64,9 +63,9 @@ std::unordered_map<DecayChannelMain, std::vector<int> > finalStates2Prongs =
6463{
6564 {DecayChannelMain::D0ToPiK, std::vector<int >{+kKMinus , +kPiPlus }},
6665 {DecayChannelMain::D0ToKK, std::vector<int >{+kKMinus , +kKPlus }},
67- {DecayChannelMain::D0ToPiKPi0, std::vector<int >{+kKMinus , +kPiPlus , +kPi0 }},
66+ {DecayChannelMain::D0ToPiKPi0, std::vector<int >{+kKMinus , +kPiPlus , +kPi0 }},
6867 {DecayChannelMain::D0ToPiPi, std::vector<int >{+kPiMinus , +kPiPlus }},
69- {DecayChannelMain::D0ToPiPiPi0, std::vector<int >{+kPiMinus , +kPiPlus , +kPi0 }}
68+ {DecayChannelMain::D0ToPiPiPi0, std::vector<int >{+kPiMinus , +kPiPlus , +kPi0 }}
7069};
7170
7271std::unordered_map<DecayChannelResonant, std::array<int , 2 > > resoStatesD0 =
@@ -167,7 +166,7 @@ std::unordered_map<DecayChannelMain, std::vector<int> > finalStatesDPlus =
167166{
168167 {DecayChannelMain::DplusToPiKPi, std::vector<int >{+kKMinus , +kKPlus , +kPiPlus }},
169168 {DecayChannelMain::DplusToPiKK, std::vector<int >{+kKMinus , +kPiPlus , +kPiPlus }},
170- {DecayChannelMain::DplusToPiKPiPi0, std::vector<int >{+kKMinus , +kPiPlus , +kPiPlus , +kPi0 }},
169+ {DecayChannelMain::DplusToPiKPiPi0, std::vector<int >{+kKMinus , +kPiPlus , +kPiPlus , +kPi0 }},
171170 {DecayChannelMain::DplusToPiPiPi, std::vector<int >{+kPiMinus , +kPiPlus , +kPiPlus }},
172171};
173172
@@ -188,10 +187,10 @@ std::unordered_map<DecayChannelResonant, std::array<int, 2> > resoStatesDs =
188187std::unordered_map<DecayChannelMain, std::vector<int > > finalStatesDs =
189188{
190189 {DecayChannelMain::DsToPiKK, std::vector<int >{+kKMinus , +kKPlus , +kPiPlus }},
191- {DecayChannelMain::DsToPiKKPi0, std::vector<int >{+kKMinus , +kKPlus , +kPiPlus , +kPi0 }},
190+ {DecayChannelMain::DsToPiKKPi0, std::vector<int >{+kKMinus , +kKPlus , +kPiPlus , +kPi0 }},
192191 {DecayChannelMain::DsToPiPiK, std::vector<int >{+kKPlus , +kPiPlus , +kPiMinus }},
193192 {DecayChannelMain::DsToPiPiPi, std::vector<int >{+kPiMinus , +kPiPlus , +kPiPlus }},
194- {DecayChannelMain::DsToPiPiPiPi0, std::vector<int >{+kPiMinus , +kPiPlus , +kPiPlus , +kPi0 }},
193+ {DecayChannelMain::DsToPiPiPiPi0, std::vector<int >{+kPiMinus , +kPiPlus , +kPiPlus , +kPi0 }},
195194};
196195
197196// Dstar → K± K∓ π±
@@ -201,22 +200,22 @@ std::unordered_map<DecayChannelResonant, std::array<int, 2> > resoStatesDstar =
201200 {DecayChannelResonant::DstarToD0ToRhoplusK, std::array<int , 2 >{213 , +kKMinus }},
202201 {DecayChannelResonant::DstarToD0ToKstar0Pi0, std::array<int , 2 >{-kK0Star892 , +kPi0 }},
203202 {DecayChannelResonant::DstarToD0ToKstarPi, std::array<int , 2 >{-kKPlusStar892 , +kPiPlus }},
204- {DecayChannelResonant::DstarToDplusToPhiPi, std::array<int , 2 >{+kPhi , +kPiPlus }},
205- {DecayChannelResonant::DstarToDplusToKstar0K, std::array<int , 2 >{-kK0Star892 , +kKPlus }},
206- {DecayChannelResonant::DstarToDplusToKstar1430_0K, std::array<int , 2 >{+10311 , +kKPlus }},
207- {DecayChannelResonant::DstarToDplusToRho0Pi, std::array<int , 2 >{+113 , +kPiPlus }},
208- {DecayChannelResonant::DstarToDplusToF2_1270Pi, std::array<int , 2 >{+225 , +kPiPlus }},
203+ {DecayChannelResonant::DstarToDplusToPhiPi, std::array<int , 2 >{+kPhi , +kPiPlus }},
204+ {DecayChannelResonant::DstarToDplusToKstar0K, std::array<int , 2 >{-kK0Star892 , +kKPlus }},
205+ {DecayChannelResonant::DstarToDplusToKstar1430_0K, std::array<int , 2 >{+10311 , +kKPlus }},
206+ {DecayChannelResonant::DstarToDplusToRho0Pi, std::array<int , 2 >{+113 , +kPiPlus }},
207+ {DecayChannelResonant::DstarToDplusToF2_1270Pi, std::array<int , 2 >{+225 , +kPiPlus }},
209208};
210209
211210std::unordered_map<DecayChannelMain, std::vector<int > > finalStatesDstar =
212211{
213212 {DecayChannelMain::DstarToPiKPi, std::vector<int >{+kKMinus , +kPiPlus , +kPiPlus }},
214- {DecayChannelMain::DstarToPiKPiPi0, std::vector<int >{+kKMinus , +kPiPlus , +kPiPlus , +kPi0 }},
215- {DecayChannelMain::DstarToPiKPiPi0Pi0, std::vector<int >{+kKMinus , +kPiPlus , +kPiPlus , +kPi0 , +kPi0 }},
213+ {DecayChannelMain::DstarToPiKPiPi0, std::vector<int >{+kKMinus , +kPiPlus , +kPiPlus , +kPi0 }},
214+ {DecayChannelMain::DstarToPiKPiPi0Pi0, std::vector<int >{+kKMinus , +kPiPlus , +kPiPlus , +kPi0 , +kPi0 }},
216215 {DecayChannelMain::DstarToPiKK, std::vector<int >{+kKMinus , +kKPlus , +kPiPlus }},
217- {DecayChannelMain::DstarToPiKKPi0, std::vector<int >{+kKMinus , +kKPlus , +kPiPlus , +kPi0 }},
216+ {DecayChannelMain::DstarToPiKKPi0, std::vector<int >{+kKMinus , +kKPlus , +kPiPlus , +kPi0 }},
218217 {DecayChannelMain::DstarToPiPiPi, std::vector<int >{+kPiMinus , +kPiPlus , +kPiPlus }},
219- {DecayChannelMain::DstarToPiPiPiPi0, std::vector<int >{+kPiMinus , +kPiPlus , +kPiPlus , +kPi0 }},
218+ {DecayChannelMain::DstarToPiPiPiPi0, std::vector<int >{+kPiMinus , +kPiPlus , +kPiPlus , +kPi0 }},
220219};
221220
222221// Lc → p K∓ π±
@@ -230,7 +229,7 @@ std::unordered_map<DecayChannelResonant, std::array<int, 2> > resoStatesLambdaC
230229std::unordered_map<DecayChannelMain, std::vector<int > > finalStatesLc =
231230{
232231 {DecayChannelMain::LcToPKPi, std::vector<int >{+kProton , +kKMinus , +kPiPlus }},
233- {DecayChannelMain::LcToPKPiPi0, std::vector<int >{+kProton , +kKMinus , +kPiPlus , +kPi0 }},
232+ {DecayChannelMain::LcToPKPiPi0, std::vector<int >{+kProton , +kKMinus , +kPiPlus , +kPi0 }},
234233 {DecayChannelMain::LcToPPiPi, std::vector<int >{+kProton , +kPiMinus , +kPiPlus }},
235234 {DecayChannelMain::LcToPKK, std::vector<int >{+kProton , +kKMinus , +kKPlus }}
236235};
@@ -244,8 +243,8 @@ std::unordered_map<DecayChannelResonant, std::array<int, 2> > resoStatesXiC =
244243
245244std::unordered_map<DecayChannelMain, std::vector<int > > finalStatesXic =
246245{
247- {DecayChannelMain::XicToPKPi, std::vector<int >{+kProton , +kKMinus , +kPiPlus }},
248- {DecayChannelMain::XicToPKK, std::vector<int >{+kProton , +kKMinus , +kKPlus }},
246+ {DecayChannelMain::XicToPKPi, std::vector<int >{+kProton , +kKMinus , +kPiPlus }},
247+ {DecayChannelMain::XicToPKK, std::vector<int >{+kProton , +kKMinus , +kKPlus }},
249248 {DecayChannelMain::XicToSPiPi, std::vector<int >{+kSigmaPlus , +kPiMinus , +kPiPlus }},
250249};
251250} // namespace hf_cand_3prong
@@ -378,9 +377,7 @@ namespace o2::hf_corrbkg
378377 }
379378
380379 template <std::size_t N>
381- bool checkResonantDecay (std::vector<int > arrDaughIndex, std::array<int , N> arrPDGResonant) {
382- // LOG(info) << "Entered checkResonantDecay with daughters: " << arrDaughIndex[0] << ", " << arrDaughIndex[1] << " and resonant PDG codes: " << arrPDGResonant[0] << ", " << arrPDGResonant[1];
383- // LOG(info) << "arrDaughIndex.size(): " << arrDaughIndex.size() << ", arrPDGResonant.size(): " << arrPDGResonant.size();
380+ bool checkResonantDecay (std::array<int , N> arrDaughIndex, std::array<int , N> arrPDGResonant) {
384381 LOG (info) << " Testing: " << arrDaughIndex[0 ] << " , " << arrDaughIndex[1 ] << " matching PDG codes: " << arrPDGResonant[0 ] << " , " << arrPDGResonant[1 ];
385382 for (int i = 0 ; i < N; i++) {
386383 LOG (info) << " Checking daughter index: " << arrDaughIndex[i];
@@ -407,13 +404,13 @@ namespace o2::hf_corrbkg
407404 // / \tparam arrDaughIndex index of the particle daughters at resonance level
408405 // / \tparam arrPDGResonant PDG code of the resonant decay
409406 // / \return true if the decay is resonant
410- template <bool is3Prong = false >
411- void flagResonantDecay (int motherPdg, int8_t * channel, std::vector <int > arrDaughIndex) {
407+ template <bool is3Prong = false , std:: size_t N >
408+ void flagResonantDecay (int motherPdg, int8_t * channel, std::array <int , N > arrDaughIndex) {
412409 if constexpr (is3Prong) {
413410 std::unordered_map<o2::hf_decay::hf_cand_3prong::DecayChannelResonant, std::array<int , 2 > > resoStates = getResoChannels3Prong (motherPdg);
414411 for (const auto & [flag, pdgCodes] : resoStates) {
415412 if (abs (motherPdg) == Pdg::kDStar ) {
416- std::cout << " Checking D0 resonant decay with flag: " << flag << " , pdgCodes: " << pdgCodes[0 ] << " , " << pdgCodes[1 ] << " vs " << arrDaughIndex[0 ] << " " << arrDaughIndex[1 ] << std::endl;
413+ std::cout << " Checking Dstar resonant decay with flag: " << flag << " , pdgCodes: " << pdgCodes[0 ] << " , " << pdgCodes[1 ] << " vs " << arrDaughIndex[0 ] << " " << arrDaughIndex[1 ] << std::endl;
417414 }
418415 if (checkResonantDecay (arrDaughIndex, pdgCodes)) {
419416 *channel = flag;
@@ -441,72 +438,6 @@ namespace o2::hf_corrbkg
441438 }
442439 }
443440 }
444-
445- // switch (motherPdg) {
446- // case Pdg::kD0:
447- // for (const auto& [flag, pdgCodes] : o2::hf_decay::hf_cand_2prong::resoStatesD0) {
448- // std::cout << "Checking D0 resonant decay with flag: " << flag << ", pdgCodes: " << pdgCodes[0] << ", " << pdgCodes[1] << " vs " << arrDaughIndex[0] << " " << arrDaughIndex[1] << std::endl;
449- // if (checkResonantDecay(arrDaughIndex, pdgCodes)) {
450- // *channel = flag;
451- // LOG(info) << "D0 resonant decay found with channel: " << static_cast<int>(*channel);
452- // break;
453- // }
454- // }
455- // break;
456- // case Pdg::kDPlus:
457- // for (const auto& [flag, pdgCodes] : o2::hf_decay::hf_cand_3prong::resoStatesDPlus) {
458- // // std::cout << "Checking DPlus resonant decay with flag: " << flag << ", pdgCodes: " << pdgCodes[0] << ", " << pdgCodes[1] << std::endl;
459- // if (checkResonantDecay(arrDaughIndex, pdgCodes)) {
460- // *channel = flag;
461- // LOG(info) << "D+ resonant decay found with channel: " << static_cast<int>(*channel);
462- // break;
463- // }
464- // }
465- // break;
466- // case Pdg::kDS:
467- // for (const auto& [flag, pdgCodes] : o2::hf_decay::hf_cand_3prong::resoStatesDs) {
468- // // std::cout << "Checking DS resonant decay with flag: " << flag << ", pdgCodes: " << pdgCodes[0] << ", " << pdgCodes[1] << std::endl;
469- // if (checkResonantDecay(arrDaughIndex, pdgCodes)) {
470- // *channel = flag;
471- // LOG(info) << "Ds resonant decay found with channel: " << static_cast<int>(*channel);
472- // break;
473- // }
474- // }
475- // break;
476- // case Pdg::kDStar:
477- // for (const auto& [flag, pdgCodes] : o2::hf_decay::hf_cand_3prong::resoStatesDstar) {
478- // std::cout << "Checking Dstar resonant decay with flag: " << flag << ", pdgCodes: " << pdgCodes[0] << ", " << pdgCodes[1] << std::endl;
479- // if (checkResonantDecay(arrDaughIndex, pdgCodes)) {
480- // *channel = flag;
481- // LOG(info) << "Dstar resonant decay found with channel: " << static_cast<int>(*channel);
482- // break;
483- // }
484- // }
485- // LOG(info) << "Dstar resonant decay not found, checking D0 resonances";
486- // break;
487- // case Pdg::kLambdaCPlus:
488- // for (const auto& [flag, pdgCodes] : o2::hf_decay::hf_cand_3prong::resoStatesLambdaC) {
489- // // std::cout << "Checking LambdaC resonant decay with flag: " << flag << ", pdgCodes: " << pdgCodes[0] << ", " << pdgCodes[1] << std::endl;
490- // if (checkResonantDecay(arrDaughIndex, pdgCodes)) {
491- // *channel = flag;
492- // LOG(info) << "Lc resonant decay found with channel: " << static_cast<int>(*channel);
493- // break;
494- // }
495- // }
496- // break;
497- // case Pdg::kXiCPlus:
498- // for (const auto& [flag, pdgCodes] : o2::hf_decay::hf_cand_3prong::resoStatesXiC) {
499- // // std::cout << "Checking XiC resonant decay with flag: " << flag << ", pdgCodes: " << pdgCodes[0] << ", " << pdgCodes[1] << std::endl;
500- // if (checkResonantDecay(arrDaughIndex, pdgCodes)) {
501- // *channel = flag;
502- // LOG(info) << "Xic resonant decay found with channel: " << static_cast<int>(*channel);
503- // break;
504- // }
505- // }
506- // break;
507- // }
508- // }
509-
510441} // namespace o2::hf_corrbkg
511442
512443#endif // PWGHF_CORE_DECAYCHANNELS_H_
0 commit comments