Skip to content

Commit 426c689

Browse files
committed
Add RCT flag for event selection
1 parent f679e1b commit 426c689

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

PWGLF/Tasks/Resonances/phispectrapbpbqa.cxx

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ using namespace o2;
6464
using namespace o2::framework;
6565
using namespace o2::framework::expressions;
6666
using std::array;
67+
using namespace o2::aod::rctsel;
6768
struct phispectrapbpbqa {
6869
double bz = 0.;
6970

@@ -75,6 +76,13 @@ struct phispectrapbpbqa {
7576
Configurable<std::string> cfgURL{"cfgURL", "http://alice-ccdb.cern.ch", "Address of the CCDB to browse"};
7677
Configurable<int64_t> nolaterthan{"ccdb-no-later-than", std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count(), "Latest acceptable timestamp of creation for the object"};
7778
} cfgCcdbParam;
79+
80+
struct : ConfigurableGroup {
81+
Configurable<bool> requireRCTFlagChecker{"requireRCTFlagChecker", true, "Check event quality in run condition table"};
82+
Configurable<std::string> cfgEvtRCTFlagCheckerLabel{"cfgEvtRCTFlagCheckerLabel", "CBT_hadronPID", "Evt sel: RCT flag checker label"};
83+
Configurable<bool> cfgEvtRCTFlagCheckerLimitAcceptAsBad{"cfgEvtRCTFlagCheckerLimitAcceptAsBad", true, "Evt sel: RCT flag checker treat Limited Acceptance As Bad"};
84+
} rctCut;
85+
7886
TH3D* hTPCCallib;
7987
TH3D* hTOFCallib;
8088

@@ -141,13 +149,13 @@ struct phispectrapbpbqa {
141149
Partition<TrackCandidates> negTracks = aod::track::signed1Pt < cfgCutCharge;
142150

143151
HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject};
144-
152+
RCTFlagsChecker rctChecker;
145153
// Event selection cuts - Alex
146154
// TF1* fMultPVCutLow = nullptr;
147155

148156
void init(o2::framework::InitContext&)
149157
{
150-
158+
rctChecker.init(rctCut.cfgEvtRCTFlagCheckerLabel, rctCut.cfgEvtRCTFlagCheckerLimitAcceptAsBad);
151159
histos.add("hphiSE", "hphiSE", HistType::kTHnSparseF, {cnfgaxis.configThnAxisInvMass, cnfgaxis.configThnAxisPt, cnfgaxis.configThnAxisCentrality, axisOccupancy, cnfgaxis.configThnAxisSector}, true);
152160
histos.add("hphiME", "hphiME", HistType::kTHnSparseF, {cnfgaxis.configThnAxisInvMass, cnfgaxis.configThnAxisPt, cnfgaxis.configThnAxisCentrality, axisOccupancy, cnfgaxis.configThnAxisSector}, true);
153161
histos.add("hphiGen", "hphiGen", HistType::kTHnSparseF, {cnfgaxis.configThnAxisInvMass, cnfgaxis.configThnAxisPt, cnfgaxis.configThnAxisCentrality, axisOccupancy}, true);
@@ -325,6 +333,11 @@ struct phispectrapbpbqa {
325333
if (!collision.sel8() || !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) || !collision.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll)) {
326334
return;
327335
}
336+
if (rctCut.requireRCTFlagChecker) {
337+
if (!rctChecker(collision)) {
338+
return;
339+
}
340+
}
328341
auto centrality = collision.centFT0C();
329342
int occupancy = collision.trackOccupancyInTimeRange();
330343
histos.fill(HIST("hCentrality"), centrality);
@@ -481,6 +494,11 @@ struct phispectrapbpbqa {
481494
if (!collision2.sel8() || !collision2.selection_bit(aod::evsel::kNoTimeFrameBorder) || !collision2.selection_bit(aod::evsel::kNoITSROFrameBorder) || !collision2.selection_bit(aod::evsel::kNoSameBunchPileup) || !collision2.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV) || !collision2.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard) || !collision2.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll)) {
482495
continue;
483496
}
497+
if (rctCut.requireRCTFlagChecker) {
498+
if (!rctChecker(collision1) || !rctChecker(collision2)) {
499+
continue;
500+
}
501+
}
484502
int occupancy = collision1.trackOccupancyInTimeRange();
485503
auto centrality = collision1.centFT0C();
486504
for (auto& [track1, track2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) {
@@ -587,8 +605,13 @@ struct phispectrapbpbqa {
587605
histos.fill(HIST("hMC"), 8);
588606
continue;
589607
}
590-
591608
histos.fill(HIST("hMC"), 9);
609+
if (rctCut.requireRCTFlagChecker) {
610+
if (!rctChecker(RecCollision)) {
611+
continue;
612+
}
613+
}
614+
histos.fill(HIST("hMC"), 10);
592615
auto centrality = RecCollision.centFT0C();
593616
int occupancy = RecCollision.trackOccupancyInTimeRange();
594617
histos.fill(HIST("hOccupancy"), occupancy, centrality);

0 commit comments

Comments
 (0)