@@ -41,6 +41,7 @@ using namespace o2;
4141using namespace o2 ::framework;
4242using namespace o2 ::framework::expressions;
4343using namespace o2 ::aod::mult;
44+ using namespace o2 ::aod::evsel;
4445using ColEvSels = soa::Join<aod::Collisions, aod::EvSels>;
4546using AodCollisions = soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Cs>>;
4647using AodTracks = soa::Filtered<soa::Join<aod::Tracks, aod::TrackSelection, aod::TracksExtra, aod::TracksDCA>>;
@@ -149,6 +150,7 @@ struct FlowZDCtask {
149150 AxisSpec axisCent{8 , 0 .f , 105 .f , " centrality" };
150151 AxisSpec axisCentBins{{0 , 5 ., 10 ., 20 ., 30 ., 40 ., 50 ., 60 ., 70 ., 80 .}, " centrality percentile" };
151152 AxisSpec axisPtBins{{0 ., 0.2 , 0.3 , 0.4 , 0.5 , 0.6 , 0.7 , 0.8 , 0.9 , 1.0 , 1.2 , 1.4 , 1.6 , 1.8 , 2.0 , 2.25 , 2.5 , 2.75 , 3.0 , 3.5 , 4.0 , 4.5 , 5.0 , 6.0 , 8.0 , 10 ., 13 ., 16 ., 20 .}, " p_{T} (GeV/c)" };
153+ AxisSpec axisEvent{6 , 0.5 , 6.5 , " #Event" , " EventAxis" };
152154
153155 // create histograms
154156 histos.add (" etaHistogram" , " etaHistogram" , kTH1F , {axisEta});
@@ -184,6 +186,7 @@ struct FlowZDCtask {
184186 {AxisSpec{100 , 0 , 100 , " Centrality [%]" }, AxisSpec{100 , 0 , 500 , " ZP Energy" }});
185187 histos.add (" revsimag" , " revsimag" , kTH2F , {axisREQ, axisIMQ}); // for q vector recentering
186188 histos.add (" hYield" , " Nch vs pT" , kTH2F , {axisMultiplicity, axisPt});
189+ histos.add (" eventSelectionSteps" , " eventSelectionSteps" , kTH1D , {axisEvent});
187190
188191 if (doprocessZdcCollAssoc) { // Check if the process function for ZDCCollAssoc is enabled
189192 histos.add (" ZNAcoll" , " ZNAcoll; ZNA amplitude; Entries" , {HistType::kTH1F , {{nBinsAmp, -0.5 , maxZn}}});
@@ -230,18 +233,34 @@ struct FlowZDCtask {
230233
231234 void processQVector (AodCollisions::iterator const & collision, aod::BCsWithTimestamps const &, AodTracks const & tracks, BCsRun3 const & /* bcs*/ , aod::Zdcs const & /* zdcsData*/ , aod::ZDCMults const & /* zdcMults*/ )
232235 {
233- histos.fill (HIST (" eventCounter" ), 0.5 );
236+ histos.fill (HIST (" eventSelectionSteps" ), 1 );
237+
234238 if (!collision.sel8 ())
235239 return ;
240+ histos.fill (HIST (" eventSelectionSteps" ), 2 );
241+
242+ if (!collision.selection_bit (o2::aod::evsel::kNoSameBunchPileup ))
243+ return ;
244+ histos.fill (HIST (" eventSelectionSteps" ), 3 );
245+
246+ if (!collision.selection_bit (o2::aod::evsel::kIsGoodZvtxFT0vsPV ))
247+ return ;
248+ histos.fill (HIST (" eventSelectionSteps" ), 4 );
249+
250+ if (!collision.selection_bit (o2::aod::evsel::kIsVertexITSTPC ))
251+ return ;
252+ histos.fill (HIST (" eventSelectionSteps" ), 5 );
253+
254+ histos.fill (HIST (" eventSelectionSteps" ), 6 );
255+
256+ histos.fill (HIST (" eventCounter" ), 0.5 );
236257 histos.fill (HIST (" centHistogram" ), collision.centFT0C ());
237258 const auto & tracksGrouped = tracksIUWithTPC->sliceByCached (aod::track::collisionId, collision.globalIndex (), cache);
238259 const int multTPC = tracksGrouped.size ();
239260 const auto cent = collision.centFT0C ();
240-
241261 // this is the q vector for the TPC data. it is a complex function
242262 double qTpcReal = 0.0 ; // Initialize qTPC_real
243263 double qTpcIm = 0.0 ; // init qTPC_imaginary
244-
245264 if (cent < 0.0 && cent > 70 )
246265 return ;
247266 std::complex <double > qTPC (0 , 0 ); // Starting with a q-vector of zero
@@ -258,7 +277,7 @@ struct FlowZDCtask {
258277 histos.fill (HIST (" ptHistogram" ), track.pt ());
259278 qTPC += std::complex <double >(std::cos (2.0 * phi), std::sin (2.0 * phi));
260279 } // end track loop 1
261- int pT{0 };
280+ double pT{0 };
262281 for (const auto & track : tracks) {
263282 if (track.tpcNClsCrossedRows () < minTpcNcrossedRows)
264283 continue ;
@@ -287,15 +306,20 @@ struct FlowZDCtask {
287306 aod::Zdcs const & /* zdcs*/ ,
288307 aod::FT0s const & /* ft0s*/ )
289308 {
309+ if (!collision.sel8 ())
310+ return ;
311+ if (!collision.selection_bit (o2::aod::evsel::kNoSameBunchPileup ))
312+ return ;
313+ if (!collision.selection_bit (o2::aod::evsel::kIsGoodZvtxFT0vsPV ))
314+ return ;
315+ if (!collision.selection_bit (o2::aod::evsel::kIsVertexITSTPC ))
316+ return ;
290317 int nTot = tracks.size ();
291318 double sumCosPsiDiff = 0.0 ; // initialize Sum of cosPsiDiff for averaging
292319 double sumSinPsiDiff = 0.0 ; // initialize Sum of cosPsiDiff for averaging
293320 int countEvents = 0 ; // initialize Counter for the number of events processed
294321 double ft0aAmp = 0 ;
295322 double ft0cAmp = 0 ;
296- // collision-based event selection
297- if (!collision.sel8 ())
298- return ;
299323 const auto & foundBC = collision.foundBC_as <BCsRun3>();
300324 if (collision.has_foundFT0 ()) {
301325 auto ft0 = collision.foundFT0 ();
0 commit comments