From 88a67a0baa6b7ec560ccc041f8e2a7efb87a7ef5 Mon Sep 17 00:00:00 2001 From: lucasjsilva Date: Thu, 15 Jan 2026 14:37:24 -0300 Subject: [PATCH 1/6] Added treatment for outliers in MC tracks --- .../Tasks/GlobalEventProperties/studyPnch.cxx | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx b/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx index 0392059fa1e..625143efb9d 100644 --- a/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx +++ b/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx @@ -251,6 +251,28 @@ struct StudyPnch { return nTrk; } + template + 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), @@ -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); From ea902fd37bcdca5aee640f634e161c25a395e423 Mon Sep 17 00:00:00 2001 From: lucasjsilva Date: Wed, 28 Jan 2026 14:19:29 -0300 Subject: [PATCH 2/6] Treatment for outliers in generated MC tracks --- .../Tasks/GlobalEventProperties/studyPnch.cxx | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx b/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx index 625143efb9d..2de6c449d93 100644 --- a/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx +++ b/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx @@ -237,16 +237,21 @@ struct StudyPnch { return nTrk; } - template - int countGenTracks(countTrk const& tracks) + template + int countGenTracks(countTrk const& tracks, McColType const& McCol) { auto nTrk = 0; for (const auto& track : tracks) { if (!isGenTrackSelected(track)) { continue; } - histos.fill(HIST("PhiVsEtaHist"), track.phi(), track.eta()); - nTrk++; + // Verify that the track belongs to the given MC collision + if (track.mcCollisionId() != McCol.globalIndex()) { + continue; + } + + histos.fill(HIST("PhiVsEtaHist"), track.phi(), track.eta()); + nTrk++; } return nTrk; } @@ -302,7 +307,7 @@ struct StudyPnch { histos.fill(HIST("NPVtracks_vs_GlobalMult"), cols.multNTracksPV(), mult); } - void processMonteCarlo(ColMCTrueTable::iterator const&, ColMCRecTable const& RecCols, TrackMCTrueTable const& GenParticles, FilTrackMCRecTable const& RecTracks) + void processMonteCarlo(ColMCTrueTable::iterator const& mcCollision, ColMCRecTable const& RecCols, TrackMCTrueTable const& GenParticles, FilTrackMCRecTable const& RecTracks) { for (const auto& RecCol : RecCols) { if (!isEventSelected(RecCol)) { @@ -311,7 +316,7 @@ struct StudyPnch { auto recTracksPart = RecTracks.sliceBy(perCollision, RecCol.globalIndex()); auto multrec = countNTracksMcCol(recTracksPart, RecCol); histos.fill(HIST("hMultiplicityMCrec"), multrec); - auto multgen = countGenTracks(GenParticles); + auto multgen = countGenTracks(GenParticles, mcCollision); histos.fill(HIST("hMultiplicityMCgen"), multgen); histos.fill(HIST("hResponseMatrix"), multrec, multgen); } @@ -327,7 +332,7 @@ struct StudyPnch { } // All generated events histos.fill(HIST("MCEventHist"), 1); - auto multAll = countGenTracks(GenParticles); + auto multAll = countGenTracks(GenParticles, mcCollision); histos.fill(HIST("hMultiplicityMCgenAll"), multAll); bool atLeastOne = false; @@ -346,7 +351,7 @@ struct StudyPnch { if (atLeastOne) { histos.fill(HIST("MCEventHist"), 2); - auto multSel = countGenTracks(GenParticles); + auto multSel = countGenTracks(GenParticles, mcCollision); histos.fill(HIST("hMultiplicityMCgenSel"), multSel); } } From 153f17224bbd17349ff6703b0a02525286e810fd Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 28 Jan 2026 17:27:12 +0000 Subject: [PATCH 3/6] Please consider the following formatting changes --- PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx b/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx index 2de6c449d93..c948f0b1f35 100644 --- a/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx +++ b/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx @@ -249,9 +249,9 @@ struct StudyPnch { if (track.mcCollisionId() != McCol.globalIndex()) { continue; } - - histos.fill(HIST("PhiVsEtaHist"), track.phi(), track.eta()); - nTrk++; + + histos.fill(HIST("PhiVsEtaHist"), track.phi(), track.eta()); + nTrk++; } return nTrk; } From b7b92bd5d88a1a3f22bc201273f0ad91989a20b7 Mon Sep 17 00:00:00 2001 From: lucasjsilva Date: Tue, 17 Mar 2026 17:22:50 +0100 Subject: [PATCH 4/6] Selection of tracks INEL grather than zero and inclusion of TVX trigger in efficiency correction --- .../Tasks/GlobalEventProperties/studyPnch.cxx | 35 ++++++++++++++----- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx b/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx index 394c54b74d5..36b7a648d1b 100644 --- a/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx +++ b/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx @@ -102,6 +102,7 @@ struct StudyPnch { Configurable isApplySameBunchPileup{"isApplySameBunchPileup", true, "Enable SameBunchPileup cut"}; Configurable isApplyInelgt0{"isApplyInelgt0", false, "Enable INEL > 0 condition"}; Configurable isApplyExtraPhiCut{"isApplyExtraPhiCut", false, "Enable extra phi cut"}; + Configurable isApplyTVX{"isApplyTVX", false, "Enable TVX trigger sel"}; void init(InitContext const&) { @@ -163,7 +164,7 @@ struct StudyPnch { bool isEventSelected(CheckCol const& col) { histos.fill(HIST("EventHist"), 1); - if (!col.selection_bit(o2::aod::evsel::kIsTriggerTVX)) { + if (isApplyTVX && !col.selection_bit(o2::aod::evsel::kIsTriggerTVX)) { return false; } histos.fill(HIST("EventHist"), 2); @@ -282,6 +283,11 @@ struct StudyPnch { return nTrk; } + bool isINELgt0(auto nTrk) + { + return nTrk > 0; + } + 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), @@ -295,7 +301,9 @@ struct StudyPnch { return; } auto mult = countNTracks(tracks); - histos.fill(HIST("hMultiplicityData"), mult); + if (isINELgt0(mult)) { + histos.fill(HIST("hMultiplicityData"), mult); + } } void processCorrelation(ColDataTable::iterator const& cols, FilTrackDataTable const& tracks) @@ -319,10 +327,14 @@ struct StudyPnch { } auto recTracksPart = RecTracks.sliceBy(perCollision, RecCol.globalIndex()); auto multrec = countNTracksMcCol(recTracksPart, RecCol); - histos.fill(HIST("hMultiplicityMCrec"), multrec); + if (isINELgt0(multrec)) { + histos.fill(HIST("hMultiplicityMCrec"), multrec); + } auto multgen = countGenTracks(GenParticles, mcCollision); - histos.fill(HIST("hMultiplicityMCgen"), multgen); - histos.fill(HIST("hResponseMatrix"), multrec, multgen); + if (isINELgt0(multgen) && isINELgt0(multrec)) { + histos.fill(HIST("hMultiplicityMCgen"), multgen); + histos.fill(HIST("hResponseMatrix"), multrec, multgen); + } } } @@ -351,14 +363,19 @@ struct StudyPnch { if (isApplyInelgt0 && !mcCollision.isInelGt0()) { return; } + if (isApplyTVX && !(mcCollision.multMCFT0C() > 0 && mcCollision.multMCFT0A() > 0)) { + return; + } if (std::abs(mcCollision.posZ()) >= vtxRange) { return; } // All generated events histos.fill(HIST("MCEventHist"), 1); auto multAll = countGenTracks(GenParticles, mcCollision); - histos.fill(HIST("hMultiplicityMCgenAll"), multAll); - + if (isINELgt0(multAll)) { + histos.fill(HIST("hMultiplicityMCgenAll"), multAll); + } + bool atLeastOne = false; auto numcontributors = -999; for (const auto& RecCol : RecCols) { @@ -376,7 +393,9 @@ struct StudyPnch { if (atLeastOne) { histos.fill(HIST("MCEventHist"), 2); auto multSel = countGenTracks(GenParticles, mcCollision); - histos.fill(HIST("hMultiplicityMCgenSel"), multSel); + if (isINELgt0(multSel)) { + histos.fill(HIST("hMultiplicityMCgenSel"), multSel); + } } } From cde838ad3012c200e0a7bb53c02ea7e08b8146a5 Mon Sep 17 00:00:00 2001 From: lucasjsilva Date: Tue, 17 Mar 2026 17:34:37 +0100 Subject: [PATCH 5/6] Exclusion of duplicated process function for MC process --- .../Tasks/GlobalEventProperties/studyPnch.cxx | 28 +------------------ 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx b/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx index 36b7a648d1b..54147124254 100644 --- a/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx +++ b/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx @@ -126,7 +126,7 @@ struct StudyPnch { x->SetBinLabel(6, "INEL > 0"); x->SetBinLabel(7, "|vz| < 10"); - if (doprocessData || doprocessCorrelation || doprocessMonteCarlo || doprocessTreatedMonteCarlo) { + if (doprocessData || doprocessCorrelation || doprocessMonteCarlo) { histos.add("PhiVsEtaHist", "PhiVsEtaHist", kTH2F, {axisPhi, axisEta}, false); } if (doprocessData) { @@ -144,11 +144,6 @@ struct StudyPnch { histos.add("hMultiplicityMCgen", "hMultiplicityMCgen", kTH1F, {axisMult}, true); histos.add("hResponseMatrix", "hResponseMatrix", kTH2F, {axisMult, axisMult}, true); } - if (doprocessTreatedMonteCarlo) { - histos.add("hMultiplicityTreatMCrec", "hMultiplicityTreatMCrec", kTH1F, {axisMult}, true); - histos.add("hMultiplicityTreatMCgen", "hMultiplicityTreatMCgen", kTH1F, {axisMult}, true); - histos.add("hResponseMatrixTreat", "hResponseMatrixTreat", kTH2F, {axisMult, axisMult}, true); - } if (doprocessEvtLossSigLossMC) { histos.add("MCEventHist", "MCEventHist", kTH1F, {axisEvent}, false); auto hstat = histos.get(HIST("MCEventHist")); @@ -338,26 +333,6 @@ struct StudyPnch { } } - void processTreatedMonteCarlo(ColMCTrueTable::iterator const& mcCollision, ColMCRecTable const& RecCols, TrackMCTrueTable const& GenParticles, FilTrackMCRecTable const& RecTracks) - { - // Count generated tracks at each iterator - auto multgen = countGenTracks(GenParticles, mcCollision); - histos.fill(HIST("hMultiplicityTreatMCgen"), multgen); - for (const auto& RecCol : RecCols) { - if (!isEventSelected(RecCol)) { - continue; - } - // Verify that the reconstructed collision corresponds to the given MC collision - if (RecCol.mcCollisionId() != mcCollision.globalIndex()) { - continue; - } - auto recTracksPart = RecTracks.sliceBy(perCollision, RecCol.globalIndex()); - auto multrec = countNTracksMcCol(recTracksPart, RecCol); - histos.fill(HIST("hMultiplicityTreatMCrec"), multrec); - histos.fill(HIST("hResponseMatrixTreat"), multrec, multgen); - } - } - void processEvtLossSigLossMC(soa::Join::iterator const& mcCollision, ColMCRecTable const& RecCols, TrackMCTrueTable const& GenParticles) { if (isApplyInelgt0 && !mcCollision.isInelGt0()) { @@ -402,7 +377,6 @@ struct StudyPnch { PROCESS_SWITCH(StudyPnch, processData, "process data CentFT0C", false); PROCESS_SWITCH(StudyPnch, processCorrelation, "do correlation study in data", false); PROCESS_SWITCH(StudyPnch, processMonteCarlo, "process MC CentFT0C", false); - PROCESS_SWITCH(StudyPnch, processTreatedMonteCarlo, "process Treated MC CentFT0C", false); PROCESS_SWITCH(StudyPnch, processEvtLossSigLossMC, "process Signal Loss, Event Loss", false); }; From 44509f59ebf3f94088112df6d136c16b2a3f9a64 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Tue, 17 Mar 2026 16:46:46 +0000 Subject: [PATCH 6/6] Please consider the following formatting changes --- PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx b/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx index 54147124254..3c60e611701 100644 --- a/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx +++ b/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx @@ -329,7 +329,7 @@ struct StudyPnch { if (isINELgt0(multgen) && isINELgt0(multrec)) { histos.fill(HIST("hMultiplicityMCgen"), multgen); histos.fill(HIST("hResponseMatrix"), multrec, multgen); - } + } } } @@ -350,7 +350,7 @@ struct StudyPnch { if (isINELgt0(multAll)) { histos.fill(HIST("hMultiplicityMCgenAll"), multAll); } - + bool atLeastOne = false; auto numcontributors = -999; for (const auto& RecCol : RecCols) { @@ -369,7 +369,7 @@ struct StudyPnch { histos.fill(HIST("MCEventHist"), 2); auto multSel = countGenTracks(GenParticles, mcCollision); if (isINELgt0(multSel)) { - histos.fill(HIST("hMultiplicityMCgenSel"), multSel); + histos.fill(HIST("hMultiplicityMCgenSel"), multSel); } } }