Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion PWGCF/Flow/Tasks/flowTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ struct FlowTask {
continue;
auto val = fGFW->Calculate(corrconfigsPtVn.at(l_ind), 0, kFALSE).real() / dnx;
if (std::abs(val) < 1) {
(dt == kGen) ? fFCptgen->fillVnPtProfiles(centmult, val, dnx, rndm, gfwConfigs.GetpTCorrMasks()[l_ind]) : fFCpt->fillVnPtProfiles(centmult, val, dnx, rndm, gfwConfigs.GetpTCorrMasks()[l_ind]);
(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]);
}
continue;
}
Expand Down
50 changes: 50 additions & 0 deletions PWGCF/GenericFramework/Core/FlowPtContainer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -106,22 +106,27 @@
for (int m = 0; m < mpar; ++m) {
fCorrList->Add(new BootstrapProfile(Form("mpt%i", m + 1), Form("mpt%i", m + 1), nMultiBins, &multiBins[0]));
}
for (int m = 0; m < 4; ++m) {

Check failure on line 109 in PWGCF/GenericFramework/Core/FlowPtContainer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
for (int i = 0; i <= m; ++i) {
fCMTermList->Add(new BootstrapProfile(Form("cm%i_Mpt%i", m + 1, i), Form("cm%i_Mpt%i", m + 1, i), nMultiBins, &multiBins[0]));
}
}
if (fUseGap) {
int obsIndex = 0;
fCovFirstIndex.resize(configs.GetSize(), 0);
for (int i = 0; i < configs.GetSize(); ++i) {
fCovFirstIndex[i] = obsIndex;
for (auto m(1); m <= mpar; ++m) {
if (!(configs.GetpTCorrMasks()[i] & (1 << (m - 1))))
continue;
if (fUseCentralMoments) {
for (auto j = 0; j <= m; ++j) {
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]));
obsIndex++;
}
} else {
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]));
obsIndex++;
}
}
}
Expand Down Expand Up @@ -191,22 +196,27 @@
for (int m = 0; m < mpar; ++m) {
fCorrList->Add(new BootstrapProfile(Form("mpt%i", m + 1), Form("mpt%i", m + 1), nbinsx, xbins));
}
for (int m = 0; m < 4; ++m) {

Check failure on line 199 in PWGCF/GenericFramework/Core/FlowPtContainer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
for (int i = 0; i <= m; ++i) {
fCMTermList->Add(new BootstrapProfile(Form("cm%i_Mpt%i", m + 1, i), Form("cm%i_Mpt%i", m + 1, i), nbinsx, xbins));
}
}
if (fUseGap) {
int obsIndex = 0;
fCovFirstIndex.resize(configs.GetSize(), 0);
for (int i = 0; i < configs.GetSize(); ++i) {
fCovFirstIndex[i] = obsIndex;
for (auto m(1); m <= mpar; ++m) {
if (!(configs.GetpTCorrMasks()[i] & (1 << (m - 1))))
continue;
if (fUseCentralMoments) {
for (auto j = 0; j <= m; ++j) {
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));
obsIndex++;
}
} else {
fCovList->Add(new BootstrapProfile(Form("%spt%i", configs.GetHeads()[i].c_str(), m), Form("%spt%i", configs.GetHeads()[i].c_str(), m), nbinsx, xbins));
obsIndex++;
}
}
}
Expand Down Expand Up @@ -274,22 +284,27 @@
for (int m = 0; m < mpar; ++m) {
fCorrList->Add(new BootstrapProfile(Form("mpt%i", m + 1), Form("mpt%i", m + 1), nbinsx, xlow, xhigh));
}
for (int m = 0; m < 4; ++m) {

Check failure on line 287 in PWGCF/GenericFramework/Core/FlowPtContainer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
for (int i = 0; i <= m; ++i) {
fCMTermList->Add(new BootstrapProfile(Form("cm%i_Mpt%i", m + 1, i), Form("cm%i_Mpt%i", m + 1, i), nbinsx, xlow, xhigh));
}
}
if (fUseGap) {
int obsIndex = 0;
fCovFirstIndex.resize(configs.GetSize(), 0);
for (int i = 0; i < configs.GetSize(); ++i) {
fCovFirstIndex[i] = obsIndex;
for (auto m(1); m <= mpar; ++m) {
if (!(configs.GetpTCorrMasks()[i] & (1 << (m - 1))))
continue;
if (fUseCentralMoments) {
for (auto j = 0; j <= m; ++j) {
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));
obsIndex++;
}
} else {
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));
obsIndex++;
}
}
}
Expand Down Expand Up @@ -412,6 +427,41 @@
}
return;
}
void FlowPtContainer::fillVnPtCorrProfiles(const int configIndex, const double& centmult, const double& flowval, const double& flowtuples, const double& rn, uint8_t mask)
{
if (!mask) {
return;
}
int startIndex = fCovFirstIndex[configIndex];
for (auto m(1); m <= mpar; ++m) {
if (!(mask & (1 << (m - 1)))) {
continue;
}
if (corrDen[m] != 0) {
dynamic_cast<BootstrapProfile*>(fCovList->At(startIndex))->FillProfile(centmult, flowval * corrNum[m] / corrDen[m], (fEventWeight == UnityWeight) ? 1.0 : flowtuples * corrDen[m], rn);
}
++startIndex;
}
return;
}
void FlowPtContainer::fillVnDeltaPtProfiles(const int configIndex, const double& centmult, const double& flowval, const double& flowtuples, const double& rn, uint8_t mask)
{
if (!mask) {
return;
}
int startIndex = fCovFirstIndex[configIndex];
for (auto m(1); m <= mpar; ++m) {
if (!(mask & (1 << (m - 1))))
continue;
for (auto i = 0; i <= m; ++i) {
if (cmDen[m] != 0) {
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);
}
++startIndex;
}
}
return;
}
void FlowPtContainer::fillVnPtCorrStdProfiles(const double& centmult, const double& rn)
{
double wAABBCC = getStdAABBCC(warr);
Expand Down Expand Up @@ -508,13 +558,13 @@
return;
cmVal.push_back(sumP[getVectorIndex(1, 1)] / cmDen[1]);
dynamic_cast<BootstrapProfile*>(fCMTermList->At(0))->FillProfile(centmult, cmVal[1], (fEventWeight == EventWeight::UnityWeight) ? 1.0 : cmDen[1], rn);
if (mpar < 2 || sumP[getVectorIndex(2, 0)] == 0 || cmDen[2] == 0)

Check failure on line 561 in PWGCF/GenericFramework/Core/FlowPtContainer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
return;
cmVal.push_back(1 / cmDen[2] * (sumP[getVectorIndex(1, 1)] * sumP[getVectorIndex(1, 1)] - sumP[getVectorIndex(2, 2)]));
dynamic_cast<BootstrapProfile*>(fCMTermList->At(1))->FillProfile(centmult, cmVal[2], (fEventWeight == EventWeight::UnityWeight) ? 1.0 : cmDen[2], rn);
cmVal.push_back(-2 * 1 / cmDen[2] * (sumP[getVectorIndex(1, 0)] * sumP[getVectorIndex(1, 1)] - sumP[getVectorIndex(2, 1)]));
dynamic_cast<BootstrapProfile*>(fCMTermList->At(2))->FillProfile(centmult, cmVal[3], (fEventWeight == EventWeight::UnityWeight) ? 1.0 : cmDen[2], rn);
if (mpar < 3 || sumP[getVectorIndex(3, 0)] == 0 || cmDen[3] == 0)

Check failure on line 567 in PWGCF/GenericFramework/Core/FlowPtContainer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
return;
cmVal.push_back(1 / cmDen[3] * (sumP[getVectorIndex(1, 1)] * sumP[getVectorIndex(1, 1)] * sumP[getVectorIndex(1, 1)] - 3 * sumP[getVectorIndex(2, 2)] * sumP[getVectorIndex(1, 1)] + 2 * sumP[getVectorIndex(3, 3)]));
dynamic_cast<BootstrapProfile*>(fCMTermList->At(3))->FillProfile(centmult, cmVal[4], (fEventWeight == EventWeight::UnityWeight) ? 1.0 : cmDen[3], rn);
Expand All @@ -522,7 +572,7 @@
dynamic_cast<BootstrapProfile*>(fCMTermList->At(4))->FillProfile(centmult, cmVal[5], (fEventWeight == EventWeight::UnityWeight) ? 1.0 : cmDen[3], rn);
cmVal.push_back(3 * 1 / cmDen[3] * (sumP[getVectorIndex(1, 1)] * sumP[getVectorIndex(1, 0)] * sumP[getVectorIndex(1, 0)] - 2 * sumP[getVectorIndex(2, 1)] * sumP[getVectorIndex(1, 0)] + 2 * sumP[getVectorIndex(3, 1)] - sumP[getVectorIndex(1, 1)] * sumP[getVectorIndex(2, 0)]));
dynamic_cast<BootstrapProfile*>(fCMTermList->At(5))->FillProfile(centmult, cmVal[6], (fEventWeight == EventWeight::UnityWeight) ? 1.0 : cmDen[3], rn);
if (mpar < 4 || sumP[getVectorIndex(4, 0)] == 0 || cmDen[4] == 0)

Check failure on line 575 in PWGCF/GenericFramework/Core/FlowPtContainer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
return;
cmVal.push_back(1 / cmDen[4] * (sumP[getVectorIndex(1, 1)] * sumP[getVectorIndex(1, 1)] * sumP[getVectorIndex(1, 1)] * sumP[getVectorIndex(1, 1)] - 6 * sumP[getVectorIndex(2, 2)] * sumP[getVectorIndex(1, 1)] * sumP[getVectorIndex(1, 1)] + 3 * sumP[getVectorIndex(2, 2)] * sumP[getVectorIndex(2, 2)] + 8 * sumP[getVectorIndex(3, 3)] * sumP[getVectorIndex(1, 1)] - 6 * sumP[getVectorIndex(4, 4)]));
dynamic_cast<BootstrapProfile*>(fCMTermList->At(6))->FillProfile(centmult, cmVal[7], (fEventWeight == EventWeight::UnityWeight) ? 1.0 : cmDen[4], rn);
Expand All @@ -536,7 +586,7 @@
}
void FlowPtContainer::fillArray(FillType a, FillType b, double c, double d)
{
for (int idx = 0; idx < 225; ++idx) {

Check failure on line 589 in PWGCF/GenericFramework/Core/FlowPtContainer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
int i = idx % 3;
int j = ((idx - i) / 3) % 3;
int k = ((idx - j * 3 - i) / 9) % 5;
Expand Down Expand Up @@ -1225,7 +1275,7 @@
delete fCentralMomentList;
fCentralMomentList = new TList();
fCentralMomentList->SetOwner();
for (auto m(1); m <= 4; ++m) {

Check failure on line 1278 in PWGCF/GenericFramework/Core/FlowPtContainer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
for (int i = -1; i < reinterpret_cast<BootstrapProfile*>(fCMTermList->At(0))->getNSubs(); ++i) {
TH1* hMpt = reinterpret_cast<BootstrapProfile*>(fCMTermList->At(0))->getHist(i);
std::vector<TH1*> hTs;
Expand Down
26 changes: 26 additions & 0 deletions PWGCF/GenericFramework/Core/FlowPtContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
};
};

using namespace o2::analysis::genericframework;

Check failure on line 39 in PWGCF/GenericFramework/Core/FlowPtContainer.h

View workflow job for this annotation

GitHub Actions / O2 linter

[using-directive]

Do not put using directives at global scope in headers.
using namespace o2::analysis::genericframework::eventweight;

Check failure on line 40 in PWGCF/GenericFramework/Core/FlowPtContainer.h

View workflow job for this annotation

GitHub Actions / O2 linter

[using-directive]

Do not put using directives at global scope in headers.

class FlowPtContainer : public TNamed
{
Expand All @@ -59,6 +59,8 @@
void fillPtProfiles(const double& lMult, const double& rn);
void fillVnPtCorrProfiles(const double& lMult, const double& flowval, const double& flowtuples, const double& rn, uint8_t mask);
void fillVnDeltaPtProfiles(const double& centmult, const double& flowval, const double& flowtuples, const double& rn, uint8_t mask);
void fillVnPtCorrProfiles(const int configIndex, const double& lMult, const double& flowval, const double& flowtuples, const double& rn, uint8_t mask);
void fillVnDeltaPtProfiles(const int configIndex, const double& centmult, const double& flowval, const double& flowtuples, const double& rn, uint8_t mask);
void fillVnDeltaPtStdProfiles(const double& centmult, const double& rn);
void fillVnPtCorrStdProfiles(const double& centmult, const double& rn);
void fillVnPtProfiles(const double& centmult, const double& flowval, const double& flowtuples, const double& rn, uint8_t mask)
Expand All @@ -68,6 +70,29 @@
else
fillVnPtCorrProfiles(centmult, flowval, flowtuples, rn, mask);
}
void fillVnPtProfiles(const int configIndex, const double& centmult, const double& flowval, const double& flowtuples, const double& rn, uint8_t mask)
{
if (fUseCentralMoments)
fillVnDeltaPtProfiles(configIndex, centmult, flowval, flowtuples, rn, mask);
else
fillVnPtCorrProfiles(configIndex, centmult, flowval, flowtuples, rn, mask);
}
void skipVnPtProfiles(uint8_t mask)
{
for (auto m(1); m <= mpar; ++m) {
if (!(mask & (1 << (m - 1)))) {
continue;
}
if (fUseCentralMoments) {
for (auto i = 0; i <= m; ++i) {
++fillCounter;
}
} else {
++fillCounter;
}
}
return;
}
void fillVnPtStdProfiles(const double& centmult, const double& rn)
{
if (fUseCentralMoments)
Expand Down Expand Up @@ -129,6 +154,7 @@
std::vector<double> cmDen; //!
std::vector<std::complex<double>> arr; //!
std::vector<double> warr; //!
std::vector<int> fCovFirstIndex; //!
template <typename T>
double getStdAABBCC(T& inarr);
template <typename T>
Expand Down
Loading