diff --git a/PWGHF/Tasks/taskPidStudies.cxx b/PWGHF/Tasks/taskPidStudies.cxx index 75878f4f9a6..e7115cd91d8 100644 --- a/PWGHF/Tasks/taskPidStudies.cxx +++ b/PWGHF/Tasks/taskPidStudies.cxx @@ -204,8 +204,8 @@ struct HfTaskPidStudies { aod::pidTOFFullPi, aod::pidTOFFullKa, aod::pidTOFFullPr>; using CollSels = soa::Join; using CollisionsMc = soa::Join; - using V0sMcRec = soa::Join; - using CascsMcRec = soa::Join; + using V0sMcRec = soa::Join; + using CascsMcRec = soa::Join; ctpRateFetcher rateFetcher; HfEventSelection hfEvSel; @@ -214,6 +214,7 @@ struct HfTaskPidStudies { o2::framework::Service ccdb; HistogramRegistry registry{"registry", {}}; + OutputObj zorroSummary{"zorroSummary"}; void init(InitContext&) { @@ -223,7 +224,9 @@ struct HfTaskPidStudies { ccdb->setURL(ccdbUrl); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); - hfEvSel.addHistograms(registry); + + // init HF event selection helper + hfEvSel.init(registry, &zorroSummary); std::shared_ptr const hTrackSel = registry.add("hTrackSel", "Track selection;;Counts", {HistType::kTH1F, {{TrackCuts::NCuts, 0, TrackCuts::NCuts}}}); @@ -308,37 +311,29 @@ struct HfTaskPidStudies { int isMatched(const T1& cand) { if constexpr (std::is_same::value) { - if (!cand.has_v0MCCore()) { - return Particle::NotMatched; - } - auto v0MC = cand.template v0MCCore_as(); - if (v0MC.pdgCode() == kK0Short && v0MC.pdgCodeNegative() == -kPiPlus && v0MC.pdgCodePositive() == kPiPlus) { + if (cand.pdgCode() == kK0Short && cand.pdgCodeNegative() == -kPiPlus && cand.pdgCodePositive() == kPiPlus) { return Particle::K0s; } - if (v0MC.pdgCode() == kLambda0 && v0MC.pdgCodeNegative() == -kPiPlus && v0MC.pdgCodePositive() == kProton) { + if (cand.pdgCode() == kLambda0 && cand.pdgCodeNegative() == -kPiPlus && cand.pdgCodePositive() == kProton) { return Particle::Lambda; } - if (v0MC.pdgCode() == -kLambda0 && v0MC.pdgCodeNegative() == -kProton && v0MC.pdgCodePositive() == kPiPlus) { + if (cand.pdgCode() == -kLambda0 && cand.pdgCodeNegative() == -kProton && cand.pdgCodePositive() == kPiPlus) { return -Particle::Lambda; } } if constexpr (std::is_same::value) { - if (!cand.has_cascMCCore()) { - return Particle::NotMatched; - } - auto cascMC = cand.template cascMCCore_as(); - if (cascMC.pdgCode() == kOmegaMinus && - cascMC.pdgCodeBachelor() == -kKPlus && - cascMC.pdgCodeV0() == kLambda0 && - cascMC.pdgCodePositive() == kProton && - cascMC.pdgCodeNegative() == -kPiPlus) { + if (cand.pdgCode() == kOmegaMinus && + cand.pdgCodeBachelor() == -kKPlus && + cand.pdgCodeV0() == kLambda0 && + cand.pdgCodePositive() == kProton && + cand.pdgCodeNegative() == -kPiPlus) { return Particle::Omega; } - if (cascMC.pdgCode() == -kOmegaMinus && - cascMC.pdgCodeBachelor() == kKPlus && - cascMC.pdgCodeV0() == -kLambda0 && - cascMC.pdgCodePositive() == kPiPlus && - cascMC.pdgCodeNegative() == -kProton) { + if (cand.pdgCode() == -kOmegaMinus && + cand.pdgCodeBachelor() == kKPlus && + cand.pdgCodeV0() == -kLambda0 && + cand.pdgCodePositive() == kPiPlus && + cand.pdgCodeNegative() == -kProton) { return -Particle::Omega; } }