1717#include " Common/DataModel/Centrality.h"
1818#include " Common/DataModel/EventSelection.h"
1919#include " Common/DataModel/Multiplicity.h"
20+ #include " Common/DataModel/TrackSelectionTables.h"
21+ #include " Common/Core/TrackSelection.h"
2022
2123#include " CCDB/BasicCCDBManager.h"
2224#include " Framework/AnalysisTask.h"
2325#include " Framework/HistogramRegistry.h"
2426#include " Framework/RunningWorkflowInfo.h"
2527#include " Framework/runDataProcessing.h"
2628
27- #include < chrono>
2829#include < cmath>
2930#include < cstdint>
31+ #include < chrono>
3032
3133using namespace o2 ;
3234using namespace o2 ::framework;
35+ using namespace o2 ::framework::expressions;
3336
34- #define O2_DEFINE_CONFIGURABLE (NAME, TYPE, DEFAULT, HELP ) Configurable<TYPE> NAME{#NAME, DEFAULT, HELP};
37+ #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-
43- ConfigurableAxis axisCent{" axisCent" , {90 , 0 , 90 }, " Centrality (%)" };
44- ConfigurableAxis axisMult{" axisMult" , {100 , 0 , 100000 }, " Multiplicity" };
45- ConfigurableAxis axisEnergy{" axisEnergy" , {300 , 0 , 300 }, " Energy" };
46- ConfigurableAxis axisRescaledDiff{" axisRescaledDiff" , {400 , -1 , 1 }, " (EA-EC)/(EA+EC)" };
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" )
46+ } evsel;
47+
48+ O2_DEFINE_CONFIGURABLE (cfgEtaMax, float , 0 .8f , " Maximum track #eta" )
49+ O2_DEFINE_CONFIGURABLE (cfgPtMin, float , 0 .2f , " Minimum track #P_{t}" )
50+ O2_DEFINE_CONFIGURABLE (cfgPtMax, float , 10 .0f , " Maximum track #P_{t}" )
51+ O2_DEFINE_CONFIGURABLE (cfgDcaXYMax, float , 0 .2f , " Maximum DCAxy" )
52+ O2_DEFINE_CONFIGURABLE (cfgDcaZMax, float , 2 .0f , " Maximum DCAz" )
53+
54+ ConfigurableAxis axisCent{ " axisCent" , { 90 , 0 , 90 }, " Centrality (%)" };
55+ ConfigurableAxis axisMult{ " axisMult" , { 100 , 0 , 100000 }, " Multiplicity" };
56+ ConfigurableAxis axisPt{ " axisPt" , { 100 , 0 , 15 }, " #P_{t}" };
57+ ConfigurableAxis axisEta{ " axisEta" , { 64 , -1.6 , 1.6 }, " #eta" };
58+ ConfigurableAxis axisEnergy{ " axisEnergy" , { 300 , 0 , 300 }, " Energy" };
59+ ConfigurableAxis axisRescaledDiff{ " axisRescaledDiff" , { 400 , -1 , 1 }, " (EA-EC)/(EA+EC)" };
4760
4861 // Event counter bins
4962 enum SelectionCriteria : uint8_t {
@@ -57,8 +70,10 @@ struct flowZdcEnergy {
5770 };
5871
5972 Service<ccdb::BasicCCDBManager> ccdb;
60- HistogramRegistry registry{" registry" };
73+ HistogramRegistry registry{ " registry" };
6174
75+ 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;
76+ using UsedTracks = soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra, aod::TrackSelection, aod::TracksDCA>>;
6277 // Run 3
6378 using CollisionsRun3 = soa::Join<aod::Collisions, aod::EvSels, aod::Mults, aod::CentFT0Cs>;
6479 using BCsRun3 = soa::Join<aod::BCs, aod::Timestamps, aod::BcSels, aod::Run3MatchedToBCSparse>;
@@ -76,60 +91,66 @@ struct flowZdcEnergy {
7691 std::chrono::system_clock::now ().time_since_epoch ())
7792 .count ();
7893 ccdb->setCreatedNotAfter (now);
79-
80- registry.add (" hEventCount" , " Event counter;Selection;Events" , {HistType::kTH1D , {{ kNSelections , 0 , kNSelections }} });
81- auto hCount = registry.get <TH1>(HIST (" hEventCount" ));
94+
95+ registry.add (" QA/ hEventCount" , " Event counter;Selection;Events" , { HistType::kTH1D , { { kNSelections , 0 , kNSelections } } });
96+ auto hCount = registry.get <TH1>(HIST (" QA/ hEventCount" ));
8297 hCount->GetXaxis ()->SetBinLabel (kAllEvents + 1 , " All events" );
8398 hCount->GetXaxis ()->SetBinLabel (kSeln + 1 , " Sel7/8" );
8499 hCount->GetXaxis ()->SetBinLabel (kZvtx + 1 , " Zvtx" );
85100 hCount->GetXaxis ()->SetBinLabel (kCentrality + 1 , " Centrality" );
86101 hCount->GetXaxis ()->SetBinLabel (kBCHasZDC + 1 , " BC has ZDC" );
87102 hCount->GetXaxis ()->SetBinLabel (kSelectedZDC + 1 , " Selected ZDC" );
88103
89- registry.add (" hCentrality" , " " , {HistType::kTH1D , {axisCent}});
90- registry.add (" hMultiplicity" , " " , {HistType::kTH1D , {axisMult}});
91-
92- registry.add (" hEnergyWithCent_ZNA_Common" , " " , {HistType::kTH2D , {axisEnergy, axisCent}});
93- registry.add (" hEnergyWithCent_ZNC_Common" , " " , {HistType::kTH2D , {axisEnergy, axisCent}});
94- registry.add (" hEnergyWithCent_RescaledDiff" , " " , {HistType::kTH2D , {axisRescaledDiff, axisCent}});
95- registry.add (" hEnergyWithCent_ZNA_1" , " " , {HistType::kTH2D , {axisEnergy, axisCent}});
96- registry.add (" hEnergyWithCent_ZNA_2" , " " , {HistType::kTH2D , {axisEnergy, axisCent}});
97- registry.add (" hEnergyWithCent_ZNA_3" , " " , {HistType::kTH2D , {axisEnergy, axisCent}});
98- registry.add (" hEnergyWithCent_ZNA_4" , " " , {HistType::kTH2D , {axisEnergy, axisCent}});
99- registry.add (" hEnergyWithCent_ZNC_1" , " " , {HistType::kTH2D , {axisEnergy, axisCent}});
100- registry.add (" hEnergyWithCent_ZNC_2" , " " , {HistType::kTH2D , {axisEnergy, axisCent}});
101- registry.add (" hEnergyWithCent_ZNC_3" , " " , {HistType::kTH2D , {axisEnergy, axisCent}});
102- registry.add (" hEnergyWithCent_ZNC_4" , " " , {HistType::kTH2D , {axisEnergy, axisCent}});
103- registry.add (" hEnergyWithCent_ZNA_SumSectors" , " " , {HistType::kTH2D , {axisEnergy, axisCent}});
104- registry.add (" hEnergyWithCent_ZNC_SumSectors" , " " , {HistType::kTH2D , {axisEnergy, axisCent}});
105- registry.add (" hEnergyWithCent_RescaledSumDiff" , " " , {HistType::kTH2D , {axisRescaledDiff, axisCent}});
104+ registry.add (" QA/hCentrality" , " " , { HistType::kTH1D , { axisCent } });
105+ registry.add (" QA/hMultiplicity" , " " , { HistType::kTH1D , { axisMult } });
106+ registry.add (" QA/hMultiplicity_TPC" , " " , { HistType::kTH1D , { axisMult } });
107+ registry.add (" QA/hPt" , " " , { HistType::kTH1D , { axisPt } });
108+ registry.add (" QA/hEta" , " " , { HistType::kTH1D , { axisEta } });
109+
110+ registry.add (" hEnergyWithCent_ZNA_Common" , " " , { HistType::kTH2D , { axisEnergy, axisCent } });
111+ registry.add (" hEnergyWithCent_ZNC_Common" , " " , { HistType::kTH2D , { axisEnergy, axisCent } });
112+ registry.add (" hEnergyWithCent_RescaledDiff" , " " , { HistType::kTH2D , { axisRescaledDiff, axisCent } });
113+ registry.add (" hEnergyWithCent_ZNA_1" , " " , { HistType::kTH2D , { axisEnergy, axisCent } });
114+ registry.add (" hEnergyWithCent_ZNA_2" , " " , { HistType::kTH2D , { axisEnergy, axisCent } });
115+ registry.add (" hEnergyWithCent_ZNA_3" , " " , { HistType::kTH2D , { axisEnergy, axisCent } });
116+ registry.add (" hEnergyWithCent_ZNA_4" , " " , { HistType::kTH2D , { axisEnergy, axisCent } });
117+ registry.add (" hEnergyWithCent_ZNC_1" , " " , { HistType::kTH2D , { axisEnergy, axisCent } });
118+ registry.add (" hEnergyWithCent_ZNC_2" , " " , { HistType::kTH2D , { axisEnergy, axisCent } });
119+ registry.add (" hEnergyWithCent_ZNC_3" , " " , { HistType::kTH2D , { axisEnergy, axisCent } });
120+ registry.add (" hEnergyWithCent_ZNC_4" , " " , { HistType::kTH2D , { axisEnergy, axisCent } });
121+ registry.add (" hEnergyWithCent_ZNA_SumSectors" , " " , { HistType::kTH2D , { axisEnergy, axisCent } });
122+ registry.add (" hEnergyWithCent_ZNC_SumSectors" , " " , { HistType::kTH2D , { axisEnergy, axisCent } });
123+ registry.add (" hEnergyWithCent_RescaledSumDiff" , " " , { HistType::kTH2D , { axisRescaledDiff, axisCent } });
106124 }
107125
108126 // Helper: event selection
109127 template <typename TCollision>
110- bool acceptEvent (TCollision const & collision, float centrality, const int runmode)
128+ bool acceptEvent (TCollision const & collision, bool UseEvsel, float centrality, const int runmode)
111129 {
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 ;
130+ if (!UseEvsel) {
131+ registry.fill (HIST (" QA/hEventCount" ), kAllEvents );
132+ registry.fill (HIST (" QA/hEventCount" ), kSeln );
133+ registry.fill (HIST (" QA/hEventCount" ), kZvtx );
134+ registry.fill (HIST (" QA/hEventCount" ), kCentrality );
135+ } else {
136+ registry.fill (HIST (" QA/hEventCount" ), kAllEvents );
137+ if (runmode == 2 && !collision.sel7 ()) {
138+ return false ;
139+ }
140+ if (runmode == 3 && !collision.sel8 ()) {
141+ return false ;
142+ }
143+ registry.fill (HIST (" QA/hEventCount" ), kSeln );
144+ if (std::abs (collision.posZ ()) > evsel.cfgVtxZ ) {
145+ return false ;
146+ }
147+ registry.fill (HIST (" QA/hEventCount" ), kZvtx );
148+ if (centrality < evsel.cfgCentMin || centrality > evsel.cfgCentMax ) {
149+ return false ;
150+ }
151+ registry.fill (HIST (" QA/hEventCount" ), kCentrality );
129152 }
130- registry.fill (HIST (" hEventCount" ), kCentrality );
131-
132- return true ;
153+ return true ;
133154 }
134155
135156 // Helper: fill ZDC observables
@@ -140,13 +161,13 @@ struct flowZdcEnergy {
140161 if (!foundBC.has_zdc ()) {
141162 return ;
142163 }
143- registry.fill (HIST (" hEventCount" ), kBCHasZDC );
164+ registry.fill (HIST (" QA/ hEventCount" ), kBCHasZDC );
144165
145166 const auto & zdc = foundBC.zdc ();
146167 if (zdc.energyCommonZNA () <= 1 .f || zdc.energyCommonZNC () <= 1 .f ) {
147168 return ;
148169 }
149- registry.fill (HIST (" hEventCount" ), kSelectedZDC );
170+ registry.fill (HIST (" QA/ hEventCount" ), kSelectedZDC );
150171
151172 const float energyCommonZNA = zdc.energyCommonZNA ();
152173 const float energyCommonZNC = zdc.energyCommonZNC ();
@@ -188,36 +209,50 @@ struct flowZdcEnergy {
188209
189210 // Run 3 process
190211 void processRun3 (CollisionsRun3::iterator const & collision,
212+ UsedTracks const & tracks,
191213 BCsRun3 const &,
192214 aod::Zdcs const &)
193215 {
194216 const float centrality = collision.centFT0C ();
195217 const float multi = collision.multFT0C ();
218+ const float multiTPC = collision.multTPC ();
196219
197- if (!acceptEvent (collision, centrality, 3 )) {
220+ if (!acceptEvent (collision, evsel. cfgUseEvsel , centrality, 3 )) {
198221 return ;
199222 }
200- registry.fill (HIST (" hCentrality" ), centrality);
201- registry.fill (HIST (" hMultiplicity" ), multi);
202-
223+ registry.fill (HIST (" QA/ hCentrality" ), centrality);
224+ registry.fill (HIST (" QA/ hMultiplicity" ), multi);
225+ registry. fill ( HIST ( " QA/hMultiplicity_TPC " ), multiTPC);
203226 fillZDCObservables<CollisionsRun3::iterator, BCsRun3>(collision, centrality);
227+
228+ for (const auto & track : tracks) {
229+ registry.fill (HIST (" QA/hPt" ), track.pt ());
230+ registry.fill (HIST (" QA/hEta" ), track.eta ());
231+ }
204232 }
205233
206234 // Run 2 process
207235 void processRun2 (CollisionsRun2::iterator const & collision,
236+ UsedTracks const & tracks,
208237 BCsRun2 const &,
209238 aod::Zdcs const &)
210239 {
211240 const float centrality = collision.centRun2V0M ();
212241 const float multi = collision.multFV0M ();
242+ const float multiTPC = collision.multTPC ();
213243
214- if (!acceptEvent (collision, centrality, 2 )) {
244+ if (!acceptEvent (collision, evsel. cfgUseEvsel , centrality, 2 )) {
215245 return ;
216246 }
217- registry.fill (HIST (" hCentrality" ), centrality);
218- registry.fill (HIST (" hMultiplicity" ), multi);
219-
247+ registry.fill (HIST (" QA/ hCentrality" ), centrality);
248+ registry.fill (HIST (" QA/ hMultiplicity" ), multi);
249+ registry. fill ( HIST ( " QA/hMultiplicity_TPC " ), multiTPC);
220250 fillZDCObservables<CollisionsRun2::iterator, BCsRun2>(collision, centrality);
251+
252+ for (const auto & track : tracks) {
253+ registry.fill (HIST (" QA/hPt" ), track.pt ());
254+ registry.fill (HIST (" QA/hEta" ), track.eta ());
255+ }
221256 }
222257
223258 // Process switches
@@ -228,5 +263,6 @@ struct flowZdcEnergy {
228263WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
229264{
230265 return WorkflowSpec{
231- adaptAnalysisTask<flowZdcEnergy>(cfgc)};
232- }
266+ adaptAnalysisTask<flowZdcEnergy>(cfgc)
267+ };
268+ }
0 commit comments