@@ -585,6 +585,24 @@ struct HfTaskSigmac {
585585 } // / end THn for candidate Λc+ cut variation w/o Σc0,++ mass-window cut
586586 }; // / end fillHistosData
587587
588+ // / @brief function to remap the value of the resonant decay channel to fit the binning of the thnAxisChannel axis
589+ // / @param channel the value obtained from candidateLc.flagMcDecayChanGen() or particleLc.flagMcDecayChanGen()
590+ int remapResoChannelLc (int channel)
591+ {
592+ switch (channel) {
593+ case 0 :
594+ // direct channel
595+ return 0 ;
596+ case o2::hf_decay::hf_cand_3prong::DecayChannelResonant::LcToPKstar0:
597+ return 1 ;
598+ case o2::hf_decay::hf_cand_3prong::DecayChannelResonant::LcToDeltaplusplusK:
599+ return 2 ;
600+ case o2::hf_decay::hf_cand_3prong::DecayChannelResonant::LcToL1520Pi:
601+ return 3 ;
602+ }
603+ return -1 ;
604+ }
605+
588606 // / @brief function to fill the histograms needed in analysis (MC)
589607 // / @param candidatesSc are the reconstructed candidate Σc0,++ with MC info
590608 // / @param mcParticles are the generated particles with flags wheter they are Σc0,++ or not
@@ -679,6 +697,7 @@ struct HfTaskSigmac {
679697 etaGenSoftPi = daugSoftPi.eta ();
680698 phiGenSoftPi = daugSoftPi.phi ();
681699 }
700+ channel = remapResoChannelLc (channel);
682701
683702 // / Fill histograms
684703 int sigmacSpecies = -1 ;
@@ -770,7 +789,8 @@ struct HfTaskSigmac {
770789 }
771790 double ptGenLc (particle.pt ()), ptGenLcBMother (-1 .);
772791 int const origin = particle.originMcGen ();
773- int const channel = particle.flagMcDecayChanGen ();
792+ int channel = particle.flagMcDecayChanGen ();
793+ channel = remapResoChannelLc (channel);
774794 if (origin == RecoDecay::OriginType::Prompt) {
775795 registry.fill (HIST (" MC/generated/hnLambdaCGen" ), ptGenLc, ptGenLcBMother, origin, channel);
776796 } else {
@@ -802,7 +822,21 @@ struct HfTaskSigmac {
802822 bool const isTrueScStar0Reco = std::abs (candSc.flagMcMatchRec ()) == o2::hf_decay::hf_cand_sigmac::DecayChannelMain::ScStar0ToPKPiPi;
803823 bool const isTrueScPlusPlusReco = std::abs (candSc.flagMcMatchRec ()) == o2::hf_decay::hf_cand_sigmac::DecayChannelMain::ScplusplusToPKPiPi;
804824 bool const isTrueScStarPlusPlusReco = std::abs (candSc.flagMcMatchRec ()) == o2::hf_decay::hf_cand_sigmac::DecayChannelMain::ScStarPlusPlusToPKPiPi;
825+ if (!isTrueSc0Reco && !isTrueScStar0Reco && !isTrueScPlusPlusReco && !isTrueScStarPlusPlusReco) {
826+ continue ;
827+ }
805828 int sigmacSpecies = -1 ;
829+
830+ // / debug
831+ if ((isTrueSc0Reco || isTrueScStar0Reco) && chargeSc != o2::aod::hf_cand_sigmac::ChargeNull) {
832+ // / this should never happen
833+ LOG (fatal) << " isTrueSc0Reco=" << isTrueSc0Reco << " , isTrueScStar0Reco=" << isTrueScStar0Reco << " , but chargeSc = " << static_cast <int >(chargeSc) << " ! Not possible, abort..." ;
834+ }
835+ if ((isTrueScPlusPlusReco || isTrueScStarPlusPlusReco) && std::abs (chargeSc) != o2::aod::hf_cand_sigmac::ChargePlusPlus) {
836+ // / this should never happen
837+ LOG (fatal) << " isTrueScPlusPlusReco=" << isTrueScPlusPlusReco << " , isTrueScStarPlusPlusReco=" << isTrueScStarPlusPlusReco << " , but chargeSc = " << static_cast <int >(chargeSc) << " ! Not possible, abort..." ;
838+ }
839+
806840 if ((isTrueSc0Reco || isTrueScStar0Reco) && (chargeSc == o2::aod::hf_cand_sigmac::ChargeNull)) {
807841 // / Reconstructed Σc0 signal
808842 // Get the corresponding MC particle for Sc, found as the mother of the soft pion
@@ -820,7 +854,7 @@ struct HfTaskSigmac {
820854 // Get the corresponding MC particle for Lc
821855 auto arrayDaughtersLc = std::array{candidateLc.template prong0_as <aod::TracksWMc>(), candidateLc.template prong1_as <aod::TracksWMc>(), candidateLc.template prong2_as <aod::TracksWMc>()};
822856 int8_t sign = 0 ;
823- int const indexMcLcRec = RecoDecay::getMatchedMCRec (mcParticles, arrayDaughtersLc, o2::constants::physics::Pdg::kLambdaCPlus , std::array{+kProton , -kKPlus , +kPiPlus }, true , &sign, 2 );
857+ int const indexMcLcRec = RecoDecay::getMatchedMCRec< false , false , false , true , true > (mcParticles, arrayDaughtersLc, o2::constants::physics::Pdg::kLambdaCPlus , std::array{+kProton , -kKPlus , +kPiPlus }, true , &sign, 2 );
824858 auto particleLc = mcParticles.rawIteratorAt (indexMcLcRec);
825859 // Get the corresponding MC particle for soft pion
826860 auto particleSoftPi = candSc.prong1_as <aod::TracksWMc>().mcParticle ();
@@ -837,6 +871,7 @@ struct HfTaskSigmac {
837871 double cpaLc (candidateLc.cpa ()), cpaXYLc (candidateLc.cpaXY ());
838872 int const origin = candSc.originMcRec ();
839873 auto channel = candidateLc.flagMcDecayChanRec (); // / 0: direct; 1: Λc± → p± K*; 2: Λc± → Δ(1232)±± K∓; 3: Λc± → Λ(1520) π±
874+ channel = remapResoChannelLc (channel);
840875
841876 // / candidate Λc+ → pK-π+ (and charge conjugate) within the range of M(pK-π+) chosen in the Σc0,++ builder
842877 if ((TESTBIT (isCandPKPiPiKP, o2::aod::hf_cand_sigmac::Decays::PKPi)) && std::abs (candidateLc.template prong0_as <aod::TracksWMc>().mcParticle ().pdgCode ()) == kProton ) {
@@ -1026,7 +1061,7 @@ struct HfTaskSigmac {
10261061 // Get the corresponding MC particle for Lc
10271062 auto arrayDaughtersLc = std::array{candidateLc.template prong0_as <aod::TracksWMc>(), candidateLc.template prong1_as <aod::TracksWMc>(), candidateLc.template prong2_as <aod::TracksWMc>()};
10281063 int8_t sign = 0 ;
1029- int const indexMcLcRec = RecoDecay::getMatchedMCRec (mcParticles, arrayDaughtersLc, o2::constants::physics::Pdg::kLambdaCPlus , std::array{+kProton , -kKPlus , +kPiPlus }, true , &sign, 2 );
1064+ int const indexMcLcRec = RecoDecay::getMatchedMCRec< false , false , false , true , true > (mcParticles, arrayDaughtersLc, o2::constants::physics::Pdg::kLambdaCPlus , std::array{+kProton , -kKPlus , +kPiPlus }, true , &sign, 2 );
10301065 auto particleLc = mcParticles.rawIteratorAt (indexMcLcRec);
10311066 // Get the corresponding MC particle for soft pion
10321067 auto particleSoftPi = candSc.prong1_as <aod::TracksWMc>().mcParticle ();
@@ -1043,6 +1078,7 @@ struct HfTaskSigmac {
10431078 double cpaLc (candidateLc.cpa ()), cpaXYLc (candidateLc.cpaXY ());
10441079 int const origin = candSc.originMcRec ();
10451080 auto channel = candidateLc.flagMcDecayChanRec (); // / 0: direct; 1: Λc± → p± K*; 2: Λc± → Δ(1232)±± K∓; 3: Λc± → Λ(1520) π±; FIXME: DecayChannelResonant
1081+ channel = remapResoChannelLc (channel);
10461082
10471083 // / candidate Λc+ → pK-π+ (and charge conjugate) within the range of M(pK-π+) chosen in the Σc0,++ builder
10481084 if ((TESTBIT (isCandPKPiPiKP, o2::aod::hf_cand_sigmac::Decays::PKPi)) && std::abs (candidateLc.template prong0_as <aod::TracksWMc>().mcParticle ().pdgCode ()) == kProton ) {
@@ -1229,6 +1265,7 @@ struct HfTaskSigmac {
12291265 double cpaLc (candidateLc.cpa ()), cpaXYLc (candidateLc.cpaXY ());
12301266 int const origin = candidateLc.originMcRec ();
12311267 auto channel = candidateLc.flagMcDecayChanRec (); // / 0: direct; 1: Λc± → p± K*; 2: Λc± → Δ(1232)±± K∓; 3: Λc± → Λ(1520) π±
1268+ channel = remapResoChannelLc (channel);
12321269 int pdgAbs = -1 ;
12331270 if (candidateLc.template prong0_as <aod::TracksWMc>().has_mcParticle ()) {
12341271 pdgAbs = std::abs (candidateLc.template prong0_as <aod::TracksWMc>().mcParticle ().pdgCode ());
0 commit comments