diff --git a/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx b/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx index 394c54b74d5..3c60e611701 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&) { @@ -125,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) { @@ -143,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")); @@ -163,7 +159,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 +278,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 +296,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,30 +322,14 @@ struct StudyPnch { } auto recTracksPart = RecTracks.sliceBy(perCollision, RecCol.globalIndex()); auto multrec = countNTracksMcCol(recTracksPart, RecCol); - histos.fill(HIST("hMultiplicityMCrec"), multrec); - auto multgen = countGenTracks(GenParticles, mcCollision); - histos.fill(HIST("hMultiplicityMCgen"), multgen); - histos.fill(HIST("hResponseMatrix"), multrec, multgen); - } - } - - 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; + if (isINELgt0(multrec)) { + histos.fill(HIST("hMultiplicityMCrec"), multrec); } - // Verify that the reconstructed collision corresponds to the given MC collision - if (RecCol.mcCollisionId() != mcCollision.globalIndex()) { - continue; + auto multgen = countGenTracks(GenParticles, mcCollision); + if (isINELgt0(multgen) && isINELgt0(multrec)) { + histos.fill(HIST("hMultiplicityMCgen"), multgen); + histos.fill(HIST("hResponseMatrix"), multrec, multgen); } - auto recTracksPart = RecTracks.sliceBy(perCollision, RecCol.globalIndex()); - auto multrec = countNTracksMcCol(recTracksPart, RecCol); - histos.fill(HIST("hMultiplicityTreatMCrec"), multrec); - histos.fill(HIST("hResponseMatrixTreat"), multrec, multgen); } } @@ -351,13 +338,18 @@ 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; @@ -376,14 +368,15 @@ 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); + } } } 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); };