1- // Copyright 2019-2020 CERN and copyright holders of ALICE O2.
1+ // opyright 2019-2020 CERN and copyright holders of ALICE O2.
22// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
33// All rights not expressly granted are reserved.
44//
1010// or submit itself to any jurisdiction.
1111
1212// / \file flowCumulantsUpc.cxx
13- // / \author Mingrui Zhao (mingrui.zhao@mail.labz0.org, mingrui.zhao@cern.ch)
13+ // / \author Yongxi Du (yongxi.du@cern.ch), Mingrui Zhao (mingrui.zhao@mail.labz0.org, mingrui.zhao@cern.ch)
1414// / \since Mar/2025
1515// / \brief jira: , task to measure flow observables with cumulant method
1616
@@ -62,14 +62,15 @@ using namespace o2::framework::expressions;
6262struct FlowCumulantsUpc {
6363
6464 O2_DEFINE_CONFIGURABLE (cfgCutVertex, float , 10 .0f , " Accepted z-vertex range" )
65+ O2_DEFINE_CONFIGURABLE (cfgIfVertex, bool , false , " choose vertex or not" )
6566 O2_DEFINE_CONFIGURABLE (cfgCentEstimator, int , 0 , " 0:FT0C; 1:FT0CVariant1; 2:FT0M; 3:FT0A" )
6667 O2_DEFINE_CONFIGURABLE (cfgCentFT0CMin, float , 0 .0f , " Minimum centrality (FT0C) to cut events in filter" )
6768 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" )
69+ O2_DEFINE_CONFIGURABLE (cfgCutPtPOIMin, float , 0 .1f , " Minimal pT for poi tracks" )
6970 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" )
71+ O2_DEFINE_CONFIGURABLE (cfgCutPtRefMin, float , 0 .1f , " Minimal pT for ref tracks" )
7172 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" )
73+ O2_DEFINE_CONFIGURABLE (cfgCutPtMin, float , 0 .1f , " Minimal pT for all tracks" )
7374 O2_DEFINE_CONFIGURABLE (cfgCutPtMax, float , 10 .0f , " Maximal pT for all tracks" )
7475 O2_DEFINE_CONFIGURABLE (cfgCutEta, float , 0 .8f , " Eta range for tracks" )
7576 O2_DEFINE_CONFIGURABLE (cfgCutChi2prTPCcls, float , 2 .5f , " max chi2 per TPC clusters" )
@@ -102,9 +103,17 @@ struct FlowCumulantsUpc {
102103 O2_DEFINE_CONFIGURABLE (cfgAcceptanceList, std::string, " " , " CCDB path to acceptance lsit object" )
103104 O2_DEFINE_CONFIGURABLE (cfgAcceptanceListEnabled, bool , false , " switch of acceptance list" )
104105 O2_DEFINE_CONFIGURABLE (cfgEvSelOccupancy, bool , true , " Occupancy cut" )
105- O2_DEFINE_CONFIGURABLE (cfgCutOccupancyHigh, int , 500 , " High cut on TPC occupancy" )
106+ O2_DEFINE_CONFIGURABLE (cfgCutOccupancyHigh, int , 1000 , " High cut on TPC occupancy" )
106107 O2_DEFINE_CONFIGURABLE (cfgCutOccupancyLow, int , 0 , " Low cut on TPC occupancy" )
107108 O2_DEFINE_CONFIGURABLE (cfgUseSmallMemory, bool , false , " Use small memory mode" )
109+ O2_DEFINE_CONFIGURABLE (cfgIsGoodItsLayers, bool , false , " whether choose itslayers" )
110+ O2_DEFINE_CONFIGURABLE (cfgGapSideA, bool , true , " choose gapside A" )
111+ O2_DEFINE_CONFIGURABLE (cfgGapSideC, bool , false , " choose gapside C" )
112+ O2_DEFINE_CONFIGURABLE (cfgDcaxy, bool , true , " choose dcaxy" )
113+ O2_DEFINE_CONFIGURABLE (cfgDcaz, bool , false , " choose dcaz" )
114+ O2_DEFINE_CONFIGURABLE (cfgDcazCut, float , 10.0 , " dcaz cut" )
115+ O2_DEFINE_CONFIGURABLE (cfgItsClusterSize, unsigned int , 5 , " ITS cluster size" )
116+ O2_DEFINE_CONFIGURABLE (cfgMaxTPCChi2NCl, int , 4 , " tpcchi2" )
108117 Configurable<std::vector<std::string>> cfgUserDefineGFWCorr{" cfgUserDefineGFWCorr" , std::vector<std::string>{" refN02 {2} refP02 {-2}" , " refN12 {2} refP12 {-2}" }, " User defined GFW CorrelatorConfig" };
109118 Configurable<std::vector<std::string>> cfgUserDefineGFWName{" cfgUserDefineGFWName" , std::vector<std::string>{" Ch02Gap22" , " Ch12Gap22" }, " User defined GFW Name" };
110119 Configurable<std::vector<int >> cfgRunRemoveList{" cfgRunRemoveList" , std::vector<int >{-1 }, " excluded run numbers" };
@@ -122,7 +131,6 @@ struct FlowCumulantsUpc {
122131 Configurable<float > cfgCutFT0A{" cfgCutFT0A" , 150 ., " FT0A threshold" };
123132 Configurable<float > cfgCutFT0C{" cfgCutFT0C" , 50 ., " FT0C threshold" };
124133 Configurable<float > cfgCutZDC{" cfgCutZDC" , 10 ., " ZDC threshold" };
125- Configurable<float > cfgGapSideSelection{" cfgGapSideSelection" , 2 , " gap selection" };
126134
127135 // Corrections
128136 TH1D* mEfficiency = nullptr ;
@@ -200,10 +208,17 @@ struct FlowCumulantsUpc {
200208 // Event QA
201209 registry.add (" hEventCount" , " Number of Event;; Count" , {HistType::kTH1D , {{5 , 0 , 5 }}});
202210 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" );
211+ registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (2 , " after gapside selection" );
212+ registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (3 , " after its selection" );
213+ registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (4 , " after pt selection" );
214+ registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (5 , " after occupancy" );
215+ registry.add (" hTrackCount" , " Number of tracks;; Count" , {HistType::kTH1D , {{5 , 0 , 5 }}});
216+ registry.get <TH1>(HIST (" hTrackCount" ))->GetXaxis ()->SetBinLabel (1 , " after event selection" );
217+ registry.get <TH1>(HIST (" hTrackCount" ))->GetXaxis ()->SetBinLabel (2 , " PVContributor" );
218+ registry.get <TH1>(HIST (" hTrackCount" ))->GetXaxis ()->SetBinLabel (3 , " dcaz" );
219+ registry.get <TH1>(HIST (" hTrackCount" ))->GetXaxis ()->SetBinLabel (4 , " dcaxy" );
220+ registry.get <TH1>(HIST (" hTrackCount" ))->GetXaxis ()->SetBinLabel (5 , " its clusters" );
221+ registry.get <TH1>(HIST (" hTrackCount" ))->GetXaxis ()->SetBinLabel (6 , " tpc chi2" );
207222 registry.add (" hEventCountSpecific" , " Number of Event;; Count" , {HistType::kTH1D , {{10 , 0 , 10 }}});
208223 registry.get <TH1>(HIST (" hEventCountSpecific" ))->GetXaxis ()->SetBinLabel (1 , " after sel8" );
209224 registry.get <TH1>(HIST (" hEventCountSpecific" ))->GetXaxis ()->SetBinLabel (2 , " kNoSameBunchPileup" );
@@ -266,6 +281,7 @@ struct FlowCumulantsUpc {
266281 registry.add (" hDCAz" , " DCAz after cuts; DCAz (cm); Pt" , {HistType::kTH2D , {{200 , -0.5 , 0.5 }, {200 , 0 , 5 }}});
267282 registry.add (" hDCAxy" , " DCAxy after cuts; DCAxy (cm); Pt" , {HistType::kTH2D , {{200 , -0.5 , 0.5 }, {200 , 0 , 5 }}});
268283 registry.add (" hTrackCorrection2d" , " Correlation table for number of tracks table; uncorrected track; corrected track" , {HistType::kTH2D , {axisNch, axisNch}});
284+ registry.add (" hEtaNch2D" , " Eta vs Nch; #eta; Nch" , {HistType::kTH2D , {axisEta, axisNch}});
269285
270286 registry.add (" hPhiMC" , " #phi distribution" , {HistType::kTH1D , {axisPhi}});
271287 registry.add (" hPhiWeightedMC" , " corrected #phi distribution" , {HistType::kTH1D , {axisPhi}});
@@ -727,7 +743,7 @@ struct FlowCumulantsUpc {
727743 registry.fill (HIST (" hEventCountSpecific" ), 6.5 );
728744 }
729745 auto multNTracksPV = collision.multNTracksPV ();
730- auto occupancy = collision.trackOccupancyInTimeRange ();
746+ auto occupancy = collision.Occ ();
731747 if (cfgEvSelOccupancy && (occupancy < cfgCutOccupancyLow || occupancy > cfgCutOccupancyHigh)) {
732748 return 0 ;
733749 }
@@ -801,27 +817,29 @@ struct FlowCumulantsUpc {
801817 template <typename TTrack>
802818 bool trackSelected (TTrack track)
803819 {
820+ registry.fill (HIST (" hTrackCount" ), 0.5 );
804821 // UPC selection
805822 if (!track.isPVContributor ()) {
806823 return false ;
807824 }
808- constexpr float kDcazCut = 2.0 ;
809- if (!(std::fabs (track.dcaZ ()) < kDcazCut )) {
825+ registry. fill ( HIST ( " hTrackCount " ), 1.5 ) ;
826+ if (cfgDcaz && !(std::fabs (track.dcaZ ()) < cfgDcazCut )) {
810827 return false ;
811828 }
829+ registry.fill (HIST (" hTrackCount" ), 2.5 );
812830 double dcaLimit = 0.0105 + 0.035 / std::pow (track.pt (), 1.1 );
813- if (!(std::fabs (track.dcaXY ()) < dcaLimit)) {
831+ if (cfgDcaxy && !(std::fabs (track.dcaXY ()) < dcaLimit)) {
814832 return false ;
815833 }
816- constexpr int kMinITSClusters = 5 ;
817- constexpr int kMaxTPCChi2NCl = 4 ;
818-
819- if (track.itsClusterSizes () <= kMinITSClusters ) {
834+ registry.fill (HIST (" hTrackCount" ), 3.5 );
835+ if (track.itsClusterSizes () <= cfgItsClusterSize) {
820836 return false ;
821837 }
822- if (track.tpcChi2NCl () >= kMaxTPCChi2NCl ) {
838+ registry.fill (HIST (" hTrackCount" ), 4.5 );
839+ if (track.tpcChi2NCl () >= cfgMaxTPCChi2NCl) {
823840 return false ;
824841 }
842+ registry.fill (HIST (" hTrackCount" ), 5.5 );
825843 return true ;
826844 }
827845
@@ -879,28 +897,55 @@ struct FlowCumulantsUpc {
879897 // return;
880898 // }
881899 int gapSide = collision.gapSide ();
882- constexpr int kGapSideSelection = 0 ;
883- constexpr int kGapSideOppositeSelection = 2 ;
884- if (gapSide > kGapSideSelection && gapSide < kGapSideOppositeSelection ) {
885- return ;
900+ if (gapSide == 0 ) {
901+ if (!cfgGapSideA) {
902+ return ;
903+ }
904+ }
905+ if (gapSide == 1 ) {
906+ if (!cfgGapSideC) {
907+ return ;
908+ }
886909 }
887- if (collision. trs () == 0 ) {
910+ if (gapSide != 0 || gapSide != 1 ) {
888911 return ;
889912 }
890913 int trueGapSide = sgSelector.trueGap (collision, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC);
891914 gapSide = trueGapSide;
892- if (gapSide == cfgGapSideSelection) {
915+ if (gapSide == 0 ) {
916+ if (!cfgGapSideA) {
917+ return ;
918+ }
919+ }
920+ if (gapSide == 1 ) {
921+ if (!cfgGapSideC) {
922+ return ;
923+ }
924+ }
925+ if (gapSide != 0 || gapSide != 1 ) {
893926 return ;
894927 }
895928 registry.fill (HIST (" hEventCount" ), 1.5 );
929+ if (cfgIsGoodItsLayers && collision.trs () == 0 ) {
930+ return ;
931+ }
932+ registry.fill (HIST (" hEventCount" ), 2.5 );
896933 float cent = 100 ;
897934 float lRandom = fRndm ->Rndm ();
898935 float vtxz = collision.posZ ();
899936 registry.fill (HIST (" hVtxZ" ), vtxz);
900937 registry.fill (HIST (" hMult" ), tracks.size ());
901938 registry.fill (HIST (" hCent" ), cent);
902939 fGFW ->Clear ();
903-
940+ if (cfgIfVertex && abs (vtxz) > cfgCutVertex) {
941+ return ;
942+ }
943+ registry.fill (HIST (" hEventCount" ), 3.5 );
944+ int occupancy = collision.occupancyInTime ();
945+ if (cfgEvSelOccupancy && (occupancy < cfgCutOccupancyLow || occupancy > cfgCutOccupancyHigh)) {
946+ return ;
947+ }
948+ registry.fill (HIST (" hEventCount" ), 4.5 );
904949 // // track weights
905950 float weff = 1 , wacc = 1 ;
906951 double nTracksCorrected = 0 ;
@@ -911,8 +956,9 @@ struct FlowCumulantsUpc {
911956
912957 for (const auto & track : tracks) {
913958 registry.fill (HIST (" hChi2prTPCcls" ), track.tpcChi2NCl ());
914- if (!trackSelected (track))
959+ if (!trackSelected (track)) {
915960 continue ;
961+ }
916962 auto momentum = std::array<double , 3 >{track.px (), track.py (), track.pz ()};
917963 double pt = RecoDecay::pt (momentum);
918964 double phi = RecoDecay::phi (momentum);
@@ -950,6 +996,7 @@ struct FlowCumulantsUpc {
950996 if (withinPtPOI && withinPtRef) {
951997 fGFW ->Fill (eta, fPtAxis ->FindBin (pt) - 1 , phi, wacc * weff, 4 );
952998 }
999+ registry.fill (HIST (" hEtaNch2D" ), eta, tracks.size ());
9531000 }
9541001 registry.fill (HIST (" hTrackCorrection2d" ), tracks.size (), nTracksCorrected);
9551002
0 commit comments