Skip to content

Commit 6f602aa

Browse files
authored
[PWGHF] Fix V0/casc. MC matching in HF PID task. (#14289)
1 parent 4dec0d5 commit 6f602aa

File tree

1 file changed

+15
-23
lines changed

1 file changed

+15
-23
lines changed

PWGHF/Tasks/taskPidStudies.cxx

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,8 @@ struct HfTaskPidStudies {
204204
aod::pidTOFFullPi, aod::pidTOFFullKa, aod::pidTOFFullPr>;
205205
using CollSels = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Cs, aod::CentFT0Ms>;
206206
using CollisionsMc = soa::Join<aod::Collisions, aod::McCollisionLabels, aod::EvSels, aod::CentFT0Cs, aod::CentFT0Ms>;
207-
using V0sMcRec = soa::Join<aod::V0Datas, aod::V0CoreMCLabels>;
208-
using CascsMcRec = soa::Join<aod::CascDatas, aod::CascCoreMCLabels>;
207+
using V0sMcRec = soa::Join<aod::V0Datas, aod::V0MCCores>;
208+
using CascsMcRec = soa::Join<aod::CascDatas, aod::CascMCCores>;
209209

210210
ctpRateFetcher rateFetcher;
211211
HfEventSelection hfEvSel;
@@ -308,37 +308,29 @@ struct HfTaskPidStudies {
308308
int isMatched(const T1& cand)
309309
{
310310
if constexpr (std::is_same<T1, V0sMcRec::iterator>::value) {
311-
if (!cand.has_v0MCCore()) {
312-
return Particle::NotMatched;
313-
}
314-
auto v0MC = cand.template v0MCCore_as<aod::V0MCCores>();
315-
if (v0MC.pdgCode() == kK0Short && v0MC.pdgCodeNegative() == -kPiPlus && v0MC.pdgCodePositive() == kPiPlus) {
311+
if (cand.pdgCode() == kK0Short && cand.pdgCodeNegative() == -kPiPlus && cand.pdgCodePositive() == kPiPlus) {
316312
return Particle::K0s;
317313
}
318-
if (v0MC.pdgCode() == kLambda0 && v0MC.pdgCodeNegative() == -kPiPlus && v0MC.pdgCodePositive() == kProton) {
314+
if (cand.pdgCode() == kLambda0 && cand.pdgCodeNegative() == -kPiPlus && cand.pdgCodePositive() == kProton) {
319315
return Particle::Lambda;
320316
}
321-
if (v0MC.pdgCode() == -kLambda0 && v0MC.pdgCodeNegative() == -kProton && v0MC.pdgCodePositive() == kPiPlus) {
317+
if (cand.pdgCode() == -kLambda0 && cand.pdgCodeNegative() == -kProton && cand.pdgCodePositive() == kPiPlus) {
322318
return -Particle::Lambda;
323319
}
324320
}
325321
if constexpr (std::is_same<T1, CascsMcRec::iterator>::value) {
326-
if (!cand.has_cascMCCore()) {
327-
return Particle::NotMatched;
328-
}
329-
auto cascMC = cand.template cascMCCore_as<aod::CascMCCores>();
330-
if (cascMC.pdgCode() == kOmegaMinus &&
331-
cascMC.pdgCodeBachelor() == -kKPlus &&
332-
cascMC.pdgCodeV0() == kLambda0 &&
333-
cascMC.pdgCodePositive() == kProton &&
334-
cascMC.pdgCodeNegative() == -kPiPlus) {
322+
if (cand.pdgCode() == kOmegaMinus &&
323+
cand.pdgCodeBachelor() == -kKPlus &&
324+
cand.pdgCodeV0() == kLambda0 &&
325+
cand.pdgCodePositive() == kProton &&
326+
cand.pdgCodeNegative() == -kPiPlus) {
335327
return Particle::Omega;
336328
}
337-
if (cascMC.pdgCode() == -kOmegaMinus &&
338-
cascMC.pdgCodeBachelor() == kKPlus &&
339-
cascMC.pdgCodeV0() == -kLambda0 &&
340-
cascMC.pdgCodePositive() == kPiPlus &&
341-
cascMC.pdgCodeNegative() == -kProton) {
329+
if (cand.pdgCode() == -kOmegaMinus &&
330+
cand.pdgCodeBachelor() == kKPlus &&
331+
cand.pdgCodeV0() == -kLambda0 &&
332+
cand.pdgCodePositive() == kPiPlus &&
333+
cand.pdgCodeNegative() == -kProton) {
342334
return -Particle::Omega;
343335
}
344336
}

0 commit comments

Comments
 (0)