1414// / \since 03/2026
1515// / \brief Study ZDC energy observables versus centrality for Run 2 / Run 3.
1616
17+ #include " Common/Core/TrackSelection.h"
1718#include " Common/DataModel/Centrality.h"
1819#include " Common/DataModel/EventSelection.h"
1920#include " Common/DataModel/Multiplicity.h"
21+ #include " Common/DataModel/TrackSelectionTables.h"
2022
2123#include " CCDB/BasicCCDBManager.h"
2224#include " Framework/AnalysisTask.h"
3032
3133using namespace o2 ;
3234using namespace o2 ::framework;
35+ using namespace o2 ::framework::expressions;
3336
3437#define O2_DEFINE_CONFIGURABLE (NAME, TYPE, DEFAULT, HELP ) Configurable<TYPE> NAME{#NAME, DEFAULT, HELP};
3538
3639struct flowZdcEnergy {
3740
3841 struct : ConfigurableGroup{
39- O2_DEFINE_CONFIGURABLE (cfgCentMin, float , 0 .f, " Minimum centrality for selected events" )
40- O2_DEFINE_CONFIGURABLE (cfgCentMax, float , 90 .f, " Maximum centrality for selected events" )
41- O2_DEFINE_CONFIGURABLE (cfgVtxZ, float , 10 .f, " Accepted z-vertex range" )} evsel;
42+ O2_DEFINE_CONFIGURABLE (cfgUseEvsel, bool , true , " whether to enable event selection" )
43+ O2_DEFINE_CONFIGURABLE (cfgCentMin, float , 0 .f, " Minimum centrality for selected events" )
44+ O2_DEFINE_CONFIGURABLE (cfgCentMax, float , 90 .f, " Maximum centrality for selected events" )
45+ O2_DEFINE_CONFIGURABLE (cfgVtxZ, float , 10 .f, " Accepted z-vertex range" )} evsel;
46+
47+ O2_DEFINE_CONFIGURABLE (cfgEtaMax, float , 0 .8f , " Maximum track #eta" )
48+ O2_DEFINE_CONFIGURABLE (cfgPtMin, float , 0 .2f , " Minimum track #P_{t}" )
49+ O2_DEFINE_CONFIGURABLE (cfgPtMax, float , 10 .0f , " Maximum track #P_{t}" )
50+ O2_DEFINE_CONFIGURABLE (cfgDcaXYMax, float , 0 .2f , " Maximum DCAxy" )
51+ O2_DEFINE_CONFIGURABLE (cfgDcaZMax, float , 2 .0f , " Maximum DCAz" )
4252
4353 ConfigurableAxis axisCent{" axisCent" , {90 , 0 , 90 }, " Centrality (%)" };
4454 ConfigurableAxis axisMult{" axisMult" , {100 , 0 , 100000 }, " Multiplicity" };
55+ ConfigurableAxis axisPt{" axisPt" , {100 , 0 , 15 }, " #P_{t}" };
56+ ConfigurableAxis axisEta{" axisEta" , {64 , -1.6 , 1.6 }, " #eta" };
4557 ConfigurableAxis axisEnergy{" axisEnergy" , {300 , 0 , 300 }, " Energy" };
4658 ConfigurableAxis axisRescaledDiff{" axisRescaledDiff" , {400 , -1 , 1 }, " (EA-EC)/(EA+EC)" };
4759
@@ -59,6 +71,8 @@ struct flowZdcEnergy {
5971 Service<ccdb::BasicCCDBManager> ccdb;
6072 HistogramRegistry registry{" registry" };
6173
74+ Filter trackFilter = nabs(aod::track::eta) < cfgEtaMax && aod::track::pt > cfgPtMin&& aod::track::pt < cfgPtMax&& nabs(aod::track::dcaXY) < cfgDcaXYMax&& nabs(aod::track::dcaZ) < cfgDcaZMax;
75+ using UsedTracks = soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra, aod::TrackSelection, aod::TracksDCA>>;
6276 // Run 3
6377 using CollisionsRun3 = soa::Join<aod::Collisions, aod::EvSels, aod::Mults, aod::CentFT0Cs>;
6478 using BCsRun3 = soa::Join<aod::BCs, aod::Timestamps, aod::BcSels, aod::Run3MatchedToBCSparse>;
@@ -77,17 +91,20 @@ struct flowZdcEnergy {
7791 .count ();
7892 ccdb->setCreatedNotAfter (now);
7993
80- registry.add (" hEventCount" , " Event counter;Selection;Events" , {HistType::kTH1D , {{kNSelections , 0 , kNSelections }}});
81- auto hCount = registry.get <TH1>(HIST (" hEventCount" ));
94+ registry.add (" QA/ hEventCount" , " Event counter;Selection;Events" , {HistType::kTH1D , {{kNSelections , 0 , kNSelections }}});
95+ auto hCount = registry.get <TH1>(HIST (" QA/ hEventCount" ));
8296 hCount->GetXaxis ()->SetBinLabel (kAllEvents + 1 , " All events" );
8397 hCount->GetXaxis ()->SetBinLabel (kSeln + 1 , " Sel7/8" );
8498 hCount->GetXaxis ()->SetBinLabel (kZvtx + 1 , " Zvtx" );
8599 hCount->GetXaxis ()->SetBinLabel (kCentrality + 1 , " Centrality" );
86100 hCount->GetXaxis ()->SetBinLabel (kBCHasZDC + 1 , " BC has ZDC" );
87101 hCount->GetXaxis ()->SetBinLabel (kSelectedZDC + 1 , " Selected ZDC" );
88102
89- registry.add (" hCentrality" , " " , {HistType::kTH1D , {axisCent}});
90- registry.add (" hMultiplicity" , " " , {HistType::kTH1D , {axisMult}});
103+ registry.add (" QA/hCentrality" , " " , {HistType::kTH1D , {axisCent}});
104+ registry.add (" QA/hMultiplicity" , " " , {HistType::kTH1D , {axisMult}});
105+ registry.add (" QA/hMultiplicity_TPC" , " " , {HistType::kTH1D , {axisMult}});
106+ registry.add (" QA/hPt" , " " , {HistType::kTH1D , {axisPt}});
107+ registry.add (" QA/hEta" , " " , {HistType::kTH1D , {axisEta}});
91108
92109 registry.add (" hEnergyWithCent_ZNA_Common" , " " , {HistType::kTH2D , {axisEnergy, axisCent}});
93110 registry.add (" hEnergyWithCent_ZNC_Common" , " " , {HistType::kTH2D , {axisEnergy, axisCent}});
@@ -107,28 +124,31 @@ struct flowZdcEnergy {
107124
108125 // Helper: event selection
109126 template <typename TCollision>
110- bool acceptEvent (TCollision const & collision, float centrality, const int runmode)
127+ bool acceptEvent (TCollision const & collision, bool UseEvsel, float centrality, const int runmode)
111128 {
112- registry.fill (HIST (" hEventCount" ), kAllEvents );
113-
114- if (runmode == 2 && !collision.sel7 ()) {
115- return false ;
116- }
117- if (runmode == 3 && !collision.sel8 ()) {
118- return false ;
119- }
120- registry.fill (HIST (" hEventCount" ), kSeln );
121-
122- if (std::abs (collision.posZ ()) > evsel.cfgVtxZ ) {
123- return false ;
124- }
125- registry.fill (HIST (" hEventCount" ), kZvtx );
126-
127- if (centrality < evsel.cfgCentMin || centrality > evsel.cfgCentMax ) {
128- return false ;
129+ if (!UseEvsel) {
130+ registry.fill (HIST (" QA/hEventCount" ), kAllEvents );
131+ registry.fill (HIST (" QA/hEventCount" ), kSeln );
132+ registry.fill (HIST (" QA/hEventCount" ), kZvtx );
133+ registry.fill (HIST (" QA/hEventCount" ), kCentrality );
134+ } else {
135+ registry.fill (HIST (" QA/hEventCount" ), kAllEvents );
136+ if (runmode == 2 && !collision.sel7 ()) {
137+ return false ;
138+ }
139+ if (runmode == 3 && !collision.sel8 ()) {
140+ return false ;
141+ }
142+ registry.fill (HIST (" QA/hEventCount" ), kSeln );
143+ if (std::abs (collision.posZ ()) > evsel.cfgVtxZ ) {
144+ return false ;
145+ }
146+ registry.fill (HIST (" QA/hEventCount" ), kZvtx );
147+ if (centrality < evsel.cfgCentMin || centrality > evsel.cfgCentMax ) {
148+ return false ;
149+ }
150+ registry.fill (HIST (" QA/hEventCount" ), kCentrality );
129151 }
130- registry.fill (HIST (" hEventCount" ), kCentrality );
131-
132152 return true ;
133153 }
134154
@@ -140,13 +160,13 @@ struct flowZdcEnergy {
140160 if (!foundBC.has_zdc ()) {
141161 return ;
142162 }
143- registry.fill (HIST (" hEventCount" ), kBCHasZDC );
163+ registry.fill (HIST (" QA/ hEventCount" ), kBCHasZDC );
144164
145165 const auto & zdc = foundBC.zdc ();
146166 if (zdc.energyCommonZNA () <= 1 .f || zdc.energyCommonZNC () <= 1 .f ) {
147167 return ;
148168 }
149- registry.fill (HIST (" hEventCount" ), kSelectedZDC );
169+ registry.fill (HIST (" QA/ hEventCount" ), kSelectedZDC );
150170
151171 const float energyCommonZNA = zdc.energyCommonZNA ();
152172 const float energyCommonZNC = zdc.energyCommonZNC ();
@@ -188,36 +208,50 @@ struct flowZdcEnergy {
188208
189209 // Run 3 process
190210 void processRun3 (CollisionsRun3::iterator const & collision,
211+ UsedTracks const & tracks,
191212 BCsRun3 const &,
192213 aod::Zdcs const &)
193214 {
194215 const float centrality = collision.centFT0C ();
195216 const float multi = collision.multFT0C ();
217+ const float multiTPC = collision.multTPC ();
196218
197- if (!acceptEvent (collision, centrality, 3 )) {
219+ if (!acceptEvent (collision, evsel. cfgUseEvsel , centrality, 3 )) {
198220 return ;
199221 }
200- registry.fill (HIST (" hCentrality" ), centrality);
201- registry.fill (HIST (" hMultiplicity" ), multi);
202-
222+ registry.fill (HIST (" QA/ hCentrality" ), centrality);
223+ registry.fill (HIST (" QA/ hMultiplicity" ), multi);
224+ registry. fill ( HIST ( " QA/hMultiplicity_TPC " ), multiTPC);
203225 fillZDCObservables<CollisionsRun3::iterator, BCsRun3>(collision, centrality);
226+
227+ for (const auto & track : tracks) {
228+ registry.fill (HIST (" QA/hPt" ), track.pt ());
229+ registry.fill (HIST (" QA/hEta" ), track.eta ());
230+ }
204231 }
205232
206233 // Run 2 process
207234 void processRun2 (CollisionsRun2::iterator const & collision,
235+ UsedTracks const & tracks,
208236 BCsRun2 const &,
209237 aod::Zdcs const &)
210238 {
211239 const float centrality = collision.centRun2V0M ();
212240 const float multi = collision.multFV0M ();
241+ const float multiTPC = collision.multTPC ();
213242
214- if (!acceptEvent (collision, centrality, 2 )) {
243+ if (!acceptEvent (collision, evsel. cfgUseEvsel , centrality, 2 )) {
215244 return ;
216245 }
217- registry.fill (HIST (" hCentrality" ), centrality);
218- registry.fill (HIST (" hMultiplicity" ), multi);
219-
246+ registry.fill (HIST (" QA/ hCentrality" ), centrality);
247+ registry.fill (HIST (" QA/ hMultiplicity" ), multi);
248+ registry. fill ( HIST ( " QA/hMultiplicity_TPC " ), multiTPC);
220249 fillZDCObservables<CollisionsRun2::iterator, BCsRun2>(collision, centrality);
250+
251+ for (const auto & track : tracks) {
252+ registry.fill (HIST (" QA/hPt" ), track.pt ());
253+ registry.fill (HIST (" QA/hEta" ), track.eta ());
254+ }
221255 }
222256
223257 // Process switches
0 commit comments