Skip to content

Commit 87b0365

Browse files
authored
Merge branch 'AliceO2Group:master' into master
2 parents 47e7853 + 2a94944 commit 87b0365

File tree

27 files changed

+1308
-961
lines changed

27 files changed

+1308
-961
lines changed

PWGCF/Flow/Tasks/flowAnalysisGF.cxx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ struct flowAnalysisGF {
286286
fFC->Initialize(oba, multAxis, cfgNbootstrap);
287287

288288
delete oba;
289-
fFCpt->Initialise(multAxis, cfgMpar, configs, cfgNbootstrap);
289+
fFCpt->initialise(multAxis, cfgMpar, configs, cfgNbootstrap);
290290

291291
// Event selection - Alex
292292
if (cfgUseAdditionalEventCut) {
@@ -497,9 +497,9 @@ struct flowAnalysisGF {
497497

498498
void FillOutputContainers(datatype dt, const float& centmult, const double& rndm)
499499
{
500-
fFCpt->CalculateCorrelations();
501-
fFCpt->FillPtProfiles(centmult, rndm);
502-
fFCpt->FillCMProfiles(centmult, rndm);
500+
fFCpt->calculateCorrelations();
501+
fFCpt->fillPtProfiles(centmult, rndm);
502+
fFCpt->fillCMProfiles(centmult, rndm);
503503
for (uint l_ind = 0; l_ind < corrconfigs.size(); ++l_ind) {
504504
auto dnx = fGFW->Calculate(corrconfigs.at(l_ind), 0, kTRUE).real();
505505
if (dnx == 0)
@@ -508,7 +508,7 @@ struct flowAnalysisGF {
508508
auto val = fGFW->Calculate(corrconfigs.at(l_ind), 0, kFALSE).real() / dnx;
509509
if (TMath::Abs(val) < 1) {
510510
(dt == kGen) ? fFC_gen->FillProfile(corrconfigs.at(l_ind).Head.c_str(), centmult, val, dnx, rndm) : fFC->FillProfile(corrconfigs.at(l_ind).Head.c_str(), centmult, val, dnx, rndm);
511-
fFCpt->FillVnPtProfiles(centmult, val, dnx, rndm, configs.GetpTCorrMasks()[l_ind]);
511+
fFCpt->fillVnPtProfiles(centmult, val, dnx, rndm, configs.GetpTCorrMasks()[l_ind]);
512512
}
513513
continue;
514514
}
@@ -535,7 +535,7 @@ struct flowAnalysisGF {
535535
registry.fill(HIST("hEventCount"), 9.5);
536536
float vtxz = collision.posZ();
537537
fGFW->Clear();
538-
fFCpt->ClearVector();
538+
fFCpt->clearVector();
539539
float l_Random = fRndm->Rndm();
540540

541541
std::vector<int> ITS_TPC_tracks(6, 0);
@@ -630,7 +630,7 @@ struct flowAnalysisGF {
630630
template <typename TrackObject>
631631
inline void FillGFW(TrackObject track, float weff, float wacc)
632632
{
633-
fFCpt->Fill(weff, track.pt());
633+
fFCpt->fill(weff, track.pt());
634634
bool WithinPtPOI = (ptpoilow < track.pt()) && (track.pt() < ptpoiup); // within POI pT range
635635
bool WithinPtRef = (ptreflow < track.pt()) && (track.pt() < ptrefup); // within RF pT range
636636
if (WithinPtRef)

PWGCF/GenericFramework/Core/FlowPtContainer.cxx

Lines changed: 334 additions & 320 deletions
Large diffs are not rendered by default.

PWGCF/GenericFramework/Core/FlowPtContainer.h

Lines changed: 61 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
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

@@ -26,9 +30,9 @@
2630

2731
namespace 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

Comments
 (0)