Skip to content

Commit 2dcc449

Browse files
[PWGLF] Inclusion of process function for Monte Carlo process avoiding over count of generated tracks (#14722)
Co-authored-by: ALICE Action Bot <[email protected]>
1 parent d393b3d commit 2dcc449

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ struct StudyPnch {
125125
x->SetBinLabel(6, "INEL > 0");
126126
x->SetBinLabel(7, "|vz| < 10");
127127

128-
if (doprocessData || doprocessCorrelation || doprocessMonteCarlo) {
128+
if (doprocessData || doprocessCorrelation || doprocessMonteCarlo || doprocessTreatedMonteCarlo) {
129129
histos.add("PhiVsEtaHist", "PhiVsEtaHist", kTH2F, {axisPhi, axisEta}, false);
130130
}
131131
if (doprocessData) {
@@ -143,6 +143,11 @@ struct StudyPnch {
143143
histos.add("hMultiplicityMCgen", "hMultiplicityMCgen", kTH1F, {axisMult}, true);
144144
histos.add("hResponseMatrix", "hResponseMatrix", kTH2F, {axisMult, axisMult}, true);
145145
}
146+
if (doprocessTreatedMonteCarlo) {
147+
histos.add("hMultiplicityTreatMCrec", "hMultiplicityTreatMCrec", kTH1F, {axisMult}, true);
148+
histos.add("hMultiplicityTreatMCgen", "hMultiplicityTreatMCgen", kTH1F, {axisMult}, true);
149+
histos.add("hResponseMatrixTreat", "hResponseMatrixTreat", kTH2F, {axisMult, axisMult}, true);
150+
}
146151
if (doprocessEvtLossSigLossMC) {
147152
histos.add("MCEventHist", "MCEventHist", kTH1F, {axisEvent}, false);
148153
auto hstat = histos.get<TH1>(HIST("MCEventHist"));
@@ -264,7 +269,6 @@ struct StudyPnch {
264269
if (!isTrackSelected(track)) {
265270
continue;
266271
}
267-
268272
// Verify that the track belongs to the given MC collision
269273
if (track.has_mcParticle()) {
270274
auto particle = track.mcParticle();
@@ -322,6 +326,26 @@ struct StudyPnch {
322326
}
323327
}
324328

329+
void processTreatedMonteCarlo(ColMCTrueTable::iterator const& mcCollision, ColMCRecTable const& RecCols, TrackMCTrueTable const& GenParticles, FilTrackMCRecTable const& RecTracks)
330+
{
331+
// Count generated tracks at each iterator
332+
auto multgen = countGenTracks(GenParticles, mcCollision);
333+
histos.fill(HIST("hMultiplicityTreatMCgen"), multgen);
334+
for (const auto& RecCol : RecCols) {
335+
if (!isEventSelected(RecCol)) {
336+
continue;
337+
}
338+
// Verify that the reconstructed collision corresponds to the given MC collision
339+
if (RecCol.mcCollisionId() != mcCollision.globalIndex()) {
340+
continue;
341+
}
342+
auto recTracksPart = RecTracks.sliceBy(perCollision, RecCol.globalIndex());
343+
auto multrec = countNTracksMcCol(recTracksPart, RecCol);
344+
histos.fill(HIST("hMultiplicityTreatMCrec"), multrec);
345+
histos.fill(HIST("hResponseMatrixTreat"), multrec, multgen);
346+
}
347+
}
348+
325349
void processEvtLossSigLossMC(soa::Join<ColMCTrueTable, aod::MultMCExtras>::iterator const& mcCollision, ColMCRecTable const& RecCols, TrackMCTrueTable const& GenParticles)
326350
{
327351
if (isApplyInelgt0 && !mcCollision.isInelGt0()) {
@@ -359,6 +383,7 @@ struct StudyPnch {
359383
PROCESS_SWITCH(StudyPnch, processData, "process data CentFT0C", false);
360384
PROCESS_SWITCH(StudyPnch, processCorrelation, "do correlation study in data", false);
361385
PROCESS_SWITCH(StudyPnch, processMonteCarlo, "process MC CentFT0C", false);
386+
PROCESS_SWITCH(StudyPnch, processTreatedMonteCarlo, "process Treated MC CentFT0C", false);
362387
PROCESS_SWITCH(StudyPnch, processEvtLossSigLossMC, "process Signal Loss, Event Loss", false);
363388
};
364389

0 commit comments

Comments
 (0)