1414// / \since Mar/2025
1515// / \brief jira: , task to measure flow observables with cumulant method
1616
17+ #include " FlowContainer.h"
18+ #include " GFW.h"
19+ #include " GFWCumulant.h"
20+ #include " GFWPowerArray.h"
21+ #include " GFWWeights.h"
22+
1723#include " PWGUD/Core/SGSelector.h"
24+ #include " PWGUD/DataModel/SGTables.h"
1825#include " PWGUD/DataModel/UDTables.h"
19- //
20- #include " PWGCF/GenericFramework/Core/FlowContainer.h"
21- #include " PWGCF/GenericFramework/Core/GFW.h"
22- #include " PWGCF/GenericFramework/Core/GFWWeights.h"
2326
2427#include " Common/CCDB/ctpRateFetcher.h"
2528#include " Common/Core/RecoDecay.h"
2629#include " Common/Core/TrackSelection.h"
2730#include " Common/Core/TrackSelectionDefaults.h"
28-
31+ #include " Common/DataModel/Centrality.h"
32+ #include " Common/DataModel/EventSelection.h"
33+ #include " Common/DataModel/Multiplicity.h"
34+ #include " Common/DataModel/TrackSelectionTables.h"
35+
36+ #include " Framework/ASoAHelpers.h"
37+ #include " Framework/AnalysisTask.h"
38+ #include " Framework/HistogramRegistry.h"
39+ #include " Framework/RunningWorkflowInfo.h"
40+ #include " Framework/runDataProcessing.h"
2941#include < CCDB/BasicCCDBManager.h>
30- #include < CommonConstants/MathConstants.h>
31- #include < CommonConstants/PhysicsConstants.h>
32- #include < Framework/ASoA.h>
33- #include < Framework/AnalysisDataModel.h>
34- #include < Framework/AnalysisHelpers.h>
35- #include < Framework/AnalysisTask.h>
36- #include < Framework/Configurable.h>
37- #include < Framework/HistogramRegistry.h>
38- #include < Framework/HistogramSpec.h>
39- #include < Framework/InitContext.h>
40- #include < Framework/StringHelpers.h>
41- #include < Framework/runDataProcessing.h>
42-
43- #include < Math/GenVector/LorentzVector.h>
44- #include < Math/GenVector/PxPyPzE4D.h>
42+
43+ #include " TList.h"
44+ #include " TVector3.h"
4545#include < TF1.h>
46- #include < TH1.h>
47- #include < TH2.h>
48- #include < TNamed.h>
4946#include < TObjArray.h>
5047#include < TProfile.h>
5148#include < TRandom3.h>
52- #include < TString.h>
53-
54- #include < sys/types.h>
55-
56- #include < RtypesCore.h>
5749
5850#include < array>
59- #include < chrono>
6051#include < cmath>
61- #include < cstdint>
6252#include < memory>
6353#include < string>
6454#include < unordered_map>
@@ -125,9 +115,17 @@ struct FlowCumulantsUpc {
125115 O2_DEFINE_CONFIGURABLE (cfgDcazCut, float , 10.0 , " dcaz cut" )
126116 O2_DEFINE_CONFIGURABLE (cfgItsClusterSize, unsigned int , 5 , " ITS cluster size" )
127117 O2_DEFINE_CONFIGURABLE (cfgMaxTPCChi2NCl, int , 4 , " tpcchi2" )
118+ 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" )
128119 Configurable<std::vector<std::string>> cfgUserDefineGFWCorr{" cfgUserDefineGFWCorr" , std::vector<std::string>{" refN02 {2} refP02 {-2}" , " refN12 {2} refP12 {-2}" }, " User defined GFW CorrelatorConfig" };
129120 Configurable<std::vector<std::string>> cfgUserDefineGFWName{" cfgUserDefineGFWName" , std::vector<std::string>{" Ch02Gap22" , " Ch12Gap22" }, " User defined GFW Name" };
130121 Configurable<std::vector<int >> cfgRunRemoveList{" cfgRunRemoveList" , std::vector<int >{-1 }, " excluded run numbers" };
122+ 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)" };
123+ struct AcceptedTracks {
124+ int nNeg;
125+ int nMid;
126+ int nPos;
127+ int nFull;
128+ };
131129
132130 ConfigurableAxis axisPtHist{" axisPtHist" , {100 , 0 ., 10 .}, " pt axis for histograms" };
133131 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 +215,14 @@ struct FlowCumulantsUpc {
217215
218216 // Add some output objects to the histogram registry
219217 // Event QA
220- registry.add (" hEventCount" , " Number of Event;; Count" , {HistType::kTH1D , {{5 , 0 , 5 }}});
218+ registry.add (" hEventCount" , " Number of Event;; Count" , {HistType::kTH1D , {{6 , 0 , 6 }}});
221219 registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (1 , " Filtered event" );
222220 registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (2 , " after gapside selection" );
223221 registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (3 , " after its selection" );
224222 registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (4 , " after pt selection" );
225223 registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (5 , " after occupancy" );
226- registry.add (" hTrackCount" , " Number of tracks;; Count" , {HistType::kTH1D , {{5 , 0 , 5 }}});
224+ registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (6 , " after consistency check" );
225+ registry.add (" hTrackCount" , " Number of tracks;; Count" , {HistType::kTH1D , {{7 , 0 , 7 }}});
227226 registry.get <TH1>(HIST (" hTrackCount" ))->GetXaxis ()->SetBinLabel (1 , " after event selection" );
228227 registry.get <TH1>(HIST (" hTrackCount" ))->GetXaxis ()->SetBinLabel (2 , " PVContributor" );
229228 registry.get <TH1>(HIST (" hTrackCount" ))->GetXaxis ()->SetBinLabel (3 , " dcaz" );
@@ -955,7 +954,7 @@ struct FlowCumulantsUpc {
955954 registry.fill (HIST (" hMult" ), tracks.size ());
956955 registry.fill (HIST (" hCent" ), cent);
957956 fGFW ->Clear ();
958- if (cfgIfVertex && abs (vtxz) > cfgCutVertex) {
957+ if (cfgIfVertex && std:: abs (vtxz) > cfgCutVertex) {
959958 return ;
960959 }
961960 registry.fill (HIST (" hEventCount" ), 3.5 );
@@ -971,6 +970,8 @@ struct FlowCumulantsUpc {
971970 if (cfgUseNch) {
972971 independent = static_cast <float >(tracks.size ());
973972 }
973+ AcceptedTracks acceptedTracks{0 , 0 , 0 , 0 };
974+ std::vector<float > consistentEventVector = cfgConsistentEventVector;
974975
975976 for (const auto & track : tracks) {
976977 registry.fill (HIST (" hChi2prTPCcls" ), track.tpcChi2NCl ());
@@ -996,6 +997,17 @@ struct FlowCumulantsUpc {
996997 continue ;
997998 }
998999 registry.fill (HIST (" hPt" ), track.pt ());
1000+
1001+ if (cfgConsistentEventFlag && consistentEventVector.size () == 6 ) { // o2-linter: disable=magic-number (size match)
1002+ acceptedTracks.nFull += 1 ;
1003+ if (eta > consistentEventVector[0 ] && eta < consistentEventVector[1 ])
1004+ acceptedTracks.nNeg += 1 ;
1005+ if (eta > consistentEventVector[2 ] && eta < consistentEventVector[3 ])
1006+ acceptedTracks.nMid += 1 ;
1007+ if (eta > consistentEventVector[4 ] && eta < consistentEventVector[5 ])
1008+ acceptedTracks.nPos += 1 ;
1009+ }
1010+
9991011 if (withinPtRef) {
10001012 registry.fill (HIST (" hPhi" ), phi);
10011013 registry.fill (HIST (" hPhiWeighted" ), phi, wacc);
@@ -1018,6 +1030,24 @@ struct FlowCumulantsUpc {
10181030 }
10191031 registry.fill (HIST (" hTrackCorrection2d" ), tracks.size (), nTracksCorrected);
10201032
1033+ if (cfgConsistentEventFlag) {
1034+ if (cfgConsistentEventFlag & 1 ) {
1035+ if (!acceptedTracks.nPos || !acceptedTracks.nNeg )
1036+ return ;
1037+ } else if (cfgConsistentEventFlag & 2 ) {
1038+ if (acceptedTracks.nFull < 4 ) // o2-linter: disable=magic-number (at least four tracks in full acceptance)
1039+ return ;
1040+ } else if (cfgConsistentEventFlag & 4 ) {
1041+ if (acceptedTracks.nPos < 2 || acceptedTracks.nNeg < 2 ) // o2-linter: disable=magic-number (at least two tracks in each subevent)
1042+ return ;
1043+ }
1044+ if (cfgConsistentEventFlag & 8 ) {
1045+ if (acceptedTracks.nPos < 2 || acceptedTracks.nMid < 2 || acceptedTracks.nNeg < 2 ) // o2-linter: disable=magic-number (at least two tracks in all three subevents)
1046+ return ;
1047+ }
1048+ }
1049+ registry.fill (HIST (" hEventCount" ), 5.5 );
1050+
10211051 // Filling Flow Container
10221052 for (uint l_ind = 0 ; l_ind < corrconfigs.size (); l_ind++) {
10231053 fillFC (corrconfigs.at (l_ind), independent, lRandom);
0 commit comments