Skip to content

Commit cecb2fe

Browse files
authored
[PWGUD] add event consistency flag (#15624)
1 parent a51139e commit cecb2fe

File tree

1 file changed

+43
-3
lines changed

1 file changed

+43
-3
lines changed

PWGUD/Tasks/flowCumulantsUpc.cxx

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,18 @@ struct FlowCumulantsUpc {
125125
O2_DEFINE_CONFIGURABLE(cfgDcazCut, float, 10.0, "dcaz cut")
126126
O2_DEFINE_CONFIGURABLE(cfgItsClusterSize, unsigned int, 5, "ITS cluster size")
127127
O2_DEFINE_CONFIGURABLE(cfgMaxTPCChi2NCl, int, 4, "tpcchi2")
128+
O2_DEFINE_CONFIGURABLE(cfgConsistentEventFlag, int, 0, "Flag to select consistent events - 0: off, 1: v2{2} gap calculable, 2: v2{4} full calculable, 4: v2{4} gap calculable, 8: v2{4} 3sub calculable")
129+
128130
Configurable<std::vector<std::string>> cfgUserDefineGFWCorr{"cfgUserDefineGFWCorr", std::vector<std::string>{"refN02 {2} refP02 {-2}", "refN12 {2} refP12 {-2}"}, "User defined GFW CorrelatorConfig"};
129131
Configurable<std::vector<std::string>> cfgUserDefineGFWName{"cfgUserDefineGFWName", std::vector<std::string>{"Ch02Gap22", "Ch12Gap22"}, "User defined GFW Name"};
130132
Configurable<std::vector<int>> cfgRunRemoveList{"cfgRunRemoveList", std::vector<int>{-1}, "excluded run numbers"};
133+
Configurable<std::vector<float>> cfgConsistentEventVector{"cfgConsistentEventVector", std::vector<float>{-0.8, -0.5, -0.4, 0.4, 0.5, 0.8}, "eta regions: left(min,max), mid(min,max), right(min,max)"};
134+
struct AcceptedTracks {
135+
int nNeg;
136+
int nMid;
137+
int nPos;
138+
int nFull;
139+
};
131140

132141
ConfigurableAxis axisPtHist{"axisPtHist", {100, 0., 10.}, "pt axis for histograms"};
133142
ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2, 2.2, 2.4, 2.6, 2.8, 3, 3.5, 4, 5, 6, 8, 10}, "pt axis for histograms"};
@@ -217,13 +226,15 @@ struct FlowCumulantsUpc {
217226

218227
// Add some output objects to the histogram registry
219228
// Event QA
220-
registry.add("hEventCount", "Number of Event;; Count", {HistType::kTH1D, {{5, 0, 5}}});
229+
registry.add("hEventCount", "Number of Event;; Count", {HistType::kTH1D, {{6, 0, 6}}});
221230
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(1, "Filtered event");
222231
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(2, "after gapside selection");
223232
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(3, "after its selection");
224233
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(4, "after pt selection");
225234
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(5, "after occupancy");
226-
registry.add("hTrackCount", "Number of tracks;; Count", {HistType::kTH1D, {{5, 0, 5}}});
235+
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(6, "after consistency check");
236+
237+
registry.add("hTrackCount", "Number of tracks;; Count", {HistType::kTH1D, {{7, 0, 7}}});
227238
registry.get<TH1>(HIST("hTrackCount"))->GetXaxis()->SetBinLabel(1, "after event selection");
228239
registry.get<TH1>(HIST("hTrackCount"))->GetXaxis()->SetBinLabel(2, "PVContributor");
229240
registry.get<TH1>(HIST("hTrackCount"))->GetXaxis()->SetBinLabel(3, "dcaz");
@@ -955,7 +966,7 @@ struct FlowCumulantsUpc {
955966
registry.fill(HIST("hMult"), tracks.size());
956967
registry.fill(HIST("hCent"), cent);
957968
fGFW->Clear();
958-
if (cfgIfVertex && abs(vtxz) > cfgCutVertex) {
969+
if (cfgIfVertex && std::abs(vtxz) > cfgCutVertex) {
959970
return;
960971
}
961972
registry.fill(HIST("hEventCount"), 3.5);
@@ -971,6 +982,8 @@ struct FlowCumulantsUpc {
971982
if (cfgUseNch) {
972983
independent = static_cast<float>(tracks.size());
973984
}
985+
AcceptedTracks acceptedTracks{0, 0, 0, 0};
986+
std::vector<float> consistentEventVector = cfgConsistentEventVector;
974987

975988
for (const auto& track : tracks) {
976989
registry.fill(HIST("hChi2prTPCcls"), track.tpcChi2NCl());
@@ -996,6 +1009,16 @@ struct FlowCumulantsUpc {
9961009
continue;
9971010
}
9981011
registry.fill(HIST("hPt"), track.pt());
1012+
1013+
if (cfgConsistentEventFlag && consistentEventVector.size() == 6) { // o2-linter: disable=magic-number (size match)
1014+
acceptedTracks.nFull += 1;
1015+
if (eta > consistentEventVector[0] && eta < consistentEventVector[1])
1016+
acceptedTracks.nNeg += 1;
1017+
if (eta > consistentEventVector[2] && eta < consistentEventVector[3])
1018+
acceptedTracks.nMid += 1;
1019+
if (eta > consistentEventVector[4] && eta < consistentEventVector[5])
1020+
acceptedTracks.nPos += 1;
1021+
}
9991022
if (withinPtRef) {
10001023
registry.fill(HIST("hPhi"), phi);
10011024
registry.fill(HIST("hPhiWeighted"), phi, wacc);
@@ -1017,6 +1040,23 @@ struct FlowCumulantsUpc {
10171040
registry.fill(HIST("hEtaNch2D"), eta, tracks.size());
10181041
}
10191042
registry.fill(HIST("hTrackCorrection2d"), tracks.size(), nTracksCorrected);
1043+
if (cfgConsistentEventFlag) {
1044+
if (cfgConsistentEventFlag & 1) {
1045+
if (!acceptedTracks.nPos || !acceptedTracks.nNeg)
1046+
return;
1047+
} else if (cfgConsistentEventFlag & 2) {
1048+
if (acceptedTracks.nFull < 4) // o2-linter: disable=magic-number (at least four tracks in full acceptance)
1049+
return;
1050+
} else if (cfgConsistentEventFlag & 4) {
1051+
if (acceptedTracks.nPos < 2 || acceptedTracks.nNeg < 2) // o2-linter: disable=magic-number (at least two tracks in each subevent)
1052+
return;
1053+
}
1054+
if (cfgConsistentEventFlag & 8) {
1055+
if (acceptedTracks.nPos < 2 || acceptedTracks.nMid < 2 || acceptedTracks.nNeg < 2) // o2-linter: disable=magic-number (at least two tracks in all three subevents)
1056+
return;
1057+
}
1058+
}
1059+
registry.fill(HIST("hEventCount"), 5.5);
10201060

10211061
// Filling Flow Container
10221062
for (uint l_ind = 0; l_ind < corrconfigs.size(); l_ind++) {

0 commit comments

Comments
 (0)