@@ -73,33 +73,33 @@ struct ZdcExtraTableProducer {
7373 Configurable<bool > cfgSaveQaHistos{" cfgSaveQaHistos" , false , " Flag to save QA histograms" };
7474
7575 enum SelectionCriteria {
76- evSel_zvtx ,
77- evSel_sel8 ,
78- evSel_occupancy ,
79- evSel_kNoSameBunchPileup ,
80- evSel_kIsGoodZvtxFT0vsPV ,
81- evSel_kNoCollInTimeRangeStandard ,
82- evSel_kIsVertexITSTPC ,
83- evSel_kIsGoodITSLayersAll ,
84- evSel_allEvents ,
85- nEventSelections
76+ ZVtxCut ,
77+ Sel8 ,
78+ OccupancyCut ,
79+ NoSameBunchPileup ,
80+ IsGoodZvtxFT0vsPV ,
81+ NoCollInTimeRangeStandard ,
82+ IsVertexITSTPC ,
83+ IsGoodITSLayersAll ,
84+ AllEvents ,
85+ NEventSelections
8686 };
8787
8888 HistogramRegistry registry{" Histos" , {}, OutputObjHandlingPolicy::AnalysisObject};
8989
9090 void init (InitContext const &)
9191 {
9292
93- registry.add (" hEventCount" , " Number of Event; Cut; #Events Passed Cut" , {HistType::kTH1D , {{nEventSelections , 0 , nEventSelections }}});
94- registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (evSel_allEvents + 1 , " All events " );
95- registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (evSel_zvtx + 1 , " vtxZ " );
96- registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (evSel_sel8 + 1 , " Sel8" );
97- registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (evSel_occupancy + 1 , " kOccupancy " );
98- registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (evSel_kNoSameBunchPileup + 1 , " kNoSameBunchPileup " );
99- registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (evSel_kIsGoodZvtxFT0vsPV + 1 , " kIsGoodZvtxFT0vsPV " );
100- registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (evSel_kNoCollInTimeRangeStandard + 1 , " kNoCollInTimeRangeStandard " );
101- registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (evSel_kIsVertexITSTPC + 1 , " kIsVertexITSTPC " );
102- registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (evSel_kIsGoodITSLayersAll + 1 , " kIsGoodITSLayersAll " );
93+ registry.add (" hEventCount" , " Number of Event; Cut; #Events Passed Cut" , {HistType::kTH1D , {{NEventSelections , 0 , NEventSelections }}});
94+ registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (AllEvents + 1 , " AllEvents " );
95+ registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (ZVtxCut + 1 , " ZVtxCut " );
96+ registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (Sel8 + 1 , " Sel8" );
97+ registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (OccupancyCut + 1 , " OccupancyCut " );
98+ registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (NoSameBunchPileup + 1 , " NoSameBunchPileup " );
99+ registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (IsGoodZvtxFT0vsPV + 1 , " IsGoodZvtxFT0vsPV " );
100+ registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (NoCollInTimeRangeStandard + 1 , " NoCollInTimeRangeStandard " );
101+ registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (IsVertexITSTPC + 1 , " IsVertexITSTPC " );
102+ registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (IsGoodITSLayersAll + 1 , " IsGoodITSLayersAll " );
103103
104104 // Skip histogram registration if QA flag is false
105105 if (!cfgSaveQaHistos) {
@@ -129,62 +129,63 @@ struct ZdcExtraTableProducer {
129129 uint8_t selectionBits = 0 ;
130130 bool selected;
131131
132- registry.fill (HIST (" hEventCount" ), evSel_allEvents );
132+ registry.fill (HIST (" hEventCount" ), AllEvents );
133133
134134 selected = std::fabs (collision.posZ ()) < cfgEvSelVtxZ;
135135 if (selected) {
136- selectionBits |= ( uint8_t )( 0x1u << evSel_zvtx );
137- registry.fill (HIST (" hEventCount" ), evSel_zvtx );
136+ SETBIT ( selectionBits, ZVtxCut );
137+ registry.fill (HIST (" hEventCount" ), ZVtxCut );
138138 }
139139
140140 selected = collision.sel8 ();
141141 if (selected) {
142- selectionBits |= ( uint8_t )( 0x1u << evSel_sel8 );
143- registry.fill (HIST (" hEventCount" ), evSel_sel8 );
142+ SETBIT ( selectionBits, Sel8 );
143+ registry.fill (HIST (" hEventCount" ), Sel8 );
144144 }
145145
146146 auto occupancy = collision.trackOccupancyInTimeRange ();
147147 selected = occupancy <= cfgEvSelsMaxOccupancy;
148148 if (selected) {
149- selectionBits |= ( uint8_t )( 0x1u << evSel_occupancy );
150- registry.fill (HIST (" hEventCount" ), evSel_occupancy );
149+ SETBIT ( selectionBits, OccupancyCut );
150+ registry.fill (HIST (" hEventCount" ), OccupancyCut );
151151 }
152152
153153 selected = collision.selection_bit (o2::aod::evsel::kNoSameBunchPileup );
154154 if (selected) {
155- selectionBits |= ( uint8_t )( 0x1u << evSel_kNoSameBunchPileup );
156- registry.fill (HIST (" hEventCount" ), evSel_kNoSameBunchPileup );
155+ SETBIT ( selectionBits, NoSameBunchPileup );
156+ registry.fill (HIST (" hEventCount" ), NoSameBunchPileup );
157157 }
158158
159159 selected = collision.selection_bit (o2::aod::evsel::kIsGoodZvtxFT0vsPV );
160160 if (selected) {
161- selectionBits |= ( uint8_t )( 0x1u << evSel_kIsGoodZvtxFT0vsPV );
162- registry.fill (HIST (" hEventCount" ), evSel_kIsGoodZvtxFT0vsPV );
161+ SETBIT ( selectionBits, IsGoodZvtxFT0vsPV );
162+ registry.fill (HIST (" hEventCount" ), IsGoodZvtxFT0vsPV );
163163 }
164164
165165 selected = collision.selection_bit (o2::aod::evsel::kNoCollInTimeRangeStandard );
166166 if (selected) {
167- selectionBits |= ( uint8_t )( 0x1u << evSel_kNoCollInTimeRangeStandard );
168- registry.fill (HIST (" hEventCount" ), evSel_kNoCollInTimeRangeStandard );
167+ SETBIT ( selectionBits, NoCollInTimeRangeStandard );
168+ registry.fill (HIST (" hEventCount" ), NoCollInTimeRangeStandard );
169169 }
170170
171171 selected = collision.selection_bit (o2::aod::evsel::kIsVertexITSTPC );
172172 if (selected) {
173- selectionBits |= ( uint8_t )( 0x1u << evSel_kIsVertexITSTPC );
174- registry.fill (HIST (" hEventCount" ), evSel_kIsVertexITSTPC );
173+ SETBIT ( selectionBits, IsVertexITSTPC );
174+ registry.fill (HIST (" hEventCount" ), IsVertexITSTPC );
175175 }
176176
177177 selected = collision.selection_bit (o2::aod::evsel::kIsGoodITSLayersAll );
178178 if (selected) {
179- selectionBits |= ( uint8_t )( 0x1u << evSel_kIsGoodITSLayersAll );
180- registry.fill (HIST (" hEventCount" ), evSel_kIsGoodITSLayersAll );
179+ SETBIT ( selectionBits, IsGoodITSLayersAll );
180+ registry.fill (HIST (" hEventCount" ), IsGoodITSLayersAll );
181181 }
182182
183183 return selectionBits;
184184 }
185185
186186 void process (ColEvSels const & cols, BCsRun3 const & /* bcs*/ , aod::Zdcs const & /* zdcs*/ )
187187 {
188+
188189 // collision-based event selection
189190 constexpr int NTowers = 4 ; // number of ZDC towers
190191
@@ -195,23 +196,30 @@ struct ZdcExtraTableProducer {
195196
196197 uint8_t evSelection = eventSelected (collision);
197198
198- // add event selection
199- if (cfgEvSelSel8 && !(evSelection & (1 << evSel_sel8)))
199+ if (cfgEvSelSel8 && !TESTBIT (evSelection, Sel8)) {
200200 continue ;
201- if (!(evSelection & (1 << evSel_zvtx)))
201+ }
202+ if (!TESTBIT (evSelection, ZVtxCut)) {
202203 continue ;
203- if (cfgEvSelsDoOccupancySel && !(evSelection & (1 << evSel_occupancy)))
204+ }
205+ if (cfgEvSelsDoOccupancySel && !TESTBIT (evSelection, OccupancyCut)) {
204206 continue ;
205- if (cfgEvSelsNoSameBunchPileupCut && !(evSelection & (1 << evSel_kNoSameBunchPileup)))
207+ }
208+ if (cfgEvSelsNoSameBunchPileupCut && !TESTBIT (evSelection, NoSameBunchPileup)) {
206209 continue ;
207- if (cfgEvSelsIsGoodZvtxFT0vsPV && !(evSelection & (1 << evSel_kIsGoodZvtxFT0vsPV)))
210+ }
211+ if (cfgEvSelsIsGoodZvtxFT0vsPV && !TESTBIT (evSelection, IsGoodZvtxFT0vsPV)) {
208212 continue ;
209- if (cfgEvSelsNoCollInTimeRangeStandard && !(evSelection & (1 << evSel_kNoCollInTimeRangeStandard)))
213+ }
214+ if (cfgEvSelsNoCollInTimeRangeStandard && !TESTBIT (evSelection, NoCollInTimeRangeStandard)) {
210215 continue ;
211- if (cfgEvSelsIsVertexITSTPC && !(evSelection & (1 << evSel_kIsVertexITSTPC)))
216+ }
217+ if (cfgEvSelsIsVertexITSTPC && !TESTBIT (evSelection, IsVertexITSTPC)) {
212218 continue ;
213- if (cfgEvSelsIsGoodITSLayersAll && !(evSelection & (1 << evSel_kIsGoodITSLayersAll)))
219+ }
220+ if (cfgEvSelsIsGoodITSLayersAll && !TESTBIT (evSelection, IsGoodITSLayersAll)) {
214221 continue ;
222+ }
215223
216224 float centrality = collision.centFT0C ();
217225
0 commit comments