diff --git a/PWGCF/Flow/Tasks/flowEventPlane.cxx b/PWGCF/Flow/Tasks/flowEventPlane.cxx index b6459387d58..e172f90e13b 100644 --- a/PWGCF/Flow/Tasks/flowEventPlane.cxx +++ b/PWGCF/Flow/Tasks/flowEventPlane.cxx @@ -163,8 +163,8 @@ struct FlowEventPlane { // Container for histograms struct CorrectionHistContainer { std::array hGainCalib; - std::array, 4> vCoarseCorrHist; - std::array, 4> vFineCorrHist; + std::array, 4>, 6> vCoarseCorrHist; + std::array, 4>, 6> vFineCorrHist; } CorrectionHistContainer; // Run number @@ -429,13 +429,13 @@ struct FlowEventPlane { } } - std::vector getAvgCorrFactors(CorrectionType const& corrType, std::array const& vCollParam) + std::vector getAvgCorrFactors(int const& itr, CorrectionType const& corrType, std::array const& vCollParam) { std::vector vAvgOutput = {0., 0., 0., 0.}; int binarray[4]; if (corrType == kCoarseCorr) { int cntrx = 0; - for (auto const& v : CorrectionHistContainer.vCoarseCorrHist) { + for (auto const& v : CorrectionHistContainer.vCoarseCorrHist[itr]) { for (auto const& h : v) { binarray[kCent] = h->GetAxis(kCent)->FindBin(vCollParam[kCent] + 0.0001); binarray[kVx] = h->GetAxis(kVx)->FindBin(vCollParam[kVx] + 0.0001); @@ -447,7 +447,7 @@ struct FlowEventPlane { } } else { int cntrx = 0; - for (auto const& v : CorrectionHistContainer.vFineCorrHist) { + for (auto const& v : CorrectionHistContainer.vFineCorrHist[itr]) { int cntry = 0; for (auto const& h : v) { vAvgOutput[cntrx] += h->GetBinContent(h->GetXaxis()->FindBin(vCollParam[cntry] + 0.0001)); @@ -467,6 +467,7 @@ struct FlowEventPlane { CorrectionType corrType = kFineCorr; std::string ccdbPath; + // Correction iterations for (int i = 0; i < nitr; ++i) { // Don't correct if corrFlag != 1 if (vCorrFlags[i] != 1) { @@ -501,9 +502,9 @@ struct FlowEventPlane { int cntry = 0; for (auto const& y : x) { if (corrType == kFineCorr) { - CorrectionHistContainer.vFineCorrHist[cntrx][cntry] = reinterpret_cast(ccdbObject->FindObject(y.c_str())); + CorrectionHistContainer.vFineCorrHist[i][cntrx][cntry] = reinterpret_cast(ccdbObject->FindObject(y.c_str())); } else { - CorrectionHistContainer.vCoarseCorrHist[cntrx][cntry] = reinterpret_cast(ccdbObject->FindObject(y.c_str())); + CorrectionHistContainer.vCoarseCorrHist[i][cntrx][cntry] = reinterpret_cast(ccdbObject->FindObject(y.c_str())); } ++cntry; } @@ -512,7 +513,7 @@ struct FlowEventPlane { } // Get averages - std::vector vAvg = getAvgCorrFactors(corrType, inputParam); + std::vector vAvg = getAvgCorrFactors(i, corrType, inputParam); // Apply correction outputParam[kXa] -= vAvg[kXa];