@@ -205,7 +205,7 @@ struct UpcRhoAnalysis {
205205 rQC.addClone (" QC/collisions/all/" , " QC/collisions/trackSelections/" );
206206 rQC.addClone (" QC/collisions/all/" , " QC/collisions/systemSelections/" );
207207
208- std::vector<std::string> collisionSelectionCounterLabels = {" all collisions" , " ITS-TPC vertex" , " same bunch pile-up" , " ITS ROF border" , " TF border" , " #it{z} position" , " number of contributors" , " RCT selections" , " reco flag selection" };
208+ std::vector<std::string> collisionSelectionCounterLabels = {" all collisions" , " rapidity gap " , " ITS-TPC vertex" , " same bunch pile-up" , " ITS ROF border" , " TF border" , " #it{z} position" , " number of contributors" , " RCT selections" , " reco flag selection" };
209209 rQC.add (" QC/collisions/hSelectionCounter" , " ;;collisions passing selections" , kTH1D , {{static_cast <int >(collisionSelectionCounterLabels.size ()), -0.5 , static_cast <float >(collisionSelectionCounterLabels.size ()) - 0.5 }});
210210 rQC.add (" QC/collisions/hSelectionCounterPerRun" , " ;;run number;collisions passing selections" , kTH2D , {{static_cast <int >(collisionSelectionCounterLabels.size ()), -0.5 , static_cast <float >(collisionSelectionCounterLabels.size ()) - 0.5 }, runNumberAxis});
211211 for (int i = 0 ; i < static_cast <int >(collisionSelectionCounterLabels.size ()); ++i) {
@@ -447,49 +447,46 @@ struct UpcRhoAnalysis {
447447 template <typename C>
448448 bool collisionPassesCuts (const C& collision, int runIndex) // collision cuts
449449 {
450- rQC.fill (HIST (" QC/collisions/hSelectionCounter" ), 0 );
451- rQC.fill (HIST (" QC/collisions/hSelectionCounterPerRun" ), 0 , runIndex);
452-
453450 if (!collision.vtxITSTPC ())
454451 return false ;
455- rQC.fill (HIST (" QC/collisions/hSelectionCounter" ), 1 );
456- rQC.fill (HIST (" QC/collisions/hSelectionCounterPerRun" ), 1 , runIndex);
457-
458- if (!collision.sbp ())
459- return false ;
460452 rQC.fill (HIST (" QC/collisions/hSelectionCounter" ), 2 );
461453 rQC.fill (HIST (" QC/collisions/hSelectionCounterPerRun" ), 2 , runIndex);
462454
463- if (!collision.itsROFb ())
455+ if (!collision.sbp ())
464456 return false ;
465457 rQC.fill (HIST (" QC/collisions/hSelectionCounter" ), 3 );
466458 rQC.fill (HIST (" QC/collisions/hSelectionCounterPerRun" ), 3 , runIndex);
467459
468- if (!collision.tfb ())
460+ if (!collision.itsROFb ())
469461 return false ;
470462 rQC.fill (HIST (" QC/collisions/hSelectionCounter" ), 4 );
471463 rQC.fill (HIST (" QC/collisions/hSelectionCounterPerRun" ), 4 , runIndex);
472464
473- if (std::abs ( collision.posZ ()) > collisionsPosZMaxCut )
465+ if (! collision.tfb () )
474466 return false ;
475467 rQC.fill (HIST (" QC/collisions/hSelectionCounter" ), 5 );
476468 rQC.fill (HIST (" QC/collisions/hSelectionCounterPerRun" ), 5 , runIndex);
477469
478- if (cutNumContribs && (collision.numContrib () > collisionsNumContribsMaxCut))
470+ if (std::abs (collision.posZ ()) > collisionsPosZMaxCut)
479471 return false ;
480472 rQC.fill (HIST (" QC/collisions/hSelectionCounter" ), 6 );
481473 rQC.fill (HIST (" QC/collisions/hSelectionCounterPerRun" ), 6 , runIndex);
482474
483- if (useRctFlag && ! isGoodRctFlag (collision)) // check RCT flags
475+ if (cutNumContribs && (collision. numContrib () > collisionsNumContribsMaxCut))
484476 return false ;
485477 rQC.fill (HIST (" QC/collisions/hSelectionCounter" ), 7 );
486478 rQC.fill (HIST (" QC/collisions/hSelectionCounterPerRun" ), 7 , runIndex);
487479
488- if (useRecoFlag && (collision. flags () != cutRecoFlag)) // check reconstruction mode
480+ if (useRctFlag && ! isGoodRctFlag (collision)) // check RCT flags
489481 return false ;
490482 rQC.fill (HIST (" QC/collisions/hSelectionCounter" ), 8 );
491483 rQC.fill (HIST (" QC/collisions/hSelectionCounterPerRun" ), 8 , runIndex);
492484
485+ if (useRecoFlag && (collision.flags () != cutRecoFlag)) // check reconstruction mode
486+ return false ;
487+ rQC.fill (HIST (" QC/collisions/hSelectionCounter" ), 9 );
488+ rQC.fill (HIST (" QC/collisions/hSelectionCounterPerRun" ), 9 , runIndex);
489+
493490 // if all selections passed
494491 return true ;
495492 }
@@ -680,12 +677,11 @@ struct UpcRhoAnalysis {
680677 }
681678
682679 template <typename C, typename T>
683- void processReco (C const & collision, T const & tracks)
680+ void processReco (C const & collision, T const & tracks, const int runIndex )
684681 {
685682 // check if the collision run number is contained within the selectedRuns vector
686683 if (selectRuns && getRunIndex (collision.runNumber (), selectedRuns) == 0 )
687684 return ;
688- int runIndex = getRunIndex (collision.runNumber (), runNumbers);
689685
690686 fillCollisionQcHistos<0 >(collision); // fill QC histograms before cuts
691687 if (!collisionPassesCuts (collision, runIndex)) // apply collision cuts
@@ -989,17 +985,28 @@ struct UpcRhoAnalysis {
989985
990986 void processSGdata (FullUdSgCollision const & collision, FullUdTracks const & tracks)
991987 {
988+ int runIndex = getRunIndex (collision.runNumber (), runNumbers);
989+ rQC.fill (HIST (" QC/collisions/hSelectionCounter" ), 0 ); // all collisions
990+ rQC.fill (HIST (" QC/collisions/hSelectionCounterPerRun" ), 0 , runIndex);
991+
992992 if (cutGapSide && collision.gapSide () != gapSide)
993993 return ;
994994 if (useTrueGap && (collision.gapSide () != sgSelector.trueGap (collision, cutTrueGapSideFV0, cutTrueGapSideFT0A, cutTrueGapSideFT0C, cutTrueGapSideZDC))) // check true gap side
995995 return ;
996- processReco (collision, tracks);
996+ rQC.fill (HIST (" QC/collisions/hSelectionCounter" ), 1 ); // only double-gap collisions
997+ rQC.fill (HIST (" QC/collisions/hSelectionCounterPerRun" ), 1 , runIndex);
998+
999+ processReco (collision, tracks, runIndex);
9971000 }
9981001 PROCESS_SWITCH (UpcRhoAnalysis, processSGdata, " analyse SG data" , true );
9991002
10001003 void processDGdata (FullUdDgCollision const & collision, FullUdTracks const & tracks)
10011004 {
1002- processReco (collision, tracks);
1005+ int runIndex = getRunIndex (collision.runNumber (), runNumbers);
1006+ rQC.fill (HIST (" QC/collisions/hSelectionCounter" ), 1 ); // no single-gap collisions in dataset
1007+ rQC.fill (HIST (" QC/collisions/hSelectionCounterPerRun" ), 1 , runIndex);
1008+
1009+ processReco (collision, tracks, runIndex);
10031010 }
10041011 PROCESS_SWITCH (UpcRhoAnalysis, processDGdata, " analyse DG data" , false );
10051012
0 commit comments