From 22a5a83193c8da7ac03bebca88c2c4138c9036eb Mon Sep 17 00:00:00 2001 From: Junlee Kim Date: Wed, 4 Oct 2023 18:43:08 +0900 Subject: [PATCH] [Common] updates for event plane reconstruction using TPC tracks (#3488) --- Common/DataModel/EvtPlanes.h | 27 +-- Common/DataModel/Qvectors.h | 58 +++--- Common/TableProducer/evtPlanesTable.cxx | 109 +++-------- Common/TableProducer/qVectorsTable.cxx | 246 ++++++++++++------------ Common/Tasks/qVectorsCorrection.cxx | 143 ++++++-------- 5 files changed, 255 insertions(+), 328 deletions(-) diff --git a/Common/DataModel/EvtPlanes.h b/Common/DataModel/EvtPlanes.h index 11e9e58994a..a160c4c4714 100644 --- a/Common/DataModel/EvtPlanes.h +++ b/Common/DataModel/EvtPlanes.h @@ -28,22 +28,27 @@ namespace o2::aod namespace ep { DECLARE_SOA_COLUMN(Cent, cent, float); //! Centrality percentile. -DECLARE_SOA_COLUMN(EvtPlFT0A, evtPlFT0A, float); //! Event plane for FT0A. -DECLARE_SOA_COLUMN(EvtPlFT0C, evtPlFT0C, float); //! Event plane for FT0C. -DECLARE_SOA_COLUMN(EvtPlFV0A, evtPlFV0A, float); //! Event plane for FV0A. -DECLARE_SOA_COLUMN(EvtPlBPos, evtPlBPos, float); //! Event plane for the central barrel, positive pseudorapidity. -DECLARE_SOA_COLUMN(EvtPlBNeg, evtPlBNeg, float); //! Event plane for the central barrel, negative pseudorapidity. +DECLARE_SOA_COLUMN(EvtPlUncor, evtPlUncor, float); +DECLARE_SOA_COLUMN(EvtPlRectr, evtPlRectr, float); +DECLARE_SOA_COLUMN(EvtPlTwist, evtPlTwist, float); +DECLARE_SOA_COLUMN(EvtPlFinal, evtPlFinal, float); -DECLARE_SOA_COLUMN(EvtPlFT0C_uncor, evtPlFT0C_uncor, float); //! Event plane for FT0C. -DECLARE_SOA_COLUMN(EvtPlFT0C_rectr, evtPlFT0C_rectr, float); //! Event plane for FT0C. -DECLARE_SOA_COLUMN(EvtPlFT0C_twist, evtPlFT0C_twist, float); //! Event plane for FT0C. +DECLARE_SOA_COLUMN(EvtPlBPosUncor, evtPlBPosUncor, float); +DECLARE_SOA_COLUMN(EvtPlBPosRectr, evtPlBPosRectr, float); +DECLARE_SOA_COLUMN(EvtPlBPosTwist, evtPlBPosTwist, float); +DECLARE_SOA_COLUMN(EvtPlBPosFinal, evtPlBPosFinal, float); + +DECLARE_SOA_COLUMN(EvtPlBNegUncor, evtPlBNegUncor, float); +DECLARE_SOA_COLUMN(EvtPlBNegRectr, evtPlBNegRectr, float); +DECLARE_SOA_COLUMN(EvtPlBNegTwist, evtPlBNegTwist, float); +DECLARE_SOA_COLUMN(EvtPlBNegFinal, evtPlBNegFinal, float); } // namespace ep DECLARE_SOA_TABLE(EvtPlanes, "AOD", "EVTPLANES", //! Table with all event planes. ep::Cent, - ep::EvtPlFT0A, ep::EvtPlFT0C, ep::EvtPlFV0A, - ep::EvtPlBPos, ep::EvtPlBNeg, - ep::EvtPlFT0C_uncor, ep::EvtPlFT0C_rectr, ep::EvtPlFT0C_twist); + ep::EvtPlUncor, ep::EvtPlRectr, ep::EvtPlTwist, ep::EvtPlFinal, + ep::EvtPlBPosUncor, ep::EvtPlBPosRectr, ep::EvtPlBPosTwist, ep::EvtPlBPosFinal, + ep::EvtPlBNegUncor, ep::EvtPlBNegRectr, ep::EvtPlBNegTwist, ep::EvtPlBNegFinal); using EvtPlane = EvtPlanes::iterator; } // namespace o2::aod diff --git a/Common/DataModel/Qvectors.h b/Common/DataModel/Qvectors.h index 04767df7acc..8c09c855f00 100644 --- a/Common/DataModel/Qvectors.h +++ b/Common/DataModel/Qvectors.h @@ -28,36 +28,42 @@ namespace o2::aod namespace qvec { DECLARE_SOA_COLUMN(Cent, cent, float); //! Centrality percentile. -DECLARE_SOA_COLUMN(QvecFT0ARe, qvecFT0ARe, float); //! Real part of Qvec in FT0A. -DECLARE_SOA_COLUMN(QvecFT0AIm, qvecFT0AIm, float); //! Imaginary part for FT0A. -DECLARE_SOA_COLUMN(QvecFT0CRe, qvecFT0CRe, float); //! Real part of Qvec in FT0C. -DECLARE_SOA_COLUMN(QvecFT0CIm, qvecFT0CIm, float); //! Imaginary part for FT0C. -DECLARE_SOA_COLUMN(QvecFV0ARe, qvecFV0ARe, float); //! Real part of Qvec in FV0A. -DECLARE_SOA_COLUMN(QvecFV0AIm, qvecFV0AIm, float); //! Imaginary part for FV0A. -DECLARE_SOA_COLUMN(QvecBPosRe, qvecBPosRe, float); -DECLARE_SOA_COLUMN(QvecBPosIm, qvecBPosIm, float); -DECLARE_SOA_COLUMN(QvecBNegRe, qvecBNegRe, float); -DECLARE_SOA_COLUMN(QvecBNegIm, qvecBNegIm, float); -DECLARE_SOA_COLUMN(QvecFT0CUncorRe, qvecFT0CUncorRe, float); -DECLARE_SOA_COLUMN(QvecFT0CUncorIm, qvecFT0CUncorIm, float); -DECLARE_SOA_COLUMN(QvecFT0CRectrRe, qvecFT0CRectrRe, float); -DECLARE_SOA_COLUMN(QvecFT0CRectrIm, qvecFT0CRectrIm, float); -DECLARE_SOA_COLUMN(QvecFT0CTwistRe, qvecFT0CTwistRe, float); -DECLARE_SOA_COLUMN(QvecFT0CTwistIm, qvecFT0CTwistIm, float); +DECLARE_SOA_COLUMN(CentBin, centBin, int); +DECLARE_SOA_COLUMN(QvecUncorRe, qvecUncorRe, float); +DECLARE_SOA_COLUMN(QvecUncorIm, qvecUncorIm, float); +DECLARE_SOA_COLUMN(QvecRectrRe, qvecRectrRe, float); +DECLARE_SOA_COLUMN(QvecRectrIm, qvecRectrIm, float); +DECLARE_SOA_COLUMN(QvecTwistRe, qvecTwistRe, float); +DECLARE_SOA_COLUMN(QvecTwistIm, qvecTwistIm, float); +DECLARE_SOA_COLUMN(QvecFinalRe, qvecFinalRe, float); +DECLARE_SOA_COLUMN(QvecFinalIm, qvecFinalIm, float); +DECLARE_SOA_COLUMN(QvecBPosUncorRe, qvecBPosUncorRe, float); +DECLARE_SOA_COLUMN(QvecBPosUncorIm, qvecBPosUncorIm, float); +DECLARE_SOA_COLUMN(QvecBPosRectrRe, qvecBPosRectrRe, float); +DECLARE_SOA_COLUMN(QvecBPosRectrIm, qvecBPosRectrIm, float); +DECLARE_SOA_COLUMN(QvecBPosTwistRe, qvecBPosTwistRe, float); +DECLARE_SOA_COLUMN(QvecBPosTwistIm, qvecBPosTwistIm, float); +DECLARE_SOA_COLUMN(QvecBPosFinalRe, qvecBPosFinalRe, float); +DECLARE_SOA_COLUMN(QvecBPosFinalIm, qvecBPosFinalIm, float); +DECLARE_SOA_COLUMN(QvecBNegUncorRe, qvecBNegUncorRe, float); +DECLARE_SOA_COLUMN(QvecBNegUncorIm, qvecBNegUncorIm, float); +DECLARE_SOA_COLUMN(QvecBNegRectrRe, qvecBNegRectrRe, float); +DECLARE_SOA_COLUMN(QvecBNegRectrIm, qvecBNegRectrIm, float); +DECLARE_SOA_COLUMN(QvecBNegTwistRe, qvecBNegTwistRe, float); +DECLARE_SOA_COLUMN(QvecBNegTwistIm, qvecBNegTwistIm, float); +DECLARE_SOA_COLUMN(QvecBNegFinalRe, qvecBNegFinalRe, float); +DECLARE_SOA_COLUMN(QvecBNegFinalIm, qvecBNegFinalIm, float); /// NOTE: Add here Qx,Qy for other systems. } // namespace qvec DECLARE_SOA_TABLE(Qvectors, "AOD", "QVECTORS", //! Table with all Qvectors. - qvec::Cent, - qvec::QvecFT0ARe, qvec::QvecFT0AIm, - qvec::QvecFT0CRe, qvec::QvecFT0CIm, - qvec::QvecFV0ARe, qvec::QvecFV0AIm, - qvec::QvecBPosRe, qvec::QvecBPosIm, - qvec::QvecBNegRe, qvec::QvecBNegIm, - qvec::QvecFT0CUncorRe, qvec::QvecFT0CUncorIm, - qvec::QvecFT0CRectrRe, qvec::QvecFT0CRectrIm, - qvec::QvecFT0CTwistRe, qvec::QvecFT0CTwistIm); - + qvec::Cent, qvec::CentBin, + qvec::QvecUncorRe, qvec::QvecUncorIm, qvec::QvecRectrRe, qvec::QvecRectrIm, + qvec::QvecTwistRe, qvec::QvecTwistIm, qvec::QvecFinalRe, qvec::QvecFinalIm, + qvec::QvecBPosUncorRe, qvec::QvecBPosUncorIm, qvec::QvecBPosRectrRe, qvec::QvecBPosRectrIm, + qvec::QvecBPosTwistRe, qvec::QvecBPosTwistIm, qvec::QvecBPosFinalRe, qvec::QvecBPosFinalIm, + qvec::QvecBNegUncorRe, qvec::QvecBNegUncorIm, qvec::QvecBNegRectrRe, qvec::QvecBNegRectrIm, + qvec::QvecBNegTwistRe, qvec::QvecBNegTwistIm, qvec::QvecBNegFinalRe, qvec::QvecBNegFinalIm); using Qvector = Qvectors::iterator; } // namespace o2::aod diff --git a/Common/TableProducer/evtPlanesTable.cxx b/Common/TableProducer/evtPlanesTable.cxx index 4c2a87b9ddd..27b01439469 100644 --- a/Common/TableProducer/evtPlanesTable.cxx +++ b/Common/TableProducer/evtPlanesTable.cxx @@ -47,24 +47,7 @@ using namespace o2; using namespace o2::framework; -namespace ep -{ -static constexpr std::string_view centClasses[] = { - "Centrality_0-5/", "Centrality_5-10/", "Centrality_10-20/", "Centrality_20-30/", - "Centrality_30-40/", "Centrality_40-50/", "Centrality_50-60/", "Centrality_60-80/"}; - -static constexpr std::string_view detNames[] = { - "FT0A", "FT0C", "FV0A", "BPos", "BNeg", - "FT0CUC", "FT0CRC", "FT0CTW"}; -} // namespace ep - struct evtPlanesTable { - // Configurables. - Configurable cfgCentEsti{"cfgCentEsti", // List from qVectorsTable.cxx - "FT0C", "Centrality estimator (Run3): 0 = FT0M, 1 = FT0A, 2 = FT0C, 3 = FV0A"}; - Configurable cfgCorrStep{"cfgCorrStep", // Used in the plotting. - "Recentered", "Latest correction applied: Raw, Recentered, Twisted, Rescaled"}; - // Table. Produces evPlane; @@ -77,32 +60,8 @@ struct evtPlanesTable { void init(InitContext const&) { - // Fill the registry with the needed objects. - const AxisSpec axisCent{100, 0., 100., fmt::format("Centrality percentile ({})", (std::string)cfgCentEsti)}; - histosQA.add("histCentFull", "Centrality distribution for valid events", - HistType::kTH1F, {axisCent}); - - const AxisSpec axisEP{200, -TMath::Pi() / 2., TMath::Pi() / 2.}; - - for (int i = 0; i < 8; i++) { - histosQA.add(("Centrality_0-5/histEP" + (std::string)ep::detNames[i]).c_str(), - ("#Psi_{2} for " + (std::string)ep::detNames[i] + (std::string)cfgCorrStep).c_str(), - HistType::kTH1F, {axisEP}); - } - - for (int iBin = 1; iBin < 8; iBin++) { - histosQA.addClone("Centrality_0-5/", ep::centClasses[iBin].data()); - } - } // void init(InitContext const&) - template - void fillHistosQA(const T& val) - { - histosQA.fill(HIST(ep::centClasses[cBin]) + HIST("histEP") + HIST(ep::detNames[det]), - val[det]); - } - void process(aod::Qvector const& qVec) { // Get the centrality bin, and fill the centrality distribution. @@ -110,56 +69,34 @@ struct evtPlanesTable { if (centBin < 0 || centBin > 8) { return; } - histosQA.fill(HIST("histCentFull"), qVec.cent()); - // Calculate the event plane for each detector, then save them in the // corresponding distribution. The order is the same as in detNames[]. // TODO: Update the calculation of the event plane for the central barrel. - float evtPlaneValues[8] = {0.}; - evtPlaneValues[0] = helperEP.GetEventPlane(qVec.qvecFT0ARe(), qVec.qvecFT0AIm()); - evtPlaneValues[1] = helperEP.GetEventPlane(qVec.qvecFT0CRe(), qVec.qvecFT0CIm()); - evtPlaneValues[2] = helperEP.GetEventPlane(qVec.qvecFV0ARe(), qVec.qvecFV0AIm()); - evtPlaneValues[3] = helperEP.GetEventPlane(1., 2.); - evtPlaneValues[4] = helperEP.GetEventPlane(2., 1.); - - evtPlaneValues[5] = helperEP.GetEventPlane(qVec.qvecFT0CUncorRe(), qVec.qvecFT0CUncorIm()); - evtPlaneValues[6] = helperEP.GetEventPlane(qVec.qvecFT0CRectrRe(), qVec.qvecFT0CRectrIm()); - evtPlaneValues[7] = helperEP.GetEventPlane(qVec.qvecFT0CTwistRe(), qVec.qvecFT0CTwistIm()); - - static_for<0, 7>([&](auto iDet) { - constexpr int indexDet = iDet.value; - switch (centBin) { - case 0: - fillHistosQA<0, indexDet>(evtPlaneValues); - break; - case 1: - fillHistosQA<1, indexDet>(evtPlaneValues); - break; - case 2: - fillHistosQA<2, indexDet>(evtPlaneValues); - break; - case 3: - fillHistosQA<3, indexDet>(evtPlaneValues); - break; - case 4: - fillHistosQA<4, indexDet>(evtPlaneValues); - break; - case 5: - fillHistosQA<5, indexDet>(evtPlaneValues); - break; - case 6: - fillHistosQA<6, indexDet>(evtPlaneValues); - break; - case 7: - fillHistosQA<7, indexDet>(evtPlaneValues); - break; - } - }); + + float evtPlane[4]; + float evtPlaneBPos[4]; + float evtPlaneBNeg[4]; + + evtPlane[0] = helperEP.GetEventPlane(qVec.qvecUncorRe(), qVec.qvecUncorIm()); + evtPlane[1] = helperEP.GetEventPlane(qVec.qvecRectrRe(), qVec.qvecRectrIm()); + evtPlane[2] = helperEP.GetEventPlane(qVec.qvecTwistRe(), qVec.qvecTwistIm()); + evtPlane[3] = helperEP.GetEventPlane(qVec.qvecFinalRe(), qVec.qvecFinalIm()); + + evtPlaneBPos[0] = helperEP.GetEventPlane(qVec.qvecBPosUncorRe(), qVec.qvecBPosUncorIm()); + evtPlaneBPos[1] = helperEP.GetEventPlane(qVec.qvecBPosRectrRe(), qVec.qvecBPosRectrIm()); + evtPlaneBPos[2] = helperEP.GetEventPlane(qVec.qvecBPosTwistRe(), qVec.qvecBPosTwistIm()); + evtPlaneBPos[3] = helperEP.GetEventPlane(qVec.qvecBPosFinalRe(), qVec.qvecBPosFinalIm()); + + evtPlaneBNeg[0] = helperEP.GetEventPlane(qVec.qvecBNegUncorRe(), qVec.qvecBNegUncorIm()); + evtPlaneBNeg[1] = helperEP.GetEventPlane(qVec.qvecBNegRectrRe(), qVec.qvecBNegRectrIm()); + evtPlaneBNeg[2] = helperEP.GetEventPlane(qVec.qvecBNegTwistRe(), qVec.qvecBNegTwistIm()); + evtPlaneBNeg[3] = helperEP.GetEventPlane(qVec.qvecBNegFinalRe(), qVec.qvecBNegFinalIm()); + // Fill the columns of the evtPlane table. evPlane(qVec.cent(), - evtPlaneValues[0], evtPlaneValues[1], evtPlaneValues[2], - evtPlaneValues[3], evtPlaneValues[4], - evtPlaneValues[5], evtPlaneValues[6], evtPlaneValues[7]); + evtPlane[0], evtPlane[1], evtPlane[2], evtPlane[3], + evtPlaneBPos[0], evtPlaneBPos[1], evtPlaneBPos[2], evtPlaneBPos[3], + evtPlaneBNeg[0], evtPlaneBNeg[1], evtPlaneBNeg[2], evtPlaneBNeg[3]); } // void process(aod::Qvector const& qVec) }; diff --git a/Common/TableProducer/qVectorsTable.cxx b/Common/TableProducer/qVectorsTable.cxx index a8b71e15e3a..a64522fa537 100644 --- a/Common/TableProducer/qVectorsTable.cxx +++ b/Common/TableProducer/qVectorsTable.cxx @@ -50,7 +50,7 @@ using namespace o2::framework; using MyCollisions = soa::Join; -// using MyTracks = soa::Join; +using MyTracks = soa::Join; struct qVectorsTable { // Configurables. @@ -64,43 +64,16 @@ struct qVectorsTable { Configurable cfgCentEsti{"cfgCentEsti", 2, "Centrality estimator (Run3): 0 = FT0M, 1 = FT0A, 2 = FT0C, 3 = FV0A"}; - // 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. - // Configurable cfgDoAnaTPC{"cfgDoAnaTPC", false, "flag for TPC track analysis"}; - - struct : ConfigurableGroup { - Configurable> cfgFT0ACentBin0{"cfgFT0ACentBin0", {0., 0., 0., 0., 0., 0.}, "Correction constants for FT0A, cent bin 0"}; - Configurable> cfgFT0ACentBin1{"cfgFT0ACentBin1", {0., 0., 0., 0., 0., 0.}, "Correction constants for FT0A, cent bin 1"}; - Configurable> cfgFT0ACentBin2{"cfgFT0ACentBin2", {0., 0., 0., 0., 0., 0.}, "Correction constants for FT0A, cent bin 2"}; - Configurable> cfgFT0ACentBin3{"cfgFT0ACentBin3", {0., 0., 0., 0., 0., 0.}, "Correction constants for FT0A, cent bin 3"}; - Configurable> cfgFT0ACentBin4{"cfgFT0ACentBin4", {0., 0., 0., 0., 0., 0.}, "Correction constants for FT0A, cent bin 4"}; - Configurable> cfgFT0ACentBin5{"cfgFT0ACentBin5", {0., 0., 0., 0., 0., 0.}, "Correction constants for FT0A, cent bin 5"}; - Configurable> cfgFT0ACentBin6{"cfgFT0ACentBin6", {0., 0., 0., 0., 0., 0.}, "Correction constants for FT0A, cent bin 6"}; - Configurable> cfgFT0ACentBin7{"cfgFT0ACentBin7", {0., 0., 0., 0., 0., 0.}, "Correction constants for FT0A, cent bin 7"}; - } cfgCorrConstFT0A; + Configurable cfgMultName{"cfgDetName", "FT0C", "The name of detector to be analyzed, available systems: FT0A, FT0C, FV0A, TPCF, TPCB"}; - struct : ConfigurableGroup { - Configurable> cfgFT0CCentBin0{"cfgFT0CCentBin0", {0., 0., 0., 0., 0., 0.}, "Correction constants for FT0C, cent bin 0"}; - Configurable> cfgFT0CCentBin1{"cfgFT0CCentBin1", {0., 0., 0., 0., 0., 0.}, "Correction constants for FT0C, cent bin 1"}; - Configurable> cfgFT0CCentBin2{"cfgFT0CCentBin2", {0., 0., 0., 0., 0., 0.}, "Correction constants for FT0C, cent bin 2"}; - Configurable> cfgFT0CCentBin3{"cfgFT0CCentBin3", {0., 0., 0., 0., 0., 0.}, "Correction constants for FT0C, cent bin 3"}; - Configurable> cfgFT0CCentBin4{"cfgFT0CCentBin4", {0., 0., 0., 0., 0., 0.}, "Correction constants for FT0C, cent bin 4"}; - Configurable> cfgFT0CCentBin5{"cfgFT0CCentBin5", {0., 0., 0., 0., 0., 0.}, "Correction constants for FT0C, cent bin 5"}; - Configurable> cfgFT0CCentBin6{"cfgFT0CCentBin6", {0., 0., 0., 0., 0., 0.}, "Correction constants for FT0C, cent bin 6"}; - Configurable> cfgFT0CCentBin7{"cfgFT0CCentBin7", {0., 0., 0., 0., 0., 0.}, "Correction constants for FT0C, cent bin 7"}; - } cfgCorrConstFT0C; + // 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. - struct : ConfigurableGroup { - Configurable> cfgFV0ACentBin0{"cfgFV0ACentBin0", {0., 0., 0., 0., 0., 0.}, "Correction constants for FV0A, cent bin 0"}; - Configurable> cfgFV0ACentBin1{"cfgFV0ACentBin1", {0., 0., 0., 0., 0., 0.}, "Correction constants for FV0A, cent bin 1"}; - Configurable> cfgFV0ACentBin2{"cfgFV0ACentBin2", {0., 0., 0., 0., 0., 0.}, "Correction constants for FV0A, cent bin 2"}; - Configurable> cfgFV0ACentBin3{"cfgFV0ACentBin3", {0., 0., 0., 0., 0., 0.}, "Correction constants for FV0A, cent bin 3"}; - Configurable> cfgFV0ACentBin4{"cfgFV0ACentBin4", {0., 0., 0., 0., 0., 0.}, "Correction constants for FV0A, cent bin 4"}; - Configurable> cfgFV0ACentBin5{"cfgFV0ACentBin5", {0., 0., 0., 0., 0., 0.}, "Correction constants for FV0A, cent bin 5"}; - Configurable> cfgFV0ACentBin6{"cfgFV0ACentBin6", {0., 0., 0., 0., 0., 0.}, "Correction constants for FV0A, cent bin 6"}; - Configurable> cfgFV0ACentBin7{"cfgFV0ACentBin7", {0., 0., 0., 0., 0., 0.}, "Correction constants for FV0A, cent bin 7"}; - } cfgCorrConstFV0A; + Configurable> cfgCorr{"cfgCorr", std::vector{0.0}, "Correction constants for detector"}; + Configurable> cfgBPosCorr{"cfgBPosCent", std::vector{0.0}, "Correction constants for positive TPC tracks"}; + Configurable> cfgBNegCorr{"cfgBNegCent", std::vector{0.0}, "Correction constants for negative TPC tracks"}; // Table. Produces qVector; @@ -114,6 +87,8 @@ struct qVectorsTable { // Variables for other classes. EventPlaneHelper helperEP; + HistogramRegistry histosQA{"histosQA", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; + void init(InitContext const&) { // Setup the access to the CCDB objects of interest. @@ -144,6 +119,17 @@ struct qVectorsTable { } else { LOGF(fatal, "Could not get the alignment parameters for FV0."); } + + if (cfgCorr->size() < 48) { + LOGF(fatal, "No proper correction factor assigned"); + } + if (cfgBPosCorr->size() < 48) { + LOGF(fatal, "No proper correction factor assigned"); + } + if (cfgBNegCorr->size() < 48) { + LOGF(fatal, "No proper correction factor assigned"); + } + //|| cfgBPosCent.size() != 48 || cfgBNegCent.size() != 48) { /* // Debug printing. printf("Offset for FT0A: x = %.3f y = %.3f\n", (*offsetFT0)[0].getX(), (*offsetFT0)[0].getY()); printf("Offset for FT0C: x = %.3f y = %.3f\n", (*offsetFT0)[1].getX(), (*offsetFT0)[1].getY()); @@ -153,10 +139,17 @@ struct qVectorsTable { // LOKI: If we need to access the corrections from the CCDB, insert that here. // In the meantime, call upon the external files with all the configurables. + + AxisSpec axisPt = {40, 0.0, 4.0}; + AxisSpec axisEta = {32, -0.8, 0.8}; + AxisSpec axisPhi = {32, -TMath::Pi(), TMath::Pi()}; + AxisSpec axixCent = {20, 0, 100}; + + histosQA.add("ChTracks", "", {HistType::kTHnSparseF, {axisPt, axisEta, axisPhi, axixCent}}); } - // void process(MyCollisions::iterator const& coll, aod::FT0s const& ft0s, aod::FV0As const& fv0s, MyTracks const& tracks) //, aod::FV0Cs const&) - void process(MyCollisions::iterator const& coll, aod::FT0s const& ft0s, aod::FV0As const& fv0s) + void process(MyCollisions::iterator const& coll, aod::FT0s const& ft0s, aod::FV0As const& fv0s, MyTracks const& tracks) //, aod::FV0Cs const&) + // void process(MyCollisions::iterator const& coll, aod::FT0s const& ft0s, aod::FV0As const& fv0s) { // Get the centrality value for all subscribed estimators and takes the one // corresponding to cfgCentEsti. Reject also the events with invalid values. @@ -175,12 +168,8 @@ struct qVectorsTable { float qVectFT0C[2] = {0.}; // Real and imaginary parts of the Q-vector in FT0C. float qVectFV0A[2] = {0.}; // Real and imaginary parts of the Q-vector in FV0A. - float qVectFT0C_uncor[2] = {0.}; - float qVectFT0C_rectr[2] = {0.}; - float qVectFT0C_twist[2] = {0.}; - - // float qVectBPos[2] = {0.}; - // float qVectBNeg[2] = {0.}; + float qVectBPos[2] = {0.}; + float qVectBNeg[2] = {0.}; TComplex QvecDet(0); // Complex value of the Q-vector for any detector. double sumAmplDet = 0.; // Sum of the amplitudes of all non-dead channels in any detector. @@ -225,8 +214,6 @@ struct qVectorsTable { helperEP.SumQvectors(0, iChC + 96, ampl, QvecDet, sumAmplDet); } - printf("Total amp = %.3f \n", sumAmplDet); - if (sumAmplDet > 1e-8) { QvecDet /= sumAmplDet; qVectFT0C[0] = QvecDet.Re(); @@ -268,21 +255,26 @@ struct qVectorsTable { qVectFV0A[0] = -999.; qVectFV0A[1] = -999.; } - /* - if( cfgDoAnaTPC ){ - for (auto& trk : tracks) { - if( !trk.isGlobalTrack() ) continue; - if( abs( trk.eta() ) < 0.1 || abs( trk.eta() ) > 0.8 ) continue; - if( trk.eta() > 0 ){ - qVectBPos[0] = trk.pt() * TMath::Cos( 2*trk.phi()); - qVectBPos[1] = trk.pt() * TMath::Sin( 2*trk.phi()); - } else if( trk.eta() < 0 ){ - qVectBNeg[0] = trk.pt() * TMath::Cos( 2*trk.phi()); - qVectBNeg[1] = trk.pt() * TMath::Sin( 2*trk.phi()); - } - } - } - */ + + qVectBPos[0] = 0.; + qVectBPos[1] = 0.; + qVectBNeg[0] = 0.; + qVectBNeg[1] = 0.; + + for (auto& trk : tracks) { + if (!trk.isGlobalTrack()) + continue; + histosQA.fill(HIST("ChTracks"), trk.pt(), trk.eta(), trk.phi(), cent); + if (abs(trk.eta()) < 0.1 || abs(trk.eta()) > 0.8) + continue; + if (trk.eta() > 0) { + qVectBPos[0] += trk.pt() * TMath::Cos(2. * trk.phi()); + qVectBPos[1] += trk.pt() * TMath::Sin(2. * trk.phi()); + } else if (trk.eta() < 0) { + qVectBNeg[0] += trk.pt() * TMath::Cos(2. * trk.phi()); + qVectBNeg[1] += trk.pt() * TMath::Sin(2. * trk.phi()); + } + } /// TODO: Repeat here the procedure for any other Qvector columns. /// Do not forget to add the configurable for the correction constants. @@ -292,80 +284,84 @@ struct qVectorsTable { // A correction constant set to zero means this correction is not applied. // LOKI: Each detector must have their own vector of correction constants. int cBin = helperEP.GetCentBin(cent); - std::vector corrConstFT0A; - std::vector corrConstFT0C; - std::vector corrConstFV0A; - switch (cBin) { - case 0: - corrConstFT0A = cfgCorrConstFT0A.cfgFT0ACentBin0; - corrConstFT0C = cfgCorrConstFT0C.cfgFT0CCentBin0; - corrConstFV0A = cfgCorrConstFV0A.cfgFV0ACentBin0; - break; - case 1: - corrConstFT0A = cfgCorrConstFT0A.cfgFT0ACentBin1; - corrConstFT0C = cfgCorrConstFT0C.cfgFT0CCentBin1; - corrConstFV0A = cfgCorrConstFV0A.cfgFV0ACentBin1; - break; - case 2: - corrConstFT0A = cfgCorrConstFT0A.cfgFT0ACentBin2; - corrConstFT0C = cfgCorrConstFT0C.cfgFT0CCentBin2; - corrConstFV0A = cfgCorrConstFV0A.cfgFV0ACentBin2; - break; - case 3: - corrConstFT0A = cfgCorrConstFT0A.cfgFT0ACentBin3; - corrConstFT0C = cfgCorrConstFT0C.cfgFT0CCentBin3; - corrConstFV0A = cfgCorrConstFV0A.cfgFV0ACentBin3; - break; - case 4: - corrConstFT0A = cfgCorrConstFT0A.cfgFT0ACentBin4; - corrConstFT0C = cfgCorrConstFT0C.cfgFT0CCentBin4; - corrConstFV0A = cfgCorrConstFV0A.cfgFV0ACentBin4; - break; - case 5: - corrConstFT0A = cfgCorrConstFT0A.cfgFT0ACentBin5; - corrConstFT0C = cfgCorrConstFT0C.cfgFT0CCentBin5; - corrConstFV0A = cfgCorrConstFV0A.cfgFV0ACentBin5; - break; - case 6: - corrConstFT0A = cfgCorrConstFT0A.cfgFT0ACentBin6; - corrConstFT0C = cfgCorrConstFT0C.cfgFT0CCentBin6; - corrConstFV0A = cfgCorrConstFV0A.cfgFV0ACentBin6; - break; - case 7: - corrConstFT0A = cfgCorrConstFT0A.cfgFT0ACentBin7; - corrConstFT0C = cfgCorrConstFT0C.cfgFT0CCentBin7; - corrConstFV0A = cfgCorrConstFV0A.cfgFV0ACentBin7; - break; + + float qVector_final[2] = {0.}; + if (cfgMultName.value == "FT0A") { + qVector_final[0] = qVectFT0A[0]; + qVector_final[1] = qVectFT0A[1]; + } else if (cfgMultName.value == "FT0C") { + qVector_final[0] = qVectFT0C[0]; + qVector_final[1] = qVectFT0C[1]; + } else if (cfgMultName.value == "FV0A") { + qVector_final[0] = qVectFV0A[0]; + qVector_final[1] = qVectFV0A[1]; } + float qVector_uncor[2]; + float qVector_rectr[2]; + float qVector_twist[2]; + + float qVectBPos_uncor[2]; + float qVectBPos_rectr[2]; + float qVectBPos_twist[2]; + float qVectBPos_final[2]; + + float qVectBNeg_uncor[2]; + float qVectBNeg_rectr[2]; + float qVectBNeg_twist[2]; + float qVectBNeg_final[2]; + for (int i = 0; i < 2; i++) { - qVectFT0C_uncor[i] = qVectFT0C[i]; - qVectFT0C_rectr[i] = qVectFT0C[i]; - qVectFT0C_twist[i] = qVectFT0C[i]; + qVector_uncor[i] = qVector_final[i]; + qVector_rectr[i] = qVector_final[i]; + qVector_twist[i] = qVector_final[i]; + + qVectBPos_uncor[i] = qVectBPos[i]; + qVectBPos_rectr[i] = qVectBPos[i]; + qVectBPos_twist[i] = qVectBPos[i]; + qVectBPos_final[i] = qVectBPos[i]; + + qVectBNeg_uncor[i] = qVectBNeg[i]; + qVectBNeg_rectr[i] = qVectBNeg[i]; + qVectBNeg_twist[i] = qVectBNeg[i]; + qVectBNeg_final[i] = qVectBNeg[i]; } - helperEP.DoCorrections(qVectFT0A[0], qVectFT0A[1], corrConstFT0A); - helperEP.DoCorrections(qVectFT0C[0], qVectFT0C[1], corrConstFT0C); - helperEP.DoCorrections(qVectFV0A[0], qVectFV0A[1], corrConstFV0A); + helperEP.DoRecenter(qVector_rectr[0], qVector_rectr[1], cfgCorr->at(cBin * 6), cfgCorr->at(cBin * 6 + 1)); + + helperEP.DoRecenter(qVector_twist[0], qVector_twist[1], cfgCorr->at(cBin * 6 + 2), cfgCorr->at(cBin * 6 + 3)); + helperEP.DoTwist(qVector_twist[0], qVector_twist[1], cfgCorr->at(cBin * 6 + 4), cfgCorr->at(cBin * 6 + 5)); + + helperEP.DoRecenter(qVector_final[0], qVector_final[1], cfgCorr->at(cBin * 6), cfgCorr->at(cBin * 6 + 1)); + helperEP.DoTwist(qVector_final[0], qVector_final[1], cfgCorr->at(cBin * 6 + 2), cfgCorr->at(cBin * 6 + 3)); + helperEP.DoRescale(qVector_final[0], qVector_final[1], cfgCorr->at(cBin * 6 + 4), cfgCorr->at(cBin * 6 + 5)); + + helperEP.DoRecenter(qVectBPos_rectr[0], qVectBPos_rectr[1], cfgBPosCorr->at(cBin * 6), cfgBPosCorr->at(cBin * 6 + 1)); + + helperEP.DoRecenter(qVectBPos_twist[0], qVectBPos_twist[1], cfgBPosCorr->at(cBin * 6), cfgBPosCorr->at(cBin * 6 + 1)); + helperEP.DoTwist(qVectBPos_twist[0], qVectBPos_twist[1], cfgBPosCorr->at(cBin * 6 + 2), cfgBPosCorr->at(cBin * 6 + 3)); + + helperEP.DoRecenter(qVectBPos_final[0], qVectBPos_final[1], cfgBPosCorr->at(cBin * 6), cfgBPosCorr->at(cBin * 6 + 1)); + helperEP.DoTwist(qVectBPos_final[0], qVectBPos_final[1], cfgBPosCorr->at(cBin * 6 + 2), cfgBPosCorr->at(cBin * 6 + 3)); + helperEP.DoRescale(qVectBPos_final[0], qVectBPos_final[1], cfgBPosCorr->at(cBin * 6 + 4), cfgBPosCorr->at(cBin * 6 + 5)); + + helperEP.DoRecenter(qVectBNeg_rectr[0], qVectBNeg_rectr[1], cfgBNegCorr->at(cBin * 6), cfgBNegCorr->at(cBin * 6 + 1)); - helperEP.DoRecenter(qVectFT0C_rectr[0], qVectFT0C_rectr[1], corrConstFT0C[0], corrConstFT0C[1]); - helperEP.DoRecenter(qVectFT0C_twist[0], qVectFT0C_twist[1], corrConstFT0C[0], corrConstFT0C[1]); - helperEP.DoTwist(qVectFT0C_twist[0], qVectFT0C_twist[1], corrConstFT0C[2], corrConstFT0C[3]); + helperEP.DoRecenter(qVectBNeg_twist[0], qVectBNeg_twist[1], cfgBNegCorr->at(cBin * 6), cfgBNegCorr->at(cBin * 6 + 1)); + helperEP.DoTwist(qVectBNeg_twist[0], qVectBNeg_twist[1], cfgBNegCorr->at(cBin * 6 + 2), cfgBNegCorr->at(cBin * 6 + 3)); - std::vector().swap(corrConstFT0A); - std::vector().swap(corrConstFT0C); - std::vector().swap(corrConstFV0A); + helperEP.DoRecenter(qVectBNeg_final[0], qVectBNeg_final[1], cfgBNegCorr->at(cBin * 6), cfgBNegCorr->at(cBin * 6 + 1)); + helperEP.DoTwist(qVectBNeg_final[0], qVectBNeg_final[1], cfgBNegCorr->at(cBin * 6 + 2), cfgBNegCorr->at(cBin * 6 + 3)); + helperEP.DoRescale(qVectBNeg_final[0], qVectBNeg_final[1], cfgBNegCorr->at(cBin * 6 + 4), cfgBNegCorr->at(cBin * 6 + 5)); // Fill the columns of the Qvectors table. - qVector(cent, - qVectFT0A[0], qVectFT0A[1], - qVectFT0C[0], qVectFT0C[1], - qVectFV0A[0], qVectFV0A[1], - 1.0, 2.0, - 2.0, 1.0, - qVectFT0C_uncor[0], qVectFT0C_uncor[1], - qVectFT0C_rectr[0], qVectFT0C_rectr[1], - qVectFT0C_twist[0], qVectFT0C_twist[1]); + qVector(cent, cBin, + qVector_uncor[0], qVector_uncor[1], qVector_rectr[0], qVector_rectr[1], + qVector_twist[0], qVector_twist[1], qVector_final[0], qVector_final[1], + qVectBPos_uncor[0], qVectBPos_uncor[1], qVectBPos_rectr[0], qVectBPos_rectr[1], + qVectBPos_twist[0], qVectBPos_twist[1], qVectBPos_final[0], qVectBPos_final[1], + qVectBNeg_uncor[0], qVectBNeg_uncor[1], qVectBNeg_rectr[0], qVectBNeg_rectr[1], + qVectBNeg_twist[0], qVectBNeg_twist[1], qVectBNeg_final[0], qVectBNeg_final[1]); } // End process. }; diff --git a/Common/Tasks/qVectorsCorrection.cxx b/Common/Tasks/qVectorsCorrection.cxx index f49f4ee5606..7575537cb94 100644 --- a/Common/Tasks/qVectorsCorrection.cxx +++ b/Common/Tasks/qVectorsCorrection.cxx @@ -45,19 +45,12 @@ using namespace o2::framework; namespace qV { -static constexpr std::string_view centClasses[] = { +static constexpr std::string_view centClasses[8] = { "Centrality_0-5/", "Centrality_5-10/", "Centrality_10-20/", "Centrality_20-30/", "Centrality_30-40/", "Centrality_40-50/", "Centrality_50-60/", "Centrality_60-80/"}; - -static constexpr std::string_view detNames[] = {"FT0A", "FT0C", "FV0A"}; } // namespace qV struct qVectorsCorrection { - // Configurables. - Configurable cfgCentEsti{"cfgCentEsti", // List from qVectorsTable.cxx - "FT0C", "Centrality estimator (Run3): 0 = FT0M, 1 = FT0A, 2 = FT0C, 3 = FV0A"}; - Configurable cfgCorrStep{"cfgCorrStep", // Used in the plotting. - "Recenter", "Correction step to obtain: Recenter, Twist, Rescale, Final"}; // No correction = recenter, recentered Qvectors = twist, twisted Qvectors = rescale. // NOTE: As of no, the twist gets both twist and rescale correction constants. @@ -72,32 +65,30 @@ struct qVectorsCorrection { void init(InitContext const&) { // Fill the registry with the needed objects. - const AxisSpec axisCent{100, 0., 100., fmt::format("Centrality percentile ({})", (std::string)cfgCentEsti)}; + const AxisSpec axisCent{110, 0., 110.}; const AxisSpec axisQvec{2000, -5, 5}; const AxisSpec axisConst{12, 0., 12.}; // 4 constants x 3 detectors. histosQA.add("histCentFull", "Centrality distribution for valid events", HistType::kTH1F, {axisCent}); + histosQA.add("Centrality_0-5/histCent", "Centrality distribution", HistType::kTH1F, {axisCent}); - histosQA.add("Centrality_0-5/histQvecFT0A", - ("(Qx,Qy) for " + (std::string)qV::detNames[0] + " with corrections ").c_str(), - HistType::kTH2F, {axisQvec, axisQvec}); - histosQA.add("Centrality_0-5/histQvecFT0C", - ("(Qx,Qy) for " + (std::string)qV::detNames[1] + " with corrections ").c_str(), - HistType::kTH2F, {axisQvec, axisQvec}); - histosQA.add("Centrality_0-5/histQvecFV0A", - ("(Qx,Qy) for " + (std::string)qV::detNames[2] + " with corrections ").c_str(), - HistType::kTH2F, {axisQvec, axisQvec}); + histosQA.add("Centrality_0-5/histQvecUncor", "", {HistType::kTH2F, {axisQvec, axisQvec}}); + histosQA.add("Centrality_0-5/histQvecRectr", "", {HistType::kTH2F, {axisQvec, axisQvec}}); + histosQA.add("Centrality_0-5/histQvecTwist", "", {HistType::kTH2F, {axisQvec, axisQvec}}); + histosQA.add("Centrality_0-5/histQvecFinal", "", {HistType::kTH2F, {axisQvec, axisQvec}}); - histosQA.add("Centrality_0-5/histQvecFT0C_uncor", "", {HistType::kTH2F, {axisQvec, axisQvec}}); - histosQA.add("Centrality_0-5/histQvecFT0C_rectr", "", {HistType::kTH2F, {axisQvec, axisQvec}}); - histosQA.add("Centrality_0-5/histQvecFT0C_twist", "", {HistType::kTH2F, {axisQvec, axisQvec}}); + histosQA.add("Centrality_0-5/histQvecBPosUncor", "", {HistType::kTH2F, {axisQvec, axisQvec}}); + histosQA.add("Centrality_0-5/histQvecBPosRectr", "", {HistType::kTH2F, {axisQvec, axisQvec}}); + histosQA.add("Centrality_0-5/histQvecBPosTwist", "", {HistType::kTH2F, {axisQvec, axisQvec}}); + histosQA.add("Centrality_0-5/histQvecBPosFinal", "", {HistType::kTH2F, {axisQvec, axisQvec}}); - histosQA.add("Centrality_0-5/histQvecCorrConst", - ("Correction constants for " + (std::string)cfgCorrStep).c_str(), - HistType::kTH1F, {axisConst}); + histosQA.add("Centrality_0-5/histQvecBNegUncor", "", {HistType::kTH2F, {axisQvec, axisQvec}}); + histosQA.add("Centrality_0-5/histQvecBNegRectr", "", {HistType::kTH2F, {axisQvec, axisQvec}}); + histosQA.add("Centrality_0-5/histQvecBNegTwist", "", {HistType::kTH2F, {axisQvec, axisQvec}}); + histosQA.add("Centrality_0-5/histQvecBNegFinal", "", {HistType::kTH2F, {axisQvec, axisQvec}}); for (int iBin = 1; iBin < 8; iBin++) { histosQA.addClone("Centrality_0-5/", qV::centClasses[iBin].data()); @@ -106,70 +97,62 @@ struct qVectorsCorrection { } // End void init(InitContext const&) // Definition of all the needed template functions. - template - void fillHistosQA(const T& vec) + template + void fillHistosQvec(const T& vec) { - // Fill the centrality distribution per class for the given bin. - histosQA.fill(HIST(qV::centClasses[bin]) + HIST("histCent"), vec.cent()); + histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histCent"), vec.cent()); + histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histCent"), vec.cent()); // Fill the (Qx,Qy) distributions for each detector, after removing dummy values. /// NOTE: FV0 (and FT0C?) are not fully implemented yet /// --> Values are just dummy placeholders. - if (TMath::Abs(vec.qvecFT0ARe()) < 100 && TMath::Abs(vec.qvecFT0AIm()) < 100) { - histosQA.fill(HIST(qV::centClasses[bin]) + HIST("histQvecFT0A"), - vec.qvecFT0ARe(), vec.qvecFT0AIm()); - } - if (TMath::Abs(vec.qvecFT0CRe()) < 100 && TMath::Abs(vec.qvecFT0CIm()) < 100) { - histosQA.fill(HIST(qV::centClasses[bin]) + HIST("histQvecFT0C"), - vec.qvecFT0CRe(), vec.qvecFT0CIm()); - histosQA.fill(HIST(qV::centClasses[bin]) + HIST("histQvecFT0C_uncor"), vec.qvecFT0CUncorRe(), vec.qvecFT0CUncorIm()); - histosQA.fill(HIST(qV::centClasses[bin]) + HIST("histQvecFT0C_rectr"), vec.qvecFT0CRectrRe(), vec.qvecFT0CRectrIm()); - histosQA.fill(HIST(qV::centClasses[bin]) + HIST("histQvecFT0C_twist"), vec.qvecFT0CTwistRe(), vec.qvecFT0CTwistIm()); - } - if (TMath::Abs(vec.qvecFV0ARe()) < 100 && TMath::Abs(vec.qvecFV0AIm()) < 100) { - histosQA.fill(HIST(qV::centClasses[bin]) + HIST("histQvecFV0A"), - vec.qvecFV0ARe(), vec.qvecFV0AIm()); - } + histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histQvecUncor"), vec.qvecUncorRe(), vec.qvecUncorIm()); + histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histQvecRectr"), vec.qvecRectrRe(), vec.qvecRectrIm()); + histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histQvecTwist"), vec.qvecTwistRe(), vec.qvecTwistIm()); + histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histQvecFinal"), vec.qvecFinalRe(), vec.qvecFinalIm()); + + histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histQvecBPosUncor"), vec.qvecBPosUncorRe(), vec.qvecBPosUncorIm()); + histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histQvecBPosRectr"), vec.qvecBPosRectrRe(), vec.qvecBPosRectrIm()); + histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histQvecBPosTwist"), vec.qvecBPosTwistRe(), vec.qvecBPosTwistIm()); + histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histQvecBPosFinal"), vec.qvecBPosFinalRe(), vec.qvecBPosFinalIm()); + + histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histQvecBNegUncor"), vec.qvecBNegUncorRe(), vec.qvecBNegUncorIm()); + histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histQvecBNegRectr"), vec.qvecBNegRectrRe(), vec.qvecBNegRectrIm()); + histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histQvecBNegTwist"), vec.qvecBNegTwistRe(), vec.qvecBNegTwistIm()); + histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histQvecBNegFinal"), vec.qvecBNegFinalRe(), vec.qvecBNegFinalIm()); } - void process(aod::Qvectors const& qVecs) + void process(aod::Qvector const& qVec) { - // Iterate over the table and fill the QA with the received qVecs. - for (auto& qVec : qVecs) { - // Get the centrality bin, and fill the centrality QA histograms. - int centBin = helperEP.GetCentBin(qVec.cent()); - histosQA.fill(HIST("histCentFull"), qVec.cent()); - if (centBin < 0 || centBin > 8) { - continue; - } - switch (centBin) { // LOKI: See if we can replace that with a const something like below. - case 0: - fillHistosQA<0>(qVec); - break; - case 1: - fillHistosQA<1>(qVec); - break; - case 2: - fillHistosQA<2>(qVec); - break; - case 3: - fillHistosQA<3>(qVec); - break; - case 4: - fillHistosQA<4>(qVec); - break; - case 5: - fillHistosQA<5>(qVec); - break; - case 6: - fillHistosQA<6>(qVec); - break; - case 7: - fillHistosQA<7>(qVec); - break; - } // End switch(centBin) - - } // Go to the next qVec. + // Get the centrality bin, and fill the centrality QA histograms. + int centBin = helperEP.GetCentBin(qVec.cent()); + histosQA.fill(HIST("histCentFull"), qVec.cent()); + switch (centBin) { // LOKI: See if we can replace that with a const something like below. + case 0: + fillHistosQvec<0>(qVec); + break; + case 1: + fillHistosQvec<1>(qVec); + break; + case 2: + fillHistosQvec<2>(qVec); + break; + case 3: + fillHistosQvec<3>(qVec); + break; + case 4: + fillHistosQvec<4>(qVec); + break; + case 5: + fillHistosQvec<5>(qVec); + break; + case 6: + fillHistosQvec<6>(qVec); + break; + case 7: + fillHistosQvec<7>(qVec); + break; + } // End switch(centBin) } // End void process(...) };