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
@@ -354,9 +353,7 @@ namespace o2::hf_corrbkg
354353 }
355354
356355 template <std::size_t N>
357- bool checkResonantDecay (std::vector<int > arrDaughIndex, std::array<int , N> arrPDGResonant) {
358- // LOG(info) << "Entered checkResonantDecay with daughters: " << arrDaughIndex[0] << ", " << arrDaughIndex[1] << " and resonant PDG codes: " << arrPDGResonant[0] << ", " << arrPDGResonant[1];
359- // LOG(info) << "arrDaughIndex.size(): " << arrDaughIndex.size() << ", arrPDGResonant.size(): " << arrPDGResonant.size();
356+ bool checkResonantDecay (std::array<int , N> arrDaughIndex, std::array<int , N> arrPDGResonant) {
360357 LOG (info) << " Testing: " << arrDaughIndex[0 ] << " , " << arrDaughIndex[1 ] << " matching PDG codes: " << arrPDGResonant[0 ] << " , " << arrPDGResonant[1 ];
361358 for (int i = 0 ; i < N; i++) {
362359 LOG (info) << " Checking daughter index: " << arrDaughIndex[i];
@@ -383,13 +380,13 @@ namespace o2::hf_corrbkg
383380 // / \tparam arrDaughIndex index of the particle daughters at resonance level
384381 // / \tparam arrPDGResonant PDG code of the resonant decay
385382 // / \return true if the decay is resonant
386- template <bool is3Prong = false >
387- void flagResonantDecay (int motherPdg, int8_t * channel, std::vector <int > arrDaughIndex) {
383+ template <bool is3Prong = false , std:: size_t N >
384+ void flagResonantDecay (int motherPdg, int8_t * channel, std::array <int , N > arrDaughIndex) {
388385 if constexpr (is3Prong) {
389386 std::unordered_map<o2::hf_decay::hf_cand_3prong::DecayChannelResonant, std::array<int , 2 > > resoStates = getResoChannels3Prong (motherPdg);
390387 for (const auto & [flag, pdgCodes] : resoStates) {
391388 if (abs (motherPdg) == Pdg::kDStar ) {
392- std::cout << " Checking D0 resonant decay with flag: " << flag << " , pdgCodes: " << pdgCodes[0 ] << " , " << pdgCodes[1 ] << " vs " << arrDaughIndex[0 ] << " " << arrDaughIndex[1 ] << std::endl;
389+ std::cout << " Checking Dstar resonant decay with flag: " << flag << " , pdgCodes: " << pdgCodes[0 ] << " , " << pdgCodes[1 ] << " vs " << arrDaughIndex[0 ] << " " << arrDaughIndex[1 ] << std::endl;
393390 }
394391 if (checkResonantDecay (arrDaughIndex, pdgCodes)) {
395392 *channel = flag;
@@ -417,72 +414,6 @@ namespace o2::hf_corrbkg
417414 }
418415 }
419416 }
420-
421- // switch (motherPdg) {
422- // case Pdg::kD0:
423- // for (const auto& [flag, pdgCodes] : o2::hf_decay::hf_cand_2prong::resoStatesD0) {
424- // std::cout << "Checking D0 resonant decay with flag: " << flag << ", pdgCodes: " << pdgCodes[0] << ", " << pdgCodes[1] << " vs " << arrDaughIndex[0] << " " << arrDaughIndex[1] << std::endl;
425- // if (checkResonantDecay(arrDaughIndex, pdgCodes)) {
426- // *channel = flag;
427- // LOG(info) << "D0 resonant decay found with channel: " << static_cast<int>(*channel);
428- // break;
429- // }
430- // }
431- // break;
432- // case Pdg::kDPlus:
433- // for (const auto& [flag, pdgCodes] : o2::hf_decay::hf_cand_3prong::resoStatesDPlus) {
434- // // std::cout << "Checking DPlus resonant decay with flag: " << flag << ", pdgCodes: " << pdgCodes[0] << ", " << pdgCodes[1] << std::endl;
435- // if (checkResonantDecay(arrDaughIndex, pdgCodes)) {
436- // *channel = flag;
437- // LOG(info) << "D+ resonant decay found with channel: " << static_cast<int>(*channel);
438- // break;
439- // }
440- // }
441- // break;
442- // case Pdg::kDS:
443- // for (const auto& [flag, pdgCodes] : o2::hf_decay::hf_cand_3prong::resoStatesDs) {
444- // // std::cout << "Checking DS resonant decay with flag: " << flag << ", pdgCodes: " << pdgCodes[0] << ", " << pdgCodes[1] << std::endl;
445- // if (checkResonantDecay(arrDaughIndex, pdgCodes)) {
446- // *channel = flag;
447- // LOG(info) << "Ds resonant decay found with channel: " << static_cast<int>(*channel);
448- // break;
449- // }
450- // }
451- // break;
452- // case Pdg::kDStar:
453- // for (const auto& [flag, pdgCodes] : o2::hf_decay::hf_cand_3prong::resoStatesDstar) {
454- // std::cout << "Checking Dstar resonant decay with flag: " << flag << ", pdgCodes: " << pdgCodes[0] << ", " << pdgCodes[1] << std::endl;
455- // if (checkResonantDecay(arrDaughIndex, pdgCodes)) {
456- // *channel = flag;
457- // LOG(info) << "Dstar resonant decay found with channel: " << static_cast<int>(*channel);
458- // break;
459- // }
460- // }
461- // LOG(info) << "Dstar resonant decay not found, checking D0 resonances";
462- // break;
463- // case Pdg::kLambdaCPlus:
464- // for (const auto& [flag, pdgCodes] : o2::hf_decay::hf_cand_3prong::resoStatesLambdaC) {
465- // // std::cout << "Checking LambdaC resonant decay with flag: " << flag << ", pdgCodes: " << pdgCodes[0] << ", " << pdgCodes[1] << std::endl;
466- // if (checkResonantDecay(arrDaughIndex, pdgCodes)) {
467- // *channel = flag;
468- // LOG(info) << "Lc resonant decay found with channel: " << static_cast<int>(*channel);
469- // break;
470- // }
471- // }
472- // break;
473- // case Pdg::kXiCPlus:
474- // for (const auto& [flag, pdgCodes] : o2::hf_decay::hf_cand_3prong::resoStatesXiC) {
475- // // std::cout << "Checking XiC resonant decay with flag: " << flag << ", pdgCodes: " << pdgCodes[0] << ", " << pdgCodes[1] << std::endl;
476- // if (checkResonantDecay(arrDaughIndex, pdgCodes)) {
477- // *channel = flag;
478- // LOG(info) << "Xic resonant decay found with channel: " << static_cast<int>(*channel);
479- // break;
480- // }
481- // }
482- // break;
483- // }
484- // }
485-
486417} // namespace o2::hf_corrbkg
487418
488419#endif // PWGHF_CORE_DECAYCHANNELS_H_
0 commit comments