1616#ifndef PWGCF_FEMTO_CORE_COLLISIONHISTMANAGER_H_
1717#define PWGCF_FEMTO_CORE_COLLISIONHISTMANAGER_H_
1818
19+ #include " PWGCF/Femto/Core/femtoUtils.h"
1920#include " PWGCF/Femto/Core/histManager.h"
2021#include " PWGCF/Femto/Core/modes.h"
2122
23+ #include < CommonConstants/MathConstants.h>
2224#include < Framework/Configurable.h>
2325#include < Framework/HistogramRegistry.h>
2426#include < Framework/HistogramSpec.h>
2527
2628#include < array>
29+ #include < cmath>
2730#include < map>
2831#include < string>
2932#include < string_view>
@@ -48,6 +51,10 @@ enum ColHist {
4851 kCentVsMult ,
4952 kCentVsSphericity ,
5053 kMultVsSphericity ,
54+ kFT0AvsFT0C ,
55+ // event shape
56+ kQvector ,
57+ kEventPlaneAngle ,
5158 // mc
5259 kTruePosZ , // pure mc-truth, no reco collision (kMc without kReco)
5360 kTrueCent , // pure mc-truth, no reco collision (kMc without kReco)
@@ -80,6 +87,10 @@ constexpr std::array<histmanager::HistInfo<ColHist>, kColHistLast> HistTable = {
8087 {kCentVsMult , o2::framework::HistType::kTH2F , " hCentVsMult" , " Centrality vs Multiplicity; Centrality (%); Multiplicity" },
8188 {kMultVsSphericity , o2::framework::HistType::kTH2F , " hMultVsSphericity" , " Multiplicity vs Sphericity; Multiplicity; Sphericity" },
8289 {kCentVsSphericity , o2::framework::HistType::kTH2F , " hCentVsSphericity" , " Centrality vs Sphericity; Centrality (%); Sphericity" },
90+ {kFT0AvsFT0C , o2::framework::HistType::kTH2F , " hFT0AvsFT0C" , " FT0A centrality vs FT0C centrality; Centrality_{FT0A} (%); Centrality_{FT0C}" },
91+ // event shape
92+ {kQvector , o2::framework::HistType::kTH1F , " hQvector" , " Q-vector; Q-vector; Entries" },
93+ {kEventPlaneAngle , o2::framework::HistType::kTH1F , " hEventPlaneAngle" , " Event Plane angle; #Psi_{n}; Entries" },
8394 // mc
8495 {kTruePosZ , o2::framework::HistType::kTH1F , " hTruePosZ" , " True vertex Z (mc-truth collision); V_{Z,True} (cm); Entries" },
8596 {kTrueCent , o2::framework::HistType::kTH1F , " hTrueCent" , " True centrality (mc-truth collision); Centrality_{True} (%); Entries" },
@@ -94,7 +105,9 @@ constexpr std::array<histmanager::HistInfo<ColHist>, kColHistLast> HistTable = {
94105 {kPosZ , {(conf).vtxZ }}, \
95106 {kMult , {(conf).mult }}, \
96107 {kCent , {(conf).cent }}, \
97- {kMagField , {(conf).magField }},
108+ {kMagField , {(conf).magField }}, \
109+ {kQvector , {(conf).qvector }}, \
110+ {kEventPlaneAngle , {(conf).eventPlaneAngle }},
98111
99112// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
100113#define COL_HIST_QA_MAP (confAnalysis, confQa ) \
@@ -107,7 +120,8 @@ constexpr std::array<histmanager::HistInfo<ColHist>, kColHistLast> HistTable = {
107120 {kPoszVsCent , {(confAnalysis).vtxZ , (confAnalysis).cent }}, \
108121 {kCentVsMult , {(confAnalysis).cent , (confAnalysis).mult }}, \
109122 {kMultVsSphericity , {(confAnalysis).mult , (confQa).sphericity }}, \
110- {kCentVsSphericity , {confBinningAnalysis.cent , (confQa).sphericity }},
123+ {kCentVsSphericity , {(confAnalysis).cent , (confQa).sphericity }}, \
124+ {kFT0AvsFT0C , {(confAnalysis).cent , (confAnalysis).cent }},
111125
112126// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
113127#define COL_HIST_MC_MAP (conf ) \
@@ -164,6 +178,9 @@ struct ConfCollisionBinning : o2::framework::ConfigurableGroup {
164178 o2::framework::ConfigurableAxis mult{" mult" , {200 , 0 , 200 }, " Multiplicity binning" };
165179 o2::framework::ConfigurableAxis cent{" cent" , {100 , 0 .0f , 100 .0f }, " Centrality (multiplicity percentile) binning" };
166180 o2::framework::ConfigurableAxis magField{" magField" , {11 , -5.5 , 5.5 }, " Magnetic field binning" };
181+ o2::framework::Configurable<bool > plotEventShape{" plotEventShape" , false , " Activate histograms for event shape (qvector, event plane angle)" };
182+ o2::framework::ConfigurableAxis qvector{" qvector" , {100 , 0 .0f , 100 .0f }, " Q-vector binning" };
183+ o2::framework::ConfigurableAxis eventPlaneAngle{" eventPlaneAngle" , {720 , 0 , 1 .f * o2::constants::math::TwoPI}, " Event plane angle binning" };
167184};
168185
169186struct ConfCollisionQaBinning : o2::framework::ConfigurableGroup {
@@ -184,9 +201,10 @@ class CollisionHistManager
184201 template <modes::Mode mode, typename T>
185202 void init (o2::framework::HistogramRegistry* registry,
186203 std::map<ColHist, std::vector<o2::framework::AxisSpec>> const & Specs,
187- T const & /* ConfCollisionBinning*/ )
204+ T const & ConfCollisionBinning)
188205 {
189206 mHistogramRegistry = registry;
207+ mPlotEventShape = ConfCollisionBinning.plotEventShape .value ;
190208 if constexpr (isFlagSet (mode, modes::Mode::kReco )) {
191209 initAnalysis (Specs);
192210 }
@@ -257,6 +275,11 @@ class CollisionHistManager
257275 mHistogramRegistry ->add (analysisDir + getHistNameV2 (kMult , HistTable), getHistDesc (kMult , HistTable), getHistType (kMult , HistTable), {Specs.at (kMult )});
258276 mHistogramRegistry ->add (analysisDir + getHistNameV2 (kCent , HistTable), getHistDesc (kCent , HistTable), getHistType (kCent , HistTable), {Specs.at (kCent )});
259277 mHistogramRegistry ->add (analysisDir + getHistNameV2 (kMagField , HistTable), getHistDesc (kMagField , HistTable), getHistType (kMagField , HistTable), {Specs.at (kMagField )});
278+
279+ if (mPlotEventShape ) {
280+ mHistogramRegistry ->add (analysisDir + getHistNameV2 (kQvector , HistTable), getHistDesc (kQvector , HistTable), getHistType (kQvector , HistTable), {Specs.at (kQvector )});
281+ mHistogramRegistry ->add (analysisDir + getHistNameV2 (kEventPlaneAngle , HistTable), getHistDesc (kEventPlaneAngle , HistTable), getHistType (kEventPlaneAngle , HistTable), {Specs.at (kEventPlaneAngle )});
282+ }
260283 }
261284
262285 void initQa (std::map<ColHist, std::vector<o2::framework::AxisSpec>> const & Specs)
@@ -273,6 +296,7 @@ class CollisionHistManager
273296 mHistogramRegistry ->add (qaDir + getHistNameV2 (kCentVsMult , HistTable), getHistDesc (kCentVsMult , HistTable), getHistType (kCentVsMult , HistTable), {Specs.at (kCentVsMult )});
274297 mHistogramRegistry ->add (qaDir + getHistNameV2 (kMultVsSphericity , HistTable), getHistDesc (kMultVsSphericity , HistTable), getHistType (kMultVsSphericity , HistTable), {Specs.at (kMultVsSphericity )});
275298 mHistogramRegistry ->add (qaDir + getHistNameV2 (kCentVsSphericity , HistTable), getHistDesc (kCentVsSphericity , HistTable), getHistType (kCentVsSphericity , HistTable), {Specs.at (kCentVsSphericity )});
299+ mHistogramRegistry ->add (qaDir + getHistNameV2 (kFT0AvsFT0C , HistTable), getHistDesc (kFT0AvsFT0C , HistTable), getHistType (kFT0AvsFT0C , HistTable), {Specs.at (kFT0AvsFT0C )});
276300 }
277301 }
278302
@@ -301,6 +325,13 @@ class CollisionHistManager
301325 mHistogramRegistry ->fill (HIST (AnalysisDir) + HIST (getHistName (kMult , HistTable)), col.mult ());
302326 mHistogramRegistry ->fill (HIST (AnalysisDir) + HIST (getHistName (kCent , HistTable)), col.cent ());
303327 mHistogramRegistry ->fill (HIST (AnalysisDir) + HIST (getHistName (kMagField , HistTable)), col.magField ());
328+
329+ if (mPlotEventShape ) {
330+ if constexpr (utils::HasEventShape<T>) {
331+ mHistogramRegistry ->fill (HIST (AnalysisDir) + HIST (getHistName (kQvector , HistTable)), col.qvec ());
332+ mHistogramRegistry ->fill (HIST (AnalysisDir) + HIST (getHistName (kEventPlaneAngle , HistTable)), col.eventPlaneAngle ());
333+ }
334+ }
304335 }
305336
306337 template <typename T>
@@ -317,6 +348,7 @@ class CollisionHistManager
317348 mHistogramRegistry ->fill (HIST (QaDir) + HIST (getHistName (kCentVsMult , HistTable)), col.cent (), col.mult ());
318349 mHistogramRegistry ->fill (HIST (QaDir) + HIST (getHistName (kMultVsSphericity , HistTable)), col.mult (), col.sphericity ());
319350 mHistogramRegistry ->fill (HIST (QaDir) + HIST (getHistName (kCentVsSphericity , HistTable)), col.cent (), col.sphericity ());
351+ mHistogramRegistry ->fill (HIST (QaDir) + HIST (getHistName (kFT0AvsFT0C , HistTable)), col.centFT0A (), col.centFT0C ());
320352 }
321353 }
322354
@@ -343,6 +375,7 @@ class CollisionHistManager
343375 }
344376
345377 o2::framework::HistogramRegistry* mHistogramRegistry = nullptr ;
378+ bool mPlotEventShape = false ;
346379 bool mPlot2d = false ;
347380};
348381} // namespace o2::analysis::femto::colhistmanager
0 commit comments