@@ -397,7 +397,7 @@ struct HfCandidateSigmac0plusplusMc {
397397
398398 using BCsInfo = soa::Join<aod::BCs, aod::Timestamps, aod::BcSels>;
399399 using LambdacMc = soa::Join<aod::HfCand3Prong, aod::HfSelLc, aod::HfCand3ProngMcRec>;
400- // using LambdacMcGen = soa::Join<aod::McParticles, aod::HfCand3ProngMcGen>;
400+ using McParticlesLcGenMatch = soa::Join<aod::McParticles, aod::HfCand3ProngMcGen>;
401401 using McCollisionsNoCents = soa::Join<aod::Collisions, aod::EvSels, aod::McCollisionLabels>;
402402
403403 PresliceUnsorted<McCollisionsNoCents> colPerMcCollision = aod::mccollisionlabel::mcCollisionId;
@@ -448,7 +448,7 @@ struct HfCandidateSigmac0plusplusMc {
448448 // / @param mcParticles table of generated particles
449449 void processMc (aod::McParticles const & mcParticles,
450450 aod::TracksWMc const & tracks,
451- LambdacMc const & candsLc /* , const LambdacMcGen& */ ,
451+ LambdacMc const & candsLc, McParticlesLcGenMatch const & mcParticlesLcGenMatch ,
452452 McCollisionsNoCents const & collInfos,
453453 aod::McCollisions const &,
454454 BCsInfo const &)
@@ -556,7 +556,7 @@ struct HfCandidateSigmac0plusplusMc {
556556 } // / end loop over reconstructed Σc0,++ candidates
557557
558558 // / Match generated Σc0,++ candidates
559- for (const auto & particle : mcParticles ) {
559+ for (const auto & particle : mcParticlesLcGenMatch ) {
560560 flag = 0 ;
561561 origin = 0 ;
562562 std::vector<int > idxBhadMothers{};
@@ -583,26 +583,26 @@ struct HfCandidateSigmac0plusplusMc {
583583 // / → here we check level 1. first, and then levels 2. and 3. are inherited by the Λc+ → pK-π+ MC matching in candidateCreator3Prong.cxx
584584
585585 // / look for Σc0,++(2455)
586- if (RecoDecay::isMatchedMCGen (mcParticles , particle, Pdg::kSigmaC0 , std::array{static_cast <int >(Pdg::kLambdaCPlus ), static_cast <int >(kPiMinus )}, true , &sign, 1 )) {
586+ if (RecoDecay::isMatchedMCGen (mcParticlesLcGenMatch , particle, Pdg::kSigmaC0 , std::array{static_cast <int >(Pdg::kLambdaCPlus ), static_cast <int >(kPiMinus )}, true , &sign, 1 )) {
587587 // generated Σc0(2455)
588- for (const auto & daughter : particle.daughters_as <aod::McParticles >()) {
588+ for (const auto & daughter : particle.daughters_as <McParticlesLcGenMatch >()) {
589589 // look for Λc+ daughter decaying in pK-π+
590590 if (std::abs (daughter.pdgCode ()) != Pdg::kLambdaCPlus )
591591 continue ;
592- if (RecoDecay::isMatchedMCGen (mcParticles, daughter, Pdg:: kLambdaCPlus , std::array{+ kProton , - kKPlus , + kPiPlus }, true , &sign, 2 ) ) {
592+ if (std::abs ( daughter. flagMcMatchGen ()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi ) {
593593 // / Λc+ daughter decaying in pK-π+ found!
594594 flag = sign * BIT (aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi);
595595 particleAntiparticle = isParticleAntiparticle (particle, Pdg::kSigmaC0 );
596596 break ;
597597 }
598598 }
599- } else if (RecoDecay::isMatchedMCGen (mcParticles , particle, Pdg::kSigmaCPlusPlus , std::array{static_cast <int >(Pdg::kLambdaCPlus ), static_cast <int >(kPiPlus )}, true , &sign, 1 )) {
599+ } else if (RecoDecay::isMatchedMCGen (mcParticlesLcGenMatch , particle, Pdg::kSigmaCPlusPlus , std::array{static_cast <int >(Pdg::kLambdaCPlus ), static_cast <int >(kPiPlus )}, true , &sign, 1 )) {
600600 // generated Σc++(2455)
601- for (const auto & daughter : particle.daughters_as <aod::McParticles >()) {
601+ for (const auto & daughter : particle.daughters_as <McParticlesLcGenMatch >()) {
602602 // look for Λc+ daughter decaying in pK-π+
603603 if (std::abs (daughter.pdgCode ()) != Pdg::kLambdaCPlus )
604604 continue ;
605- if (RecoDecay::isMatchedMCGen (mcParticles, daughter, Pdg:: kLambdaCPlus , std::array{+ kProton , - kKPlus , + kPiPlus }, true , &sign, 2 ) ) {
605+ if (std::abs ( daughter. flagMcMatchGen ()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi ) {
606606 // / Λc+ daughter decaying in pK-π+ found!
607607 flag = sign * BIT (aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi);
608608 particleAntiparticle = isParticleAntiparticle (particle, Pdg::kSigmaCPlusPlus );
@@ -613,26 +613,26 @@ struct HfCandidateSigmac0plusplusMc {
613613
614614 // / look for Σc0,++(2520)
615615 if (flag == 0 ) {
616- if (RecoDecay::isMatchedMCGen (mcParticles , particle, Pdg::kSigmaCStar0 , std::array{static_cast <int >(Pdg::kLambdaCPlus ), static_cast <int >(kPiMinus )}, true , &sign, 1 )) {
616+ if (RecoDecay::isMatchedMCGen (mcParticlesLcGenMatch , particle, Pdg::kSigmaCStar0 , std::array{static_cast <int >(Pdg::kLambdaCPlus ), static_cast <int >(kPiMinus )}, true , &sign, 1 )) {
617617 // generated Σc0(2520)
618- for (const auto & daughter : particle.daughters_as <aod::McParticles >()) {
618+ for (const auto & daughter : particle.daughters_as <McParticlesLcGenMatch >()) {
619619 // look for Λc+ daughter decaying in pK-π+
620620 if (std::abs (daughter.pdgCode ()) != Pdg::kLambdaCPlus )
621621 continue ;
622- if (RecoDecay::isMatchedMCGen (mcParticles, daughter, Pdg:: kLambdaCPlus , std::array{+ kProton , - kKPlus , + kPiPlus }, true , &sign, 2 ) ) {
622+ if (std::abs ( daughter. flagMcMatchGen ()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi ) {
623623 // / Λc+ daughter decaying in pK-π+ found!
624624 flag = sign * BIT (aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi);
625625 particleAntiparticle = isParticleAntiparticle (particle, Pdg::kSigmaCStar0 );
626626 break ;
627627 }
628628 }
629- } else if (RecoDecay::isMatchedMCGen (mcParticles , particle, Pdg::kSigmaCStarPlusPlus , std::array{static_cast <int >(Pdg::kLambdaCPlus ), static_cast <int >(kPiPlus )}, true , &sign, 1 )) {
629+ } else if (RecoDecay::isMatchedMCGen (mcParticlesLcGenMatch , particle, Pdg::kSigmaCStarPlusPlus , std::array{static_cast <int >(Pdg::kLambdaCPlus ), static_cast <int >(kPiPlus )}, true , &sign, 1 )) {
630630 // generated Σc++(2520)
631- for (const auto & daughter : particle.daughters_as <aod::McParticles >()) {
631+ for (const auto & daughter : particle.daughters_as <McParticlesLcGenMatch >()) {
632632 // look for Λc+ daughter decaying in pK-π+
633633 if (std::abs (daughter.pdgCode ()) != Pdg::kLambdaCPlus )
634634 continue ;
635- if (RecoDecay::isMatchedMCGen (mcParticles, daughter, Pdg:: kLambdaCPlus , std::array{+ kProton , - kKPlus , + kPiPlus }, true , &sign, 2 ) ) {
635+ if (std::abs ( daughter. flagMcMatchGen ()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi ) {
636636 // / Λc+ daughter decaying in pK-π+ found!
637637 flag = sign * BIT (aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi);
638638 particleAntiparticle = isParticleAntiparticle (particle, Pdg::kSigmaCStarPlusPlus );
@@ -644,7 +644,7 @@ struct HfCandidateSigmac0plusplusMc {
644644
645645 // / check the origin (prompt vs. non-prompt)
646646 if (flag != 0 ) {
647- origin = RecoDecay::getCharmHadronOrigin (mcParticles , particle, false , &idxBhadMothers);
647+ origin = RecoDecay::getCharmHadronOrigin (mcParticlesLcGenMatch , particle, false , &idxBhadMothers);
648648 }
649649 // / fill the table with results of generation level MC matching
650650 if (origin == RecoDecay::OriginType::NonPrompt) {
0 commit comments