From 4042932332285b0159c51abfbdbec6ef280f9b2c Mon Sep 17 00:00:00 2001 From: Omar Vazquez Date: Sat, 13 Dec 2025 09:42:05 -0600 Subject: [PATCH 1/3] TVX-like selection in MC --- PWGLF/Tasks/Nuspex/piKpRAA.cxx | 39 +++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/piKpRAA.cxx b/PWGLF/Tasks/Nuspex/piKpRAA.cxx index 95eaa7b8948..b6328ecc744 100644 --- a/PWGLF/Tasks/Nuspex/piKpRAA.cxx +++ b/PWGLF/Tasks/Nuspex/piKpRAA.cxx @@ -121,6 +121,10 @@ struct PiKpRAA { static constexpr float kMaxdEdxMIP{60.0f}; static constexpr float kMindEdxMIPPlateau{70.0f}; static constexpr float kMaxdEdxMIPPlateau{90.0f}; + static constexpr float kMinFT0A{3.5f}; + static constexpr float kMaxFT0A{4.9f}; + static constexpr float kMinFT0C{-3.3f}; + static constexpr float kMaxFT0C{-2.1f}; static constexpr float kLowEta[kNEtaHists] = {-0.8, -0.6, -0.4, -0.2, 0.0, 0.2, 0.4, 0.6}; static constexpr float kHighEta[kNEtaHists] = {-0.6, -0.4, -0.2, 0.0, 0.2, 0.4, 0.6, 0.8}; @@ -203,6 +207,7 @@ struct PiKpRAA { Configurable isT0Ccent{"isT0Ccent", true, "Use T0C-based centrality?"}; Configurable isZvtxPosSel{"isZvtxPosSel", true, "Zvtx position selection?"}; Configurable isZvtxPosSelMC{"isZvtxPosSelMC", true, "Zvtx position selection for MC events?"}; + Configurable selTVXMC{"selTVXMC", true, "apply TVX selection in MC?"}; Configurable selINELgt0{"selINELgt0", true, "Select INEL > 0?"}; Configurable isApplyFT0CbasedOccupancy{"isApplyFT0CbasedOccupancy", false, "T0C Occu cut"}; Configurable applyNchSel{"applyNchSel", false, "Use mid-rapidity-based Nch selection"}; @@ -523,6 +528,9 @@ struct PiKpRAA { if (doprocessSim) { + // MC events passing the TVX requirement + registry.add("NchMCcentVsTVX", ";Passed(=1.5) NOT Passed(=0.5);", kTH2F, {{{nBinsNch, minNch, maxNch}, {2, 0, 2}}}); + registry.add("NumberOfRecoCollisions", "Number of times Gen. Coll.are reconstructed;N;Entries", kTH1F, {{10, -0.5, 9.5}}); // Pt resolution @@ -1390,11 +1398,10 @@ struct PiKpRAA { // By counting number of primary charged particles in |eta| < 1 //--------------------------- int nChMC{0}; + int nChFT0A{0}; + int nChFT0C{0}; for (const auto& particle : mcParticles) { - if (std::abs(particle.eta()) > kOne) - continue; - auto charge{0.}; // Get the MC particle const auto* pdgParticle = pdg->GetParticle(particle.pdgCode()); @@ -1412,9 +1419,35 @@ struct PiKpRAA { if (!particle.isPhysicalPrimary()) continue; + const float eta{particle.eta()}; + + // TVX requirement + if (eta > kMinFT0A && eta < kMaxFT0A) { + nChFT0A++; + } + + if (eta > kMinFT0C && eta < kMaxFT0C) { + nChFT0C++; + } + + // INEL > 0 + if (std::abs(eta) > kOne) + continue; + nChMC++; } + //--------------------------- + // Only events with at least one charged particle in the FT0A and FT0C acceptances + //--------------------------- + if (selTVXMC) { + if (!(nChFT0A > kZeroInt && nChFT0C > kZeroInt)) { + registry.fill(HIST("NchMCcentVsTVX"), nChMC, 0.5); + return; + } + registry.fill(HIST("NchMCcentVsTVX"), nChMC, 1.5); + } + //--------------------------- // Only MC events with |Vtx Z| < 10 cm //--------------------------- From 3732651e469f2aed2eb0a061e5bb7d4c5663b44d Mon Sep 17 00:00:00 2001 From: Omar Vazquez Date: Mon, 9 Feb 2026 15:23:12 -0600 Subject: [PATCH 2/3] Adds RCT checker --- PWGLF/Tasks/Nuspex/piKpRAA.cxx | 43 ++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/PWGLF/Tasks/Nuspex/piKpRAA.cxx b/PWGLF/Tasks/Nuspex/piKpRAA.cxx index b6328ecc744..093bfc2d0ad 100644 --- a/PWGLF/Tasks/Nuspex/piKpRAA.cxx +++ b/PWGLF/Tasks/Nuspex/piKpRAA.cxx @@ -66,6 +66,7 @@ using namespace o2::framework; using namespace o2::aod::evsel; using namespace o2::constants::math; using namespace o2::framework::expressions; +using namespace o2::aod::rctsel; using ColEvSels = soa::Join; using BCsRun3 = soa::Join; @@ -252,6 +253,14 @@ struct PiKpRAA { Configurable pathPhiCutHigh{"pathPhiCutHigh", "Users/o/omvazque/PhiCut/OO/Global/High", "base path to the ccdb object"}; Configurable pathPhiCutLow{"pathPhiCutLow", "Users/o/omvazque/PhiCut/OO/Global/Low", "base path to the ccdb object"}; Configurable ccdbNoLaterThan{"ccdbNoLaterThan", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; + Configurable rctLabel{"rctLabel", "CBT_hadronPID", "RCT selection flag (CBT, CBT_hadronPID, CBT_electronPID, CBT_calo, CBT_muon, CBT_muon_glo)"}; + Configurable rctCheckZDC{"rctCheckZDC", false, "RCT flag to check whether the ZDC is present or not"}; + Configurable rctTreatLimitedAcceptanceAsBad{"rctTreatLimitedAcceptanceAsBad", false, "RCT flag to reject events with limited acceptance for selected detectors"}; + Configurable requireGoodRct{"requireGoodRct", true, "RCT flag to reject events with limited acceptance for selected detectors"}; + Configurable requireGoodPIDRct{"requireGoodPIDRct", true, "RCT flag to reject events with limited acceptance for selected detectors"}; + + // RCT Checker instance + RCTFlagsChecker rctChecker; enum EvCutLabel { All = 1, @@ -349,6 +358,12 @@ struct PiKpRAA { int currentRunNumberPhiSel; void init(InitContext const&) { + + // Initialize the rct checker + if (requireGoodRct) { + rctChecker.init(rctLabel.value, rctCheckZDC.value, rctTreatLimitedAcceptanceAsBad.value); + } + currentRunNumberNchSel = -1; currentRunNumberPhiSel = -1; trkSelGlobalOpenDCAxy = trkSelOpenDCAxy(); @@ -372,6 +387,7 @@ struct PiKpRAA { registry.add("zPos", "With Event Selection;;Entries;", kTH1F, {axisZpos}); registry.add("T0Ccent", ";;Entries", kTH1F, {axisCent}); registry.add("T0CcentVsFoundFT0", ";Found(=1.5) NOT Found(=0.5);", kTH2F, {{{axisCent}, {2, 0, 2}}}); + 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}}}); registry.add("NchVsCent", "Measured Nch v.s. Centrality (At least Once Rec. Coll. + Sel. criteria);;Nch", kTH2F, {{axisCent, {nBinsNch, minNch, maxNch}}}); registry.add("NclVsEtaPID", ";#eta;Ncl used for PID", kTH2F, {{{axisEta}, {161, -0.5, 160.5}}}); registry.add("NclVsEtaPIDp", ";#eta;#LTNcl#GT used for PID", kTProfile, {axisEta}); @@ -577,6 +593,7 @@ struct PiKpRAA { registry.add("MCclosure_PtPrVsNchMC", "Gen Evts With at least one Rec. Coll. + Sel. criteria 4 MC closure;;Gen. Nch;", kTH2F, {{axisPt, {nBinsNch, minNch, maxNch}}}); } + LOG(info) << "\trequireGoodRct=" << requireGoodRct.value; LOG(info) << "\tccdbNoLaterThan=" << ccdbNoLaterThan.value; LOG(info) << "\tapplyNchSel=" << applyNchSel.value; LOG(info) << "\tselINELgt0=" << selINELgt0.value; @@ -640,6 +657,7 @@ struct PiKpRAA { // LOG(info) << " Collisions size: " << collisions.size() << " // Table's size: " << collisions.tableSize() << "\n"; // LOG(info) << "Run number: " << foundBC.runNumber() << "\n"; + if (!isEventSelected(collision)) { return; } @@ -650,6 +668,31 @@ struct PiKpRAA { const double nPV{collision.multNTracksPVeta1() / 1.}; const float centrality{isT0Ccent ? collision.centFT0C() : collision.centFT0M()}; + //--------------------------- + // Control histogram + //--------------------------- + if (selHasFT0 && !collision.has_foundFT0()) { + registry.fill(HIST("T0CcentVsFoundFT0"), centrality, 0.5); + } + registry.fill(HIST("T0CcentVsFoundFT0"), centrality, 1.5); + + // Apply RCT selection? + if (requireGoodRct) { + + // Checks if collisions passes RCT selection + if (!rctChecker(*collision)) { + registry.fill(HIST("T0CcentVsRCTSel"), centrality, 0.5); + return; + } + + registry.fill(HIST("T0CcentVsRCTSel"), centrality, 1.5); + // Checks if collisions passes good PID RCT status + if (requireGoodPIDRct && collision.rct_bit(kTPCBadPID)) { + return; + } + registry.fill(HIST("T0CcentVsRCTSel"), centrality, 2.5); + } + if (applyNchSel) { const int nextRunNumber{foundBC.runNumber()}; if (currentRunNumberNchSel != nextRunNumber) { From a7b466b658650ef6af0ad77ec232e41beec33c91 Mon Sep 17 00:00:00 2001 From: Omar Vazquez Date: Mon, 9 Feb 2026 15:49:50 -0600 Subject: [PATCH 3/3] Adds RCT-base selection --- PWGLF/Tasks/Nuspex/piKpRAA.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/piKpRAA.cxx b/PWGLF/Tasks/Nuspex/piKpRAA.cxx index 093bfc2d0ad..8f38e08509d 100644 --- a/PWGLF/Tasks/Nuspex/piKpRAA.cxx +++ b/PWGLF/Tasks/Nuspex/piKpRAA.cxx @@ -386,8 +386,7 @@ struct PiKpRAA { registry.add("EventCounter", ";;Events", kTH1F, {axisEvent}); registry.add("zPos", "With Event Selection;;Entries;", kTH1F, {axisZpos}); registry.add("T0Ccent", ";;Entries", kTH1F, {axisCent}); - registry.add("T0CcentVsFoundFT0", ";Found(=1.5) NOT Found(=0.5);", kTH2F, {{{axisCent}, {2, 0, 2}}}); - 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}}}); + registry.add("T0CcentVsFoundFT0", "Found(=1.5) NOT Found(=0.5);;Status;", kTH2F, {{{axisCent}, {2, 0, 2}}}); registry.add("NchVsCent", "Measured Nch v.s. Centrality (At least Once Rec. Coll. + Sel. criteria);;Nch", kTH2F, {{axisCent, {nBinsNch, minNch, maxNch}}}); registry.add("NclVsEtaPID", ";#eta;Ncl used for PID", kTH2F, {{{axisEta}, {161, -0.5, 160.5}}}); registry.add("NclVsEtaPIDp", ";#eta;#LTNcl#GT used for PID", kTProfile, {axisEta}); @@ -414,6 +413,7 @@ struct PiKpRAA { x->SetBinLabel(16, "INEL > 0"); if (doprocessCalibrationAndV0s) { + 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}}}); registry.add("NchVsNPV", ";Nch; NPV;", kTH2F, {{{nBinsNPV, minNpv, maxNpv}, {nBinsNch, minNch, maxNch}}}); registry.add("ExcludedEvtVsNch", ";Nch;Entries;", kTH1F, {{nBinsNch, minNch, maxNch}}); registry.add("ExcludedEvtVsNPV", ";NPV;Entries;", kTH1F, {{nBinsNPV, minNpv, maxNpv}});