Skip to content

Commit

Permalink
[Common] updates for event plane reconstruction using TPC tracks (Ali…
Browse files Browse the repository at this point in the history
  • Loading branch information
jikim1290 authored Oct 4, 2023
1 parent 0071844 commit 22a5a83
Show file tree
Hide file tree
Showing 5 changed files with 255 additions and 328 deletions.
27 changes: 16 additions & 11 deletions Common/DataModel/EvtPlanes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
58 changes: 32 additions & 26 deletions Common/DataModel/Qvectors.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
109 changes: 23 additions & 86 deletions Common/TableProducer/evtPlanesTable.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string> cfgCentEsti{"cfgCentEsti", // List from qVectorsTable.cxx
"FT0C", "Centrality estimator (Run3): 0 = FT0M, 1 = FT0A, 2 = FT0C, 3 = FV0A"};
Configurable<std::string> cfgCorrStep{"cfgCorrStep", // Used in the plotting.
"Recentered", "Latest correction applied: Raw, Recentered, Twisted, Rescaled"};

// Table.
Produces<aod::EvtPlanes> evPlane;

Expand All @@ -77,89 +60,43 @@ 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 <int cBin, int det, typename T>
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.
int centBin = helperEP.GetCentBin(qVec.cent());
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)
};

Expand Down
Loading

0 comments on commit 22a5a83

Please sign in to comment.