Skip to content

Commit 246af06

Browse files
authored
[PWGUD] fix gapside selection (#14971)
1 parent f92138a commit 246af06

File tree

2 files changed

+356
-227
lines changed

2 files changed

+356
-227
lines changed

PWGUD/Tasks/flowCorrelationsUpc.cxx

Lines changed: 107 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111

1212
/// \file flowCorrelationsUpc.cxx
1313
/// \brief Provides a sparse with usefull two particle correlation info
14-
/// \author Mingrui Zhao ([email protected], [email protected])
14+
/// \author Yongxi Du ([email protected]), Mingrui Zhao ([email protected], [email protected])
1515
/// copied from Thor Jensen ([email protected]) and Debojit Sarkar ([email protected])
1616

1717
#include "PWGCF/Core/CorrelationContainer.h"
1818
#include "PWGCF/Core/PairCuts.h"
1919
#include "PWGCF/DataModel/CorrelationsDerived.h"
2020
#include "PWGUD/Core/SGSelector.h"
21+
#include "PWGUD/DataModel/SGTables.h"
2122
#include "PWGUD/DataModel/UDTables.h"
2223

2324
#include "Common/Core/RecoDecay.h"
@@ -94,7 +95,8 @@ struct CalcNchUpc {
9495

9596
struct FlowCorrelationsUpc {
9697
O2_DEFINE_CONFIGURABLE(cfgZVtxCut, float, 10.0f, "Accepted z-vertex range")
97-
O2_DEFINE_CONFIGURABLE(cfgPtCutMin, float, 0.2f, "minimum accepted track pT")
98+
O2_DEFINE_CONFIGURABLE(cfgIfVertex, bool, false, "choose vertex or not")
99+
O2_DEFINE_CONFIGURABLE(cfgPtCutMin, float, 0.1f, "minimum accepted track pT")
98100
O2_DEFINE_CONFIGURABLE(cfgPtCutMax, float, 10.0f, "maximum accepted track pT")
99101
O2_DEFINE_CONFIGURABLE(cfgEtaCut, float, 0.8f, "Eta cut")
100102
O2_DEFINE_CONFIGURABLE(cfgMinMixEventNum, int, 5, "Minimum number of events to mix")
@@ -106,6 +108,17 @@ struct FlowCorrelationsUpc {
106108
O2_DEFINE_CONFIGURABLE(cfgCutMerging, float, 0.02, "Merging cut on track merge")
107109
O2_DEFINE_CONFIGURABLE(cfgRadiusLow, float, 0.8, "Low radius for merging cut")
108110
O2_DEFINE_CONFIGURABLE(cfgRadiusHigh, float, 2.5, "High radius for merging cut")
111+
O2_DEFINE_CONFIGURABLE(cfgIsGoodItsLayers, bool, false, "whether choose itslayers")
112+
O2_DEFINE_CONFIGURABLE(cfgGapSideA, bool, true, "choose gapside A")
113+
O2_DEFINE_CONFIGURABLE(cfgGapSideC, bool, false, "choose gapside C")
114+
O2_DEFINE_CONFIGURABLE(cfgDcaxy, bool, true, "choose dcaxy")
115+
O2_DEFINE_CONFIGURABLE(cfgDcaz, bool, false, "choose dcaz")
116+
O2_DEFINE_CONFIGURABLE(cfgDcazCut, float, 10.0, "dcaz cut")
117+
O2_DEFINE_CONFIGURABLE(cfgItsClusterSize, unsigned int, 5, "ITS cluster size")
118+
O2_DEFINE_CONFIGURABLE(cfgMaxTPCChi2NCl, int, 4, "tpcchi2")
119+
O2_DEFINE_CONFIGURABLE(cfgEvSelOccupancy, bool, true, "Occupancy cut")
120+
O2_DEFINE_CONFIGURABLE(cfgCutOccupancyHigh, int, 1000, "High cut on TPC occupancy")
121+
O2_DEFINE_CONFIGURABLE(cfgCutOccupancyLow, int, 0, "Low cut on TPC occupancy")
109122

110123
ConfigurableAxis axisVertex{"axisVertex", {10, -10, 10}, "vertex axis for histograms"};
111124
ConfigurableAxis axisEta{"axisEta", {40, -1., 1.}, "eta axis for histograms"};
@@ -130,7 +143,6 @@ struct FlowCorrelationsUpc {
130143
Configurable<float> cfgCutFT0A{"cfgCutFT0A", 150., "FT0A threshold"};
131144
Configurable<float> cfgCutFT0C{"cfgCutFT0C", 50., "FT0C threshold"};
132145
Configurable<float> cfgCutZDC{"cfgCutZDC", 10., "ZDC threshold"};
133-
Configurable<float> cfgGapSideSelection{"cfgGapSideSelection", 2, "gap selection"};
134146

135147
// make the filters and cuts.
136148
// Filter collisionFilter = (nabs(aod::collision::posZ) < cfgZVtxCut) && (aod::flowcorrupc::multiplicity) > cfgMinMult && (aod::flowcorrupc::multiplicity) < cfgMaxMult && (aod::evsel::sel8) == true;
@@ -212,29 +224,29 @@ struct FlowCorrelationsUpc {
212224
template <typename TTrack>
213225
bool trackSelected(TTrack track)
214226
{
227+
registry.fill(HIST("hTrackCount"), 0.5);
215228
// UPC selection
216229
if (!track.isPVContributor()) {
217230
return false;
218231
}
219-
constexpr float kDcazCut = 2.0;
220-
if (!(std::fabs(track.dcaZ()) < kDcazCut)) {
232+
registry.fill(HIST("hTrackCount"), 1.5);
233+
if (cfgDcaz && !(std::fabs(track.dcaZ()) < cfgDcazCut)) {
221234
return false;
222235
}
236+
registry.fill(HIST("hTrackCount"), 2.5);
223237
double dcaLimit = 0.0105 + 0.035 / std::pow(track.pt(), 1.1);
224-
if (!(std::fabs(track.dcaXY()) < dcaLimit)) {
238+
if (cfgDcaxy && !(std::fabs(track.dcaXY()) < dcaLimit)) {
225239
return false;
226240
}
227-
constexpr int kMinITSClusters = 5;
228-
constexpr int kMaxTPCChi2NCl = 4;
229-
230-
if (track.itsClusterSizes() <= kMinITSClusters) {
241+
registry.fill(HIST("hTrackCount"), 3.5);
242+
if (track.itsClusterSizes() <= cfgItsClusterSize) {
231243
return false;
232244
}
233-
if (track.tpcChi2NCl() >= kMaxTPCChi2NCl) {
245+
registry.fill(HIST("hTrackCount"), 4.5);
246+
if (track.tpcChi2NCl() >= cfgMaxTPCChi2NCl) {
234247
return false;
235248
}
236-
if (track.pt() < cfgPtCutMin || track.pt() > cfgPtCutMax)
237-
return false;
249+
registry.fill(HIST("hTrackCount"), 5.5);
238250
return true;
239251
}
240252

@@ -324,23 +336,47 @@ struct FlowCorrelationsUpc {
324336
if (tracks.size() < cfgMinMult || tracks.size() > cfgMaxMult) {
325337
return;
326338
}
327-
if (collision.trs() == 0) {
339+
if (cfgIsGoodItsLayers && collision.trs() == 0) {
328340
return;
329341
}
330342

331343
int gapSide = collision.gapSide();
332-
const int minGapSide = 0;
333-
const int maxGapSide = 2;
334-
if (gapSide > minGapSide && gapSide < maxGapSide) {
344+
if (gapSide == 0) {
345+
if (!cfgGapSideA) {
346+
return;
347+
}
348+
}
349+
if (gapSide == 1) {
350+
if (!cfgGapSideC) {
351+
return;
352+
}
353+
}
354+
if (gapSide != 0 && gapSide != 1) {
335355
return;
336356
}
337-
338357
int trueGapSide = sgSelector.trueGap(collision, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC);
339358
gapSide = trueGapSide;
340-
if (gapSide == cfgGapSideSelection) {
359+
if (gapSide == 0) {
360+
if (!cfgGapSideA) {
361+
return;
362+
}
363+
}
364+
if (gapSide == 1) {
365+
if (!cfgGapSideC) {
366+
return;
367+
}
368+
}
369+
if (gapSide != 0 && gapSide != 1) {
370+
return;
371+
}
372+
float vtxz = collision.posZ();
373+
if (cfgIfVertex && abs(vtxz) > cfgZVtxCut) {
374+
return;
375+
}
376+
int occupancy = collision.occupancyInTime();
377+
if (cfgEvSelOccupancy && (occupancy < cfgCutOccupancyLow || occupancy > cfgCutOccupancyHigh)) {
341378
return;
342379
}
343-
344380
int runIndex = collision.runNumber();
345381

346382
registry.fill(HIST("eventcount"), SameEvent); // because its same event i put it in the 1 bin
@@ -365,29 +401,66 @@ struct FlowCorrelationsUpc {
365401
if (tracks1.size() < cfgMinMult || tracks1.size() > cfgMaxMult || tracks2.size() < cfgMinMult || tracks2.size() > cfgMaxMult) {
366402
continue;
367403
}
368-
if (collision1.trs() == 0 || collision2.trs() == 0) {
404+
if (cfgIsGoodItsLayers && (collision1.trs() == 0 || collision2.trs() == 0)) {
369405
continue;
370406
}
371407

372-
const int minGapSide = 0;
373-
const int maxGapSide = 2;
374-
if (collision1.gapSide() > minGapSide && collision1.gapSide() < maxGapSide) {
375-
continue;
408+
int gapSide1 = collision1.gapSide();
409+
if (gapSide1 == 0) {
410+
if (!cfgGapSideA) {
411+
continue;
412+
}
376413
}
377-
if (collision2.gapSide() > minGapSide && collision2.gapSide() < maxGapSide) {
378-
continue;
414+
if (gapSide1 == 1) {
415+
if (!cfgGapSideC) {
416+
continue;
417+
}
379418
}
380-
381-
int trueGapSide = sgSelector.trueGap(collision1, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC);
382-
int gapSide = trueGapSide;
383-
if (gapSide == cfgGapSideSelection) {
419+
int gapSide2 = collision2.gapSide();
420+
if (gapSide2 == 0) {
421+
if (!cfgGapSideA) {
422+
continue;
423+
}
424+
}
425+
if (gapSide2 == 1) {
426+
if (!cfgGapSideC) {
427+
continue;
428+
}
429+
}
430+
int trueGapSide1 = sgSelector.trueGap(collision1, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC);
431+
int trueGapSide2 = sgSelector.trueGap(collision2, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC);
432+
if (trueGapSide1 != trueGapSide2) {
384433
continue;
385434
}
386-
trueGapSide = sgSelector.trueGap(collision2, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC);
387-
gapSide = trueGapSide;
388-
if (gapSide == cfgGapSideSelection) {
435+
if (trueGapSide1 == 0) {
436+
if (!cfgGapSideA) {
437+
continue;
438+
}
439+
}
440+
if (trueGapSide2 == 1) {
441+
if (!cfgGapSideC) {
442+
continue;
443+
}
444+
}
445+
if ((gapSide1 != 0 && gapSide1 != 1) || (gapSide2 != 0 && gapSide2 != 1)) {
389446
continue;
390447
}
448+
float vtxz = collision1.posZ();
449+
if (cfgIfVertex && abs(vtxz) > cfgZVtxCut) {
450+
return;
451+
}
452+
int occupancy = collision1.occupancyInTime();
453+
if (cfgEvSelOccupancy && (occupancy < cfgCutOccupancyLow || occupancy > cfgCutOccupancyHigh)) {
454+
return;
455+
}
456+
vtxz = collision2.posZ();
457+
if (cfgIfVertex && abs(vtxz) > cfgZVtxCut) {
458+
return;
459+
}
460+
occupancy = collision2.occupancyInTime();
461+
if (cfgEvSelOccupancy && (occupancy < cfgCutOccupancyLow || occupancy > cfgCutOccupancyHigh)) {
462+
return;
463+
}
391464
registry.fill(HIST("eventcount"), MixedEvent); // fill the mixed event in the 3 bin
392465
fillCorrelations<CorrelationContainer::kCFStepReconstructed>(tracks1, tracks2, collision1.posZ(), MixedEvent, collision1.runNumber()); // fill the ME histogram and Sparse
393466
}

0 commit comments

Comments
 (0)