Skip to content

Commit b6a8437

Browse files
committed
simplified filter
1 parent 0445012 commit b6a8437

File tree

1 file changed

+60
-30
lines changed

1 file changed

+60
-30
lines changed

PWGUD/Tasks/flowCorrelationsUpc.cxx

Lines changed: 60 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ using namespace o2::framework::expressions;
6262

6363
struct CalcNchUpc {
6464
O2_DEFINE_CONFIGURABLE(cfgZVtxCut, float, 10.0f, "Accepted z-vertex range")
65-
O2_DEFINE_CONFIGURABLE(cfgPtCutMin, float, 0.2f, "minimum accepted track pT")
65+
O2_DEFINE_CONFIGURABLE(cfgPtCutMin, float, 0.1f, "minimum accepted track pT")
6666
O2_DEFINE_CONFIGURABLE(cfgPtCutMax, float, 10.0f, "maximum accepted track pT")
67-
O2_DEFINE_CONFIGURABLE(cfgEtaCut, float, 0.8f, "Eta cut")
67+
O2_DEFINE_CONFIGURABLE(cfgEtaCut, float, 0.9f, "Eta cut")
6868
O2_DEFINE_CONFIGURABLE(cfgMinMixEventNum, int, 5, "Minimum number of events to mix")
6969

7070
// Added UPC Cuts
@@ -89,18 +89,25 @@ struct CalcNchUpc {
8989
{
9090
AxisSpec axisNch = {100, 0, 100};
9191
AxisSpec axisVrtx = {10, -10, 10};
92-
AxisSpec axisgap = {12, -6, 6};
92+
// AxisSpec axisgap = {12, -6, 6};
93+
// std::vector<AxisSpec> trueGapBins = {-2, -1, 0, 1, 2, 3};
94+
// AxisSpec axisgap = {trueGapBins, "true gap side"};
95+
96+
std::vector<double> binEdges = {-1.5, -0.5, 0.5, 1.5, 2.5, 3.5};
97+
AxisSpec axisgap = {binEdges, "true gap side"};
98+
registry.add("truegap", "truegap", {HistType::kTH1D, {axisgap}});
9399

94100
registry.add("Ncharge", "N_{charge}", {HistType::kTH1D, {axisNch}});
95101
registry.add("zVtx_all", "zVtx_all", {HistType::kTH1D, {axisVrtx}});
96102
registry.add("Nch_vs_zVtx", "Nch vs zVtx", {HistType::kTH2D, {axisVrtx, axisNch}});
97-
registry.add("truegap", "truegap", {HistType::kTH1D, {axisgap}});
103+
// registry.add("truegap", "truegap", {HistType::kTH1D, {axisgap}});
98104
}
99105

100106
void process(UDCollisionsFull::iterator const& collision, UdTracksFull const& tracks)
101107
{
102108
multiplicityNch(tracks.size());
103109
truegapside(sgSelector.trueGap(collision, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC));
110+
// LOG(info) << "truegapside=" << sgSelector.trueGap(collision, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC);
104111
registry.fill(HIST("Ncharge"), tracks.size());
105112
registry.fill(HIST("truegap"), sgSelector.trueGap(collision, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC));
106113
registry.fill(HIST("zVtx_all"), collision.posZ());
@@ -113,7 +120,7 @@ struct FlowCorrelationsUpc {
113120
O2_DEFINE_CONFIGURABLE(cfgIfVertex, bool, false, "choose vertex or not")
114121
O2_DEFINE_CONFIGURABLE(cfgPtCutMin, float, 0.1f, "minimum accepted track pT")
115122
O2_DEFINE_CONFIGURABLE(cfgPtCutMax, float, 10.0f, "maximum accepted track pT")
116-
O2_DEFINE_CONFIGURABLE(cfgEtaCut, float, 0.8f, "Eta cut")
123+
O2_DEFINE_CONFIGURABLE(cfgEtaCut, float, 0.9f, "Eta cut")
117124
O2_DEFINE_CONFIGURABLE(cfgMinMixEventNum, int, 5, "Minimum number of events to mix")
118125
O2_DEFINE_CONFIGURABLE(cfgMinMult, int, 0, "Minimum multiplicity for collision")
119126
O2_DEFINE_CONFIGURABLE(cfgMaxMult, int, 10, "Maximum multiplicity for collision")
@@ -124,7 +131,7 @@ struct FlowCorrelationsUpc {
124131
O2_DEFINE_CONFIGURABLE(cfgRadiusLow, float, 0.8, "Low radius for merging cut")
125132
O2_DEFINE_CONFIGURABLE(cfgRadiusHigh, float, 2.5, "High radius for merging cut")
126133
O2_DEFINE_CONFIGURABLE(cfgIsGoodItsLayers, bool, false, "whether choose itslayers")
127-
O2_DEFINE_CONFIGURABLE(cfgGapSide, int, 0, "0: gapside A;1:C")
134+
O2_DEFINE_CONFIGURABLE(cfgGapSide, int, 1, "0: gapside A;1:C")
128135
O2_DEFINE_CONFIGURABLE(cfgGapSideMerge, bool, false, "whether merge A and C side together")
129136
O2_DEFINE_CONFIGURABLE(cfgDcaxy, bool, true, "choose dcaxy")
130137
O2_DEFINE_CONFIGURABLE(cfgDcaz, bool, false, "choose dcaz")
@@ -161,14 +168,22 @@ struct FlowCorrelationsUpc {
161168

162169
// make the filters and cuts.
163170
Filter trackFilter = (aod::udtrack::isPVContributor == true);
164-
Filter collisionFilter = (((cfgGapSideMerge == true && (aod::udcollision::gapSide == (uint8_t)1 || aod::udcollision::gapSide == (uint8_t)0)) || aod::udcollision::gapSide == (uint8_t)cfgGapSide) && (cfgIfVertex == false || aod::collision::posZ < cfgZVtxCut) && (aod::udcollision::occupancyInTime > 0 && aod::udcollision::occupancyInTime < cfgCutOccupancyHigh) && ((cfgGapSideMerge == true && (aod::flowcorrupc::truegapside == 0 || aod::flowcorrupc::truegapside == 1)) || aod::flowcorrupc::truegapside == cfgGapSide) && (aod::flowcorrupc::multiplicity > cfgMinMult) && (aod::flowcorrupc::multiplicity < cfgMaxMult));
171+
Filter collisionFilter = (aod::udcollision::gapSide == (uint8_t)cfgGapSide && (cfgIfVertex == false || aod::collision::posZ < cfgZVtxCut) && (aod::udcollision::occupancyInTime > 0 && aod::udcollision::occupancyInTime < cfgCutOccupancyHigh) && aod::flowcorrupc::truegapside == 1 && (aod::flowcorrupc::multiplicity > cfgMinMult) && (aod::flowcorrupc::multiplicity < cfgMaxMult));
172+
// Filter collisionFilter = (((cfgGapSideMerge == true && (aod::udcollision::gapSide == (uint8_t)1 || aod::udcollision::gapSide == (uint8_t)0)) || aod::udcollision::gapSide == (uint8_t)cfgGapSide) && (cfgIfVertex == false || aod::collision::posZ < cfgZVtxCut) && (aod::udcollision::occupancyInTime > 0 && aod::udcollision::occupancyInTime < cfgCutOccupancyHigh) && ((cfgGapSideMerge == true && (aod::flowcorrupc::truegapside == 0 || aod::flowcorrupc::truegapside == 1)) || aod::flowcorrupc::truegapside == cfgGapSide) && (aod::flowcorrupc::multiplicity > cfgMinMult) && (aod::flowcorrupc::multiplicity < cfgMaxMult));
173+
// Filter trackFilter = (aod::udtrack::isPVContributor == true);
174+
// Filter collisionFilter = ((aod::flowcorrupc::multiplicity > cfgMinMult) && (aod::flowcorrupc::multiplicity < cfgMaxMult) && (aod::udcollision::gapSide == (uint8_t) 1) && (aod::flowcorrupc::truegapside == 1) && (aod::udcollision::occupancyInTime > 0 && aod::udcollision::occupancyInTime < cfgCutOccupancyHigh));
165175
// Filter collisionFilter = (nabs(aod::collision::posZ) < cfgZVtxCut) && (aod::flowcorrupc::multiplicity) > cfgMinMult && (aod::flowcorrupc::multiplicity) < cfgMaxMult && (aod::evsel::sel8) == true;
166176
// Filter trackFilter = (nabs(aod::track::eta) < cfgEtaCut) && (aod::track::pt > cfgPtCutMin) && (aod::track::pt < cfgPtCutMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true));
167177

168178
using UdTracks = soa::Filtered<soa::Join<aod::UDTracks, aod::UDTracksExtra, aod::UDTracksPID>>;
169179
using UdTracksFull = soa::Filtered<soa::Join<aod::UDTracks, aod::UDTracksPID, aod::UDTracksExtra, aod::UDTracksFlags, aod::UDTracksDCA>>;
180+
170181
using UDCollisionsFull = soa::Filtered<soa::Join<aod::UDCollisions, aod::SGCollisions, aod::UDCollisionsSels, aod::UDZdcsReduced, aod::Multiplicity, aod::Truegapside, aod::UDCollisionSelExtras>>;
171182

183+
// using UdTracks = soa::Join<aod::UDTracks, aod::UDTracksExtra, aod::UDTracksPID>;
184+
// using UdTracksFull = soa::Join<aod::UDTracks, aod::UDTracksPID, aod::UDTracksExtra, aod::UDTracksFlags, aod::UDTracksDCA>;
185+
// using UDCollisionsFull = soa::Join<aod::UDCollisions, aod::SGCollisions, aod::UDCollisionsSels, aod::UDZdcsReduced, aod::Multiplicity, aod::Truegapside, aod::UDCollisionSelExtra>;
186+
172187
// Define the outputs
173188
OutputObj<CorrelationContainer> same{Form("sameEvent_%i_%i", static_cast<int>(cfgMinMult), static_cast<int>(cfgMaxMult))};
174189
OutputObj<CorrelationContainer> mixed{Form("mixedEvent_%i_%i", static_cast<int>(cfgMinMult), static_cast<int>(cfgMaxMult))};
@@ -177,6 +192,8 @@ struct FlowCorrelationsUpc {
177192

178193
void init(InitContext&)
179194
{
195+
LOG(info) << "cfgGapSide = " << cfgGapSide;
196+
LOG(info) << "cfgGapSide value type: " << typeid(cfgGapSide).name();
180197
LOGF(info, "Starting init");
181198
// Make histograms to check the distributions after cuts
182199
registry.add("deltaEta_deltaPhi_same", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEta}}); // check to see the delta eta and delta phi distribution
@@ -190,7 +207,11 @@ struct FlowCorrelationsUpc {
190207

191208
registry.add("Trig_hist", "", {HistType::kTHnSparseF, {{axisSample, axisVertex, axisPtTrigger}}});
192209

193-
registry.add("eventcount", "bin", {HistType::kTH1F, {{10, 0, 10, "bin"}}}); // histogram to see how many events are in the same and mixed event
210+
registry.add("eventcount_same", "bin", {HistType::kTH1F, {{10, 0, 10, "bin"}}}); // histogram to see how many events are in the same and mixed event
211+
registry.add("eventcount_mixed", "bin", {HistType::kTH1F, {{10, 0, 10, "bin"}}}); // histogram to see how many events are in the same and mixed event
212+
213+
registry.add("trackcount_same", "bin", {HistType::kTH1F, {{10, 0, 10, "bin"}}}); // histogram to see how many tracks are in the same and mixed event
214+
registry.add("trackcount_mixed", "bin", {HistType::kTH1F, {{10, 0, 10, "bin"}}}); // histogram to see how many tracks are in the same and mixed event
194215

195216
std::vector<AxisSpec> corrAxis = {{axisSample, "Sample"},
196217
{axisVertex, "z-vtx (cm)"},
@@ -352,23 +373,26 @@ struct FlowCorrelationsUpc {
352373

353374
void processSame(UDCollisionsFull::iterator const& collision, UdTracksFull const& tracks)
354375
{
376+
LOG(info) << "Event passed filter: truegapside=" << collision.truegapside();
355377
// if (tracks.size() < cfgMinMult || tracks.size() > cfgMaxMult) {
356378
// return;
357379
// }
358-
// if (cfgIsGoodItsLayers && collision.trs() == 0) {
380+
// registry.fill(HIST("eventcount_same"), 0.5);
381+
// if(collision.gapSide() !=0){
359382
// return;
360383
// }
361-
384+
registry.fill(HIST("eventcount_same"), 1.5);
362385
// if (cfgGapSideMerge) {
363386
// int gapSide = collision.gapSide();
364387
// if (gapSide != 0 && gapSide != 1) {
365388
// return;
366389
// }
367-
// int trueGapSide = sgSelector.trueGap(collision, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC);
368-
// int gapSide1 = trueGapSide;
369-
// if (gapSide1 != 0 && gapSide1 != 1) {
370-
// return;
371-
// }
390+
// int trueGapSide = sgSelector.trueGap(collision, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC);
391+
// int gapSide1 = trueGapSide;
392+
// if (gapSide1 != 0) {
393+
// return;
394+
// }
395+
registry.fill(HIST("eventcount_same"), 2.5);
372396
// }
373397
// if (!cfgGapSideMerge) {
374398
// int trueGapSide = sgSelector.trueGap(collision, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC);
@@ -385,9 +409,10 @@ struct FlowCorrelationsUpc {
385409
// if (cfgEvSelOccupancy && (occupancy < cfgCutOccupancyLow || occupancy > cfgCutOccupancyHigh)) {
386410
// return;
387411
// }
412+
registry.fill(HIST("eventcount_same"), 3.5);
388413
int runIndex = collision.runNumber();
389414

390-
registry.fill(HIST("eventcount"), SameEvent); // because its same event i put it in the 1 bin
415+
// registry.fill(HIST("eventcount"), SameEvent); // because its same event i put it in the 1 bin
391416
registry.fill(HIST("Nch_vs_zVtx"), collision.posZ(), tracks.size());
392417
fillYield(collision, tracks);
393418
fillCorrelations<CorrelationContainer::kCFStepReconstructed>(tracks, tracks, collision.posZ(), SameEvent, runIndex); // fill the SE histogram and Sparse
@@ -408,14 +433,18 @@ struct FlowCorrelationsUpc {
408433
Pair<UDCollisionsFull, UdTracksFull, UdTracksFull, MixedBinning> pairs{binningOnVtxAndMult, cfgMinMixEventNum, -1, collisions, tracksTuple, &cache}; // -1 is the number of the bin to skip
409434

410435
for (auto const& [collision1, tracks1, collision2, tracks2] : pairs) {
411-
registry.fill(HIST("eventcount"), MixedEvent); // fill the mixed event in the 3 bin
436+
// registry.fill(HIST("eventcount"), MixedEvent); // fill the mixed event in the 3 bin
412437
// if (tracks1.size() < cfgMinMult || tracks1.size() > cfgMaxMult || tracks2.size() < cfgMinMult || tracks2.size() > cfgMaxMult) {
413438
// continue;
414439
// }
415-
// registry.fill(HIST("eventcount"), 4.5);
440+
registry.fill(HIST("eventcount_same"), 4.5);
416441
// if (cfgIsGoodItsLayers && (collision1.trs() == 0 || collision2.trs() == 0)) {
417442
// continue;
418443
// }
444+
// if(collision1.gapSide() != 0 || collision2.gapSide() != 0){
445+
// continue;
446+
// }
447+
registry.fill(HIST("eventcount_same"), 5.5);
419448
// registry.fill(HIST("eventcount"), 5.5);
420449
// if (cfgGapSideMerge) {
421450
// int gapSide = collision1.gapSide();
@@ -429,22 +458,23 @@ struct FlowCorrelationsUpc {
429458
// }
430459
// }
431460
// if (!cfgGapSideMerge) {
432-
// int trueGapSide = sgSelector.trueGap(collision1, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC);
433-
// int gapSide1 = trueGapSide;
434-
// if (gapSide1 != cfgGapSide) {
435-
// continue;
436-
// }
461+
// int trueGapSide = sgSelector.trueGap(collision1, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC);
462+
// int gapSide1 = trueGapSide;
463+
// if (gapSide1 != 0) {
464+
// continue;
465+
// }
437466
// }
438467
// if (cfgGapSideMerge) {
439468
// int gapSide = collision2.gapSide();
440469
// if (gapSide != 0 && gapSide != 1) {
441470
// continue;
442471
// }
443-
// int trueGapSide = sgSelector.trueGap(collision2, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC);
444-
// int gapSide2 = trueGapSide;
445-
// if (gapSide2 != 0 && gapSide2 != 1) {
446-
// continue;
447-
// }
472+
// trueGapSide = sgSelector.trueGap(collision2, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC);
473+
// int gapSide2 = trueGapSide;
474+
// if (gapSide2 != 0) {
475+
// continue;
476+
// }
477+
registry.fill(HIST("eventcount_same"), 6.5);
448478
// }
449479
// if (!cfgGapSideMerge) {
450480
// int trueGapSide = sgSelector.trueGap(collision2, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC);
@@ -453,7 +483,7 @@ struct FlowCorrelationsUpc {
453483
// continue;
454484
// }
455485
// }
456-
registry.fill(HIST("eventcount"), 6.5);
486+
// registry.fill(HIST("eventcount"), 6.5);
457487
// float vtxz = collision1.posZ();
458488
// if (cfgIfVertex && abs(vtxz) > cfgZVtxCut) {
459489
// continue;
@@ -470,7 +500,7 @@ struct FlowCorrelationsUpc {
470500
// if (cfgEvSelOccupancy && (occupancy < cfgCutOccupancyLow || occupancy > cfgCutOccupancyHigh)) {
471501
// continue;
472502
// }
473-
registry.fill(HIST("eventcount"), MixedFinal);
503+
registry.fill(HIST("eventcount_same"), 7.5);
474504
fillCorrelations<CorrelationContainer::kCFStepReconstructed>(tracks1, tracks2, collision1.posZ(), MixedEvent, collision1.runNumber()); // fill the ME histogram and Sparse
475505
}
476506
}

0 commit comments

Comments
 (0)