Skip to content

Commit 335249e

Browse files
authored
[PWGCF] Update flowEventPlane.cxx (#14034)
1 parent 6008653 commit 335249e

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

PWGCF/Flow/Tasks/flowEventPlane.cxx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ struct FlowEventPlane {
163163
// Container for histograms
164164
struct CorrectionHistContainer {
165165
std::array<TH2F*, 2> hGainCalib;
166-
std::array<std::array<THnSparseF*, 1>, 4> vCoarseCorrHist;
167-
std::array<std::array<TProfile*, 4>, 4> vFineCorrHist;
166+
std::array<std::array<std::array<THnSparseF*, 1>, 4>, 6> vCoarseCorrHist;
167+
std::array<std::array<std::array<TProfile*, 4>, 4>, 6> vFineCorrHist;
168168
} CorrectionHistContainer;
169169

170170
// Run number
@@ -429,13 +429,13 @@ struct FlowEventPlane {
429429
}
430430
}
431431

432-
std::vector<float> getAvgCorrFactors(CorrectionType const& corrType, std::array<float, 4> const& vCollParam)
432+
std::vector<float> getAvgCorrFactors(int const& itr, CorrectionType const& corrType, std::array<float, 4> const& vCollParam)
433433
{
434434
std::vector<float> vAvgOutput = {0., 0., 0., 0.};
435435
int binarray[4];
436436
if (corrType == kCoarseCorr) {
437437
int cntrx = 0;
438-
for (auto const& v : CorrectionHistContainer.vCoarseCorrHist) {
438+
for (auto const& v : CorrectionHistContainer.vCoarseCorrHist[itr]) {
439439
for (auto const& h : v) {
440440
binarray[kCent] = h->GetAxis(kCent)->FindBin(vCollParam[kCent] + 0.0001);
441441
binarray[kVx] = h->GetAxis(kVx)->FindBin(vCollParam[kVx] + 0.0001);
@@ -447,7 +447,7 @@ struct FlowEventPlane {
447447
}
448448
} else {
449449
int cntrx = 0;
450-
for (auto const& v : CorrectionHistContainer.vFineCorrHist) {
450+
for (auto const& v : CorrectionHistContainer.vFineCorrHist[itr]) {
451451
int cntry = 0;
452452
for (auto const& h : v) {
453453
vAvgOutput[cntrx] += h->GetBinContent(h->GetXaxis()->FindBin(vCollParam[cntry] + 0.0001));
@@ -467,6 +467,7 @@ struct FlowEventPlane {
467467
CorrectionType corrType = kFineCorr;
468468
std::string ccdbPath;
469469

470+
// Correction iterations
470471
for (int i = 0; i < nitr; ++i) {
471472
// Don't correct if corrFlag != 1
472473
if (vCorrFlags[i] != 1) {
@@ -501,9 +502,9 @@ struct FlowEventPlane {
501502
int cntry = 0;
502503
for (auto const& y : x) {
503504
if (corrType == kFineCorr) {
504-
CorrectionHistContainer.vFineCorrHist[cntrx][cntry] = reinterpret_cast<TProfile*>(ccdbObject->FindObject(y.c_str()));
505+
CorrectionHistContainer.vFineCorrHist[i][cntrx][cntry] = reinterpret_cast<TProfile*>(ccdbObject->FindObject(y.c_str()));
505506
} else {
506-
CorrectionHistContainer.vCoarseCorrHist[cntrx][cntry] = reinterpret_cast<THnSparseF*>(ccdbObject->FindObject(y.c_str()));
507+
CorrectionHistContainer.vCoarseCorrHist[i][cntrx][cntry] = reinterpret_cast<THnSparseF*>(ccdbObject->FindObject(y.c_str()));
507508
}
508509
++cntry;
509510
}
@@ -512,7 +513,7 @@ struct FlowEventPlane {
512513
}
513514

514515
// Get averages
515-
std::vector<float> vAvg = getAvgCorrFactors(corrType, inputParam);
516+
std::vector<float> vAvg = getAvgCorrFactors(i, corrType, inputParam);
516517

517518
// Apply correction
518519
outputParam[kXa] -= vAvg[kXa];

0 commit comments

Comments
 (0)