Skip to content

Commit 190b88f

Browse files
committed
add solution function for fillCounter problem
1 parent e0cdec4 commit 190b88f

File tree

3 files changed

+77
-1
lines changed

3 files changed

+77
-1
lines changed

PWGCF/Flow/Tasks/flowTask.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ struct FlowTask {
640640
continue;
641641
auto val = fGFW->Calculate(corrconfigsPtVn.at(l_ind), 0, kFALSE).real() / dnx;
642642
if (std::abs(val) < 1) {
643-
(dt == kGen) ? fFCptgen->fillVnPtProfiles(centmult, val, dnx, rndm, gfwConfigs.GetpTCorrMasks()[l_ind]) : fFCpt->fillVnPtProfiles(centmult, val, dnx, rndm, gfwConfigs.GetpTCorrMasks()[l_ind]);
643+
(dt == kGen) ? fFCptgen->fillVnPtProfiles(l_ind, centmult, val, dnx, rndm, gfwConfigs.GetpTCorrMasks()[l_ind]) : fFCpt->fillVnPtProfiles(l_ind, centmult, val, dnx, rndm, gfwConfigs.GetpTCorrMasks()[l_ind]);
644644
}
645645
continue;
646646
}

PWGCF/GenericFramework/Core/FlowPtContainer.cxx

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,16 +112,21 @@ void FlowPtContainer::initialise(const o2::framework::AxisSpec axis, const int&
112112
}
113113
}
114114
if (fUseGap) {
115+
int obsIndex = 0;
116+
fCovFirstIndex.resize(configs.GetSize(), 0);
115117
for (int i = 0; i < configs.GetSize(); ++i) {
118+
fCovFirstIndex[i] = obsIndex;
116119
for (auto m(1); m <= mpar; ++m) {
117120
if (!(configs.GetpTCorrMasks()[i] & (1 << (m - 1))))
118121
continue;
119122
if (fUseCentralMoments) {
120123
for (auto j = 0; j <= m; ++j) {
121124
fCovList->Add(new BootstrapProfile(Form("%spt%i_Mpt%i", configs.GetHeads()[i].c_str(), m, j), Form("%spt%i_Mpt%i", configs.GetHeads()[i].c_str(), m, j), nMultiBins, &multiBins[0]));
125+
obsIndex++;
122126
}
123127
} else {
124128
fCovList->Add(new BootstrapProfile(Form("%spt%i", configs.GetHeads()[i].c_str(), m), Form("%spt%i", configs.GetHeads()[i].c_str(), m), nMultiBins, &multiBins[0]));
129+
obsIndex++;
125130
}
126131
}
127132
}
@@ -197,16 +202,21 @@ void FlowPtContainer::initialise(int nbinsx, double* xbins, const int& m, const
197202
}
198203
}
199204
if (fUseGap) {
205+
int obsIndex = 0;
206+
fCovFirstIndex.resize(configs.GetSize(), 0);
200207
for (int i = 0; i < configs.GetSize(); ++i) {
208+
fCovFirstIndex[i] = obsIndex;
201209
for (auto m(1); m <= mpar; ++m) {
202210
if (!(configs.GetpTCorrMasks()[i] & (1 << (m - 1))))
203211
continue;
204212
if (fUseCentralMoments) {
205213
for (auto j = 0; j <= m; ++j) {
206214
fCovList->Add(new BootstrapProfile(Form("%spt%i_Mpt%i", configs.GetHeads()[i].c_str(), m, j), Form("%spt%i_Mpt%i", configs.GetHeads()[i].c_str(), m, j), nbinsx, xbins));
215+
obsIndex++;
207216
}
208217
} else {
209218
fCovList->Add(new BootstrapProfile(Form("%spt%i", configs.GetHeads()[i].c_str(), m), Form("%spt%i", configs.GetHeads()[i].c_str(), m), nbinsx, xbins));
219+
obsIndex++;
210220
}
211221
}
212222
}
@@ -280,16 +290,21 @@ void FlowPtContainer::initialise(int nbinsx, double xlow, double xhigh, const in
280290
}
281291
}
282292
if (fUseGap) {
293+
int obsIndex = 0;
294+
fCovFirstIndex.resize(configs.GetSize(), 0);
283295
for (int i = 0; i < configs.GetSize(); ++i) {
296+
fCovFirstIndex[i] = obsIndex;
284297
for (auto m(1); m <= mpar; ++m) {
285298
if (!(configs.GetpTCorrMasks()[i] & (1 << (m - 1))))
286299
continue;
287300
if (fUseCentralMoments) {
288301
for (auto j = 0; j <= m; ++j) {
289302
fCovList->Add(new BootstrapProfile(Form("%spt%i_Mpt%i", configs.GetHeads()[i].c_str(), m, j), Form("%spt%i_Mpt%i", configs.GetHeads()[i].c_str(), m, j), nbinsx, xlow, xhigh));
303+
obsIndex++;
290304
}
291305
} else {
292306
fCovList->Add(new BootstrapProfile(Form("%spt%i", configs.GetHeads()[i].c_str(), m), Form("%spt%i", configs.GetHeads()[i].c_str(), m), nbinsx, xlow, xhigh));
307+
obsIndex++;
293308
}
294309
}
295310
}
@@ -412,6 +427,41 @@ void FlowPtContainer::fillVnDeltaPtProfiles(const double& centmult, const double
412427
}
413428
return;
414429
}
430+
void FlowPtContainer::fillVnPtCorrProfiles(const int configIndex, const double& centmult, const double& flowval, const double& flowtuples, const double& rn, uint8_t mask)
431+
{
432+
if (!mask) {
433+
return;
434+
}
435+
int startIndex = fCovFirstIndex[configIndex];
436+
for (auto m(1); m <= mpar; ++m) {
437+
if (!(mask & (1 << (m - 1)))) {
438+
continue;
439+
}
440+
if (corrDen[m] != 0) {
441+
dynamic_cast<BootstrapProfile*>(fCovList->At(startIndex))->FillProfile(centmult, flowval * corrNum[m] / corrDen[m], (fEventWeight == UnityWeight) ? 1.0 : flowtuples * corrDen[m], rn);
442+
}
443+
++startIndex;
444+
}
445+
return;
446+
}
447+
void FlowPtContainer::fillVnDeltaPtProfiles(const int configIndex, const double& centmult, const double& flowval, const double& flowtuples, const double& rn, uint8_t mask)
448+
{
449+
if (!mask) {
450+
return;
451+
}
452+
int startIndex = fCovFirstIndex[configIndex];
453+
for (auto m(1); m <= mpar; ++m) {
454+
if (!(mask & (1 << (m - 1))))
455+
continue;
456+
for (auto i = 0; i <= m; ++i) {
457+
if (cmDen[m] != 0) {
458+
dynamic_cast<BootstrapProfile*>(fCovList->At(startIndex))->FillProfile(centmult, flowval * ((i == m) ? cmVal[0] : cmVal[m * (m - 1) / 2 + i + 1]), (fEventWeight == UnityWeight) ? 1.0 : flowtuples * cmDen[m], rn);
459+
}
460+
++startIndex;
461+
}
462+
}
463+
return;
464+
}
415465
void FlowPtContainer::fillVnPtCorrStdProfiles(const double& centmult, const double& rn)
416466
{
417467
double wAABBCC = getStdAABBCC(warr);

PWGCF/GenericFramework/Core/FlowPtContainer.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ class FlowPtContainer : public TNamed
5959
void fillPtProfiles(const double& lMult, const double& rn);
6060
void fillVnPtCorrProfiles(const double& lMult, const double& flowval, const double& flowtuples, const double& rn, uint8_t mask);
6161
void fillVnDeltaPtProfiles(const double& centmult, const double& flowval, const double& flowtuples, const double& rn, uint8_t mask);
62+
void fillVnPtCorrProfiles(const int configIndex, const double& lMult, const double& flowval, const double& flowtuples, const double& rn, uint8_t mask);
63+
void fillVnDeltaPtProfiles(const int configIndex, const double& centmult, const double& flowval, const double& flowtuples, const double& rn, uint8_t mask);
6264
void fillVnDeltaPtStdProfiles(const double& centmult, const double& rn);
6365
void fillVnPtCorrStdProfiles(const double& centmult, const double& rn);
6466
void fillVnPtProfiles(const double& centmult, const double& flowval, const double& flowtuples, const double& rn, uint8_t mask)
@@ -68,6 +70,29 @@ class FlowPtContainer : public TNamed
6870
else
6971
fillVnPtCorrProfiles(centmult, flowval, flowtuples, rn, mask);
7072
}
73+
void fillVnPtProfiles(const int configIndex, const double& centmult, const double& flowval, const double& flowtuples, const double& rn, uint8_t mask)
74+
{
75+
if (fUseCentralMoments)
76+
fillVnDeltaPtProfiles(configIndex, centmult, flowval, flowtuples, rn, mask);
77+
else
78+
fillVnPtCorrProfiles(configIndex, centmult, flowval, flowtuples, rn, mask);
79+
}
80+
void skipVnPtProfiles(uint8_t mask)
81+
{
82+
for (auto m(1); m <= mpar; ++m) {
83+
if (!(mask & (1 << (m - 1)))) {
84+
continue;
85+
}
86+
if (fUseCentralMoments) {
87+
for (auto i = 0; i <= m; ++i) {
88+
++fillCounter;
89+
}
90+
} else {
91+
++fillCounter;
92+
}
93+
}
94+
return;
95+
}
7196
void fillVnPtStdProfiles(const double& centmult, const double& rn)
7297
{
7398
if (fUseCentralMoments)
@@ -129,6 +154,7 @@ class FlowPtContainer : public TNamed
129154
std::vector<double> cmDen; //!
130155
std::vector<std::complex<double>> arr; //!
131156
std::vector<double> warr; //!
157+
std::vector<int> fCovFirstIndex; //!
132158
template <typename T>
133159
double getStdAABBCC(T& inarr);
134160
template <typename T>

0 commit comments

Comments
 (0)