Skip to content

Commit 7dd729d

Browse files
author
Emil Gorm Nielsen
committed
Added merge procedure for covlist
1 parent 88f0a2f commit 7dd729d

File tree

2 files changed

+40
-12
lines changed

2 files changed

+40
-12
lines changed

PWGCF/GenericFramework/Core/FlowPtContainer.cxx

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
#include <vector>
1515
#include <cstdio>
1616

17-
FlowPtContainer::FlowPtContainer() : TNamed("name", "name"),
18-
fCMTermList(0),
17+
FlowPtContainer::FlowPtContainer() : fCMTermList(0),
1918
fCorrList(0),
2019
fCovList(0),
2120
fCumulantList(0),
@@ -29,11 +28,14 @@ FlowPtContainer::FlowPtContainer() : TNamed("name", "name"),
2928
corrNum(),
3029
corrDen(),
3130
cmVal(),
32-
cmDen() {}
31+
cmDen(),
32+
arr{},
33+
warr{} {}
3334
FlowPtContainer::~FlowPtContainer()
3435
{
3536
delete fCMTermList;
3637
delete fCorrList;
38+
delete fCovList;
3739
};
3840
FlowPtContainer::FlowPtContainer(const char* name) : TNamed(name, name),
3941
fCMTermList(0),
@@ -50,7 +52,9 @@ FlowPtContainer::FlowPtContainer(const char* name) : TNamed(name, name),
5052
corrNum(),
5153
corrDen(),
5254
cmVal(),
53-
cmDen() {}
55+
cmDen(),
56+
arr{},
57+
warr{} {}
5458
FlowPtContainer::FlowPtContainer(const char* name, const char* title) : TNamed(name, title),
5559
fCMTermList(0),
5660
fCorrList(0),
@@ -66,7 +70,9 @@ FlowPtContainer::FlowPtContainer(const char* name, const char* title) : TNamed(n
6670
corrNum(),
6771
corrDen(),
6872
cmVal(),
69-
cmDen() {}
73+
cmDen(),
74+
arr{},
75+
warr{} {}
7076
void FlowPtContainer::Initialise(const o2::framework::AxisSpec axis, const int& m, const GFWCorrConfigs& configs, const int& nsub)
7177
{
7278
if (!mpar)
@@ -149,6 +155,7 @@ void FlowPtContainer::Initialise(const o2::framework::AxisSpec axis, const int&
149155
};
150156
void FlowPtContainer::Initialise(int nbinsx, double* xbins, const int& m, const GFWCorrConfigs& configs, const int& nsub)
151157
{
158+
printf("1\n");
152159
if (!mpar)
153160
mpar = m;
154161
if (fCMTermList)
@@ -159,14 +166,21 @@ void FlowPtContainer::Initialise(int nbinsx, double* xbins, const int& m, const
159166
delete fCorrList;
160167
fCorrList = new TList();
161168
fCorrList->SetOwner(kTRUE);
169+
if (fCovList)
170+
delete fCovList;
171+
fCovList = new TList();
172+
fCovList->SetOwner(kTRUE);
173+
printf("2\n");
162174
for (int m = 0; m < mpar; ++m) {
163175
fCorrList->Add(new BootstrapProfile(Form("mpt%i", m + 1), Form("mpt%i", m + 1), nbinsx, xbins));
164176
}
177+
printf("3\n");
165178
for (int m = 0; m < 4; ++m) {
166179
for (int i = 0; i <= m; ++i) {
167180
fCMTermList->Add(new BootstrapProfile(Form("cm%i_Mpt%i", m + 1, i), Form("cm%i_Mpt%i", m + 1, i), nbinsx, xbins));
168181
}
169182
}
183+
printf("4\n");
170184
if (fUseGap) {
171185
for (int i = 0; i < configs.GetSize(); ++i) {
172186
for (auto m(1); m <= mpar; ++m) {
@@ -197,12 +211,14 @@ void FlowPtContainer::Initialise(int nbinsx, double* xbins, const int& m, const
197211
fCovList->Add(new BootstrapProfile("ChFull22pt1_Mpt0", "ChFull22pt1_Mpt0", nbinsx, xbins));
198212
fCovList->Add(new BootstrapProfile("ChFull22pt1_Mpt1", "ChFull22pt1_Mpt1", nbinsx, xbins));
199213
} else {
214+
printf("5\n");
200215
fCovList->Add(new BootstrapProfile("ChFull24pt2", "ChFull24pt2", nbinsx, xbins));
201216
fCovList->Add(new BootstrapProfile("ChFull24pt1", "ChFull24pt1", nbinsx, xbins));
202217
fCovList->Add(new BootstrapProfile("ChFull22pt2", "ChFull22pt2", nbinsx, xbins));
203218
fCovList->Add(new BootstrapProfile("ChFull22pt1", "ChFull22pt1", nbinsx, xbins));
204219
}
205220
}
221+
printf("6\n");
206222
if (nsub) {
207223
for (int i = 0; i < fCorrList->GetEntries(); ++i)
208224
dynamic_cast<BootstrapProfile*>(fCorrList->At(i))->InitializeSubsamples(nsub);
@@ -225,6 +241,10 @@ void FlowPtContainer::Initialise(int nbinsx, double xlow, double xhigh, const in
225241
delete fCorrList;
226242
fCorrList = new TList();
227243
fCorrList->SetOwner(kTRUE);
244+
if (fCovList)
245+
delete fCovList;
246+
fCovList = new TList();
247+
fCovList->SetOwner(kTRUE);
228248
for (int m = 0; m < mpar; ++m) {
229249
fCorrList->Add(new BootstrapProfile(Form("mpt%i", m + 1), Form("mpt%i", m + 1), nbinsx, xlow, xhigh));
230250
}
@@ -900,6 +920,7 @@ Long64_t FlowPtContainer::Merge(TCollection* collist)
900920
while ((l_PTC = dynamic_cast<FlowPtContainer*>(all_PTC()))) {
901921
TList* t_CMTerm = l_PTC->fCMTermList;
902922
TList* t_Corr = l_PTC->fCorrList;
923+
TList* t_Cov = l_PTC->fCovList;
903924
TList* t_Cum = l_PTC->fCumulantList;
904925
TList* t_CM = l_PTC->fCentralMomentList;
905926
if (t_CMTerm) {
@@ -915,6 +936,12 @@ Long64_t FlowPtContainer::Merge(TCollection* collist)
915936
else
916937
MergeBSLists(fCorrList, t_Corr);
917938
}
939+
if (t_Cov) {
940+
if (!fCovList)
941+
fCovList = dynamic_cast<TList*>(t_Cov->Clone());
942+
else
943+
MergeBSLists(fCovList, t_Cov);
944+
}
918945
if (t_Cum) {
919946
if (!fCumulantList)
920947
fCumulantList = dynamic_cast<TList*>(t_Cum->Clone());

PWGCF/GenericFramework/Core/FlowPtContainer.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,17 @@ class FlowPtContainer : public TNamed
101101
fillCounter = 0;
102102
};
103103

104-
private:
105104
TList* fCMTermList;
106105
TList* fCorrList;
107106
TList* fCovList;
108107
TList* fCumulantList;
109108
TList* fCentralMomentList;
110-
int mpar;
111-
int fillCounter;
112-
unsigned int fEventWeight;
113-
bool fUseCentralMoments;
114-
bool fUseGap;
109+
110+
int mpar; //!
111+
int fillCounter; //!
112+
unsigned int fEventWeight; //!
113+
bool fUseCentralMoments; //!
114+
bool fUseGap; //!
115115
void MergeBSLists(TList* source, TList* target);
116116
TH1* raiseHistToPower(TH1* inh, double p);
117117
std::vector<double> sumP; //!
@@ -141,8 +141,9 @@ class FlowPtContainer : public TNamed
141141
double getStdABC(T& inarr);
142142
template <typename T>
143143
double getStdABD(T& inarr);
144+
private:
144145
static constexpr float fFactorial[9] = {1., 1., 2., 6., 24., 120., 720., 5040., 40320.};
145146
static constexpr int fSign[9] = {1, -1, 1, -1, 1, -1, 1, -1, 1};
146-
ClassDef(FlowPtContainer, 1);
147+
ClassDef(FlowPtContainer, 2);
147148
};
148149
#endif // PWGCF_GENERICFRAMEWORK_CORE_FLOWPTCONTAINER_H_

0 commit comments

Comments
 (0)