99// granted to it by virtue of its status as an Intergovernmental Organization
1010// or submit itself to any jurisdiction.
1111
12+ // / \file FlowPtContainer.h
13+ // / \brief Class to handle angular and transverse momentum correlations
14+ // / \author Emil Gorm Nielsen, NBI, [email protected] 15+
1216#ifndef PWGCF_GENERICFRAMEWORK_CORE_FLOWPTCONTAINER_H_
1317#define PWGCF_GENERICFRAMEWORK_CORE_FLOWPTCONTAINER_H_
1418
2630
2731namespace o2 ::analysis::genericframework::eventweight
2832{
29- enum kEventWeight {
30- kUnity ,
31- kTuples
33+ enum EventWeight {
34+ UnityWeight ,
35+ TupleWeight
3236};
3337};
3438
@@ -43,84 +47,88 @@ class FlowPtContainer : public TNamed
4347 explicit FlowPtContainer (const char * name);
4448 ~FlowPtContainer ();
4549 FlowPtContainer (const char * name, const char * title);
46- void Initialise (const o2::framework::AxisSpec axis, const int & m, const GFWCorrConfigs& configs, const int & nsub = 10 );
47- void Initialise (int nbinsx, double * xbins, const int & m, const GFWCorrConfigs& configs, const int & nsub = 10 );
48- void Initialise (int nbinsx, double xlow, double xhigh, const int & m, const GFWCorrConfigs& configs, const int & nsub = 10 );
49- void Fill (const double & w, const double & pt);
50- void FillArray (FillType a, FillType b, double c, double d);
51- int GetVectorIndex (const int i, const int j) { return j * (mpar + 1 ) + i; }
52- void CalculateCorrelations ();
53- void CalculateCMTerms ();
54- void FillPtProfiles (const Double_t& lMult, const Double_t& rn);
55- void FillVnPtCorrProfiles (const double & lMult, const double & flowval, const double & flowtuples, const double & rn, uint8_t mask);
56- void FillVnDeltaPtProfiles (const double & centmult, const double & flowval, const double & flowtuples, const double & rn, uint8_t mask);
57- void FillVnDeltaPtStdProfiles (const double & centmult, const double & rn);
58- void FillVnPtCorrStdProfiles (const double & centmult, const double & rn);
59- void FillVnPtProfiles (const double & centmult, const double & flowval, const double & flowtuples, const double & rn, uint8_t mask)
50+ void initialise (const o2::framework::AxisSpec axis, const int & m, const GFWCorrConfigs& configs, const int & nsub = 10 );
51+ void initialise (int nbinsx, double * xbins, const int & m, const GFWCorrConfigs& configs, const int & nsub = 10 );
52+ void initialise (int nbinsx, double xlow, double xhigh, const int & m, const GFWCorrConfigs& configs, const int & nsub = 10 );
53+ void fill (const double & w, const double & pt);
54+ void fillArray (FillType a, FillType b, double c, double d);
55+ int getVectorIndex (const int i, const int j) { return j * (mpar + 1 ) + i; } // index for 2d array for storing pt correlations
56+ int getVectorIndex (const int i, const int j, const int k, const int l) { return i + j * 3 + k * 3 * 3 + l * 3 * 3 * 3 ; } // index for 4d array for std vnpt correlation - size 3x3x3x3
57+ void calculateCorrelations ();
58+ void calculateCMTerms ();
59+ void fillPtProfiles (const double & lMult, const double & rn);
60+ void fillVnPtCorrProfiles (const double & lMult, const double & flowval, const double & flowtuples, const double & rn, uint8_t mask);
61+ void fillVnDeltaPtProfiles (const double & centmult, const double & flowval, const double & flowtuples, const double & rn, uint8_t mask);
62+ void fillVnDeltaPtStdProfiles (const double & centmult, const double & rn);
63+ void fillVnPtCorrStdProfiles (const double & centmult, const double & rn);
64+ void fillVnPtProfiles (const double & centmult, const double & flowval, const double & flowtuples, const double & rn, uint8_t mask)
6065 {
6166 if (fUseCentralMoments )
62- FillVnDeltaPtProfiles (centmult, flowval, flowtuples, rn, mask);
67+ fillVnDeltaPtProfiles (centmult, flowval, flowtuples, rn, mask);
6368 else
64- FillVnPtCorrProfiles (centmult, flowval, flowtuples, rn, mask);
69+ fillVnPtCorrProfiles (centmult, flowval, flowtuples, rn, mask);
6570 }
66- void FillVnPtStdProfiles (const double & centmult, const double & rn)
71+ void fillVnPtStdProfiles (const double & centmult, const double & rn)
6772 {
6873 if (fUseCentralMoments )
69- FillVnDeltaPtStdProfiles (centmult, rn);
74+ fillVnDeltaPtStdProfiles (centmult, rn);
7075 else
71- FillVnPtCorrStdProfiles (centmult, rn);
76+ fillVnPtCorrStdProfiles (centmult, rn);
7277 }
73- void FillCMProfiles (const double & lMult, const double & rn);
74- TList* GetCorrList () { return fCorrList ; }
75- TList* GetCMTermList () { return fCMTermList ; }
76- TList* GetCovList () { return fCovList ; }
77- void SetEventWeight (const unsigned int & lWeight) { fEventWeight = lWeight; }
78- void SetUseCentralMoments (bool newval) { fUseCentralMoments = newval; }
79- void SetUseGapMethod (bool newval) { fUseGap = newval; }
78+ void fillCMProfiles (const double & lMult, const double & rn);
79+ TList* getCorrList () { return fCorrList ; }
80+ TList* getCMTermList () { return fCMTermList ; }
81+ TList* getCovList () { return fCovList ; }
82+ void setEventWeight (const unsigned int & lWeight) { fEventWeight = lWeight; }
83+ void setUseCentralMoments (bool newval) { fUseCentralMoments = newval; }
84+ void setUseGapMethod (bool newval) { fUseGap = newval; }
8085 bool usesCentralMoments () { return fUseCentralMoments ; }
8186 bool usesGap () { return fUseGap ; }
82- void RebinMulti (Int_t nbins);
83- void RebinMulti (Int_t nbins, double * binedges);
87+ void rebinMulti ( int nbins);
88+ void rebinMulti ( int nbins, double * binedges);
8489 TH1* getCentralMomentHist (int ind, int m);
8590 TH1* getCumulantHist (int ind, int m);
8691 TH1* getCorrHist (int ind, int m);
87- Int_t getMpar () { return mpar; }
92+ int getMpar () { return mpar; }
8893 Long64_t Merge (TCollection* collist);
89- Double_t OrderedAddition (std::vector<double > vec);
90- void CreateCentralMomentList ();
91- void CalculateCentralMomentHists (std::vector<TH1*> inh, int ind, int m, TH1* hMpt);
92- void CreateCumulantList ();
93- void CalculateCumulantHists (std::vector<TH1*> inh, Int_t ind);
94- void ClearArray ();
95- void ClearVector ()
94+ double orderedAddition (std::vector<double > vec);
95+ void createCentralMomentList ();
96+ void calculateCentralMomentHists (std::vector<TH1*> inh, int ind, int m, TH1* hMpt);
97+ void createCumulantList ();
98+ void calculateCumulantHists (std::vector<TH1*> inh, int ind);
99+ void clearVector ()
96100 {
97101 sumP.clear ();
98102 sumP.resize ((mpar + 1 ) * (mpar + 1 ));
99103 cmVal.clear ();
100104 cmDen.clear ();
101105 fillCounter = 0 ;
106+ arr.clear ();
107+ arr.resize (3 * 3 * 3 * 3 , {0.0 , 0.0 });
108+ warr.clear ();
109+ warr.resize (3 * 3 * 3 * 3 , 0.0 );
102110 };
103111
104- private:
105112 TList* fCMTermList ;
106113 TList* fCorrList ;
107114 TList* fCovList ;
108115 TList* fCumulantList ;
109116 TList* fCentralMomentList ;
110- int mpar;
111- int fillCounter;
112- unsigned int fEventWeight ;
113- bool fUseCentralMoments ;
114- bool fUseGap ;
115- void MergeBSLists (TList* source, TList* target);
117+
118+ int mpar; // !
119+ int fillCounter; // !
120+ unsigned int fEventWeight ; // !
121+ bool fUseCentralMoments ; // !
122+ bool fUseGap ; // !
123+ void mergeBSLists (TList* source, TList* target);
116124 TH1* raiseHistToPower (TH1* inh, double p);
117125 std::vector<double > sumP; // !
118126 std::vector<double > corrNum; // !
119127 std::vector<double > corrDen; // !
120128 std::vector<double > cmVal; // !
121129 std::vector<double > cmDen; // !
122- std::complex <double > arr[ 3 ][ 3 ][ 3 ][ 3 ] ; // !
123- double warr[ 3 ][ 3 ][ 3 ][ 3 ] ; // !
130+ std::vector<std:: complex <double >> arr; // !
131+ std::vector< double > warr; // !
124132 template <typename T>
125133 double getStdAABBCC (T& inarr);
126134 template <typename T>
@@ -141,8 +149,10 @@ class FlowPtContainer : public TNamed
141149 double getStdABC (T& inarr);
142150 template <typename T>
143151 double getStdABD (T& inarr);
144- static constexpr float fFactorial [9 ] = {1 ., 1 ., 2 ., 6 ., 24 ., 120 ., 720 ., 5040 ., 40320 .};
145- static constexpr int fSign [9 ] = {1 , -1 , 1 , -1 , 1 , -1 , 1 , -1 , 1 };
146- ClassDef (FlowPtContainer, 1 );
152+
153+ private:
154+ static constexpr float FactorialArray[9 ] = {1 ., 1 ., 2 ., 6 ., 24 ., 120 ., 720 ., 5040 ., 40320 .};
155+ static constexpr int SignArray[9 ] = {1 , -1 , 1 , -1 , 1 , -1 , 1 , -1 , 1 };
156+ ClassDef (FlowPtContainer, 2 );
147157};
148158#endif // PWGCF_GENERICFRAMEWORK_CORE_FLOWPTCONTAINER_H_
0 commit comments