Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,28 @@ struct StudyPnch {
return nTrk;
}

template <typename countTrk, typename McColType>
int countNTracksMcCol(countTrk const& tracks, McColType const& McCol)
{
auto nTrk = 0;
for (const auto& track : tracks) {
if (!isTrackSelected(track)) {
continue;
}

// Verify that the track belongs to the given MC collision
if (track.has_mcParticle()) {
auto particle = track.mcParticle();
if (particle.mcCollisionId() != McCol.mcCollisionId()) {
continue;
}
}
histos.fill(HIST("PhiVsEtaHist"), track.phi(), track.eta());
nTrk++;
}
return nTrk;
}

Filter fTrackSelectionITS = ncheckbit(aod::track::v001::detectorMap, (uint8_t)o2::aod::track::ITS) &&
ncheckbit(aod::track::trackCutFlag, TrackSelectionIts);
Filter fTrackSelectionTPC = ifnode(ncheckbit(aod::track::v001::detectorMap, (uint8_t)o2::aod::track::TPC),
Expand Down Expand Up @@ -287,7 +309,7 @@ struct StudyPnch {
continue;
}
auto recTracksPart = RecTracks.sliceBy(perCollision, RecCol.globalIndex());
auto multrec = countNTracks(recTracksPart);
auto multrec = countNTracksMcCol(recTracksPart, RecCol);
histos.fill(HIST("hMultiplicityMCrec"), multrec);
auto multgen = countGenTracks(GenParticles);
histos.fill(HIST("hMultiplicityMCgen"), multgen);
Expand Down
Loading