Skip to content

Commit bf502b1

Browse files
authored
[PWGLF] nuclei-proton correlation analysis: fix rejection of final state protons (#10121)
1 parent eb4a5f4 commit bf502b1

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,11 +1306,35 @@ struct hadronnucleicorrelation {
13061306
if (particle.pdgCode() == pdgProton) {
13071307
if (!particle.has_daughters()) {
13081308
selectedparticlesMC_p[particle.mcCollisionId()].push_back(std::make_shared<decltype(particle)>(particle));
1309+
} else {
1310+
bool isp = false;
1311+
1312+
for (auto& dau : particle.daughters_as<aod::McParticles>()) {
1313+
if (dau.pdgCode() == pdgProton) {
1314+
isp = true;
1315+
}
1316+
}
1317+
1318+
if (isp) {
1319+
selectedparticlesMC_p[particle.mcCollisionId()].push_back(std::make_shared<decltype(particle)>(particle));
1320+
}
13091321
}
13101322
}
13111323
if (particle.pdgCode() == -pdgProton) {
13121324
if (!particle.has_daughters()) {
13131325
selectedparticlesMC_antip[particle.mcCollisionId()].push_back(std::make_shared<decltype(particle)>(particle));
1326+
} else {
1327+
bool isantip = false;
1328+
1329+
for (auto& dau : particle.daughters_as<aod::McParticles>()) {
1330+
if (dau.pdgCode() == -pdgProton) {
1331+
isantip = true;
1332+
}
1333+
}
1334+
1335+
if (isantip) {
1336+
selectedparticlesMC_antip[particle.mcCollisionId()].push_back(std::make_shared<decltype(particle)>(particle));
1337+
}
13141338
}
13151339
}
13161340
}

0 commit comments

Comments
 (0)