@@ -152,6 +152,8 @@ struct MeanptFluctuationsAnalysis {
152152 using MyMCTracks = soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection, aod::McTrackLabels>>;
153153 using EventCandidatesMC = soa::Join<aod::Collisions, aod::EvSels, aod::McCollisionLabels, aod::CentFT0Cs, aod::CentFT0Ms, aod::CentFT0As, aod::CentFV0As, aod::Mults>;
154154
155+ Preslice<MyMCTracks> perCollision = aod::track::collisionId;
156+
155157 // Event selection cuts - Alex
156158 TF1* fMultPVCutLow = nullptr ;
157159 TF1* fMultPVCutHigh = nullptr ;
@@ -170,6 +172,7 @@ struct MeanptFluctuationsAnalysis {
170172 AxisSpec ptAxis = {ptBinning, " #it{p}_{T} (GeV/#it{c})" };
171173
172174 // Add histograms to histogram manager (as in the output object of in AliPhysics)
175+ histos.add (" hEventStatData" , " Data Event statistics" , kTH1F , {{10 , 0 .0f , 10 .0f }});
173176 histos.add (" hZvtx_after_sel" , " ;Z (cm)" , kTH1F , {vtxZAxis});
174177 histos.add (" hP" , " ;#it{p} (GeV/#it{c})" , kTH1F , {{35 , 0.2 , 4 .}});
175178 histos.add (" hPt" , " ;#it{p}_{T} (GeV/#it{c})" , kTH1F , {ptAxis});
@@ -376,26 +379,40 @@ struct MeanptFluctuationsAnalysis {
376379 }
377380
378381 template <typename TCollision>
379- void eventSelectionDefaultCuts (TCollision coll)
382+ bool eventSelectionDefaultCuts (TCollision coll)
380383 {
384+ histos.fill (HIST (" hEventStatData" ), 0.5 );
381385 if (!coll.sel8 ()) {
382- return ;
386+ return 0 ;
383387 }
388+
389+ histos.fill (HIST (" hEventStatData" ), 1.5 );
384390 if (cfgUseGoodITSLayerAllCut && !(coll.selection_bit (o2::aod::evsel::kIsGoodITSLayersAll ))) {
385- return ;
391+ return 0 ;
386392 }
393+
394+ histos.fill (HIST (" hEventStatData" ), 2.5 );
387395 if (cfgEvSelkNoSameBunchPileup && !(coll.selection_bit (o2::aod::evsel::kNoSameBunchPileup ))) {
388- return ;
396+ return 0 ;
389397 }
398+
399+ histos.fill (HIST (" hEventStatData" ), 3.5 );
390400 if (cfgEvSelkNoITSROFrameBorder && !(coll.selection_bit (o2::aod::evsel::kNoITSROFrameBorder ))) {
391- return ;
401+ return 0 ;
392402 }
403+
404+ histos.fill (HIST (" hEventStatData" ), 4.5 );
393405 if (cfgEvSelkNoTimeFrameBorder && !(coll.selection_bit (o2::aod::evsel::kNoTimeFrameBorder ))) {
394- return ;
406+ return 0 ;
395407 }
408+
409+ histos.fill (HIST (" hEventStatData" ), 5.5 );
396410 if (cfgEvSelUseGoodZvtxFT0vsPV && !(coll.selection_bit (o2::aod::evsel::kIsGoodZvtxFT0vsPV ))) {
397- return ;
411+ return 0 ;
398412 }
413+
414+ histos.fill (HIST (" hEventStatData" ), 6.5 );
415+ return 1 ;
399416 }
400417
401418 template <typename C, typename T>
@@ -461,11 +478,12 @@ struct MeanptFluctuationsAnalysis {
461478 if (cfgEvSelUseGoodZvtxFT0vsPV && !(collision.selection_bit (o2::aod::evsel::kIsGoodZvtxFT0vsPV ))) {
462479 continue ;
463480 }
464- if (cfgUseSmallIonAdditionalEventCutInMC && !eventSelectedSmallion (collision, tracks.size (), cent)) {
465- continue ;
466- }
467481
482+ auto rectrackspart = tracks.sliceBy (perCollision, collision.globalIndex ());
468483 cent = collision.centFT0C ();
484+ if (cfgUseSmallIonAdditionalEventCutInMC && !eventSelectedSmallion (collision, rectrackspart.size (), cent)) {
485+ continue ;
486+ }
469487
470488 selectedEvents[nevts++] = collision.mcCollision_as <aod::McCollisions>().globalIndex ();
471489 }
@@ -554,10 +572,17 @@ struct MeanptFluctuationsAnalysis {
554572
555573 void processMCRec (MyMCRecCollisions::iterator const & collision, MyMCTracks const & tracks, aod::McCollisions const &, aod::McParticles const &)
556574 {
575+ histos.fill (HIST (" MCGenerated/hMC" ), 5.5 );
576+
557577 if (!collision.has_mcCollision ()) {
558578 return ;
559579 }
560- eventSelectionDefaultCuts (collision);
580+ histos.fill (HIST (" MCGenerated/hMC" ), 6.5 );
581+
582+ if (!eventSelectionDefaultCuts (collision)) {
583+ return ;
584+ }
585+ histos.fill (HIST (" MCGenerated/hMC" ), 7.5 );
561586
562587 fillMultCorrPlotsBeforeSel (collision, tracks);
563588
@@ -571,7 +596,7 @@ struct MeanptFluctuationsAnalysis {
571596 fillMultCorrPlotsAfterSel (collision, tracks);
572597 }
573598
574- histos.fill (HIST (" MCGenerated/hMC" ), 5 .5 );
599+ histos.fill (HIST (" MCGenerated/hMC" ), 8 .5 );
575600 histos.fill (HIST (" hZvtx_after_sel" ), collision.posZ ());
576601
577602 double cent = 0.0 ;
@@ -688,7 +713,9 @@ struct MeanptFluctuationsAnalysis {
688713 // void process(aod::Collision const& coll, aod::Tracks const& inputTracks)
689714 void processData (AodCollisions::iterator const & coll, aod::BCsWithTimestamps const &, AodTracks const & inputTracks)
690715 {
691- eventSelectionDefaultCuts (coll);
716+ if (!eventSelectionDefaultCuts (coll)) {
717+ return ;
718+ }
692719
693720 fillMultCorrPlotsBeforeSel (coll, inputTracks);
694721
@@ -702,6 +729,8 @@ struct MeanptFluctuationsAnalysis {
702729 fillMultCorrPlotsAfterSel (coll, inputTracks);
703730 }
704731
732+ histos.fill (HIST (" hEventStatData" ), 7.5 );
733+
705734 histos.fill (HIST (" hZvtx_after_sel" ), coll.posZ ());
706735
707736 double cent = 0.0 ;
0 commit comments