Skip to content

Commit

Permalink
[Event Plane] Adding CCDB connection (AliceO2Group#4542)
Browse files Browse the repository at this point in the history
* Adding CCDB connection

* fix

* fix

* fix

* fix

* Please consider the following formatting changes

---------

Co-authored-by: junleekim <[email protected]>
Co-authored-by: ALICE Action Bot <[email protected]>
  • Loading branch information
3 people authored Feb 1, 2024
1 parent 5efa099 commit 64d6097
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 38 deletions.
111 changes: 88 additions & 23 deletions Common/TableProducer/qVectorsTable.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ struct qVectorsTable {
Configurable<int> cfgCentEsti{"cfgCentEsti",
2, "Centrality estimator (Run3): 0 = FT0M, 1 = FT0A, 2 = FT0C, 3 = FV0A"};

Configurable<int> cfgCCDBConst{"cfgCCDBConst", 1, "Using constants in CCDB, 1 = CCDB, 2= Configurable"};

// LOKI: We have here all centrality estimators for Run 3 (except FDDM and NTPV),
// but the Q-vectors are calculated only for some of them.
// FIXME: 6 correction factors for each centrality and 8 centrality intervals are hard-coded.
Expand Down Expand Up @@ -147,30 +149,93 @@ struct qVectorsTable {
LOGF(fatal, "Could not get the alignment parameters for FV0.");
}

if (cfgFT0CCorr->size() < 48) {
LOGF(fatal, "No proper correction factor assigned for FT0C");
}
if (cfgFT0ACorr->size() < 48) {
LOGF(fatal, "No proper correction factor assigned for FT0A");
}
if (cfgFT0MCorr->size() < 48) {
LOGF(fatal, "No proper correction factor assigned for FT0M");
}
if (cfgFV0ACorr->size() < 48) {
LOGF(fatal, "No proper correction factor assigned for FV0A");
}
if (cfgBPosCorr->size() < 48) {
LOGF(fatal, "No proper correction factor assigned for positive TPC tracks");
if (cfgCCDBConst == 1) {
if (!(ccdb->getForTimeStamp<std::vector<float>>("Analysis/EventPlane/QVecCorrections/FT0C", cfgCcdbParam.nolaterthan.value))->empty()) {
cfgCorr.push_back(*(ccdb->getForTimeStamp<std::vector<float>>("Analysis/EventPlane/QVecCorrections/FT0C", cfgCcdbParam.nolaterthan.value)));
} else {
if (cfgFT0CCorr->size() < 48) {
LOGF(fatal, "No proper correction factor assigned for FT0C");
} else {
cfgCorr.push_back(cfgFT0CCorr);
}
}

if (!(ccdb->getForTimeStamp<std::vector<float>>("Analysis/EventPlane/QVecCorrections/FT0A", cfgCcdbParam.nolaterthan.value))->empty()) {
cfgCorr.push_back(*(ccdb->getForTimeStamp<std::vector<float>>("Analysis/EventPlane/QVecCorrections/FT0A", cfgCcdbParam.nolaterthan.value)));
} else {
if (cfgFT0ACorr->size() < 48) {
LOGF(fatal, "No proper correction factor assigned for FT0A");
} else {
cfgCorr.push_back(cfgFT0ACorr);
}
}

if (!(ccdb->getForTimeStamp<std::vector<float>>("Analysis/EventPlane/QVecCorrections/FT0M", cfgCcdbParam.nolaterthan.value))->empty()) {
cfgCorr.push_back(*(ccdb->getForTimeStamp<std::vector<float>>("Analysis/EventPlane/QVecCorrections/FT0M", cfgCcdbParam.nolaterthan.value)));
} else {
if (cfgFT0MCorr->size() < 48) {
LOGF(fatal, "No proper correction factor assigned for FT0M");
} else {
cfgCorr.push_back(cfgFT0MCorr);
}
}

if (!(ccdb->getForTimeStamp<std::vector<float>>("Analysis/EventPlane/QVecCorrections/FT0C", cfgCcdbParam.nolaterthan.value))->empty()) {
cfgCorr.push_back(*(ccdb->getForTimeStamp<std::vector<float>>("Analysis/EventPlane/QVecCorrections/FT0C", cfgCcdbParam.nolaterthan.value)));
} else {
if (cfgFV0ACorr->size() < 48) {
LOGF(fatal, "No proper correction factor assigned for FV0A");
} else {
cfgCorr.push_back(cfgFV0ACorr);
}
} // no FV0A

if (!(ccdb->getForTimeStamp<std::vector<float>>("Analysis/EventPlane/QVecCorrections/BPos", cfgCcdbParam.nolaterthan.value))->empty()) {
cfgCorr.push_back(*(ccdb->getForTimeStamp<std::vector<float>>("Analysis/EventPlane/QVecCorrections/BPos", cfgCcdbParam.nolaterthan.value)));
} else {
if (cfgBPosCorr->size() < 48) {
LOGF(fatal, "No proper correction factor assigned for BPos");
} else {
cfgCorr.push_back(cfgBPosCorr);
}
}

if (!(ccdb->getForTimeStamp<std::vector<float>>("Analysis/EventPlane/QVecCorrections/BNeg", cfgCcdbParam.nolaterthan.value))->empty()) {
cfgCorr.push_back(*(ccdb->getForTimeStamp<std::vector<float>>("Analysis/EventPlane/QVecCorrections/BNeg", cfgCcdbParam.nolaterthan.value)));
} else {
if (cfgBNegCorr->size() < 48) {
LOGF(fatal, "No proper correction factor assigned for BNeg");
} else {
cfgCorr.push_back(cfgBNegCorr);
}
}
} else if (cfgCCDBConst == 2) {
if (cfgFT0CCorr->size() < 48) {
LOGF(fatal, "No proper correction factor assigned for FT0C");
}
if (cfgFT0ACorr->size() < 48) {
LOGF(fatal, "No proper correction factor assigned for FT0A");
}
if (cfgFT0MCorr->size() < 48) {
LOGF(fatal, "No proper correction factor assigned for FT0M");
}
if (cfgFV0ACorr->size() < 48) {
LOGF(fatal, "No proper correction factor assigned for FV0A");
}
if (cfgBPosCorr->size() < 48) {
LOGF(fatal, "No proper correction factor assigned for positive TPC tracks");
}
if (cfgBNegCorr->size() < 48) {
LOGF(fatal, "No proper correction factor assigned for negative TPC tracks");
} // will be replaced with method that call constants from CCDB

cfgCorr.push_back(cfgFT0CCorr);
cfgCorr.push_back(cfgFT0ACorr);
cfgCorr.push_back(cfgFT0MCorr);
cfgCorr.push_back(cfgFV0ACorr);
cfgCorr.push_back(cfgBPosCorr);
cfgCorr.push_back(cfgBNegCorr);
}
if (cfgBNegCorr->size() < 48) {
LOGF(fatal, "No proper correction factor assigned for negative TPC tracks");
} // will be replaced with method that call constants from CCDB
cfgCorr.push_back(cfgFT0CCorr);
cfgCorr.push_back(cfgFT0ACorr);
cfgCorr.push_back(cfgFT0MCorr);
cfgCorr.push_back(cfgFV0ACorr);
cfgCorr.push_back(cfgBPosCorr);
cfgCorr.push_back(cfgBNegCorr);

/* // Debug printing.
printf("Offset for FT0A: x = %.3f y = %.3f\n", (*offsetFT0)[0].getX(), (*offsetFT0)[0].getY());
Expand Down
30 changes: 15 additions & 15 deletions Common/Tasks/qVectorsCorrection.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,10 @@ struct qVectorsCorrection {
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histQvecTwist"), vec.qvecRe()[DetId * 4 + 2], vec.qvecIm()[DetId * 4 + 2]);
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histQvecFinal"), vec.qvecRe()[DetId * 4 + 3], vec.qvecIm()[DetId * 4 + 3]);

histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlUncor"), helperEP.GetEventPlane(vec.qvecRe()[DetId * 4], vec.qvecIm()[DetId * 4], 2));
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRectr"), helperEP.GetEventPlane(vec.qvecRe()[DetId * 4 + 1], vec.qvecIm()[DetId * 4 + 1], 2));
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlTwist"), helperEP.GetEventPlane(vec.qvecRe()[DetId * 4 + 2], vec.qvecIm()[DetId * 4 + 2], 2));
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlFinal"), helperEP.GetEventPlane(vec.qvecRe()[DetId * 4 + 3], vec.qvecIm()[DetId * 4 + 3], 2));
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlUncor"), helperEP.GetEventPlane(vec.qvecRe()[DetId * 4], vec.qvecIm()[DetId * 4], cfgnMod));
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRectr"), helperEP.GetEventPlane(vec.qvecRe()[DetId * 4 + 1], vec.qvecIm()[DetId * 4 + 1], cfgnMod));
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlTwist"), helperEP.GetEventPlane(vec.qvecRe()[DetId * 4 + 2], vec.qvecIm()[DetId * 4 + 2], cfgnMod));
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlFinal"), helperEP.GetEventPlane(vec.qvecRe()[DetId * 4 + 3], vec.qvecIm()[DetId * 4 + 3], cfgnMod));
}

if (vec.qvecAmp()[RefAId] > 1e-8) {
Expand All @@ -180,10 +180,10 @@ struct qVectorsCorrection {
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histQvecRefATwist"), vec.qvecRe()[RefAId * 4 + 2], vec.qvecIm()[RefAId * 4 + 2]);
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histQvecRefAFinal"), vec.qvecRe()[RefAId * 4 + 3], vec.qvecIm()[RefAId * 4 + 3]);

histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRefAUncor"), helperEP.GetEventPlane(vec.qvecRe()[RefAId * 4], vec.qvecIm()[RefAId * 4], 2));
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRefARectr"), helperEP.GetEventPlane(vec.qvecRe()[RefAId * 4 + 1], vec.qvecIm()[RefAId * 4 + 1], 2));
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRefATwist"), helperEP.GetEventPlane(vec.qvecRe()[RefAId * 4 + 2], vec.qvecIm()[RefAId * 4 + 2], 2));
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRefAFinal"), helperEP.GetEventPlane(vec.qvecRe()[RefAId * 4 + 3], vec.qvecIm()[RefAId * 4 + 3], 2));
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRefAUncor"), helperEP.GetEventPlane(vec.qvecRe()[RefAId * 4], vec.qvecIm()[RefAId * 4], cfgnMod));
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRefARectr"), helperEP.GetEventPlane(vec.qvecRe()[RefAId * 4 + 1], vec.qvecIm()[RefAId * 4 + 1], cfgnMod));
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRefATwist"), helperEP.GetEventPlane(vec.qvecRe()[RefAId * 4 + 2], vec.qvecIm()[RefAId * 4 + 2], cfgnMod));
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRefAFinal"), helperEP.GetEventPlane(vec.qvecRe()[RefAId * 4 + 3], vec.qvecIm()[RefAId * 4 + 3], cfgnMod));
}

if (vec.qvecAmp()[RefBId] > 1e-8) {
Expand All @@ -192,17 +192,17 @@ struct qVectorsCorrection {
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histQvecRefBTwist"), vec.qvecRe()[RefBId * 4 + 2], vec.qvecIm()[RefBId * 4 + 2]);
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histQvecRefBFinal"), vec.qvecRe()[RefBId * 4 + 3], vec.qvecIm()[RefBId * 4 + 3]);

histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRefBUncor"), helperEP.GetEventPlane(vec.qvecRe()[RefBId * 4], vec.qvecIm()[RefBId * 4], 2));
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRefBRectr"), helperEP.GetEventPlane(vec.qvecRe()[RefBId * 4 + 1], vec.qvecIm()[RefBId * 4 + 1], 2));
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRefBTwist"), helperEP.GetEventPlane(vec.qvecRe()[RefBId * 4 + 2], vec.qvecIm()[RefBId * 4 + 2], 2));
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRefBFinal"), helperEP.GetEventPlane(vec.qvecRe()[RefBId * 4 + 3], vec.qvecIm()[RefBId * 4 + 3], 2));
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRefBUncor"), helperEP.GetEventPlane(vec.qvecRe()[RefBId * 4], vec.qvecIm()[RefBId * 4], cfgnMod));
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRefBRectr"), helperEP.GetEventPlane(vec.qvecRe()[RefBId * 4 + 1], vec.qvecIm()[RefBId * 4 + 1], cfgnMod));
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRefBTwist"), helperEP.GetEventPlane(vec.qvecRe()[RefBId * 4 + 2], vec.qvecIm()[RefBId * 4 + 2], cfgnMod));
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRefBFinal"), helperEP.GetEventPlane(vec.qvecRe()[RefBId * 4 + 3], vec.qvecIm()[RefBId * 4 + 3], cfgnMod));
}

if (vec.qvecAmp()[DetId] > 1e-8 && vec.qvecAmp()[RefAId] > 1e-8 && vec.qvecAmp()[RefBId] > 1e-8) {
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlResolution"), helperEP.GetResolution(
helperEP.GetEventPlane(vec.qvecRe()[RefAId * 4 + 3], vec.qvecIm()[RefAId * 4 + 3], 2),
helperEP.GetEventPlane(vec.qvecRe()[RefBId * 4 + 3], vec.qvecIm()[RefBId * 4 + 3], 2),
helperEP.GetEventPlane(vec.qvecRe()[DetId * 4 + 3], vec.qvecIm()[DetId * 4 + 3], 2), 2));
helperEP.GetEventPlane(vec.qvecRe()[RefAId * 4 + 3], vec.qvecIm()[RefAId * 4 + 3], cfgnMod),
helperEP.GetEventPlane(vec.qvecRe()[RefBId * 4 + 3], vec.qvecIm()[RefBId * 4 + 3], cfgnMod),
helperEP.GetEventPlane(vec.qvecRe()[DetId * 4 + 3], vec.qvecIm()[DetId * 4 + 3], cfgnMod), cfgnMod));
}
}

Expand Down

0 comments on commit 64d6097

Please sign in to comment.