@@ -47,6 +47,7 @@ using namespace o2::framework::expressions;
4747using namespace o2 ::soa;
4848using namespace o2 ::constants::physics;
4949using namespace o2 ::constants::math;
50+ using namespace o2 ::aod::rctsel;
5051
5152// / Initializer for the resonance candidate producers
5253struct ResonanceInitializer {
@@ -103,6 +104,7 @@ struct ResonanceInitializer {
103104
104105 // / Event cuts
105106 o2::analysis::CollisonCuts colCuts;
107+
106108 struct : ConfigurableGroup {
107109 Configurable<float > cfgEvtZvtx{" cfgEvtZvtx" , 10 .f , " Evt sel: Max. z-Vertex (cm)" };
108110 Configurable<int > cfgEvtOccupancyInTimeRangeMax{" cfgEvtOccupancyInTimeRangeMax" , -1 , " Evt sel: maximum track occupancy" };
@@ -118,7 +120,12 @@ struct ResonanceInitializer {
118120 Configurable<bool > cfgEvtCollInTimeRangeStandard{" cfgEvtCollInTimeRangeStandard" , false , " Evt sel: apply NoCollInTimeRangeStandard" };
119121 Configurable<bool > cfgEvtRun2AliEventCuts{" cfgEvtRun2AliEventCuts" , true , " Evt sel: apply Run2 AliEventCuts" };
120122 Configurable<bool > cfgEvtRun2INELgtZERO{" cfgEvtRun2INELgtZERO" , false , " Evt sel: apply Run2 INELgtZERO" };
123+ Configurable<bool > cfgEvtUseRCTFlagChecker{" cfgEvtUseRCTFlagChecker" , false , " Evt sel: use RCT flag checker" };
124+ Configurable<std::string> cfgEvtRCTFlagCheckerLabel{" cfgEvtRCTFlagCheckerLabel" , " CBT_hadronPID" , " Evt sel: RCT flag checker label" };
125+ Configurable<bool > cfgEvtRCTFlagCheckerZDCCheck{" cfgEvtRCTFlagCheckerZDCCheck" , false , " Evt sel: RCT flag checker ZDC check" };
126+ Configurable<bool > cfgEvtRCTFlagCheckerLimitAcceptAsBad{" cfgEvtRCTFlagCheckerLimitAcceptAsBad" , false , " Evt sel: RCT flag checker treat Limited Acceptance As Bad" };
121127 } EventCuts;
128+ RCTFlagsChecker rctChecker;
122129
123130 Configurable<std::string> cfgMultName{" cfgMultName" , " FT0M" , " The name of multiplicity estimator" };
124131
@@ -1202,6 +1209,9 @@ struct ResonanceInitializer {
12021209 colCuts.setApplyRun2AliEventCuts (EventCuts.cfgEvtRun2AliEventCuts );
12031210 colCuts.setApplyRun2INELgtZERO (EventCuts.cfgEvtRun2INELgtZERO );
12041211 colCuts.printCuts ();
1212+
1213+ rctChecker.init (EventCuts.cfgEvtRCTFlagCheckerLabel , EventCuts.cfgEvtRCTFlagCheckerZDCCheck , EventCuts.cfgEvtRCTFlagCheckerLimitAcceptAsBad );
1214+
12051215 if (!cfgBypassCCDB) {
12061216 ccdb->setURL (ccdbURL.value );
12071217 ccdb->setCaching (true );
@@ -1287,6 +1297,8 @@ struct ResonanceInitializer {
12871297 // Default event selection
12881298 if (!colCuts.isSelected (collision))
12891299 return ;
1300+ if (EventCuts.cfgEvtUseRCTFlagChecker && !rctChecker (collision))
1301+ return ;
12901302 colCuts.fillQA (collision);
12911303
12921304 resoCollisions (0 , collision.posX (), collision.posY (), collision.posZ (), centEst (collision), dBz);
@@ -1311,6 +1323,8 @@ struct ResonanceInitializer {
13111323 // Default event selection
13121324 if (!colCuts.isSelected (collision))
13131325 return ;
1326+ if (EventCuts.cfgEvtUseRCTFlagChecker && !rctChecker (collision))
1327+ return ;
13141328 colCuts.fillQARun2 (collision);
13151329
13161330 resoCollisions (0 , collision.posX (), collision.posY (), collision.posZ (), collision.centRun2V0M (), dBz);
@@ -1336,6 +1350,8 @@ struct ResonanceInitializer {
13361350 // Default event selection
13371351 if (!colCuts.isSelected (collision))
13381352 return ;
1353+ if (EventCuts.cfgEvtUseRCTFlagChecker && !rctChecker (collision))
1354+ return ;
13391355 colCuts.fillQA (collision);
13401356
13411357 resoCollisions (0 , collision.posX (), collision.posY (), collision.posZ (), centEst (collision), dBz);
@@ -1361,6 +1377,8 @@ struct ResonanceInitializer {
13611377 // Default event selection
13621378 if (!colCuts.isSelected (collision))
13631379 return ;
1380+ if (EventCuts.cfgEvtUseRCTFlagChecker && !rctChecker (collision))
1381+ return ;
13641382 colCuts.fillQA (collision);
13651383
13661384 resoCollisions (0 , collision.posX (), collision.posY (), collision.posZ (), centEst (collision), dBz);
@@ -1415,6 +1433,8 @@ struct ResonanceInitializer {
14151433 // Default event selection
14161434 if (!colCuts.isSelected (collision))
14171435 return ;
1436+ if (EventCuts.cfgEvtUseRCTFlagChecker && !rctChecker (collision))
1437+ return ;
14181438 colCuts.fillQA (collision);
14191439
14201440 resoCollisions (0 , collision.posX (), collision.posY (), collision.posZ (), centEst (collision), dBz);
@@ -1467,6 +1487,8 @@ struct ResonanceInitializer {
14671487 {
14681488 auto bc = collision.bc_as <aod::BCsWithTimestamps>(); // / adding timestamp to access magnetic field later
14691489 initCCDB (bc);
1490+ if (EventCuts.cfgEvtUseRCTFlagChecker && !rctChecker (collision))
1491+ return ;
14701492 colCuts.fillQA (collision);
14711493
14721494 resoCollisions (0 , collision.posX (), collision.posY (), collision.posZ (), centEst (collision), dBz);
@@ -1497,6 +1519,8 @@ struct ResonanceInitializer {
14971519 {
14981520 auto bc = collision.bc_as <aod::BCsWithTimestamps>(); // / adding timestamp to access magnetic field later
14991521 initCCDB (bc);
1522+ if (EventCuts.cfgEvtUseRCTFlagChecker && !rctChecker (collision))
1523+ return ;
15001524 colCuts.fillQA (collision);
15011525
15021526 resoCollisions (0 , collision.posX (), collision.posY (), collision.posZ (), centEst (collision), dBz);
@@ -1552,6 +1576,8 @@ struct ResonanceInitializer {
15521576 {
15531577 auto bc = collision.bc_as <aod::BCsWithTimestamps>(); // / adding timestamp to access magnetic field later
15541578 initCCDB (bc);
1579+ if (EventCuts.cfgEvtUseRCTFlagChecker && !rctChecker (collision))
1580+ return ;
15551581 colCuts.fillQA (collision);
15561582
15571583 resoCollisions (0 , collision.posX (), collision.posY (), collision.posZ (), centEst (collision), dBz);
@@ -1612,6 +1638,8 @@ struct ResonanceInitializer {
16121638 {
16131639 auto bc = collision.bc_as <aod::BCsWithTimestamps>(); // / adding timestamp to access magnetic field later
16141640 initCCDB (bc);
1641+ if (EventCuts.cfgEvtUseRCTFlagChecker && !rctChecker (collision))
1642+ return ;
16151643 colCuts.fillQA (collision);
16161644
16171645 resoCollisions (0 , collision.posX (), collision.posY (), collision.posZ (), centEst (collision), dBz);
0 commit comments