Skip to content

Commit 22120a2

Browse files
committed
fix gapside selection
1 parent de81db0 commit 22120a2

File tree

1 file changed

+80
-27
lines changed

1 file changed

+80
-27
lines changed

PWGUD/Tasks/flowCumulantsUpc.cxx

Lines changed: 80 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
2+
* Copyright CERN for the benefit of the ALICE Collaboration.
3+
* In applying this license CERN does not waive the privileges and immunities
4+
* granted to it by virtue of its status as an Intergovernmental Organization
5+
* or submit itself to any jurisdiction.
6+
*/
17
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
28
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
39
// All rights not expressly granted are reserved.
@@ -10,7 +16,7 @@
1016
// or submit itself to any jurisdiction.
1117

1218
/// \file flowCumulantsUpc.cxx
13-
/// \author Mingrui Zhao (mingrui.zhao@mail.labz0.org, mingrui.zhao@cern.ch)
19+
/// \author Yongxi Du (yongxi.du@cern.ch), Mingrui Zhao (mingrui.zhao@mail.labz0.org, mingrui.zhao@cern.ch)
1420
/// \since Mar/2025
1521
/// \brief jira: , task to measure flow observables with cumulant method
1622

@@ -62,14 +68,15 @@ using namespace o2::framework::expressions;
6268
struct FlowCumulantsUpc {
6369

6470
O2_DEFINE_CONFIGURABLE(cfgCutVertex, float, 10.0f, "Accepted z-vertex range")
71+
O2_DEFINE_CONFIGURABLE(cfgIfVertex, bool, false, "choose vertex or not")
6572
O2_DEFINE_CONFIGURABLE(cfgCentEstimator, int, 0, "0:FT0C; 1:FT0CVariant1; 2:FT0M; 3:FT0A")
6673
O2_DEFINE_CONFIGURABLE(cfgCentFT0CMin, float, 0.0f, "Minimum centrality (FT0C) to cut events in filter")
6774
O2_DEFINE_CONFIGURABLE(cfgCentFT0CMax, float, 100.0f, "Maximum centrality (FT0C) to cut events in filter")
68-
O2_DEFINE_CONFIGURABLE(cfgCutPtPOIMin, float, 0.2f, "Minimal pT for poi tracks")
75+
O2_DEFINE_CONFIGURABLE(cfgCutPtPOIMin, float, 0.1f, "Minimal pT for poi tracks")
6976
O2_DEFINE_CONFIGURABLE(cfgCutPtPOIMax, float, 10.0f, "Maximal pT for poi tracks")
70-
O2_DEFINE_CONFIGURABLE(cfgCutPtRefMin, float, 0.2f, "Minimal pT for ref tracks")
77+
O2_DEFINE_CONFIGURABLE(cfgCutPtRefMin, float, 0.1f, "Minimal pT for ref tracks")
7178
O2_DEFINE_CONFIGURABLE(cfgCutPtRefMax, float, 3.0f, "Maximal pT for ref tracks")
72-
O2_DEFINE_CONFIGURABLE(cfgCutPtMin, float, 0.2f, "Minimal pT for all tracks")
79+
O2_DEFINE_CONFIGURABLE(cfgCutPtMin, float, 0.1f, "Minimal pT for all tracks")
7380
O2_DEFINE_CONFIGURABLE(cfgCutPtMax, float, 10.0f, "Maximal pT for all tracks")
7481
O2_DEFINE_CONFIGURABLE(cfgCutEta, float, 0.8f, "Eta range for tracks")
7582
O2_DEFINE_CONFIGURABLE(cfgCutChi2prTPCcls, float, 2.5f, "max chi2 per TPC clusters")
@@ -102,9 +109,17 @@ struct FlowCumulantsUpc {
102109
O2_DEFINE_CONFIGURABLE(cfgAcceptanceList, std::string, "", "CCDB path to acceptance lsit object")
103110
O2_DEFINE_CONFIGURABLE(cfgAcceptanceListEnabled, bool, false, "switch of acceptance list")
104111
O2_DEFINE_CONFIGURABLE(cfgEvSelOccupancy, bool, true, "Occupancy cut")
105-
O2_DEFINE_CONFIGURABLE(cfgCutOccupancyHigh, int, 500, "High cut on TPC occupancy")
112+
O2_DEFINE_CONFIGURABLE(cfgCutOccupancyHigh, int, 1000, "High cut on TPC occupancy")
106113
O2_DEFINE_CONFIGURABLE(cfgCutOccupancyLow, int, 0, "Low cut on TPC occupancy")
107114
O2_DEFINE_CONFIGURABLE(cfgUseSmallMemory, bool, false, "Use small memory mode")
115+
O2_DEFINE_CONFIGURABLE(cfgIsGoodItsLayers, bool, false, "whether choose itslayers")
116+
O2_DEFINE_CONFIGURABLE(cfgGapSideA, bool, true, "choose gapside A")
117+
O2_DEFINE_CONFIGURABLE(cfgGapSideC, bool, false, "choose gapside C")
118+
O2_DEFINE_CONFIGURABLE(cfgDcaxy, bool, true, "choose dcaxy")
119+
O2_DEFINE_CONFIGURABLE(cfgDcaz, bool, false, "choose dcaz")
120+
O2_DEFINE_CONFIGURABLE(cfgDcazCut, float, 10.0, "dcaz cut")
121+
O2_DEFINE_CONFIGURABLE(cfgItsClusterSize, unsigned int, 5, "ITS cluster size")
122+
O2_DEFINE_CONFIGURABLE(cfgMaxTPCChi2NCl, int, 4, "tpcchi2")
108123
Configurable<std::vector<std::string>> cfgUserDefineGFWCorr{"cfgUserDefineGFWCorr", std::vector<std::string>{"refN02 {2} refP02 {-2}", "refN12 {2} refP12 {-2}"}, "User defined GFW CorrelatorConfig"};
109124
Configurable<std::vector<std::string>> cfgUserDefineGFWName{"cfgUserDefineGFWName", std::vector<std::string>{"Ch02Gap22", "Ch12Gap22"}, "User defined GFW Name"};
110125
Configurable<std::vector<int>> cfgRunRemoveList{"cfgRunRemoveList", std::vector<int>{-1}, "excluded run numbers"};
@@ -122,7 +137,6 @@ struct FlowCumulantsUpc {
122137
Configurable<float> cfgCutFT0A{"cfgCutFT0A", 150., "FT0A threshold"};
123138
Configurable<float> cfgCutFT0C{"cfgCutFT0C", 50., "FT0C threshold"};
124139
Configurable<float> cfgCutZDC{"cfgCutZDC", 10., "ZDC threshold"};
125-
Configurable<float> cfgGapSideSelection{"cfgGapSideSelection", 2, "gap selection"};
126140

127141
// Corrections
128142
TH1D* mEfficiency = nullptr;
@@ -200,10 +214,17 @@ struct FlowCumulantsUpc {
200214
// Event QA
201215
registry.add("hEventCount", "Number of Event;; Count", {HistType::kTH1D, {{5, 0, 5}}});
202216
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(1, "Filtered event");
203-
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(2, "after sel8");
204-
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(3, "after supicious Runs removal");
205-
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(4, "after additional event cut");
206-
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(5, "after correction loads");
217+
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(2, "after gapside selection");
218+
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(3, "after its selection");
219+
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(4, "after pt selection");
220+
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(5, "after occupancy");
221+
registry.add("hTrackCount", "Number of tracks;; Count", {HistType::kTH1D, {{5, 0, 5}}});
222+
registry.get<TH1>(HIST("hTrackCount"))->GetXaxis()->SetBinLabel(1, "after event selection");
223+
registry.get<TH1>(HIST("hTrackCount"))->GetXaxis()->SetBinLabel(2, "PVContributor");
224+
registry.get<TH1>(HIST("hTrackCount"))->GetXaxis()->SetBinLabel(3, "dcaz");
225+
registry.get<TH1>(HIST("hTrackCount"))->GetXaxis()->SetBinLabel(4, "dcaxy");
226+
registry.get<TH1>(HIST("hTrackCount"))->GetXaxis()->SetBinLabel(5, "its clusters");
227+
registry.get<TH1>(HIST("hTrackCount"))->GetXaxis()->SetBinLabel(6, "tpc chi2");
207228
registry.add("hEventCountSpecific", "Number of Event;; Count", {HistType::kTH1D, {{10, 0, 10}}});
208229
registry.get<TH1>(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(1, "after sel8");
209230
registry.get<TH1>(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(2, "kNoSameBunchPileup");
@@ -266,6 +287,7 @@ struct FlowCumulantsUpc {
266287
registry.add("hDCAz", "DCAz after cuts; DCAz (cm); Pt", {HistType::kTH2D, {{200, -0.5, 0.5}, {200, 0, 5}}});
267288
registry.add("hDCAxy", "DCAxy after cuts; DCAxy (cm); Pt", {HistType::kTH2D, {{200, -0.5, 0.5}, {200, 0, 5}}});
268289
registry.add("hTrackCorrection2d", "Correlation table for number of tracks table; uncorrected track; corrected track", {HistType::kTH2D, {axisNch, axisNch}});
290+
registry.add("hEtaNch2D", "Eta vs Nch; #eta; Nch", {HistType::kTH2D, {axisEta, axisNch}});
269291

270292
registry.add("hPhiMC", "#phi distribution", {HistType::kTH1D, {axisPhi}});
271293
registry.add("hPhiWeightedMC", "corrected #phi distribution", {HistType::kTH1D, {axisPhi}});
@@ -727,7 +749,7 @@ struct FlowCumulantsUpc {
727749
registry.fill(HIST("hEventCountSpecific"), 6.5);
728750
}
729751
auto multNTracksPV = collision.multNTracksPV();
730-
auto occupancy = collision.trackOccupancyInTimeRange();
752+
auto occupancy = collision.Occ();
731753
if (cfgEvSelOccupancy && (occupancy < cfgCutOccupancyLow || occupancy > cfgCutOccupancyHigh)) {
732754
return 0;
733755
}
@@ -801,27 +823,29 @@ struct FlowCumulantsUpc {
801823
template <typename TTrack>
802824
bool trackSelected(TTrack track)
803825
{
826+
registry.fill(HIST("hTrackCount"), 0.5);
804827
// UPC selection
805828
if (!track.isPVContributor()) {
806829
return false;
807830
}
808-
constexpr float kDcazCut = 2.0;
809-
if (!(std::fabs(track.dcaZ()) < kDcazCut)) {
831+
registry.fill(HIST("hTrackCount"), 1.5);
832+
if (cfgDcaz && !(std::fabs(track.dcaZ()) < cfgDcazCut)) {
810833
return false;
811834
}
835+
registry.fill(HIST("hTrackCount"), 2.5);
812836
double dcaLimit = 0.0105 + 0.035 / std::pow(track.pt(), 1.1);
813-
if (!(std::fabs(track.dcaXY()) < dcaLimit)) {
837+
if (cfgDcaxy && !(std::fabs(track.dcaXY()) < dcaLimit)) {
814838
return false;
815839
}
816-
constexpr int kMinITSClusters = 5;
817-
constexpr int kMaxTPCChi2NCl = 4;
818-
819-
if (track.itsClusterSizes() <= kMinITSClusters) {
840+
registry.fill(HIST("hTrackCount"), 3.5);
841+
if (track.itsClusterSizes() <= cfgItsClusterSize) {
820842
return false;
821843
}
822-
if (track.tpcChi2NCl() >= kMaxTPCChi2NCl) {
844+
registry.fill(HIST("hTrackCount"), 4.5);
845+
if (track.tpcChi2NCl() >= cfgMaxTPCChi2NCl) {
823846
return false;
824847
}
848+
registry.fill(HIST("hTrackCount"), 5.5);
825849
return true;
826850
}
827851

@@ -879,28 +903,55 @@ struct FlowCumulantsUpc {
879903
// return;
880904
// }
881905
int gapSide = collision.gapSide();
882-
constexpr int kGapSideSelection = 0;
883-
constexpr int kGapSideOppositeSelection = 2;
884-
if (gapSide > kGapSideSelection && gapSide < kGapSideOppositeSelection) {
885-
return;
906+
if (gapSide == 0) {
907+
if (!cfgGapSideA) {
908+
return;
909+
}
910+
}
911+
if (gapSide == 1) {
912+
if (!cfgGapSideC) {
913+
return;
914+
}
886915
}
887-
if (collision.trs() == 0) {
916+
if (gapSide != 0 || gapSide != 1) {
888917
return;
889918
}
890919
int trueGapSide = sgSelector.trueGap(collision, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC);
891920
gapSide = trueGapSide;
892-
if (gapSide == cfgGapSideSelection) {
921+
if (gapSide == 0) {
922+
if (!cfgGapSideA) {
923+
return;
924+
}
925+
}
926+
if (gapSide == 1) {
927+
if (!cfgGapSideC) {
928+
return;
929+
}
930+
}
931+
if (gapSide != 0 || gapSide != 1) {
893932
return;
894933
}
895934
registry.fill(HIST("hEventCount"), 1.5);
935+
if (cfgIsGoodItsLayers && collision.trs() == 0) {
936+
return;
937+
}
938+
registry.fill(HIST("hEventCount"), 2.5);
896939
float cent = 100;
897940
float lRandom = fRndm->Rndm();
898941
float vtxz = collision.posZ();
899942
registry.fill(HIST("hVtxZ"), vtxz);
900943
registry.fill(HIST("hMult"), tracks.size());
901944
registry.fill(HIST("hCent"), cent);
902945
fGFW->Clear();
903-
946+
if (cfgIfVertex && abs(vtxz) > cfgCutVertex) {
947+
return;
948+
}
949+
registry.fill(HIST("hEventCount"), 3.5);
950+
int occupancy = collision.occupancyInTime();
951+
if (cfgEvSelOccupancy && (occupancy < cfgCutOccupancyLow || occupancy > cfgCutOccupancyHigh)) {
952+
return;
953+
}
954+
registry.fill(HIST("hEventCount"), 4.5);
904955
// // track weights
905956
float weff = 1, wacc = 1;
906957
double nTracksCorrected = 0;
@@ -911,8 +962,9 @@ struct FlowCumulantsUpc {
911962

912963
for (const auto& track : tracks) {
913964
registry.fill(HIST("hChi2prTPCcls"), track.tpcChi2NCl());
914-
if (!trackSelected(track))
965+
if (!trackSelected(track)) {
915966
continue;
967+
}
916968
auto momentum = std::array<double, 3>{track.px(), track.py(), track.pz()};
917969
double pt = RecoDecay::pt(momentum);
918970
double phi = RecoDecay::phi(momentum);
@@ -950,6 +1002,7 @@ struct FlowCumulantsUpc {
9501002
if (withinPtPOI && withinPtRef) {
9511003
fGFW->Fill(eta, fPtAxis->FindBin(pt) - 1, phi, wacc * weff, 4);
9521004
}
1005+
registry.fill(HIST("hEtaNch2D"), eta, tracks.size());
9531006
}
9541007
registry.fill(HIST("hTrackCorrection2d"), tracks.size(), nTracksCorrected);
9551008

0 commit comments

Comments
 (0)