Skip to content

Commit 99273fe

Browse files
authored
[PWGLF] Adds RCT-base selection (#14879)
1 parent 776a3ff commit 99273fe

File tree

1 file changed

+44
-1
lines changed

1 file changed

+44
-1
lines changed

PWGLF/Tasks/Nuspex/piKpRAA.cxx

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ using namespace o2::framework;
6767
using namespace o2::aod::evsel;
6868
using namespace o2::constants::math;
6969
using namespace o2::framework::expressions;
70+
using namespace o2::aod::rctsel;
7071

7172
using ColEvSels = soa::Join<aod::Collisions, aod::EvSels, aod::FT0MultZeqs, o2::aod::CentFT0Cs, o2::aod::CentFT0Ms, aod::TPCMults, o2::aod::BarrelMults>;
7273
using BCsRun3 = soa::Join<aod::BCsWithTimestamps, aod::BcSels, aod::Run3MatchedToBCSparse>;
@@ -253,6 +254,14 @@ struct PiKpRAA {
253254
Configurable<std::string> pathPhiCutHigh{"pathPhiCutHigh", "Users/o/omvazque/PhiCut/OO/Global/High", "base path to the ccdb object"};
254255
Configurable<std::string> pathPhiCutLow{"pathPhiCutLow", "Users/o/omvazque/PhiCut/OO/Global/Low", "base path to the ccdb object"};
255256
Configurable<int64_t> ccdbNoLaterThan{"ccdbNoLaterThan", std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"};
257+
Configurable<std::string> rctLabel{"rctLabel", "CBT_hadronPID", "RCT selection flag (CBT, CBT_hadronPID, CBT_electronPID, CBT_calo, CBT_muon, CBT_muon_glo)"};
258+
Configurable<bool> rctCheckZDC{"rctCheckZDC", false, "RCT flag to check whether the ZDC is present or not"};
259+
Configurable<bool> rctTreatLimitedAcceptanceAsBad{"rctTreatLimitedAcceptanceAsBad", false, "RCT flag to reject events with limited acceptance for selected detectors"};
260+
Configurable<bool> requireGoodRct{"requireGoodRct", true, "RCT flag to reject events with limited acceptance for selected detectors"};
261+
Configurable<bool> requireGoodPIDRct{"requireGoodPIDRct", true, "RCT flag to reject events with limited acceptance for selected detectors"};
262+
263+
// RCT Checker instance
264+
RCTFlagsChecker rctChecker;
256265

257266
enum EvCutLabel {
258267
All = 1,
@@ -350,6 +359,12 @@ struct PiKpRAA {
350359
int currentRunNumberPhiSel;
351360
void init(InitContext const&)
352361
{
362+
363+
// Initialize the rct checker
364+
if (requireGoodRct) {
365+
rctChecker.init(rctLabel.value, rctCheckZDC.value, rctTreatLimitedAcceptanceAsBad.value);
366+
}
367+
353368
currentRunNumberNchSel = -1;
354369
currentRunNumberPhiSel = -1;
355370
trkSelGlobalOpenDCAxy = trkSelOpenDCAxy();
@@ -372,7 +387,7 @@ struct PiKpRAA {
372387
registry.add("EventCounter", ";;Events", kTH1F, {axisEvent});
373388
registry.add("zPos", "With Event Selection;;Entries;", kTH1F, {axisZpos});
374389
registry.add("T0Ccent", ";;Entries", kTH1F, {axisCent});
375-
registry.add("T0CcentVsFoundFT0", ";Found(=1.5) NOT Found(=0.5);", kTH2F, {{{axisCent}, {2, 0, 2}}});
390+
registry.add("T0CcentVsFoundFT0", "Found(=1.5) NOT Found(=0.5);;Status;", kTH2F, {{{axisCent}, {2, 0, 2}}});
376391
registry.add("NchVsCent", "Measured Nch v.s. Centrality (At least Once Rec. Coll. + Sel. criteria);;Nch", kTH2F, {{axisCent, {nBinsNch, minNch, maxNch}}});
377392
registry.add("NclVsEtaPID", ";#eta;Ncl used for PID", kTH2F, {{{axisEta}, {161, -0.5, 160.5}}});
378393
registry.add("NclVsEtaPIDp", ";#eta;#LTNcl#GT used for PID", kTProfile, {axisEta});
@@ -399,6 +414,7 @@ struct PiKpRAA {
399414
x->SetBinLabel(16, "INEL > 0");
400415

401416
if (doprocessCalibrationAndV0s) {
417+
registry.add("T0CcentVsRCTSel", "Bad RCT(=0.5) Good RCT(=1.5) Good RCT & Good PID RCT(=2.5);;RCT Status;", kTH2F, {{{axisCent}, {3, 0, 3}}});
402418
registry.add("NchVsNPV", ";Nch; NPV;", kTH2F, {{{nBinsNPV, minNpv, maxNpv}, {nBinsNch, minNch, maxNch}}});
403419
registry.add("ExcludedEvtVsNch", ";Nch;Entries;", kTH1F, {{nBinsNch, minNch, maxNch}});
404420
registry.add("ExcludedEvtVsNPV", ";NPV;Entries;", kTH1F, {{nBinsNPV, minNpv, maxNpv}});
@@ -578,6 +594,7 @@ struct PiKpRAA {
578594
registry.add("MCclosure_PtPrVsNchMC", "Gen Evts With at least one Rec. Coll. + Sel. criteria 4 MC closure;;Gen. Nch;", kTH2F, {{axisPt, {nBinsNch, minNch, maxNch}}});
579595
}
580596

597+
LOG(info) << "\trequireGoodRct=" << requireGoodRct.value;
581598
LOG(info) << "\tccdbNoLaterThan=" << ccdbNoLaterThan.value;
582599
LOG(info) << "\tapplyNchSel=" << applyNchSel.value;
583600
LOG(info) << "\tselINELgt0=" << selINELgt0.value;
@@ -641,6 +658,7 @@ struct PiKpRAA {
641658
// LOG(info) << " Collisions size: " << collisions.size() << "
642659
// Table's size: " << collisions.tableSize() << "\n";
643660
// LOG(info) << "Run number: " << foundBC.runNumber() << "\n";
661+
644662
if (!isEventSelected(collision)) {
645663
return;
646664
}
@@ -651,6 +669,31 @@ struct PiKpRAA {
651669
const double nPV{collision.multNTracksPVeta1() / 1.};
652670
const float centrality{isT0Ccent ? collision.centFT0C() : collision.centFT0M()};
653671

672+
//---------------------------
673+
// Control histogram
674+
//---------------------------
675+
if (selHasFT0 && !collision.has_foundFT0()) {
676+
registry.fill(HIST("T0CcentVsFoundFT0"), centrality, 0.5);
677+
}
678+
registry.fill(HIST("T0CcentVsFoundFT0"), centrality, 1.5);
679+
680+
// Apply RCT selection?
681+
if (requireGoodRct) {
682+
683+
// Checks if collisions passes RCT selection
684+
if (!rctChecker(*collision)) {
685+
registry.fill(HIST("T0CcentVsRCTSel"), centrality, 0.5);
686+
return;
687+
}
688+
689+
registry.fill(HIST("T0CcentVsRCTSel"), centrality, 1.5);
690+
// Checks if collisions passes good PID RCT status
691+
if (requireGoodPIDRct && collision.rct_bit(kTPCBadPID)) {
692+
return;
693+
}
694+
registry.fill(HIST("T0CcentVsRCTSel"), centrality, 2.5);
695+
}
696+
654697
if (applyNchSel) {
655698
const int nextRunNumber{foundBC.runNumber()};
656699
if (currentRunNumberNchSel != nextRunNumber) {

0 commit comments

Comments
 (0)