@@ -417,7 +417,7 @@ struct HfCandidateSigmac0plusplusMc {
417417
418418 using BCsInfo = soa::Join<aod::BCs, aod::Timestamps, aod::BcSels>;
419419 using LambdacMc = soa::Join<aod::HfCand3Prong, aod::HfSelLc, aod::HfCand3ProngMcRec>;
420- // using LambdacMcGen = soa::Join<aod::McParticles, aod::HfCand3ProngMcGen>;
420+ using McParticlesLcGenMatch = soa::Join<aod::McParticles, aod::HfCand3ProngMcGen>;
421421 using McCollisionsNoCents = soa::Join<aod::Collisions, aod::EvSels, aod::McCollisionLabels>;
422422
423423 PresliceUnsorted<McCollisionsNoCents> colPerMcCollision = aod::mccollisionlabel::mcCollisionId;
@@ -468,7 +468,7 @@ struct HfCandidateSigmac0plusplusMc {
468468 // / @param mcParticles table of generated particles
469469 void processMc (aod::McParticles const & mcParticles,
470470 aod::TracksWMc const & tracks,
471- LambdacMc const & candsLc /* , const LambdacMcGen& */ ,
471+ LambdacMc const & candsLc, McParticlesLcGenMatch const & mcParticlesLcGenMatch ,
472472 McCollisionsNoCents const & collInfos,
473473 aod::McCollisions const &,
474474 BCsInfo const &)
@@ -576,7 +576,7 @@ struct HfCandidateSigmac0plusplusMc {
576576 } // / end loop over reconstructed Σc0,++ candidates
577577
578578 // / Match generated Σc0,++ candidates
579- for (const auto & particle : mcParticles ) {
579+ for (const auto & particle : mcParticlesLcGenMatch ) {
580580 flag = 0 ;
581581 origin = 0 ;
582582 std::vector<int > idxBhadMothers{};
@@ -603,26 +603,26 @@ struct HfCandidateSigmac0plusplusMc {
603603 // / → here we check level 1. first, and then levels 2. and 3. are inherited by the Λc+ → pK-π+ MC matching in candidateCreator3Prong.cxx
604604
605605 // / look for Σc0,++(2455)
606- if (RecoDecay::isMatchedMCGen (mcParticles , particle, Pdg::kSigmaC0 , std::array{static_cast <int >(Pdg::kLambdaCPlus ), static_cast <int >(kPiMinus )}, true , &sign, 1 )) {
606+ if (RecoDecay::isMatchedMCGen (mcParticlesLcGenMatch , particle, Pdg::kSigmaC0 , std::array{static_cast <int >(Pdg::kLambdaCPlus ), static_cast <int >(kPiMinus )}, true , &sign, 1 )) {
607607 // generated Σc0(2455)
608- for (const auto & daughter : particle.daughters_as <aod::McParticles >()) {
608+ for (const auto & daughter : particle.daughters_as <McParticlesLcGenMatch >()) {
609609 // look for Λc+ daughter decaying in pK-π+
610610 if (std::abs (daughter.pdgCode ()) != Pdg::kLambdaCPlus )
611611 continue ;
612- if (RecoDecay::isMatchedMCGen (mcParticles, daughter, Pdg:: kLambdaCPlus , std::array{+ kProton , - kKPlus , + kPiPlus }, true , &sign, 2 ) ) {
612+ if (std::abs ( daughter. flagMcMatchGen ()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi ) {
613613 // / Λc+ daughter decaying in pK-π+ found!
614614 flag = sign * BIT (aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi);
615615 particleAntiparticle = isParticleAntiparticle (particle, Pdg::kSigmaC0 );
616616 break ;
617617 }
618618 }
619- } else if (RecoDecay::isMatchedMCGen (mcParticles , particle, Pdg::kSigmaCPlusPlus , std::array{static_cast <int >(Pdg::kLambdaCPlus ), static_cast <int >(kPiPlus )}, true , &sign, 1 )) {
619+ } else if (RecoDecay::isMatchedMCGen (mcParticlesLcGenMatch , particle, Pdg::kSigmaCPlusPlus , std::array{static_cast <int >(Pdg::kLambdaCPlus ), static_cast <int >(kPiPlus )}, true , &sign, 1 )) {
620620 // generated Σc++(2455)
621- for (const auto & daughter : particle.daughters_as <aod::McParticles >()) {
621+ for (const auto & daughter : particle.daughters_as <McParticlesLcGenMatch >()) {
622622 // look for Λc+ daughter decaying in pK-π+
623623 if (std::abs (daughter.pdgCode ()) != Pdg::kLambdaCPlus )
624624 continue ;
625- if (RecoDecay::isMatchedMCGen (mcParticles, daughter, Pdg:: kLambdaCPlus , std::array{+ kProton , - kKPlus , + kPiPlus }, true , &sign, 2 ) ) {
625+ if (std::abs ( daughter. flagMcMatchGen ()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi ) {
626626 // / Λc+ daughter decaying in pK-π+ found!
627627 flag = sign * BIT (aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi);
628628 particleAntiparticle = isParticleAntiparticle (particle, Pdg::kSigmaCPlusPlus );
@@ -633,26 +633,26 @@ struct HfCandidateSigmac0plusplusMc {
633633
634634 // / look for Σc0,++(2520)
635635 if (flag == 0 ) {
636- if (RecoDecay::isMatchedMCGen (mcParticles , particle, Pdg::kSigmaCStar0 , std::array{static_cast <int >(Pdg::kLambdaCPlus ), static_cast <int >(kPiMinus )}, true , &sign, 1 )) {
636+ if (RecoDecay::isMatchedMCGen (mcParticlesLcGenMatch , particle, Pdg::kSigmaCStar0 , std::array{static_cast <int >(Pdg::kLambdaCPlus ), static_cast <int >(kPiMinus )}, true , &sign, 1 )) {
637637 // generated Σc0(2520)
638- for (const auto & daughter : particle.daughters_as <aod::McParticles >()) {
638+ for (const auto & daughter : particle.daughters_as <McParticlesLcGenMatch >()) {
639639 // look for Λc+ daughter decaying in pK-π+
640640 if (std::abs (daughter.pdgCode ()) != Pdg::kLambdaCPlus )
641641 continue ;
642- if (RecoDecay::isMatchedMCGen (mcParticles, daughter, Pdg:: kLambdaCPlus , std::array{+ kProton , - kKPlus , + kPiPlus }, true , &sign, 2 ) ) {
642+ if (std::abs ( daughter. flagMcMatchGen ()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi ) {
643643 // / Λc+ daughter decaying in pK-π+ found!
644644 flag = sign * BIT (aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi);
645645 particleAntiparticle = isParticleAntiparticle (particle, Pdg::kSigmaCStar0 );
646646 break ;
647647 }
648648 }
649- } else if (RecoDecay::isMatchedMCGen (mcParticles , particle, Pdg::kSigmaCStarPlusPlus , std::array{static_cast <int >(Pdg::kLambdaCPlus ), static_cast <int >(kPiPlus )}, true , &sign, 1 )) {
649+ } else if (RecoDecay::isMatchedMCGen (mcParticlesLcGenMatch , particle, Pdg::kSigmaCStarPlusPlus , std::array{static_cast <int >(Pdg::kLambdaCPlus ), static_cast <int >(kPiPlus )}, true , &sign, 1 )) {
650650 // generated Σc++(2520)
651- for (const auto & daughter : particle.daughters_as <aod::McParticles >()) {
651+ for (const auto & daughter : particle.daughters_as <McParticlesLcGenMatch >()) {
652652 // look for Λc+ daughter decaying in pK-π+
653653 if (std::abs (daughter.pdgCode ()) != Pdg::kLambdaCPlus )
654654 continue ;
655- if (RecoDecay::isMatchedMCGen (mcParticles, daughter, Pdg:: kLambdaCPlus , std::array{+ kProton , - kKPlus , + kPiPlus }, true , &sign, 2 ) ) {
655+ if (std::abs ( daughter. flagMcMatchGen ()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi ) {
656656 // / Λc+ daughter decaying in pK-π+ found!
657657 flag = sign * BIT (aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi);
658658 particleAntiparticle = isParticleAntiparticle (particle, Pdg::kSigmaCStarPlusPlus );
@@ -664,7 +664,7 @@ struct HfCandidateSigmac0plusplusMc {
664664
665665 // / check the origin (prompt vs. non-prompt)
666666 if (flag != 0 ) {
667- origin = RecoDecay::getCharmHadronOrigin (mcParticles , particle, false , &idxBhadMothers);
667+ origin = RecoDecay::getCharmHadronOrigin (mcParticlesLcGenMatch , particle, false , &idxBhadMothers);
668668 }
669669 // / fill the table with results of generation level MC matching
670670 if (origin == RecoDecay::OriginType::NonPrompt) {
0 commit comments