@@ -59,6 +59,7 @@ using namespace o2;
5959using namespace o2 ::framework;
6060using namespace o2 ::framework::expressions;
6161using std::array;
62+ using namespace o2 ::aod::rctsel;
6263struct kstarpbpb {
6364
6465 struct : ConfigurableGroup {
@@ -70,6 +71,16 @@ struct kstarpbpb {
7071 Service<o2::ccdb::BasicCCDBManager> ccdb;
7172 o2::ccdb::CcdbApi ccdbApi;
7273 // Service<o2::framework::O2DatabasePDG> pdg;
74+ struct RCTCut : ConfigurableGroup {
75+ Configurable<bool > requireRCTFlagChecker{" requireRCTFlagChecker" , true , " Check event quality in run condition table" };
76+ Configurable<std::string> cfgEvtRCTFlagCheckerLabel{" cfgEvtRCTFlagCheckerLabel" , " CBT_hadronPID" , " Evt sel: RCT flag checker label" };
77+ Configurable<bool > cfgEvtRCTFlagCheckerZDCCheck{" cfgEvtRCTFlagCheckerZDCCheck" , false , " Evt sel: RCT flag checker ZDC check" };
78+ Configurable<bool > cfgEvtRCTFlagCheckerLimitAcceptAsBad{" cfgEvtRCTFlagCheckerLimitAcceptAsBad" , true , " Evt sel: RCT flag checker treat Limited Acceptance As Bad" };
79+
80+ RCTFlagsChecker rctChecker;
81+ };
82+
83+ RCTCut rctCut;
7384
7485 // CCDB options
7586 // Configurable<std::string> ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
@@ -162,6 +173,11 @@ struct kstarpbpb {
162173
163174 void init (o2::framework::InitContext&)
164175 {
176+ rctCut.rctChecker .init (
177+ rctCut.cfgEvtRCTFlagCheckerLabel ,
178+ rctCut.cfgEvtRCTFlagCheckerZDCCheck ,
179+ rctCut.cfgEvtRCTFlagCheckerLimitAcceptAsBad );
180+
165181 std::vector<double > occupancyBinning = {0.0 , 500.0 , 1000.0 , 1500.0 , 2000.0 , 3000.0 , 4000.0 , 5000.0 , 50000.0 };
166182 AxisSpec phiAxis = {500 , -6.28 , 6.28 , " phi" };
167183 AxisSpec resAxis = {6000 , -30 , 30 , " Res" };
@@ -170,6 +186,7 @@ struct kstarpbpb {
170186 if (!fillSA) {
171187 if (same) {
172188 histos.add (" hSparseV2SASameEvent_V2" , " hSparseV2SASameEvent_V2" , HistType::kTHnSparseF , {configThnAxisInvMass, configThnAxisPt, configThnAxisV2, configThnAxisCentrality});
189+ histos.add (" hEvtSelInfo" , " hEvtSelInfo" , kTH1F , {{10 , 0 , 10.0 }});
173190 }
174191 if (like) {
175192 histos.add (" hSparseV2SAlikeEventNN_V2" , " hSparseV2SAlikeEventNN_V2" , HistType::kTHnSparseF , {configThnAxisInvMass, configThnAxisPt, configThnAxisV2, configThnAxisCentrality});
@@ -230,10 +247,11 @@ struct kstarpbpb {
230247 }
231248 if (additionalQAplots) {
232249 // DCA QA
233- histos.add (" QAbefore/trkDCAxyka" , " DCAxy distribution of kaon track candidates" , HistType::kTH1F , {{150 , 0 .0f , 1 .0f }});
234- histos.add (" QAbefore/trkDCAzka" , " DCAz distribution of kaon track candidates" , HistType::kTH1F , {{150 , 0 .0f , 1 .0f }});
235- histos.add (" QAafter/trkDCAxyka" , " DCAxy distribution of kaon track candidates" , HistType::kTH1F , {{150 , 0 .0f , 1 .0f }});
236- histos.add (" QAafter/trkDCAzka" , " DCAz distribution of kaon track candidates" , HistType::kTH1F , {{150 , 0 .0f , 1 .0f }});
250+ histos.add (" QAbefore/trkDCAxyka" , " DCAxy distribution of kaon track candidates" , HistType::kTH1F , {{150 , -1 .0f , 1 .0f }});
251+ histos.add (" QAbefore/trkDCAzka" , " DCAz distribution of kaon track candidates" , HistType::kTH1F , {{150 , -1 .0f , 1 .0f }});
252+ histos.add (" QAafter/trkDCAxyka" , " DCAxy distribution of kaon track candidates" , HistType::kTH1F , {{150 , -1 .0f , 1 .0f }});
253+ histos.add (" QAafter/trkDCAzka" , " DCAz distribution of kaon track candidates" , HistType::kTH1F , {{150 , -1 .0f , 1 .0f }});
254+
237255 // PID QA before cuts
238256 histos.add (" QAbefore/TOF_TPC_Mapka_allka" , " TOF + TPC Combined PID for Kaon;#sigma_{TOF}^{Kaon};#sigma_{TPC}^{Kaon}" , {HistType::kTH2D , {{100 , -6 , 6 }, {100 , -6 , 6 }}});
239257 histos.add (" QAbefore/TOF_Nsigma_allka" , " TOF NSigma for Kaon;#it{p}_{T} (GeV/#it{c});#sigma_{TOF}^{Kaon};" , {HistType::kTH3D , {{200 , 0.0 , 20.0 }, {100 , -6 , 6 }, {100 , 0.0 , 100.0 }}});
@@ -244,10 +262,10 @@ struct kstarpbpb {
244262 histos.add (" QAafter/TPC_Nsigma_allka" , " TPC NSigma for Kaon;#it{p}_{T} (GeV/#it{c});#sigma_{TPC}^{Kaon};" , {HistType::kTH3D , {{200 , 0.0 , 20.0 }, {100 , -6 , 6 }, {100 , 0.0 , 100.0 }}});
245263
246264 // DCA QA
247- histos.add (" QAbefore/trkDCAxypi" , " DCAxy distribution of pion track candidates" , HistType::kTH1F , {{150 , 0 .0f , 1 .0f }});
248- histos.add (" QAbefore/trkDCAzpi" , " DCAz distribution of pion track candidates" , HistType::kTH1F , {{150 , 0 .0f , 1 .0f }});
249- histos.add (" QAafter/trkDCAxypi" , " DCAxy distribution of pion track candidates" , HistType::kTH1F , {{150 , 0 .0f , 1 .0f }});
250- histos.add (" QAafter/trkDCAzpi" , " DCAz distribution of pion track candidates" , HistType::kTH1F , {{150 , 0 .0f , 1 .0f }});
265+ histos.add (" QAbefore/trkDCAxypi" , " DCAxy distribution of pion track candidates" , HistType::kTH1F , {{150 , - 1 .0f , 1 .0f }});
266+ histos.add (" QAbefore/trkDCAzpi" , " DCAz distribution of pion track candidates" , HistType::kTH1F , {{150 , - 1 .0f , 1 .0f }});
267+ histos.add (" QAafter/trkDCAxypi" , " DCAxy distribution of pion track candidates" , HistType::kTH1F , {{150 , - 1 .0f , 1 .0f }});
268+ histos.add (" QAafter/trkDCAzpi" , " DCAz distribution of pion track candidates" , HistType::kTH1F , {{150 , - 1 .0f , 1 .0f }});
251269 // PID QA before cuts
252270 histos.add (" QAbefore/TOF_TPC_Mapka_allpi" , " TOF + TPC Combined PID for pion;#sigma_{TOF}^{pion};#sigma_{TPC}^{pion}" , {HistType::kTH2D , {{100 , -6 , 6 }, {100 , -6 , 6 }}});
253271 histos.add (" QAbefore/TOF_Nsigma_allpi" , " TOF NSigma for pion;#it{p}_{T} (GeV/#it{c});#sigma_{TOF}^{pion};" , {HistType::kTH3D , {{200 , 0.0 , 20.0 }, {100 , -6 , 6 }, {100 , 0.0 , 100.0 }}});
@@ -492,9 +510,15 @@ struct kstarpbpb {
492510 TH2D* hweight;
493511 void processSE (EventCandidates::iterator const & collision, TrackCandidates const & tracks, aod::BCsWithTimestamps const &)
494512 {
513+ histos.fill (HIST (" hEvtSelInfo" ), 0.5 );
514+ if (rctCut.requireRCTFlagChecker && !rctCut.rctChecker (collision)) {
515+ return ;
516+ }
517+ histos.fill (HIST (" hEvtSelInfo" ), 1.5 );
495518 if (!collision.sel8 () || !collision.triggereventep () || !collision.selection_bit (aod::evsel::kNoTimeFrameBorder ) || !collision.selection_bit (aod::evsel::kNoITSROFrameBorder ) || !collision.selection_bit (aod::evsel::kNoSameBunchPileup ) || !collision.selection_bit (aod::evsel::kIsGoodZvtxFT0vsPV ) || !collision.selection_bit (o2::aod::evsel::kNoCollInTimeRangeStandard )) {
496519 return ;
497520 }
521+ histos.fill (HIST (" hEvtSelInfo" ), 2.5 );
498522 auto centrality = collision.centFT0C ();
499523 auto multTPC = collision.multNTracksPV ();
500524 int occupancy = collision.trackOccupancyInTimeRange ();
@@ -504,15 +528,18 @@ struct kstarpbpb {
504528 auto QFT0C = collision.qFT0C ();
505529 auto QFT0A = collision.qFT0A ();
506530 auto QTPC = collision.qTPC ();
507- if (fillOccupancy && occupancy >= cfgOccupancyCut) {
531+ if (fillOccupancy && occupancy > cfgOccupancyCut) {
508532 return ;
509533 }
534+ histos.fill (HIST (" hEvtSelInfo" ), 3.5 );
510535 if (additionalEvsel && !eventSelected (collision, centrality)) {
511536 return ;
512537 }
538+ histos.fill (HIST (" hEvtSelInfo" ), 4.5 );
513539 if (additionalEvselITS && !collision.selection_bit (o2::aod::evsel::kIsGoodITSLayersAll )) {
514540 return ;
515541 }
542+ histos.fill (HIST (" hEvtSelInfo" ), 5.5 );
516543 if (additionalQAplots1) {
517544 histos.fill (HIST (" hFTOCvsTPCSelected" ), centrality, multTPC);
518545 histos.fill (HIST (" hPsiFT0C" ), centrality, psiFT0C);
@@ -1088,6 +1115,12 @@ struct kstarpbpb {
10881115 BinningTypeVertexContributor binningOnPositions{{axisVertex, axisMultiplicityClass, axisOccup}, true };
10891116 SameKindPair<EventCandidates, TrackCandidates, BinningTypeVertexContributor> pair{binningOnPositions, cfgNoMixedEvents, -1 , collisions, tracksTuple, &cache};
10901117 for (auto & [collision1, tracks1, collision2, tracks2] : pair) {
1118+ if (rctCut.requireRCTFlagChecker && !rctCut.rctChecker (collision1)) {
1119+ continue ;
1120+ }
1121+ if (rctCut.requireRCTFlagChecker && !rctCut.rctChecker (collision2)) {
1122+ continue ;
1123+ }
10911124 if (!collision1.sel8 () || !collision1.triggereventep () || !collision1.selection_bit (aod::evsel::kNoTimeFrameBorder ) || !collision1.selection_bit (aod::evsel::kNoITSROFrameBorder ) || !collision1.selection_bit (aod::evsel::kNoSameBunchPileup ) || !collision1.selection_bit (aod::evsel::kIsGoodZvtxFT0vsPV ) || !collision1.selection_bit (o2::aod::evsel::kNoCollInTimeRangeStandard )) {
10921125 continue ;
10931126 }
0 commit comments