Skip to content

Commit 3a083da

Browse files
[PWGLF] Inclusion of INEL grather than zero (#15460)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent 090227f commit 3a083da

File tree

1 file changed

+26
-33
lines changed

1 file changed

+26
-33
lines changed

PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx

Lines changed: 26 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ struct StudyPnch {
102102
Configurable<bool> isApplySameBunchPileup{"isApplySameBunchPileup", true, "Enable SameBunchPileup cut"};
103103
Configurable<bool> isApplyInelgt0{"isApplyInelgt0", false, "Enable INEL > 0 condition"};
104104
Configurable<bool> isApplyExtraPhiCut{"isApplyExtraPhiCut", false, "Enable extra phi cut"};
105+
Configurable<bool> isApplyTVX{"isApplyTVX", false, "Enable TVX trigger sel"};
105106

106107
void init(InitContext const&)
107108
{
@@ -125,7 +126,7 @@ struct StudyPnch {
125126
x->SetBinLabel(6, "INEL > 0");
126127
x->SetBinLabel(7, "|vz| < 10");
127128

128-
if (doprocessData || doprocessCorrelation || doprocessMonteCarlo || doprocessTreatedMonteCarlo) {
129+
if (doprocessData || doprocessCorrelation || doprocessMonteCarlo) {
129130
histos.add("PhiVsEtaHist", "PhiVsEtaHist", kTH2F, {axisPhi, axisEta}, false);
130131
}
131132
if (doprocessData) {
@@ -143,11 +144,6 @@ struct StudyPnch {
143144
histos.add("hMultiplicityMCgen", "hMultiplicityMCgen", kTH1F, {axisMult}, true);
144145
histos.add("hResponseMatrix", "hResponseMatrix", kTH2F, {axisMult, axisMult}, true);
145146
}
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-
}
151147
if (doprocessEvtLossSigLossMC) {
152148
histos.add("MCEventHist", "MCEventHist", kTH1F, {axisEvent}, false);
153149
auto hstat = histos.get<TH1>(HIST("MCEventHist"));
@@ -163,7 +159,7 @@ struct StudyPnch {
163159
bool isEventSelected(CheckCol const& col)
164160
{
165161
histos.fill(HIST("EventHist"), 1);
166-
if (!col.selection_bit(o2::aod::evsel::kIsTriggerTVX)) {
162+
if (isApplyTVX && !col.selection_bit(o2::aod::evsel::kIsTriggerTVX)) {
167163
return false;
168164
}
169165
histos.fill(HIST("EventHist"), 2);
@@ -282,6 +278,11 @@ struct StudyPnch {
282278
return nTrk;
283279
}
284280

281+
bool isINELgt0(auto nTrk)
282+
{
283+
return nTrk > 0;
284+
}
285+
285286
Filter fTrackSelectionITS = ncheckbit(aod::track::v001::detectorMap, (uint8_t)o2::aod::track::ITS) &&
286287
ncheckbit(aod::track::trackCutFlag, TrackSelectionIts);
287288
Filter fTrackSelectionTPC = ifnode(ncheckbit(aod::track::v001::detectorMap, (uint8_t)o2::aod::track::TPC),
@@ -295,7 +296,9 @@ struct StudyPnch {
295296
return;
296297
}
297298
auto mult = countNTracks(tracks);
298-
histos.fill(HIST("hMultiplicityData"), mult);
299+
if (isINELgt0(mult)) {
300+
histos.fill(HIST("hMultiplicityData"), mult);
301+
}
299302
}
300303

301304
void processCorrelation(ColDataTable::iterator const& cols, FilTrackDataTable const& tracks)
@@ -319,30 +322,14 @@ struct StudyPnch {
319322
}
320323
auto recTracksPart = RecTracks.sliceBy(perCollision, RecCol.globalIndex());
321324
auto multrec = countNTracksMcCol(recTracksPart, RecCol);
322-
histos.fill(HIST("hMultiplicityMCrec"), multrec);
323-
auto multgen = countGenTracks(GenParticles, mcCollision);
324-
histos.fill(HIST("hMultiplicityMCgen"), multgen);
325-
histos.fill(HIST("hResponseMatrix"), multrec, multgen);
326-
}
327-
}
328-
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;
325+
if (multrec > 0) {
326+
histos.fill(HIST("hMultiplicityMCrec"), multrec);
337327
}
338-
// Verify that the reconstructed collision corresponds to the given MC collision
339-
if (RecCol.mcCollisionId() != mcCollision.globalIndex()) {
340-
continue;
328+
auto multgen = countGenTracks(GenParticles, mcCollision);
329+
if (multgen > 0 && multrec > 0) {
330+
histos.fill(HIST("hMultiplicityMCgen"), multgen);
331+
histos.fill(HIST("hResponseMatrix"), multrec, multgen);
341332
}
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);
346333
}
347334
}
348335

@@ -351,13 +338,18 @@ struct StudyPnch {
351338
if (isApplyInelgt0 && !mcCollision.isInelGt0()) {
352339
return;
353340
}
341+
if (isApplyTVX && !(mcCollision.multMCFT0C() > 0 && mcCollision.multMCFT0A() > 0)) {
342+
return;
343+
}
354344
if (std::abs(mcCollision.posZ()) >= vtxRange) {
355345
return;
356346
}
357347
// All generated events
358348
histos.fill(HIST("MCEventHist"), 1);
359349
auto multAll = countGenTracks(GenParticles, mcCollision);
360-
histos.fill(HIST("hMultiplicityMCgenAll"), multAll);
350+
if (multAll > 0) {
351+
histos.fill(HIST("hMultiplicityMCgenAll"), multAll);
352+
}
361353

362354
bool atLeastOne = false;
363355
auto numcontributors = -999;
@@ -376,14 +368,15 @@ struct StudyPnch {
376368
if (atLeastOne) {
377369
histos.fill(HIST("MCEventHist"), 2);
378370
auto multSel = countGenTracks(GenParticles, mcCollision);
379-
histos.fill(HIST("hMultiplicityMCgenSel"), multSel);
371+
if (multSel > 0) {
372+
histos.fill(HIST("hMultiplicityMCgenSel"), multSel);
373+
}
380374
}
381375
}
382376

383377
PROCESS_SWITCH(StudyPnch, processData, "process data CentFT0C", false);
384378
PROCESS_SWITCH(StudyPnch, processCorrelation, "do correlation study in data", false);
385379
PROCESS_SWITCH(StudyPnch, processMonteCarlo, "process MC CentFT0C", false);
386-
PROCESS_SWITCH(StudyPnch, processTreatedMonteCarlo, "process Treated MC CentFT0C", false);
387380
PROCESS_SWITCH(StudyPnch, processEvtLossSigLossMC, "process Signal Loss, Event Loss", false);
388381
};
389382

0 commit comments

Comments
 (0)