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
74 changes: 36 additions & 38 deletions PWGCF/Flow/TableProducer/zdcQVectors.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ std::vector<double> pyZDC = {-1.75, -1.75, 1.75, 1.75};
double alphaZDC = 0.395;

// q-vectors before (q) and after (qRec) recentering.
std::vector<double> q(4); // start values of [QxA, QyA, QxC, QyC]
std::vector<double> q(4); // start values of [QxA, QyA, QxC, QyC]
std::vector<double> qRec(4); // Recentered values of [QxA, QyA, QxC, QyC]

// for energy calibration
Expand Down Expand Up @@ -121,7 +121,6 @@ struct ZdcQVectors {
ConfigurableAxis axisVy{"axisVy", {10, -0.01, 0.01}, "for Pos Y of collision"};
ConfigurableAxis axisVz{"axisVz", {10, -10, 1}, "for vz of collision"};


// Centrality Estimators -> standard is FT0C
O2_DEFINE_CONFIGURABLE(cfgFT0Cvariant1, bool, false, "Set centrality estimator to cfgFT0Cvariant1");
O2_DEFINE_CONFIGURABLE(cfgFT0M, bool, false, "Set centrality estimator to cfgFT0M");
Expand Down Expand Up @@ -182,11 +181,11 @@ struct ZdcQVectors {
energyZN[tower] = registry.add<TProfile2D>(Form("Energy/%s", namesEcal[tower].Data()), Form("%s", namesEcal[tower].Data()), kTProfile2D, {{1, 0, 1}, axisCent});
}

registry.add<TH2>(Form("before/QA/hSPplaneA"), "hSPplaneA", kTH2D, {{100, -4, 4}, axisCent10});
registry.add<TH2>(Form("before/QA/hSPplaneC"), "hSPplaneC", kTH2D, {{100, -4, 4}, axisCent10});
registry.add<TH2>(Form("before/QA/hSPplaneFull"), "hSPplaneFull", kTH2D, {{100, -4, 4}, axisCent10});
for (const auto& side : sides) {
registry.add<TH2>(Form("before/hZN%s_Qx_vs_Qy", side), Form("hZN%s_Qx_vs_Qy", side), kTH2F, {axisQ, axisQ});
registry.add<TH2>(Form("before/QA/hSPplaneA"), "hSPplaneA", kTH2D, {{100, -4, 4}, axisCent10});
registry.add<TH2>(Form("before/QA/hSPplaneC"), "hSPplaneC", kTH2D, {{100, -4, 4}, axisCent10});
registry.add<TH2>(Form("before/QA/hSPplaneFull"), "hSPplaneFull", kTH2D, {{100, -4, 4}, axisCent10});
for (const auto& side : sides) {
registry.add<TH2>(Form("before/hZN%s_Qx_vs_Qy", side), Form("hZN%s_Qx_vs_Qy", side), kTH2F, {axisQ, axisQ});
}

for (const auto& COORD1 : capCOORDS) {
Expand All @@ -213,19 +212,19 @@ struct ZdcQVectors {
} // end of capCOORDS
} // end of sides

// recentered q-vectors (to check what steps are finished in the end)
// recentered q-vectors (to check what steps are finished in the end)

registry.add<TProfile>("vmean/hvertex_vx", "hvertex_vx", kTProfile, {{1, 0., 1.}});
registry.add<TProfile>("vmean/hvertex_vy", "hvertex_vy", kTProfile, {{1, 0., 1.}});
registry.add<TProfile>("vmean/hvertex_vz", "hvertex_vz", kTProfile, {{1, 0., 1.}});
registry.add<TProfile>("vmean/hvertex_vx", "hvertex_vx", kTProfile, {{1, 0., 1.}});
registry.add<TProfile>("vmean/hvertex_vy", "hvertex_vy", kTProfile, {{1, 0., 1.}});
registry.add<TProfile>("vmean/hvertex_vz", "hvertex_vz", kTProfile, {{1, 0., 1.}});

registry.add<TH1>("QA/centrality_before", "centrality_before", kTH1D, {{200, 0, 100}});
registry.add<TH1>("QA/centrality_after", "centrality_after", kTH1D, {{200, 0, 100}});
registry.add<TH1>("QA/centrality_before", "centrality_before", kTH1D, {{200, 0, 100}});
registry.add<TH1>("QA/centrality_after", "centrality_after", kTH1D, {{200, 0, 100}});

registry.add<TProfile>("QA/ZNA_Energy", "ZNA_Energy", kTProfile, {{8, 0, 8}});
registry.add<TProfile>("QA/ZNC_Energy", "ZNC_Energy", kTProfile, {{8, 0, 8}});
registry.add<TProfile>("QA/ZNA_Energy", "ZNA_Energy", kTProfile, {{8, 0, 8}});
registry.add<TProfile>("QA/ZNC_Energy", "ZNC_Energy", kTProfile, {{8, 0, 8}});

registry.addClone("before/", "after/");
registry.addClone("before/", "after/");
}

template <FillType ft>
Expand Down Expand Up @@ -397,7 +396,6 @@ struct ZdcQVectors {
return calibConstant;
}


void process(UsedCollisions::iterator const& collision,
BCsRun3 const& /*bcs*/,
aod::Zdcs const& /*zdcs*/)
Expand All @@ -410,15 +408,15 @@ struct ZdcQVectors {

isSelected = true;

// TODO Implement other ZDC estimators
// TODO Implement other ZDC estimators
auto cent = collision.centFT0C();
if (cfgFT0Cvariant1)
cent = collision.centFT0CVariant1();
if (cfgFT0M)
cent = collision.centFT0M();
if (cfgFV0A)
cent = collision.centFV0A();
if (cfgNGlobal)
if (cfgNGlobal)
cent = collision.centNGlobal();

if (cent < 0 || cent > 90) {
Expand Down Expand Up @@ -608,45 +606,45 @@ struct ZdcQVectors {
if (counter < 1)
LOGF(warning, "Calibation files missing!!! Output created with q-vectors right after energy gain eq. !!");
if (isSelected)
fillCommonRegistry<kBefore>(q[0], q[1], q[2], q[3], v, centrality);
fillCommonRegistry<kBefore>(q[0], q[1], q[2], q[3], v, centrality);
spTableZDC(runnumber, centrality, v[0], v[1], v[2], q[0], q[1], q[2], q[3], isSelected, 0, 0);
counter++;
return;
} else if (cal.atIteration == 5 && cal.atStep == 4){
std::vector<double> qRec(4);
} else if (cal.atIteration == 5 && cal.atStep == 4) {
std::vector<double> qRec(4);
fillCommonRegistry<kBefore>(q[0], q[1], q[2], q[3], v, centrality);
qRec = q;
qRec = q;

// vector of 4
// vector of 4
std::vector<double> corrQxA;
std::vector<double> corrQyA;
std::vector<double> corrQxC;
std::vector<double> corrQyC;

int pb = 0;
int pb = 0;

for(int it = 1; it<6; it++){
for (int it = 1; it < 6; it++) {
corrQxA.push_back(getCorrection<THnSparse>(it, 0, names[0][0].Data()));
corrQyA.push_back(getCorrection<THnSparse>(it, 0, names[0][1].Data()));
corrQxC.push_back(getCorrection<THnSparse>(it, 0, names[0][2].Data()));
corrQyC.push_back(getCorrection<THnSparse>(it, 0, names[0][3].Data()));

pb++;
pb++;

for(int step = 1; step<5; step++){
corrQxA.push_back(getCorrection<TProfile>( it, step, names[step][0].Data()));
corrQyA.push_back(getCorrection<TProfile>( it, step, names[step][1].Data()));
corrQxC.push_back(getCorrection<TProfile>( it, step, names[step][2].Data()));
corrQyC.push_back(getCorrection<TProfile>( it, step, names[step][3].Data()));
pb++;
for (int step = 1; step < 5; step++) {
corrQxA.push_back(getCorrection<TProfile>(it, step, names[step][0].Data()));
corrQyA.push_back(getCorrection<TProfile>(it, step, names[step][1].Data()));
corrQxC.push_back(getCorrection<TProfile>(it, step, names[step][2].Data()));
corrQyC.push_back(getCorrection<TProfile>(it, step, names[step][3].Data()));
pb++;
}
}

for(int cor = 0; cor < pb; cor++){
qRec[0] -= corrQxA[cor];
qRec[1] -= corrQyA[cor];
qRec[2] -= corrQxC[cor];
qRec[3] -= corrQyC[cor];
for (int cor = 0; cor < pb; cor++) {
qRec[0] -= corrQxA[cor];
qRec[1] -= corrQyA[cor];
qRec[2] -= corrQxC[cor];
qRec[3] -= corrQyC[cor];
}

if (counter < 1)
Expand Down
24 changes: 12 additions & 12 deletions PWGCF/Flow/Tasks/flowSP.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ struct FlowSP {
bool correctionsLoaded = false;
int lastRunNumber = 0;

TProfile* hcorrQQ = nullptr;
TProfile* hcorrQQx = nullptr;
TProfile* hcorrQQy = nullptr;
TProfile* hEvPlaneRes = nullptr;
TProfile* hcorrQQ = nullptr;
TProfile* hcorrQQx = nullptr;
TProfile* hcorrQQy = nullptr;
TProfile* hEvPlaneRes = nullptr;
bool clQQ = false;
bool clEvPlaneRes = false;

Expand Down Expand Up @@ -692,7 +692,7 @@ struct FlowSP {
centrality = collision.centFT0M();
if (cfgFV0A)
centrality = collision.centFV0A();
if (cfgNGlobal)
if (cfgNGlobal)
centrality = collision.centNGlobal();

if (!eventSelected(collision, tracks.size(), centrality))
Expand Down Expand Up @@ -740,15 +740,15 @@ struct FlowSP {
double corrQQ = 1., corrQQx = 1., corrQQy = 1.;

// Load correlations and SP resolution needed for Scalar Product and event plane methods.
// Only load once!
// Only load once!
// If not loaded set to 1
if (cfgLoadAverageQQ) {
if(!cfg.clQQ){
if (!cfg.clQQ) {
TList* hcorrList = ccdb->getForTimeStamp<TList>(cfgCCDBdir.value, bc.timestamp());
cfg.hcorrQQ = reinterpret_cast<TProfile*>(hcorrList->FindObject("qAqCXY"));
cfg.hcorrQQx = reinterpret_cast<TProfile*>(hcorrList->FindObject("qAqCX"));
cfg.hcorrQQy = reinterpret_cast<TProfile*>(hcorrList->FindObject("qAqCY"));
cfg.clQQ = true;
cfg.clQQ = true;
}
corrQQ = cfg.hcorrQQ->GetBinContent(cfg.hcorrQQ->FindBin(centrality));
corrQQx = cfg.hcorrQQx->GetBinContent(cfg.hcorrQQx->FindBin(centrality));
Expand All @@ -757,9 +757,9 @@ struct FlowSP {

double evPlaneRes = 1.;
if (cfgLoadSPPlaneRes) {
if(!cfg.clEvPlaneRes){
if (!cfg.clEvPlaneRes) {
cfg.hEvPlaneRes = ccdb->getForTimeStamp<TProfile>(cfgCCDBdir_SP.value, bc.timestamp());
cfg.clEvPlaneRes = true;
cfg.clEvPlaneRes = true;
}
evPlaneRes = cfg.hEvPlaneRes->GetBinContent(cfg.hEvPlaneRes->FindBin(centrality));
if (evPlaneRes < 0)
Expand Down Expand Up @@ -844,7 +844,7 @@ struct FlowSP {
centrality = collision.centFT0M();
if (cfgFV0A)
centrality = collision.centFV0A();
if (cfgNGlobal)
if (cfgNGlobal)
centrality = collision.centNGlobal();

if (cfgFillQAHistos)
Expand Down Expand Up @@ -901,7 +901,7 @@ struct FlowSP {
centrality = collision.centFT0M();
if (cfgFV0A)
centrality = collision.centFV0A();
if (cfgNGlobal)
if (cfgNGlobal)
centrality = collision.centNGlobal();
}

Expand Down
Loading