Skip to content
Merged
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
109 changes: 44 additions & 65 deletions PWGLF/TableProducer/Strangeness/cascadeflow.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,9 @@
// Configurable for shift correction
struct : ConfigurableGroup {
Configurable<bool> cfgShiftCorr{"cfgShiftCorr", 0, ""};
Configurable<std::string> cfgShiftPath{"cfgShiftPath", "Users/j/junlee/Qvector/QvecCalib/Shift", "Path for Shift"};
Configurable<std::string> cfgShiftPathFT0C{"cfgShiftPathFT0C", "Users/j/junlee/Qvector/QvecCalib/Shift", "Path for Shift"};
Configurable<std::string> cfgShiftPathTPCL{"cfgShiftPathTPCL", "Users/j/junlee/Qvector/QvecCalib/Shift", "Path for Shift"};
Configurable<std::string> cfgShiftPathTPCR{"cfgShiftPathTPCR", "Users/j/junlee/Qvector/QvecCalib/Shift", "Path for Shift"};
Configurable<int> cfgnMods{"cfgnMods", 1, "The number of modulations of interest starting from 2"};
Configurable<std::string> cfgShiftPathFT0C{"cfgShiftPathFT0C", "Users/c/chdemart/OOpass2Shift/ShiftFT0C", "Path for Shift"};
Configurable<std::string> cfgShiftPathTPCL{"cfgShiftPathTPCL", "Users/c/chdemart/OOpass2Shift/ShiftTPCL", "Path for Shift"};
Configurable<std::string> cfgShiftPathTPCR{"cfgShiftPathTPCR", "Users/c/chdemart/OOpass2Shift/ShiftTPCR", "Path for Shift"};
} ShiftConfigs;
// Configurable<float> cfgHarmonic{"cfgHarmonic", 2, "Harmonic for event plane calculation"};

Expand Down Expand Up @@ -483,54 +481,54 @@

int currentRunNumber = -999;
int lastRunNumber = -999;
std::vector<TProfile3D*> shiftprofile{};
std::vector<TProfile3D*> shiftprofileFT0C{};
std::vector<TProfile3D*> shiftprofileTPCL{};
std::vector<TProfile3D*> shiftprofileTPCR{};
TProfile3D* shiftprofile;
TProfile3D* shiftprofileFT0C;
TProfile3D* shiftprofileTPCL;
TProfile3D* shiftprofileTPCR;
std::string fullCCDBShiftCorrPath;
std::string fullCCDBShiftCorrPathFT0C;
std::string fullCCDBShiftCorrPathTPCL;
std::string fullCCDBShiftCorrPathTPCR;

template <typename TCollision>
double ApplyShiftCorrection(TCollision coll, double psiT0C)
double ApplyShiftCorrection(TCollision coll, double psiT0C, TProfile3D* shiftprofile)
{
int nmode = 2;
auto deltapsiFT0C = 0.0;
int nmode = 2;

for (int ishift = 1; ishift <= 10; ishift++) {
auto coeffshiftxFT0C = shiftprofile.at(nmode - 2)->GetBinContent(shiftprofile.at(nmode - 2)->FindBin(coll.centFT0C(), 0.5, ishift - 0.5));
auto coeffshiftyFT0C = shiftprofile.at(nmode - 2)->GetBinContent(shiftprofile.at(nmode - 2)->FindBin(coll.centFT0C(), 1.5, ishift - 0.5));
auto coeffshiftxFT0C = shiftprofile->GetBinContent(shiftprofile->FindBin(coll.centFT0C(), 0.5, ishift - 0.5));
auto coeffshiftyFT0C = shiftprofile->GetBinContent(shiftprofile->FindBin(coll.centFT0C(), 1.5, ishift - 0.5));

deltapsiFT0C += ((1 / (1.0 * ishift)) * (-coeffshiftxFT0C * TMath::Cos(ishift * static_cast<float>(nmode) * psiT0C) + coeffshiftyFT0C * TMath::Sin(ishift * static_cast<float>(nmode) * psiT0C)));

Check failure on line 503 in PWGLF/TableProducer/Strangeness/cascadeflow.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
}
return psiT0C + deltapsiFT0C;
}

template <typename TCollision>
double ComputeEPResolutionwShifts(TCollision coll, double psiT0C, double psiTPCA, double psiTPCC)
double ComputeEPResolutionwShifts(TCollision coll, double psiT0C, double psiTPCA, double psiTPCC, TProfile3D* shiftprofileA, TProfile3D* shiftprofileB, TProfile3D* shiftprofileC)
{
int nmode = 2;
auto deltapsiFT0C = 0.0;
auto deltapsiTPCA = 0.0;
auto deltapsiTPCC = 0.0;
for (int ishift = 1; ishift <= 10; ishift++) {
auto coeffshiftxFT0C = shiftprofile.at(nmode - 2)->GetBinContent(shiftprofile.at(nmode - 2)->FindBin(coll.centFT0C(), 0.5, ishift - 0.5));
auto coeffshiftyFT0C = shiftprofile.at(nmode - 2)->GetBinContent(shiftprofile.at(nmode - 2)->FindBin(coll.centFT0C(), 1.5, ishift - 0.5));
auto coeffshiftxTPCA = shiftprofile.at(nmode - 2)->GetBinContent(shiftprofile.at(nmode - 2)->FindBin(coll.centFT0C(), 2.5, ishift - 0.5));
auto coeffshiftyTPCA = shiftprofile.at(nmode - 2)->GetBinContent(shiftprofile.at(nmode - 2)->FindBin(coll.centFT0C(), 3.5, ishift - 0.5));
auto coeffshiftxTPCC = shiftprofile.at(nmode - 2)->GetBinContent(shiftprofile.at(nmode - 2)->FindBin(coll.centFT0C(), 4.5, ishift - 0.5));
auto coeffshiftyTPCC = shiftprofile.at(nmode - 2)->GetBinContent(shiftprofile.at(nmode - 2)->FindBin(coll.centFT0C(), 5.5, ishift - 0.5));
auto coeffshiftxFT0C = shiftprofileA->GetBinContent(shiftprofileFT0C->FindBin(coll.centFT0C(), 0.5, ishift - 0.5));
auto coeffshiftyFT0C = shiftprofileA->GetBinContent(shiftprofileFT0C->FindBin(coll.centFT0C(), 1.5, ishift - 0.5));
auto coeffshiftxTPCA = shiftprofileB->GetBinContent(shiftprofileTPCL->FindBin(coll.centFT0C(), 2.5, ishift - 0.5));
auto coeffshiftyTPCA = shiftprofileB->GetBinContent(shiftprofileTPCL->FindBin(coll.centFT0C(), 3.5, ishift - 0.5));
auto coeffshiftxTPCC = shiftprofileC->GetBinContent(shiftprofileTPCR->FindBin(coll.centFT0C(), 4.5, ishift - 0.5));
auto coeffshiftyTPCC = shiftprofileC->GetBinContent(shiftprofileTPCR->FindBin(coll.centFT0C(), 5.5, ishift - 0.5));
deltapsiFT0C += ((1 / (1.0 * ishift)) * (-coeffshiftxFT0C * TMath::Cos(ishift * static_cast<float>(nmode) * psiT0C) + coeffshiftyFT0C * TMath::Sin(ishift * static_cast<float>(nmode) * psiT0C)));

Check failure on line 522 in PWGLF/TableProducer/Strangeness/cascadeflow.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
deltapsiTPCA += ((1 / (1.0 * ishift)) * (-coeffshiftxTPCA * TMath::Cos(ishift * static_cast<float>(nmode) * psiTPCA) + coeffshiftyTPCA * TMath::Sin(ishift * static_cast<float>(nmode) * psiTPCA)));

Check failure on line 523 in PWGLF/TableProducer/Strangeness/cascadeflow.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
deltapsiTPCC += ((1 / (1.0 * ishift)) * (-coeffshiftxTPCC * TMath::Cos(ishift * static_cast<float>(nmode) * psiTPCC) + coeffshiftyTPCC * TMath::Sin(ishift * static_cast<float>(nmode) * psiTPCC)));

Check failure on line 524 in PWGLF/TableProducer/Strangeness/cascadeflow.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
}
// histos.fill(HIST("psi2/QA/EP_FT0C_shifted"), coll.centFT0C(), psiT0C + deltapsiFT0C);
// histos.fill(HIST("psi2/QA/EP_TPCA_shifted"), coll.centFT0C(), psiTPCA + deltapsiTPCA);
// histos.fill(HIST("psi2/QA/EP_TPCC_shifted"), coll.centFT0C(), psiTPCC + deltapsiTPCC);
resolution.fill(HIST("QVectorsT0CTPCA_Shifted"), coll.centFT0C(), TMath::Cos(static_cast<float>(nmode) * (psiT0C + deltapsiFT0C - psiTPCA - deltapsiTPCA)));

Check failure on line 529 in PWGLF/TableProducer/Strangeness/cascadeflow.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
resolution.fill(HIST("QVectorsT0CTPCC_Shifted"), coll.centFT0C(), TMath::Cos(static_cast<float>(nmode) * (psiT0C + deltapsiFT0C - psiTPCC - deltapsiTPCC)));

Check failure on line 530 in PWGLF/TableProducer/Strangeness/cascadeflow.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
resolution.fill(HIST("QVectorsTPCAC_Shifted"), coll.centFT0C(), TMath::Cos(static_cast<float>(nmode) * (psiTPCA + deltapsiTPCA - psiTPCC - deltapsiTPCC)));

Check failure on line 531 in PWGLF/TableProducer/Strangeness/cascadeflow.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
return true;
}

Expand Down Expand Up @@ -751,7 +749,7 @@
histos.add("ShiftTPCR", "ShiftTPCR", kTProfile3D, {CentAxis, basisAxis, shiftAxis});

histos.add("hNEvents", "hNEvents", {HistType::kTH1F, {{10, 0.f, 10.f}}});
for (Int_t n = 1; n <= histos.get<TH1>(HIST("hNEvents"))->GetNbinsX(); n++) {

Check failure on line 752 in PWGLF/TableProducer/Strangeness/cascadeflow.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
histos.get<TH1>(HIST("hNEvents"))->GetXaxis()->SetBinLabel(n, hNEventsLabels[n - 1]);
}
histos.add("hEventVertexZ", "hEventVertexZ", kTH1F, {{120, -12., 12.}});
Expand Down Expand Up @@ -890,11 +888,11 @@
histosMCGen.add("hGenOmegaY", "hGenOmegaY", HistType::kTH1F, {{100, -1, 1}});
histosMCGen.add("hZvertexGen", "hZvertexGen", HistType::kTH1F, {{100, -20, 20}});
histosMCGen.add("hNEventsMC", "hNEventsMC", {HistType::kTH1F, {{6, 0.f, 6.f}}});
for (Int_t n = 1; n <= histosMCGen.get<TH1>(HIST("hNEventsMC"))->GetNbinsX(); n++) {

Check failure on line 891 in PWGLF/TableProducer/Strangeness/cascadeflow.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
histosMCGen.get<TH1>(HIST("hNEventsMC"))->GetXaxis()->SetBinLabel(n, hNEventsLabelsMC[n - 1]);
}
histosMCGen.add("hNCascGen", "hNCascGen", {HistType::kTH1F, {{8, 0.f, 8.f}}});
for (Int_t n = 1; n <= histosMCGen.get<TH1>(HIST("hNCascGen"))->GetNbinsX(); n++) {

Check failure on line 895 in PWGLF/TableProducer/Strangeness/cascadeflow.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
histosMCGen.get<TH1>(HIST("hNCascGen"))->GetXaxis()->SetBinLabel(n, hNCascLabelsMC[n - 1]);
}

Expand Down Expand Up @@ -1079,25 +1077,19 @@
if (ShiftConfigs.cfgShiftCorr) {
currentRunNumber = coll.runNumber();
if (currentRunNumber != lastRunNumber) {
shiftprofileFT0C.clear();
shiftprofileTPCL.clear();
shiftprofileTPCR.clear();
fullCCDBShiftCorrPathFT0C = ShiftConfigs.cfgShiftPathFT0C;
fullCCDBShiftCorrPathTPCL = ShiftConfigs.cfgShiftPathTPCL;
fullCCDBShiftCorrPathTPCR = ShiftConfigs.cfgShiftPathTPCR;
auto objshiftFT0C = ccdb->getForTimeStamp<TProfile3D>(fullCCDBShiftCorrPathFT0C, coll.timestamp());
shiftprofileFT0C.push_back(objshiftFT0C);
auto objshiftTPCL = ccdb->getForTimeStamp<TProfile3D>(fullCCDBShiftCorrPathTPCL, coll.timestamp());
shiftprofileTPCL.push_back(objshiftTPCL);
auto objshiftTPCR = ccdb->getForTimeStamp<TProfile3D>(fullCCDBShiftCorrPathTPCR, coll.timestamp());
shiftprofileTPCR.push_back(objshiftTPCR);
shiftprofileFT0C = ccdb->getForTimeStamp<TProfile3D>(fullCCDBShiftCorrPathFT0C, coll.timestamp());
shiftprofileTPCL = ccdb->getForTimeStamp<TProfile3D>(fullCCDBShiftCorrPathTPCL, coll.timestamp());
shiftprofileTPCR = ccdb->getForTimeStamp<TProfile3D>(fullCCDBShiftCorrPathTPCR, coll.timestamp());
lastRunNumber = currentRunNumber;
}
}

if (ShiftConfigs.cfgShiftCorr) {
psiT0CCorr = ApplyShiftCorrection(coll, psiT0C);
ComputeEPResolutionwShifts(coll, psiT0C, psiTPCA, psiTPCC);
psiT0CCorr = ApplyShiftCorrection(coll, psiT0C, shiftprofileFT0C);
ComputeEPResolutionwShifts(coll, psiT0C, psiTPCA, psiTPCC, shiftprofileFT0C, shiftprofileTPCL, shiftprofileTPCR);
}

histos.fill(HIST("hPsiT0C"), psiT0CCorr);
Expand Down Expand Up @@ -1398,25 +1390,21 @@
if (ShiftConfigs.cfgShiftCorr) {
currentRunNumber = coll.runNumber();
if (currentRunNumber != lastRunNumber) {
shiftprofileFT0C.clear();
shiftprofileTPCL.clear();
shiftprofileTPCR.clear();
fullCCDBShiftCorrPathFT0C = ShiftConfigs.cfgShiftPathFT0C;
fullCCDBShiftCorrPathTPCL = ShiftConfigs.cfgShiftPathTPCL;
fullCCDBShiftCorrPathTPCR = ShiftConfigs.cfgShiftPathTPCR;
auto objshiftFT0C = ccdb->getForTimeStamp<TProfile3D>(fullCCDBShiftCorrPathFT0C, coll.timestamp());
shiftprofileFT0C.push_back(objshiftFT0C);
auto objshiftTPCL = ccdb->getForTimeStamp<TProfile3D>(fullCCDBShiftCorrPathTPCL, coll.timestamp());
shiftprofileTPCL.push_back(objshiftTPCL);
auto objshiftTPCR = ccdb->getForTimeStamp<TProfile3D>(fullCCDBShiftCorrPathTPCR, coll.timestamp());
shiftprofileTPCR.push_back(objshiftTPCR);
shiftprofileFT0C = ccdb->getForTimeStamp<TProfile3D>(fullCCDBShiftCorrPathFT0C, coll.timestamp());
shiftprofileTPCL = ccdb->getForTimeStamp<TProfile3D>(fullCCDBShiftCorrPathTPCL, coll.timestamp());
shiftprofileTPCR = ccdb->getForTimeStamp<TProfile3D>(fullCCDBShiftCorrPathTPCR, coll.timestamp());
lastRunNumber = currentRunNumber;
}
}

if (ShiftConfigs.cfgShiftCorr) {
psiT0CCorr = ApplyShiftCorrection(coll, psiT0C);
ComputeEPResolutionwShifts(coll, psiT0C, psiTPCA, psiTPCC);
psiT0CCorr = ApplyShiftCorrection(coll, psiT0C, shiftprofileFT0C);
ComputeEPResolutionwShifts(coll, psiT0C, psiTPCA, psiTPCC, shiftprofileFT0C, shiftprofileTPCL, shiftprofileTPCR);
}

histos.fill(HIST("hPsiT0C"), psiT0CCorr);
histos.fill(HIST("hPsiT0CvsCentFT0C"), coll.centFT0C(), psiT0CCorr);

Expand Down Expand Up @@ -1703,25 +1691,21 @@
if (ShiftConfigs.cfgShiftCorr) {
currentRunNumber = coll.runNumber();
if (currentRunNumber != lastRunNumber) {
shiftprofileFT0C.clear();
shiftprofileTPCL.clear();
shiftprofileTPCR.clear();
fullCCDBShiftCorrPathFT0C = ShiftConfigs.cfgShiftPathFT0C;
fullCCDBShiftCorrPathTPCL = ShiftConfigs.cfgShiftPathTPCL;
fullCCDBShiftCorrPathTPCR = ShiftConfigs.cfgShiftPathTPCR;
auto objshiftFT0C = ccdb->getForTimeStamp<TProfile3D>(fullCCDBShiftCorrPathFT0C, coll.timestamp());
shiftprofileFT0C.push_back(objshiftFT0C);
auto objshiftTPCL = ccdb->getForTimeStamp<TProfile3D>(fullCCDBShiftCorrPathTPCL, coll.timestamp());
shiftprofileTPCL.push_back(objshiftTPCL);
auto objshiftTPCR = ccdb->getForTimeStamp<TProfile3D>(fullCCDBShiftCorrPathTPCR, coll.timestamp());
shiftprofileTPCR.push_back(objshiftTPCR);
shiftprofileFT0C = ccdb->getForTimeStamp<TProfile3D>(fullCCDBShiftCorrPathFT0C, coll.timestamp());
shiftprofileTPCL = ccdb->getForTimeStamp<TProfile3D>(fullCCDBShiftCorrPathTPCL, coll.timestamp());
shiftprofileTPCR = ccdb->getForTimeStamp<TProfile3D>(fullCCDBShiftCorrPathTPCR, coll.timestamp());
lastRunNumber = currentRunNumber;
}
}

if (ShiftConfigs.cfgShiftCorr) {
psiT0CCorr = ApplyShiftCorrection(coll, psiT0C);
ComputeEPResolutionwShifts(coll, psiT0C, psiTPCA, psiTPCC);
psiT0CCorr = ApplyShiftCorrection(coll, psiT0C, shiftprofileFT0C);
ComputeEPResolutionwShifts(coll, psiT0C, psiTPCA, psiTPCC, shiftprofileFT0C, shiftprofileTPCL, shiftprofileTPCR);
}

histos.fill(HIST("hPsiT0C"), psiT0CCorr);
histos.fill(HIST("hPsiT0CvsCentFT0C"), coll.centFT0C(), psiT0CCorr);

Expand Down Expand Up @@ -1931,29 +1915,24 @@
histos.fill(HIST("ShiftTPCR"), coll.centFT0C(), 0.5, ishift - 0.5, std::sin(ishift * 2 * psiTPCC));
histos.fill(HIST("ShiftTPCR"), coll.centFT0C(), 1.5, ishift - 0.5, std::cos(ishift * 2 * psiTPCC));
}

if (ShiftConfigs.cfgShiftCorr) {
currentRunNumber = coll.runNumber();
if (currentRunNumber != lastRunNumber) {
shiftprofileFT0C.clear();
shiftprofileTPCL.clear();
shiftprofileTPCR.clear();
fullCCDBShiftCorrPathFT0C = ShiftConfigs.cfgShiftPathFT0C;
fullCCDBShiftCorrPathTPCL = ShiftConfigs.cfgShiftPathTPCL;
fullCCDBShiftCorrPathTPCR = ShiftConfigs.cfgShiftPathTPCR;
auto objshiftFT0C = ccdb->getForTimeStamp<TProfile3D>(fullCCDBShiftCorrPathFT0C, coll.timestamp());
shiftprofileFT0C.push_back(objshiftFT0C);
auto objshiftTPCL = ccdb->getForTimeStamp<TProfile3D>(fullCCDBShiftCorrPathTPCL, coll.timestamp());
shiftprofileTPCL.push_back(objshiftTPCL);
auto objshiftTPCR = ccdb->getForTimeStamp<TProfile3D>(fullCCDBShiftCorrPathTPCR, coll.timestamp());
shiftprofileTPCR.push_back(objshiftTPCR);
shiftprofileFT0C = ccdb->getForTimeStamp<TProfile3D>(fullCCDBShiftCorrPathFT0C, coll.timestamp());
shiftprofileTPCL = ccdb->getForTimeStamp<TProfile3D>(fullCCDBShiftCorrPathTPCL, coll.timestamp());
shiftprofileTPCR = ccdb->getForTimeStamp<TProfile3D>(fullCCDBShiftCorrPathTPCR, coll.timestamp());
lastRunNumber = currentRunNumber;
}
}

if (ShiftConfigs.cfgShiftCorr) {
psiT0CCorr = ApplyShiftCorrection(coll, psiT0C);
ComputeEPResolutionwShifts(coll, psiT0C, psiTPCA, psiTPCC);
psiT0CCorr = ApplyShiftCorrection(coll, psiT0C, shiftprofileFT0C);
ComputeEPResolutionwShifts(coll, psiT0C, psiTPCA, psiTPCC, shiftprofileFT0C, shiftprofileTPCL, shiftprofileTPCR);
}

histos.fill(HIST("hpsiT0C"), psiT0CCorr);
histos.fill(HIST("hpsiT0CvsCentFT0C"), coll.centFT0C(), psiT0CCorr);

Expand Down
Loading