Skip to content

Commit 88a67a0

Browse files
committed
Added treatment for outliers in MC tracks
1 parent 398c722 commit 88a67a0

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,28 @@ struct StudyPnch {
251251
return nTrk;
252252
}
253253

254+
template <typename countTrk, typename McColType>
255+
int countNTracksMcCol(countTrk const& tracks, McColType const& McCol)
256+
{
257+
auto nTrk = 0;
258+
for (const auto& track : tracks) {
259+
if (!isTrackSelected(track)) {
260+
continue;
261+
}
262+
263+
// Verify that the track belongs to the given MC collision
264+
if (track.has_mcParticle()) {
265+
auto particle = track.mcParticle();
266+
if (particle.mcCollisionId() != McCol.mcCollisionId()) {
267+
continue;
268+
}
269+
}
270+
histos.fill(HIST("PhiVsEtaHist"), track.phi(), track.eta());
271+
nTrk++;
272+
}
273+
return nTrk;
274+
}
275+
254276
Filter fTrackSelectionITS = ncheckbit(aod::track::v001::detectorMap, (uint8_t)o2::aod::track::ITS) &&
255277
ncheckbit(aod::track::trackCutFlag, TrackSelectionIts);
256278
Filter fTrackSelectionTPC = ifnode(ncheckbit(aod::track::v001::detectorMap, (uint8_t)o2::aod::track::TPC),
@@ -287,7 +309,7 @@ struct StudyPnch {
287309
continue;
288310
}
289311
auto recTracksPart = RecTracks.sliceBy(perCollision, RecCol.globalIndex());
290-
auto multrec = countNTracks(recTracksPart);
312+
auto multrec = countNTracksMcCol(recTracksPart, RecCol);
291313
histos.fill(HIST("hMultiplicityMCrec"), multrec);
292314
auto multgen = countGenTracks(GenParticles);
293315
histos.fill(HIST("hMultiplicityMCgen"), multgen);

0 commit comments

Comments
 (0)