diff --git a/PWGHF/D2H/Tasks/taskSigmac.cxx b/PWGHF/D2H/Tasks/taskSigmac.cxx index 439deb9ef44..b9deabbaee2 100644 --- a/PWGHF/D2H/Tasks/taskSigmac.cxx +++ b/PWGHF/D2H/Tasks/taskSigmac.cxx @@ -427,9 +427,9 @@ struct HfTaskSigmac { /// @param mcParticles are the generated particles with flags wheter they are Σc0,++ or not /// @param void processMc(soa::Join const& candidatesSc, - aod::McParticles const& mcParticles, soa::Join const& mcParticlesSc, soa::Join const& mcParticlesLc, + aod::McParticles const& mcParticles, // this establishes the type of particle obtained with the .mcParticle() getter soa::Join const& candidatesLc, aod::TracksWMc const&) { @@ -881,17 +881,24 @@ struct HfTaskSigmac { if (enableTHn) { /// loop over Λc+ candidates w/o Σc0,++ mass-window cut for (const auto& candidateLc : candidatesLc) { + if (!TESTBIT(std::abs(candidateLc.flagMcMatchRec()), aod::hf_cand_3prong::DecayType::LcToPKPi)) { + continue; + } double massLc(-1.); double ptLc(candidateLc.pt()); double decLengthLc(candidateLc.decayLength()), decLengthXYLc(candidateLc.decayLengthXY()); double cpaLc(candidateLc.cpa()), cpaXYLc(candidateLc.cpaXY()); int origin = candidateLc.originMcRec(); auto channel = candidateLc.flagMcDecayChanRec(); /// 0: direct; 1: Λc± → p± K*; 2: Λc± → Δ(1232)±± K∓; 3: Λc± → Λ(1520) π± - if (candidateLc.isSelLcToPKPi() >= 1 && std::abs(candidateLc.prong0_as().mcParticle().pdgCode()) == kProton) { + int pdgAbs = -1; + if (candidateLc.prong0_as().has_mcParticle()) { + pdgAbs = std::abs(candidateLc.prong0_as().mcParticle().pdgCode()); + } + if (candidateLc.isSelLcToPKPi() >= 1 && pdgAbs == kProton) { massLc = hfHelper.invMassLcToPKPi(candidateLc); registry.get(HIST("hnLambdaC"))->Fill(ptLc, massLc, decLengthLc, decLengthXYLc, cpaLc, cpaXYLc, origin, channel); } - if (candidateLc.isSelLcToPiKP() >= 1 && std::abs(candidateLc.prong0_as().mcParticle().pdgCode()) == kPiPlus) { + if (candidateLc.isSelLcToPiKP() >= 1 && pdgAbs == kPiPlus) { massLc = hfHelper.invMassLcToPiKP(candidateLc); registry.get(HIST("hnLambdaC"))->Fill(ptLc, massLc, decLengthLc, decLengthXYLc, cpaLc, cpaXYLc, origin, channel); } diff --git a/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx b/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx index 674295848e2..c450e60d5c0 100644 --- a/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx +++ b/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx @@ -381,11 +381,12 @@ struct HfCandidateSigmac0plusplusMc { /// @param mcParticles table of generated particles void processMc(aod::McParticles const& mcParticles, aod::TracksWMc const& tracks, - LambdacMc const& /*, const LambdacMcGen&*/) + LambdacMc const& candsLc /*, const LambdacMcGen&*/) { // Match reconstructed candidates. candidatesSigmac->bindExternalIndices(&tracks); + candidatesSigmac->bindExternalIndices(&candsLc); int indexRec = -1; int8_t sign = 0;