99// granted to it by virtue of its status as an Intergovernmental Organization
1010// or submit itself to any jurisdiction.
1111
12+ // / \file FlowEseCorre.cxx
13+ // / \brief Task for flow and event shape engineering corrections
14+ // / \author Alice Collaboration
15+
1216// C++/ROOT includes.
1317#include < TComplex.h>
1418#include < TH1F.h>
@@ -46,70 +50,72 @@ using MyCollisions = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms, aod
4650using MyTracks = soa::Join<aod::Tracks, aod::TracksExtra, aod::TrackSelection, aod::TrackSelectionExtension>;
4751using BCsWithRun3Matchings = soa::Join<aod::BCs, aod::Timestamps, aod::Run3MatchedToBCSparse>;
4852
49- struct flowEseCorre {
53+ struct FlowEseCorr {
5054 HistogramRegistry histosQA{" histosQA" , {}, OutputObjHandlingPolicy::AnalysisObject, false , false };
5155
52- Configurable<std::vector<int >> cfgnMods{ " cfgnMods " , {2 }, " Modulation of interest" };
56+ Configurable<std::vector<int >> cfgNmods{ " cfgNmods " , {2 }, " Modulation of interest" };
5357 Configurable<std::string> cfgDetName{" cfgDetName" , " FT0C" , " The name of detector to be analyzed" };
5458 Configurable<std::string> cfgRefAName{" cfgRefAName" , " TPCpos" , " The name of detector for reference A" };
5559 Configurable<std::string> cfgRefBName{" cfgRefBName" , " TPCneg" , " The name of detector for reference B" };
5660
57- Configurable<float > cfgMinPt{" cfgMinPt" , 0.15 , " Minimum transverse momentum for charged track" };
58- Configurable<float > cfgMaxEta{" cfgMaxEta" , 0.8 , " Maximum pseudorapidiy for charged track" };
59- Configurable<float > cfgMaxDCArToPVcut{" cfgMaxDCArToPVcut" , 0.1 , " Maximum transverse DCA" };
60- Configurable<float > cfgMaxDCAzToPVcut{" cfgMaxDCAzToPVcut" , 1.0 , " Maximum longitudinal DCA" };
61+ Configurable<float > cfgMinPt{" cfgMinPt" , 0 .15f , " Minimum transverse momentum for charged track" };
62+ Configurable<float > cfgMaxEta{" cfgMaxEta" , 0 .8f , " Maximum pseudorapidiy for charged track" };
63+ Configurable<float > cfgMaxDCArToPVcut{" cfgMaxDCArToPVcut" , 0 .1f , " Maximum transverse DCA" };
64+ Configurable<float > cfgMaxDCAzToPVcut{" cfgMaxDCAzToPVcut" , 1 .0f , " Maximum longitudinal DCA" };
65+
66+ ConfigurableAxis cfgAxisQvecF{" cfgAxisQvecF" , {300 , -1 , 1 }, " " };
67+ ConfigurableAxis cfgAxisQvec{" cfgAxisQvec" , {100 , -3 , 3 }, " " };
68+ ConfigurableAxis cfgAxisCent{" cfgAxisCent" , {100 , 0 , 100 }, " " };
6169
62- ConfigurableAxis cfgaxisQvecF{" cfgaxisQvecF" , {300 , -1 , 1 }, " " };
63- ConfigurableAxis cfgaxisQvec{" cfgaxisQvec" , {100 , -3 , 3 }, " " };
64- ConfigurableAxis cfgaxisCent{" cfgaxisCent" , {100 , 0 , 100 }, " " };
70+ ConfigurableAxis cfgAxisCos{" cfgAxisCos" , {102 , -1.02 , 1.02 }, " " };
71+ ConfigurableAxis cfgAxisPt{" cfgAxisPt" , {100 , 0 , 10 }, " " };
72+ ConfigurableAxis cfgAxisCentMerged{" cfgAxisCentMerged" , {20 , 0 , 100 }, " " };
73+ ConfigurableAxis cfgAxisMultNum{" cfgAxisMultNum" , {300 , 0 , 2700 }, " " };
6574
66- ConfigurableAxis cfgaxiscos{" cfgaxiscos" , {102 , -1.02 , 1.02 }, " " };
67- ConfigurableAxis cfgaxispt{" cfgaxispt" , {100 , 0 , 10 }, " " };
68- ConfigurableAxis cfgaxisCentMerged{" cfgaxisCentMerged" , {20 , 0 , 100 }, " " };
69- ConfigurableAxis cfgaxisMultnum{" cfgaxisMultnum" , {300 , 0 , 2700 }, " " };
75+ static constexpr float kMinAmplitudeThreshold = 1e-4f ;
76+ static constexpr int kDefaultModulation = 2 ;
7077
7178 EventPlaneHelper helperEP;
7279
73- void init (InitContext const &)
80+ void init (InitContext const &)
7481 {
75- AxisSpec axisCent{cfgaxisCent , " centrality" };
76- AxisSpec axisQvec{cfgaxisQvec , " Q" };
77- AxisSpec axisQvecF{cfgaxisQvecF , " Q" };
82+ AxisSpec axisCent{cfgAxisCent , " centrality" };
83+ AxisSpec axisQvec{cfgAxisQvec , " Q" };
84+ AxisSpec axisQvecF{cfgAxisQvecF , " Q" };
7885 AxisSpec axisEvtPl = {100 , -1.0 * constants::math::PI, constants::math::PI};
7986
80- AxisSpec axisCos{cfgaxiscos , " angle function" };
81- AxisSpec axisPt{cfgaxispt , " trasverse momentum" };
82- AxisSpec axisCentMerged{cfgaxisCentMerged , " merged centrality" };
83- AxisSpec axisMultnum{cfgaxisMultnum , " statistic of mult" };
87+ AxisSpec axisCos{cfgAxisCos , " angle function" };
88+ AxisSpec axisPt{cfgAxisPt , " trasverse momentum" };
89+ AxisSpec axisCentMerged{cfgAxisCentMerged , " merged centrality" };
90+ AxisSpec axisMultNum{cfgAxisMultNum , " statistic of mult" };
8491
8592 histosQA.add (Form (" histQvecV2" ), " " , {HistType::kTH3F , {axisQvecF, axisQvecF, axisCent}});
8693 histosQA.add (Form (" histEvtPlV2" ), " " , {HistType::kTH2F , {axisEvtPl, axisCent}});
8794 histosQA.add (Form (" histQvecRes_SigRefAV2" ), " " , {HistType::kTH2F , {axisQvecF, axisCent}});
8895 histosQA.add (Form (" histCosDetV2" ), " " , {HistType::kTH3F , {axisCentMerged, axisPt, axisCos}});
89- histosQA.add (Form (" histMult_Cent" ), " " , {HistType::kTH2F , {axisMultnum , axisCent}});
96+ histosQA.add (Form (" histMult_Cent" ), " " , {HistType::kTH2F , {axisMultNum , axisCent}});
9097 }
9198
9299 template <typename CollType>
93- bool SelEvent (const CollType& collision)
100+ bool selectEvent (const CollType & collision)
94101 {
95- if (!collision.sel8 ()) {
96- return 0 ;
102+ if (!collision.sel8 ()){
103+ return false ;
97104 }
98- if (!collision.selection_bit (aod::evsel::kIsGoodZvtxFT0vsPV )) {
99- return 0 ;
105+ if (!collision.selection_bit (aod::evsel::kIsGoodZvtxFT0vsPV )){
106+ return false ;
100107 }
101- if (!collision.selection_bit (aod::evsel::kNoSameBunchPileup )) {
102- return 0 ;
108+ if (!collision.selection_bit (aod::evsel::kNoSameBunchPileup )){
109+ return false ;
103110 }
104- if (!collision.selection_bit (o2::aod::evsel::kNoCollInTimeRangeStandard )) {
105- return 0 ;
111+ if (!collision.selection_bit (o2::aod::evsel::kNoCollInTimeRangeStandard )){
112+ return false ;
106113 }
107-
108- return 1 ;
114+ return true ;
109115 }
110116
111117 template <typename TrackType>
112- bool SelTrack (const TrackType track)
118+ bool selectTrack (const TrackType & track)
113119 {
114120 if (track.pt () < cfgMinPt)
115121 return false ;
@@ -134,9 +140,9 @@ struct flowEseCorre {
134140 }
135141
136142 template <typename CollType>
137- void fillHistosQvec (const CollType& collision, int nmode)
143+ void fillHistosQvec (const CollType & collision, int nmode)
138144 {
139- if (nmode == 2 ) {
145+ if (nmode == kDefaultModulation ) {
140146 histosQA.fill (HIST (" histQvecV2" ), collision.qvecFT0CReVec ()[0 ], collision.qvecFT0CImVec ()[0 ], collision.centFT0C ());
141147 histosQA.fill (HIST (" histEvtPlV2" ), helperEP.GetEventPlane (collision.qvecFT0CReVec ()[0 ], collision.qvecFT0CImVec ()[0 ], nmode), collision.centFT0C ());
142148 histosQA.fill (HIST (" histQvecRes_SigRefAV2" ), helperEP.GetResolution (helperEP.GetEventPlane (collision.qvecFT0CReVec ()[0 ], collision.qvecFT0CImVec ()[0 ], nmode), helperEP.GetEventPlane (collision.qvecTPCposReVec ()[0 ], collision.qvecTPCposImVec ()[0 ], nmode), nmode), collision.centFT0C ());
@@ -145,36 +151,37 @@ struct flowEseCorre {
145151 }
146152
147153 template <typename CollType, typename TrackType>
148- void fillHistosFlow (const CollType& collision, const TrackType& track , int nmode)
154+ void fillHistosFlow (const CollType & collision, const TrackType &tracks , int nmode)
149155 {
150- if (collision.sumAmplFT0C () < 1e-4 ) {
156+ if (collision.sumAmplFT0C () < kMinAmplitudeThreshold ) {
151157 return ;
152158 }
153- for (auto & trk : track) {
154- if (!SelTrack (trk)) {
159+ for (const auto &trk : tracks)
160+ {
161+ if (!selectTrack (trk)){
155162 continue ;
156163 }
157- if (nmode == 2 ) {
164+ if (nmode == kDefaultModulation ) {
158165 histosQA.fill (HIST (" histCosDetV2" ), collision.centFT0C (), trk.pt (),
159166 std::cos (static_cast <float >(nmode) * (trk.phi () - helperEP.GetEventPlane (collision.qvecFT0CReVec ()[0 ], collision.qvecFT0CImVec ()[0 ], nmode))));
160167 }
161168 }
162169 }
163170
164- void process (MyCollisions::iterator const & collision, MyTracks const & tracks)
171+ void process (MyCollisions::iterator const & collision, MyTracks const & tracks)
165172 {
166- if (!SelEvent (collision)) {
173+ if (!selectEvent (collision)){
167174 return ;
168175 }
169- for (std:: size_t i = 0 ; i < cfgnMods-> size (); i++) {
170- fillHistosQvec (collision, cfgnMods-> at (i) );
171- fillHistosFlow (collision, tracks, cfgnMods-> at (i) );
176+ for (const auto &mod : cfgNmods-> at (i)) {
177+ fillHistosQvec (collision, mod );
178+ fillHistosFlow (collision, tracks, mod );
172179 }
173180 }
174181};
175182
176- WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
183+ WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
177184{
178185 return WorkflowSpec{
179- adaptAnalysisTask<flowEseCorre >(cfgc)};
180- }
186+ adaptAnalysisTask<FlowEseCorre >(cfgc)};
187+ }
0 commit comments