Skip to content

Commit

Permalink
[PWGDQ] Updating the Flow framework for the new Q-vector names (Alice…
Browse files Browse the repository at this point in the history
…O2Group#7275)

* Updating the Flow framework for the new Q-vector names

* Fix clang

---------

Co-authored-by: Lucamicheletti93 <[email protected]>
  • Loading branch information
lucamicheletti93 and lucamicheletti authored Aug 12, 2024
1 parent 870c26f commit 6dfa280
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 18 deletions.
21 changes: 12 additions & 9 deletions PWGDQ/Core/VarManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ class VarManager : public TObject
ReducedZdc = BIT(17),
CollisionMultExtra = BIT(18),
ReducedEventMultExtra = BIT(19),
CollisionQvectCentr = BIT(20),
Track = BIT(0),
TrackCov = BIT(1),
TrackExtra = BIT(2),
Expand Down Expand Up @@ -938,6 +939,8 @@ class VarManager : public TObject
template <typename C>
static void FillQVectorFromCentralFW(C const& collision, float* values = nullptr);
template <typename C>
static void FillNewQVectorFromCentralFW(C const& collision, float* values = nullptr);
template <typename C>
static void FillSpectatorPlane(C const& collision, float* values = nullptr);
template <uint32_t fillMap, int pairType, typename T1, typename T2>
static void FillPairVn(T1 const& t1, T2 const& t2, float* values = nullptr);
Expand Down Expand Up @@ -3659,13 +3662,13 @@ void VarManager::FillQVectorFromCentralFW(C const& collision, float* values)
float yQVecFT0m = collision.qvecFT0MIm(); // already normalised
float xQVecFV0a = collision.qvecFV0ARe(); // already normalised
float yQVecFV0a = collision.qvecFV0AIm(); // already normalised
float xQVecBPos = collision.qvecBPosRe(); // already normalised
float yQVecBPos = collision.qvecBPosIm(); // already normalised
float xQVecBNeg = collision.qvecBNegRe(); // already normalised
float yQVecBNeg = collision.qvecBNegIm(); // already normalised
float xQVecBPos = collision.qvecTPCposRe(); // already normalised
float yQVecBPos = collision.qvecTPCposIm(); // already normalised
float xQVecBNeg = collision.qvecTPCnegRe(); // already normalised
float yQVecBNeg = collision.qvecTPCnegIm(); // already normalised

values[kQ2X0A] = (collision.nTrkBPos() * xQVecBPos + collision.nTrkBNeg() * xQVecBNeg) / (collision.nTrkBPos() + collision.nTrkBNeg());
values[kQ2Y0A] = (collision.nTrkBPos() * yQVecBPos + collision.nTrkBNeg() * yQVecBNeg) / (collision.nTrkBPos() + collision.nTrkBNeg());
values[kQ2X0A] = collision.qvecTPCallRe();
values[kQ2Y0A] = collision.qvecTPCallIm();
values[kQ2X0APOS] = xQVecBPos;
values[kQ2Y0APOS] = yQVecBPos;
values[kQ2X0ANEG] = xQVecBNeg;
Expand All @@ -3674,9 +3677,9 @@ void VarManager::FillQVectorFromCentralFW(C const& collision, float* values)
values[kQ2Y0B] = yQVecFT0a;
values[kQ2X0C] = xQVecFT0c;
values[kQ2Y0C] = yQVecFT0c;
values[kMultA] = collision.nTrkBPos() + collision.nTrkBNeg();
values[kMultAPOS] = collision.nTrkBPos();
values[kMultANEG] = collision.nTrkBNeg();
values[kMultA] = collision.nTrkTPCpos() + collision.nTrkTPCneg();
values[kMultAPOS] = collision.nTrkTPCpos();
values[kMultANEG] = collision.nTrkTPCneg();
values[kMultB] = collision.sumAmplFT0A(); // Be careful, this is weighted sum of multiplicity
values[kMultC] = collision.sumAmplFT0C(); // Be careful, this is weighted sum of multiplicity

Expand Down
19 changes: 17 additions & 2 deletions PWGDQ/DataModel/ReducedInfoTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,17 @@ DECLARE_SOA_COLUMN(NTPCpileupZC, nTPCpileupZC, float); //! Median Z p
DECLARE_SOA_COLUMN(NTPCtracksInPast, nTPCtracksInPast, int); //! Number of TPC tracks in the past events (configurable, but e.g. one drift time)
DECLARE_SOA_COLUMN(NTPCtracksInFuture, nTPCtracksInFuture, int); //! Number of TPC tracks in the future events (configurable, but e.g. one drift time)

// Columns declared to guarantee the backward compatibility of the tables
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(QvecBAllRe, qvecBAllRe, float);
DECLARE_SOA_COLUMN(QvecBAllIm, qvecBAllIm, float);
DECLARE_SOA_COLUMN(NTrkBPos, nTrkBPos, int);
DECLARE_SOA_COLUMN(NTrkBNeg, nTrkBNeg, int);
DECLARE_SOA_COLUMN(NTrkBAll, nTrkBAll, int);

DECLARE_SOA_COLUMN(Q1ZNAX, q1znax, float); //! Q-vector x component, evaluated with ZNA (harmonic 1 and power 1)
DECLARE_SOA_COLUMN(Q1ZNAY, q1znay, float); //! Q-vector y component, evaluated with ZNA (harmonic 1 and power 1)
DECLARE_SOA_COLUMN(Q1ZNCX, q1zncx, float); //! Q-vector x component, evaluated with ZNC (harmonic 1 and power 1)
Expand Down Expand Up @@ -142,8 +153,11 @@ DECLARE_SOA_TABLE(ReducedEventsQvectorExtra, "AOD", "REQVECTOREXTRA", //! Eve
reducedevent::S11A, reducedevent::S12A, reducedevent::S13A, reducedevent::S31A);

DECLARE_SOA_TABLE(ReducedEventsQvectorCentr, "AOD", "REQVECTORCTR", //! Event Q-vector information from central framework
qvec::QvecFT0ARe, qvec::QvecFT0AIm, qvec::QvecFT0CRe, qvec::QvecFT0CIm, qvec::QvecFT0MRe, qvec::QvecFT0MIm, qvec::QvecFV0ARe, qvec::QvecFV0AIm, qvec::QvecBPosRe, qvec::QvecBPosIm, qvec::QvecBNegRe, qvec::QvecBNegIm,
qvec::SumAmplFT0A, qvec::SumAmplFT0C, qvec::SumAmplFT0M, qvec::SumAmplFV0A, qvec::NTrkBPos, qvec::NTrkBNeg);
qvec::QvecFT0ARe, qvec::QvecFT0AIm, qvec::QvecFT0CRe, qvec::QvecFT0CIm, qvec::QvecFT0MRe, qvec::QvecFT0MIm, qvec::QvecFV0ARe, qvec::QvecFV0AIm, reducedevent::QvecBPosRe, reducedevent::QvecBPosIm, reducedevent::QvecBNegRe, reducedevent::QvecBNegIm,
qvec::SumAmplFT0A, qvec::SumAmplFT0C, qvec::SumAmplFT0M, qvec::SumAmplFV0A, reducedevent::NTrkBPos, reducedevent::NTrkBNeg);

DECLARE_SOA_TABLE(ReducedEventsQvectorCentrExtra, "AOD", "REQVECCTREXTA", //! Event Q-vector information from central framework with TPC all
reducedevent::QvecBAllRe, reducedevent::QvecBAllIm, reducedevent::NTrkBAll);

DECLARE_SOA_TABLE(ReducedEventsRefFlow, "AOD", "REREFFLOW", //! Event Ref Flow information
reducedevent::M11REF, reducedevent::M1111REF, reducedevent::CORR2REF, reducedevent::CORR4REF, cent::CentFT0C);
Expand Down Expand Up @@ -172,6 +186,7 @@ using ReducedEventMultAll = ReducedEventsMultAll::iterator;
using ReducedEventQvector = ReducedEventsQvector::iterator;
using ReducedEventQvectorExtra = ReducedEventsQvectorExtra::iterator;
using ReducedEventQvectorCentr = ReducedEventsQvectorCentr::iterator;
using ReducedEventQvectorCentrExtra = ReducedEventsQvectorCentrExtra::iterator;
using ReducedEventRefFlow = ReducedEventsRefFlow::iterator;
using ReducedEventQvectorZN = ReducedEventsQvectorZN::iterator;
using ReducedMCEvent = ReducedMCEvents::iterator;
Expand Down
19 changes: 12 additions & 7 deletions PWGDQ/Tasks/dqFlow.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ using MyBcs = soa::Join<aod::BCsWithTimestamps, aod::Run3MatchedToBCSparse>;
using MyEvents = soa::Join<aod::Collisions, aod::EvSels>;
using MyEventsWithCent = soa::Join<aod::Collisions, aod::EvSels, aod::CentRun2V0Ms>;
using MyEventsWithCentRun3 = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Cs>;
using MyEventsWithCentQvectRun3 = soa::Join<aod::Collisions, aod::EvSels, aod::QvectorFT0Cs, aod::QvectorFT0As, aod::QvectorFT0Ms, aod::QvectorFV0As, aod::QvectorBPoss, aod::QvectorBNegs, aod::CentFV0As, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs>;
// using MyEventsWithCentQvectRun3 = soa::Join<aod::Collisions, aod::EvSels, aod::QvectorFT0Cs, aod::QvectorFT0As, aod::QvectorFT0Ms, aod::QvectorFV0As, aod::QvectorBPoss, aod::QvectorBNegs, aod::CentFV0As, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs>;
// using MyEventsWithCentQvectRun3 = soa::Join<aod::Collisions, aod::EvSels, aod::QvectorFT0CVecs, aod::QvectorFT0AVecs, aod::QvectorFT0MVecs, aod::QvectorFV0AVecs, aod::QvectorTPCposVecs, aod::QvectorTPCnegVecs, aod::QvectorTPCallVecs, aod::CentFV0As, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs>;
using MyEventsWithCentQvectRun3 = soa::Join<aod::Collisions, aod::EvSels, aod::QvectorFT0Cs, aod::QvectorFT0As, aod::QvectorFT0Ms, aod::QvectorFV0As, aod::QvectorTPCposs, aod::QvectorTPCnegs, aod::QvectorTPCalls, aod::CentFV0As, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs>;

using MyBarrelTracks = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection,
aod::pidTPCFullEl, aod::pidTPCFullMu, aod::pidTPCFullPi,
Expand All @@ -83,7 +85,7 @@ using MyMuonsWithCov = soa::Join<aod::FwdTracks, aod::FwdTracksCov>;

constexpr static uint32_t gkEventFillMap = VarManager::ObjTypes::BC | VarManager::ObjTypes::Collision | VarManager::ObjTypes::CollisionCentRun2;
constexpr static uint32_t gkEventFillMapRun3 = VarManager::ObjTypes::BC | VarManager::ObjTypes::Collision | VarManager::ObjTypes::CollisionCent;
constexpr static uint32_t gkEventFillMapRun3Qvect = VarManager::ObjTypes::BC | VarManager::ObjTypes::Collision | VarManager::ObjTypes::CollisionCent | VarManager::ObjTypes::CollisionQvect;
constexpr static uint32_t gkEventFillMapRun3Qvect = VarManager::ObjTypes::BC | VarManager::ObjTypes::Collision | VarManager::ObjTypes::CollisionCent | VarManager::ObjTypes::CollisionQvectCentr;
constexpr static uint32_t gkTrackFillMap = VarManager::ObjTypes::Track | VarManager::ObjTypes::TrackExtra | VarManager::ObjTypes::TrackDCA | VarManager::ObjTypes::TrackSelection | VarManager::ObjTypes::TrackPID;

void DefineHistograms(HistogramManager* histMan, TString histClasses);
Expand All @@ -99,6 +101,7 @@ struct DQEventQvector {
Produces<ReducedEventsQvector> eventQvector;
Produces<ReducedEventsQvectorExtra> eventQvectorExtra;
Produces<ReducedEventsQvectorCentr> eventQvectorCentr;
Produces<ReducedEventsQvectorCentrExtra> eventQvectorCentrExtra;
Produces<ReducedEventsRefFlow> eventRefFlow;
Produces<ReducedEventsQvectorZN> eventQvectorZN;
Produces<ReducedZdc> eventReducedZdc;
Expand Down Expand Up @@ -293,8 +296,9 @@ struct DQEventQvector {

// Fill the tree for the reduced event table with Q vector quantities
if (fEventCut->IsSelected(VarManager::fgValues)) {
eventQvectorCentr(collision.qvecFT0ARe(), collision.qvecFT0AIm(), collision.qvecFT0CRe(), collision.qvecFT0CIm(), collision.qvecFT0MRe(), collision.qvecFT0MIm(), collision.qvecFV0ARe(), collision.qvecFV0AIm(), collision.qvecBPosRe(), collision.qvecBPosIm(), collision.qvecBNegRe(), collision.qvecBNegIm(),
collision.sumAmplFT0A(), collision.sumAmplFT0C(), collision.sumAmplFT0M(), collision.sumAmplFV0A(), collision.nTrkBPos(), collision.nTrkBNeg());
eventQvectorCentr(collision.qvecFT0ARe(), collision.qvecFT0AIm(), collision.qvecFT0CRe(), collision.qvecFT0CIm(), collision.qvecFT0MRe(), collision.qvecFT0MIm(), collision.qvecFV0ARe(), collision.qvecFV0AIm(), collision.qvecTPCposRe(), collision.qvecTPCposIm(), collision.qvecTPCnegRe(), collision.qvecTPCnegIm(),
collision.sumAmplFT0A(), collision.sumAmplFT0C(), collision.sumAmplFT0M(), collision.sumAmplFV0A(), collision.nTrkTPCpos(), collision.nTrkTPCneg());
eventQvectorCentrExtra(collision.qvecTPCallRe(), collision.qvecTPCallIm(), collision.nTrkTPCall());
}
}

Expand Down Expand Up @@ -462,7 +466,7 @@ struct DQEventQvector {
eventRefFlow(VarManager::fgValues[VarManager::kM11REF], VarManager::fgValues[VarManager::kM1111REF], VarManager::fgValues[VarManager::kCORR2REF], VarManager::fgValues[VarManager::kCORR4REF], centrality);
}

if constexpr ((TEventFillMap & VarManager::ObjTypes::CollisionQvect) > 0) {
if constexpr ((TEventFillMap & VarManager::ObjTypes::CollisionQvectCentr) > 0) {
VarManager::FillQVectorFromCentralFW(collision);

if (bc.has_zdc()) {
Expand All @@ -479,8 +483,9 @@ struct DQEventQvector {
}
}
if (fEventCut->IsSelected(VarManager::fgValues)) {
eventQvectorCentr(collision.qvecFT0ARe(), collision.qvecFT0AIm(), collision.qvecFT0CRe(), collision.qvecFT0CIm(), collision.qvecFT0MRe(), collision.qvecFT0MIm(), collision.qvecFV0ARe(), collision.qvecFV0AIm(), collision.qvecBPosRe(), collision.qvecBPosIm(), collision.qvecBNegRe(), collision.qvecBNegIm(),
collision.sumAmplFT0A(), collision.sumAmplFT0C(), collision.sumAmplFT0M(), collision.sumAmplFV0A(), collision.nTrkBPos(), collision.nTrkBNeg());
eventQvectorCentr(collision.qvecFT0ARe(), collision.qvecFT0AIm(), collision.qvecFT0CRe(), collision.qvecFT0CIm(), collision.qvecFT0MRe(), collision.qvecFT0MIm(), collision.qvecFV0ARe(), collision.qvecFV0AIm(), collision.qvecTPCposRe(), collision.qvecTPCposIm(), collision.qvecTPCnegRe(), collision.qvecTPCnegIm(),
collision.sumAmplFT0A(), collision.sumAmplFT0C(), collision.sumAmplFT0M(), collision.sumAmplFV0A(), collision.nTrkTPCpos(), collision.nTrkTPCneg());
eventQvectorCentrExtra(collision.qvecTPCallRe(), collision.qvecTPCallIm(), collision.nTrkTPCall());
if (bc.has_zdc()) {
eventQvectorZN(VarManager::fgValues[VarManager::kQ1ZNAX], VarManager::fgValues[VarManager::kQ1ZNAY], VarManager::fgValues[VarManager::kQ1ZNCX], VarManager::fgValues[VarManager::kQ1ZNCY]);
eventReducedZdc(VarManager::fgValues[VarManager::kEnergyCommonZNA], VarManager::fgValues[VarManager::kEnergyCommonZNC], VarManager::fgValues[VarManager::kEnergyCommonZPA], VarManager::fgValues[VarManager::kEnergyCommonZPC],
Expand Down

0 comments on commit 6dfa280

Please sign in to comment.