Skip to content

Commit ad96fd2

Browse files
authored
[PWGLF] Added a switch for QA plots
1 parent 6c59df4 commit ad96fd2

File tree

1 file changed

+49
-19
lines changed

1 file changed

+49
-19
lines changed

PWGLF/Utils/collisionCuts.h

Lines changed: 49 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,17 @@
1616
/// original author: Laura Serksnyte, TU München
1717
///
1818
/// \author Bong-Hwi Lim <bong-hwi.lim@cern.ch>
19+
/// \author Hirak Kumar Koley <hirak.koley@cern.ch>
1920

2021
#ifndef PWGLF_UTILS_COLLISIONCUTS_H_
2122
#define PWGLF_UTILS_COLLISIONCUTS_H_
2223

23-
#include <vector>
24+
#include "Common/DataModel/EventSelection.h"
2425

2526
#include "Framework/HistogramRegistry.h"
2627
#include "Framework/Logger.h"
27-
#include "Common/DataModel/EventSelection.h"
28+
29+
#include <vector>
2830

2931
namespace o2::analysis
3032
{
@@ -185,13 +187,15 @@ class CollisonCuts
185187
/// \param col Collision
186188
/// \return whether or not the collisions fulfills the specified selections
187189
template <typename T>
188-
bool isSelected(T const& col)
190+
bool isSelected(T const& col, const bool QA = true)
189191
{
190-
mHistogramRegistry->fill(HIST("Event/posZ_noCut"), col.posZ());
191-
if (mCheckIsRun3) {
192-
mHistogramRegistry->fill(HIST("Event/trackOccupancyInTimeRange_noCut"), col.trackOccupancyInTimeRange());
192+
if (QA) {
193+
mHistogramRegistry->fill(HIST("Event/posZ_noCut"), col.posZ());
194+
if (mCheckIsRun3) {
195+
mHistogramRegistry->fill(HIST("Event/trackOccupancyInTimeRange_noCut"), col.trackOccupancyInTimeRange());
196+
}
197+
mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kAllEvent);
193198
}
194-
mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kAllEvent);
195199
if (std::abs(col.posZ()) > mZvtxMax) {
196200
LOGF(debug, "Vertex out of range");
197201
return false;
@@ -204,48 +208,66 @@ class CollisonCuts
204208
}
205209
mInitialColBitScan = false;
206210
}
207-
mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagZvertex);
211+
if (QA) {
212+
mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagZvertex);
213+
}
208214
if (mCheckIsRun3) { // Run3 case
209215
if (!col.selection_bit(aod::evsel::kIsTriggerTVX) && mTriggerTVXselection) {
210216
LOGF(debug, "Offline selection TVX failed (Run3)");
211217
return false;
212218
}
213-
mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagTrigerTVX);
219+
if (QA) {
220+
mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagTrigerTVX);
221+
}
214222
if (!col.selection_bit(aod::evsel::kNoTimeFrameBorder) && mApplyTFBorderCut) {
215223
LOGF(debug, "Time frame border cut failed");
216224
return false;
217225
}
218-
mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagTimeFrameBorder);
226+
if (QA) {
227+
mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagTimeFrameBorder);
228+
}
219229
if (!col.selection_bit(aod::evsel::kNoITSROFrameBorder) && mApplyNoITSROBorderCut) {
220230
LOGF(debug, "NoITSRO frame border cut failed");
221231
return false;
222232
}
223-
mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagITSROFrameBorder);
233+
if (QA) {
234+
mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagITSROFrameBorder);
235+
}
224236
if (!col.sel8() && mCheckOffline) {
225237
LOGF(debug, "Offline selection failed (Run3)");
226238
return false;
227239
}
228-
mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagSel8);
240+
if (QA) {
241+
mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagSel8);
242+
}
229243
if (!col.selection_bit(o2::aod::evsel::kIsVertexITSTPC) && mApplyITSTPCvertex) {
230244
LOGF(debug, "ITS-TPC matching cut failed");
231245
return false;
232246
}
233-
mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagVertexITSTPC);
247+
if (QA) {
248+
mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagVertexITSTPC);
249+
}
234250
if (!col.selection_bit(o2::aod::evsel::kNoSameBunchPileup) && mApplyPileupRejection) {
235251
LOGF(debug, "Pileup rejection failed");
236252
return false;
237253
}
238-
mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagBunchPileup);
254+
if (QA) {
255+
mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagBunchPileup);
256+
}
239257
if (!col.selection_bit(o2::aod::evsel::kNoCollInTimeRangeNarrow) && mApplyCollInTimeRangeNarrow) {
240258
LOGF(debug, "NoCollInTimeRangeNarrow selection failed");
241259
return false;
242260
}
243-
mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kNoCollInTimeRangeNarrow);
261+
if (QA) {
262+
mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kNoCollInTimeRangeNarrow);
263+
}
244264
if (!col.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV) && mApplyZvertexTimedifference) {
245265
LOGF(debug, "Z-vertex time difference cut failed");
246266
return false;
247267
}
248-
mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagZvtxFT0vsPV);
268+
if (QA) {
269+
mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagZvtxFT0vsPV);
270+
}
249271
if (mtrackOccupancyInTimeRangeMax > 0 && col.trackOccupancyInTimeRange() > mtrackOccupancyInTimeRangeMax) {
250272
LOGF(debug, "trackOccupancyInTimeRange selection failed");
251273
return false;
@@ -254,12 +276,16 @@ class CollisonCuts
254276
LOGF(debug, "trackOccupancyInTimeRange selection failed");
255277
return false;
256278
}
257-
mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagOccupancy);
279+
if (QA) {
280+
mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagOccupancy);
281+
}
258282
if ((!col.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) && mApplyCollInTimeRangeStandard) {
259283
LOGF(debug, "NoCollInTimeRangeStandard selection failed");
260284
return false;
261285
}
262-
mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kNoCollInTimeRangeStandard);
286+
if (QA) {
287+
mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kNoCollInTimeRangeStandard);
288+
}
263289
} else { // Run2 case
264290
if (mCheckOffline && !col.sel7()) {
265291
LOGF(debug, "Offline selection failed (sel7)");
@@ -275,9 +301,13 @@ class CollisonCuts
275301
LOGF(debug, "INELgtZERO selection failed");
276302
return false;
277303
}
304+
if (QA) {
305+
mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kAllpassed);
306+
}
307+
}
308+
if (QA) {
278309
mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kAllpassed);
279310
}
280-
mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kAllpassed);
281311
return true;
282312
}
283313

0 commit comments

Comments
 (0)