@@ -121,8 +121,7 @@ struct decay3bodyBuilder {
121121 Configurable<int > useMatCorrType{" useMatCorrType" , 0 , " 0: none, 1: TGeo, 2: LUT" };
122122 Configurable<bool > doTrackQA{" doTrackQA" , false , " Flag to fill QA histograms for daughter tracks of (selected) decay3body candidates." };
123123 Configurable<bool > doVertexQA{" doVertexQA" , false , " Flag to fill QA histograms for PV of (selected) events." };
124- Configurable<bool > doSel8selection{" doSel8selection" , true , " flag for sel8 event selection" };
125- Configurable<bool > doPosZselection{" doPosZselection" , true , " flag for posZ event selection" };
124+ Configurable<bool > disableITSROFCut{" disableITSROFCut" , false , " Disable ITS ROF border cut" };
126125
127126 // data processing options
128127 Configurable<bool > doSkimmedProcessing{" doSkimmedProcessing" , false , " Apply Zoroo counting in case of skimmed data input" };
@@ -433,13 +432,19 @@ struct decay3bodyBuilder {
433432
434433 // Add histograms separately for different process functions
435434 if (doprocessRealData == true || doprocessMonteCarlo == true ) {
436- auto hEventCounter = registry.add <TH1>(" Counters/hEventCounter" , " hEventCounter" , HistType::kTH1D , {{3 , 0 .0f , 3 .0f }});
437- hEventCounter->GetXaxis ()->SetBinLabel (1 , " total" );
438- hEventCounter->GetXaxis ()->SetBinLabel (2 , " sel8" );
439- hEventCounter->GetXaxis ()->SetBinLabel (3 , " vertexZ" );
435+ auto hEventCounter = registry.add <TH1>(" Counters/hEventCounter" , " hEventCounter" , HistType::kTH1D , {{2 , 0 .0f , 2 .0f }});
436+ hEventCounter->GetXaxis ()->SetBinLabel (1 , " all" );
437+ hEventCounter->GetXaxis ()->SetBinLabel (2 , " selected" );
440438 hEventCounter->LabelsOption (" v" );
441439 }
442440
441+ if (doprocessMonteCarlo == true ) {
442+ auto hMcEventCounter = registry.add <TH1>(" Counters/hMcEventCounter" , " hMcEventCounter" , HistType::kTH1D , {{2 , 0 .0f , 2 .0f }});
443+ hMcEventCounter->GetXaxis ()->SetBinLabel (1 , " all" );
444+ hMcEventCounter->GetXaxis ()->SetBinLabel (2 , " reconstructed" );
445+ hMcEventCounter->LabelsOption (" v" );
446+ }
447+
443448 if (doprocessRealData == true || doprocessRealDataReduced == true || doprocessMonteCarlo == true ) {
444449 if (doTrackQA) { // histograms for all daughter tracks of (selected) 3body candidates
445450 registry.add (" QA/Tracks/hTrackProtonTPCNcls" , " hTrackProtonTPCNcls" , HistType::kTH1F , {{152 , 0 , 152 , " # TPC clusters" }});
@@ -618,26 +623,31 @@ struct decay3bodyBuilder {
618623 // Loop over collisions for vertex QA
619624 for (const auto & collision : collisions) {
620625 if constexpr (soa::is_table<TBCs>) { // only do if NOT running over reduced data (already done in reducedCreator)
626+
627+ // all events
628+ registry.fill (HIST (" Counters/hEventCounter" ), 0.5 );
629+
630+ // ITS ROF boarder cut if not disabled
631+ if (!collision.selection_bit (aod::evsel::kNoITSROFrameBorder ) && !disableITSROFCut) {
632+ continue ;
633+ }
634+
621635 // Zorro event counting
622636 bool isZorroSelected = false ;
623637 if (doSkimmedProcessing) {
624638 isZorroSelected = zorro.isSelected (collision.template bc_as <TBCs>().globalBC ());
625- if (! isZorroSelected && onlyKeepInterestedTrigger ) {
626- continue ;
639+ if (isZorroSelected) {
640+ isTriggeredCollision[collision. globalIndex ()] = true ;
627641 }
628642 }
629643
630- isTriggeredCollision[collision.globalIndex ()] = true ;
631- // event counting
632- registry.fill (HIST (" Counters/hEventCounter" ), 0.5 );
633- if (doSel8selection && !collision.sel8 ()) {
644+ // event selection
645+ if (!collision.selection_bit (aod::evsel::kIsTriggerTVX ) || !collision.selection_bit (aod::evsel::kNoTimeFrameBorder ) || (collision.posZ () >= 10 .0f || collision.posZ () <= -10 .0f )) {
634646 continue ;
635647 }
648+
649+ // selected events
636650 registry.fill (HIST (" Counters/hEventCounter" ), 1.5 );
637- if (doPosZselection && (collision.posZ () >= 10 .0f || collision.posZ () <= -10 .0f )) {
638- continue ;
639- }
640- registry.fill (HIST (" Counters/hEventCounter" ), 2.5 );
641651 }
642652
643653 // vertex QA and counting
@@ -656,7 +666,7 @@ struct decay3bodyBuilder {
656666
657667 // In case of MC: reco collision survived event selection filter --> fill value for MC collision if collision is "true" MC collision
658668 if constexpr (soa::is_table<TMCParticles>) {
659- if (collision.mcCollisionId () >= 0 ) {
669+ if (collision.has_mcCollision () ) {
660670 isGoodCollision[collision.mcCollisionId ()] = true ;
661671 }
662672 }
@@ -680,26 +690,27 @@ struct decay3bodyBuilder {
680690 // aquire collision
681691 auto const & collision = collisions.rawIteratorAt (decay3body.collisionId ());
682692
683- // initialise CCDB from run number saved in reduced collisions table when running over reduced data
684- if constexpr (!soa::is_table<TBCs>) { // only do if running over reduced data (otherwise CCDB is initialised in process function)
685- if (collision.runNumber () != lastRunNumber) {
686- initFittersWithMagField (collision.runNumber (), getMagFieldFromRunNumber (collision.runNumber ()));
687- lastRunNumber = collision.runNumber (); // Update the last run number
688- LOG (debug) << " CCDB initialized for run " << lastRunNumber;
689- }
690- }
691-
692693 // event selection
693694 if constexpr (soa::is_table<TBCs>) { // only when NOT running over reduced data
694- if (doSel8selection && !collision.sel8 ()) {
695+ if (!collision.selection_bit (aod::evsel::kNoITSROFrameBorder ) && !disableITSROFCut) { // ITS ROF boarder cut if not disabled
696+ continue ;
697+ }
698+ if (!collision.selection_bit (aod::evsel::kIsTriggerTVX ) || !collision.selection_bit (aod::evsel::kNoTimeFrameBorder ) || (collision.posZ () >= 10 .0f || collision.posZ () <= -10 .0f )) {
695699 continue ;
696700 }
697- if (onlyKeepInterestedTrigger && !isTriggeredCollision[collision.globalIndex ()]) {
701+ // Zorro
702+ if (doSkimmedProcessing && onlyKeepInterestedTrigger && !isTriggeredCollision[collision.globalIndex ()]) {
698703 continue ;
699704 }
700705 }
701- if (doPosZselection && (collision.posZ () >= 10 .0f || collision.posZ () <= -10 .0f )) {
702- continue ;
706+
707+ // initialise CCDB from run number saved in reduced collisions table when running over reduced data
708+ if constexpr (!soa::is_table<TBCs>) { // only do if running over reduced data (otherwise CCDB is initialised in process function)
709+ if (collision.runNumber () != lastRunNumber) {
710+ initFittersWithMagField (collision.runNumber (), getMagFieldFromRunNumber (collision.runNumber ()));
711+ lastRunNumber = collision.runNumber (); // Update the last run number
712+ LOG (debug) << " CCDB initialized for run " << lastRunNumber;
713+ }
703714 }
704715
705716 // aquire tracks
@@ -775,7 +786,7 @@ struct decay3bodyBuilder {
775786 this3BodyMCInfo.isReco = true ;
776787
777788 // set flag if selected reco collision has matched gen collision
778- if (collision.mcCollisionId () >= 0 ) { // reco collision is matched to gen collision
789+ if (collision.has_mcCollision () ) { // reco collision is matched to gen collision
779790 this3BodyMCInfo.survivedEventSel = isGoodCollision[collision.mcCollisionId ()];
780791 } else {
781792 this3BodyMCInfo.survivedEventSel = false ; // false if reco collision not matched to gen collision
@@ -1327,6 +1338,14 @@ struct decay3bodyBuilder {
13271338 fTrackedClSizeVector [tvtx3body.decay3BodyId ()] = tvtx3body.itsClsSize ();
13281339 }
13291340
1341+ // MC collision counting for event loss
1342+ registry.fill (HIST (" Counters/hMcEventCounter" ), 0.5 , mcCollisions.size ());
1343+ for (const auto & collision : collisions) {
1344+ if (collision.has_mcCollision ()) {
1345+ registry.fill (HIST (" Counters/hMcEventCounter" ), 1.5 );
1346+ }
1347+ }
1348+
13301349 // do candidate analysis with MC processing
13311350 buildCandidates<TracksExtPIDIUwithEvTimesLabeled>(bcs, // bc table
13321351 collisions, // collision table
0 commit comments