diff --git a/Common/TableProducer/qVectorsTable.cxx b/Common/TableProducer/qVectorsTable.cxx index 0e51ffdd6bb..dd42ed8408f 100644 --- a/Common/TableProducer/qVectorsTable.cxx +++ b/Common/TableProducer/qVectorsTable.cxx @@ -74,6 +74,8 @@ struct qVectorsTable { Configurable cfgCentEsti{"cfgCentEsti", 2, "Centrality estimator (Run3): 0 = FT0M, 1 = FT0A, 2 = FT0C, 3 = FV0A"}; + Configurable 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. @@ -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>("Analysis/EventPlane/QVecCorrections/FT0C", cfgCcdbParam.nolaterthan.value))->empty()) { + cfgCorr.push_back(*(ccdb->getForTimeStamp>("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>("Analysis/EventPlane/QVecCorrections/FT0A", cfgCcdbParam.nolaterthan.value))->empty()) { + cfgCorr.push_back(*(ccdb->getForTimeStamp>("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>("Analysis/EventPlane/QVecCorrections/FT0M", cfgCcdbParam.nolaterthan.value))->empty()) { + cfgCorr.push_back(*(ccdb->getForTimeStamp>("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>("Analysis/EventPlane/QVecCorrections/FT0C", cfgCcdbParam.nolaterthan.value))->empty()) { + cfgCorr.push_back(*(ccdb->getForTimeStamp>("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>("Analysis/EventPlane/QVecCorrections/BPos", cfgCcdbParam.nolaterthan.value))->empty()) { + cfgCorr.push_back(*(ccdb->getForTimeStamp>("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>("Analysis/EventPlane/QVecCorrections/BNeg", cfgCcdbParam.nolaterthan.value))->empty()) { + cfgCorr.push_back(*(ccdb->getForTimeStamp>("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()); diff --git a/Common/Tasks/qVectorsCorrection.cxx b/Common/Tasks/qVectorsCorrection.cxx index b639d1e77df..e91497b4fb8 100644 --- a/Common/Tasks/qVectorsCorrection.cxx +++ b/Common/Tasks/qVectorsCorrection.cxx @@ -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) { @@ -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) { @@ -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)); } }