From b2f69de625457d222d8c9e2b5faf49f4f90aa4aa Mon Sep 17 00:00:00 2001 From: Omar Vazquez Date: Thu, 20 Nov 2025 10:44:36 -0600 Subject: [PATCH 1/2] Added more distributions --- PWGLF/Tasks/Nuspex/piKpRAA.cxx | 84 ++++++++++++++++++++-------------- 1 file changed, 49 insertions(+), 35 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/piKpRAA.cxx b/PWGLF/Tasks/Nuspex/piKpRAA.cxx index 9e66a4c6b95..c33d1a83318 100644 --- a/PWGLF/Tasks/Nuspex/piKpRAA.cxx +++ b/PWGLF/Tasks/Nuspex/piKpRAA.cxx @@ -217,8 +217,9 @@ struct PiKpRAA { ConfigurableAxis binsPtNcl{"binsPtNcl", {VARIABLE_WIDTH, 0.0, 0.15, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.5, 3.0, 3.5, 4.0, 5.0, 7.0, 9.0, 12.0, 15.0, 20.0, 25.0, 30.0, 35.0, 40.0, 45.0, 50.0}, "pT"}; ConfigurableAxis binsPt{"binsPt", {VARIABLE_WIDTH, 0.0, 0.1, 0.12}, "pT binning"}; ConfigurableAxis binsCent{"binsCent", {VARIABLE_WIDTH, 0., 5., 10., 20., 30., 40., 50., 60., 70., 80., 90., 100.}, "T0C binning"}; - ConfigurableAxis axisEta{"axisEta", {50, -1.0, 1.0}, "Eta axix"}; - ConfigurableAxis axisY{"axisY", {50, -1.0, 1.0}, "rapidity axix"}; + ConfigurableAxis binsZpos{"binsZpos", {60, -30.0, 30.0}, "Z pos axis"}; + ConfigurableAxis axisEta{"axisEta", {50, -1.0, 1.0}, "Eta axis"}; + ConfigurableAxis axisY{"axisY", {50, -1.0, 1.0}, "rapidity axis"}; ConfigurableAxis axisArmAlpha{"axisArmAlpha", {200, -1.0, 1.0}, "Armenteros alpha"}; ConfigurableAxis axisArmqT{"axisArmqT", {600, 0.0f, 0.3f}, "Armenteros qT"}; ConfigurableAxis axisK0Mass{"axisK0Mass", {200, 0.4f, 0.6f}, "Mass K0Short"}; @@ -345,7 +346,7 @@ struct PiKpRAA { // define axes you want to use const std::string titlePorPt{v0Selections.usePinPhiSelection ? "#it{p} (GeV/#it{c})" : "#it{p}_{T} (GeV/#it{c})"}; - const AxisSpec axisZpos{80, -20., 20., "Vtx_{z} (cm)"}; + const AxisSpec axisZpos{binsZpos, "Vtx_{z} (cm)"}; const AxisSpec axisEvent{15, 0.5, 15.5, ""}; const AxisSpec axisNcl{161, -0.5, 160.5, "#it{N}_{cl} TPC"}; const AxisSpec axisPt{binsPt, "#it{p}_{T} (GeV/#it{c})"}; @@ -353,13 +354,11 @@ struct PiKpRAA { const AxisSpec axisPtNcl{binsPtNcl, Form("%s", titlePorPt.data())}; const AxisSpec axisXPhiCut{binsPtPhiCut, Form("%s", titlePorPt.data())}; const AxisSpec axisCent{binsCent, "Centrality Perc."}; - // const char* endingEta[kNEtaHists] = {"02", "24", "46", "68"}; - // const char* latexEta[kNEtaHists] = {"0<|#eta|<0.2", "0.2<#eta<0.4", "0.4<#eta<0.6", "0.6<#eta<0.8"}; const char* endingEta[kNEtaHists] = {"86", "64", "42", "20", "02", "24", "46", "68"}; const char* latexEta[kNEtaHists] = {"-0.8<#eta<-0.6", "-0.6<#eta<-0.4", "-0.4<#eta<-0.2", "-0.2<#eta<0", "0<#eta<0.2", "0.2<#eta<0.4", "0.4<#eta<0.6", "0.6<#eta<0.8"}; registry.add("EventCounter", ";;Events", kTH1F, {axisEvent}); - registry.add("zPos", ";;Entries;", kTH1F, {axisZpos}); + registry.add("zPos", "With Event Selection;;Entries;", kTH1F, {axisZpos}); registry.add("T0Ccent", ";;Entries", kTH1F, {axisCent}); 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}); @@ -491,7 +490,7 @@ struct PiKpRAA { } if (doprocessMC || doprocessSim) { - registry.add("zPosMC", ";Gen. Coll. With at least One Ass. Rec. Coll.;Entries;", kTH1F, {axisZpos}); + registry.add("zPosMC", "Generated Events With at least One Rec. Collision + Sel. criteria;;Entries;", kTH1F, {axisZpos}); registry.add("dcaVsPtPiDec", "Secondary pions from decays;#it{p}_{T} (GeV/#it{c});DCA_{xy} (cm);Centrality Perc.;", kTH3F, {axisPt, axisDCAxy, axisCent}); registry.add("dcaVsPtPrDec", "Secondary protons from decays;#it{p}_{T} (GeV/#it{c});DCA_{xy} (cm);Centrality Perc.;", kTH3F, {axisPt, axisDCAxy, axisCent}); registry.add("dcaVsPtPiMat", "Secondary pions from material interactions;#it{p}_{T} (GeV/#it{c});DCA_{xy} (cm);Centrality Perc.;", kTH3F, {axisPt, axisDCAxy, axisCent}); @@ -513,8 +512,12 @@ struct PiKpRAA { } if (doprocessSim) { + registry.add("NumberOfRecoCollisions", "Number of times Gen. Coll.are reconstructed;N;Entries", kTH1F, {{10, -0.5, 9.5}}); + // Pt resolution + registry.add("PtResolution", "p_{T} resolution;;(pt_{rec} - pt_{gen})/pt_{gen};", kTH2F, {axisPt, {100, -1.0, 1.0}}); + // Needed to calculate the numerator of the Acceptance X Efficiency registry.add("PtPiVsCent_WithRecoEvt", "Generated Events With at least One Rec. Collision + Sel. criteria;;;", kTH2F, {axisPt, axisCent}); registry.add("PtKaVsCent_WithRecoEvt", "Generated Events With at least One Rec. Collision + Sel. criteria;;;", kTH2F, {axisPt, axisCent}); @@ -533,7 +536,8 @@ struct PiKpRAA { registry.add("NchMC_AllGen", "Generated Nch of All Gen. Evts.;Gen. Nch;Entries", kTH1F, {{nBinsNch, minNch, maxNch}}); // Needed to measure Event Splitting - registry.add("Centrality_WithRecoEvt", "Generated Events With at least One Rec. Collision + Sel. criteria;;Entries", kTH1F, {axisCent}); + registry.add("Centrality_WRecoEvt", "Generated Events With at least One Rec. Collision And NO Sel. criteria;;Entries", kTH1F, {axisCent}); + registry.add("Centrality_WRecoEvtWSelCri", "Generated Events With at least One Rec. Collision + Sel. criteria;;Entries", kTH1F, {axisCent}); registry.add("Centrality_AllRecoEvt", "Generated Events Irrespective of the number of times it was reconstructed + Evt. Selections;;Entries", kTH1F, {axisCent}); // Needed to calculate the numerator of the Signal Loss correction @@ -1438,9 +1442,9 @@ struct PiKpRAA { nChMC++; } - registry.fill(HIST("zPosMC"), mccollision.posZ()); - const float centrality{isT0Ccent ? collision.centFT0C() : collision.centFT0M()}; + registry.fill(HIST("Centrality_WRecoEvt"), centrality); + registry.fill(HIST("zPosMC"), mccollision.posZ()); //--------------------------- // All Generated events with at least one associated reconstructed collision @@ -1456,10 +1460,11 @@ struct PiKpRAA { auto charge{0.}; // Get the MC particle auto* pdgParticle = pdg->GetParticle(particle.pdgCode()); - if (pdgParticle != nullptr) + if (pdgParticle != nullptr) { charge = pdgParticle->Charge(); - else + } else { continue; + } // Is it a charged particle? if (std::abs(charge) < kMinCharge) @@ -1495,7 +1500,7 @@ struct PiKpRAA { continue; } - registry.fill(HIST("Centrality_WithRecoEvt"), centrality); + registry.fill(HIST("Centrality_WRecoEvtWSelCri"), centrality); registry.fill(HIST("NchMCVsCent"), centrality, nChMC); registry.fill(HIST("NchMC_WithRecoEvt"), nChMC); registry.fill(HIST("T0Ccent"), centrality); @@ -1522,10 +1527,11 @@ struct PiKpRAA { const auto& particle{track.mcParticle()}; auto charge{0.}; auto* pdgParticle = pdg->GetParticle(particle.pdgCode()); - if (pdgParticle != nullptr) + if (pdgParticle != nullptr) { charge = pdgParticle->Charge(); - else + } else { continue; + } // Is it a charged particle? if (std::abs(charge) < kMinCharge) @@ -1549,21 +1555,23 @@ struct PiKpRAA { bool isPrimary{false}; bool isDecay{false}; bool isMaterial{false}; - if (particle.isPhysicalPrimary()) + if (particle.isPhysicalPrimary()) { isPrimary = true; - else if (particle.getProcess() == TMCProcess::kPDecay) + } else if (particle.getProcess() == TMCProcess::kPDecay) { isDecay = true; - else + } else { isMaterial = true; + } bool isPi{false}; bool isPr{false}; - if (particle.pdgCode() == PDG_t::kPiPlus || particle.pdgCode() == PDG_t::kPiMinus) + if (particle.pdgCode() == PDG_t::kPiPlus || particle.pdgCode() == PDG_t::kPiMinus) { isPi = true; - else if (particle.pdgCode() == PDG_t::kProton || particle.pdgCode() == PDG_t::kProtonBar) + } else if (particle.pdgCode() == PDG_t::kProton || particle.pdgCode() == PDG_t::kProtonBar) { isPr = true; - else + } else { continue; + } if (isPrimary && !isDecay && !isMaterial) { if (isPi && !isPr) @@ -1607,10 +1615,11 @@ struct PiKpRAA { const auto& particle{track.mcParticle()}; auto charge{0.}; auto* pdgParticle = pdg->GetParticle(particle.pdgCode()); - if (pdgParticle != nullptr) + if (pdgParticle != nullptr) { charge = pdgParticle->Charge(); - else + } else { continue; + } // Is it a charged particle? if (std::abs(charge) < kMinCharge) @@ -1658,14 +1667,15 @@ struct PiKpRAA { bool isKa{false}; bool isPr{false}; - if (particle.pdgCode() == PDG_t::kPiPlus || particle.pdgCode() == PDG_t::kPiMinus) + if (particle.pdgCode() == PDG_t::kPiPlus || particle.pdgCode() == PDG_t::kPiMinus) { isPi = true; - else if (particle.pdgCode() == PDG_t::kKPlus || particle.pdgCode() == PDG_t::kKMinus) + } else if (particle.pdgCode() == PDG_t::kKPlus || particle.pdgCode() == PDG_t::kKMinus) { isKa = true; - else if (particle.pdgCode() == PDG_t::kProton || particle.pdgCode() == PDG_t::kProtonBar) + } else if (particle.pdgCode() == PDG_t::kProton || particle.pdgCode() == PDG_t::kProtonBar) { isPr = true; - else + } else { continue; + } if (isPi && !isKa && !isPr) registry.fill(HIST("PtPiVsCent_WithRecoEvt"), track.pt(), centrality); @@ -1674,6 +1684,7 @@ struct PiKpRAA { if (isPr && !isPi && !isKa) registry.fill(HIST("PtPrVsCent_WithRecoEvt"), track.pt(), centrality); + registry.fill(HIST("PtResolution"), particle.pt(), (track.pt() - particle.pt()) / particle.pt()); } // Loop over reconstructed tracks } // Loop over Reco. Collisions: These collisions are not required to pass the event selection } // If condition: Only simulated evets with at least one reconstrued collision @@ -1695,10 +1706,11 @@ struct PiKpRAA { auto charge{0.}; // Get the MC particle auto* pdgParticle = pdg->GetParticle(particle.pdgCode()); - if (pdgParticle != nullptr) + if (pdgParticle != nullptr) { charge = pdgParticle->Charge(); - else + } else { continue; + } // Is it a charged particle? if (std::abs(charge) < kMinCharge) @@ -1721,10 +1733,11 @@ struct PiKpRAA { auto charge{0.}; // Get the MC particle auto* pdgParticle = pdg->GetParticle(particle.pdgCode()); - if (pdgParticle != nullptr) + if (pdgParticle != nullptr) { charge = pdgParticle->Charge(); - else + } else { continue; + } // Is it a charged particle? if (std::abs(charge) < kMinCharge) @@ -1736,14 +1749,15 @@ struct PiKpRAA { isPrimary = false; if (isPrimary) { - if (particle.pdgCode() == PDG_t::kPiPlus || particle.pdgCode() == PDG_t::kPiMinus) // pion + if (particle.pdgCode() == PDG_t::kPiPlus || particle.pdgCode() == PDG_t::kPiMinus) { registry.fill(HIST("PtPiVsNchMC_AllGen"), particle.pt(), nChMC); - else if (particle.pdgCode() == PDG_t::kKPlus || particle.pdgCode() == PDG_t::kKMinus) // kaon + } else if (particle.pdgCode() == PDG_t::kKPlus || particle.pdgCode() == PDG_t::kKMinus) { registry.fill(HIST("PtKaVsNchMC_AllGen"), particle.pt(), nChMC); - else if (particle.pdgCode() == PDG_t::kProton || particle.pdgCode() == PDG_t::kProtonBar) // proton + } else if (particle.pdgCode() == PDG_t::kProton || particle.pdgCode() == PDG_t::kProtonBar) { registry.fill(HIST("PtPrVsNchMC_AllGen"), particle.pt(), nChMC); - else + } else { continue; + } } } // Loop over Generated Particles registry.fill(HIST("NchMC_AllGen"), nChMC); From 50af68bdbc586c72333d1465edaf0c4e8142a695 Mon Sep 17 00:00:00 2001 From: Omar Vazquez Date: Thu, 20 Nov 2025 13:58:48 -0600 Subject: [PATCH 2/2] Added more distributions --- PWGLF/Tasks/Nuspex/piKpRAA.cxx | 60 ++++++++++++++++++++++++++++++---- 1 file changed, 53 insertions(+), 7 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/piKpRAA.cxx b/PWGLF/Tasks/Nuspex/piKpRAA.cxx index c33d1a83318..0e412acf028 100644 --- a/PWGLF/Tasks/Nuspex/piKpRAA.cxx +++ b/PWGLF/Tasks/Nuspex/piKpRAA.cxx @@ -69,7 +69,7 @@ using namespace o2::framework::expressions; using ColEvSels = soa::Join; using BCsRun3 = soa::Join; -using ColEvSelsMC = soa::Join; +using ColEvSelsMC = soa::Join; using TracksFull = soa::Join; @@ -198,7 +198,7 @@ struct PiKpRAA { Configurable isCentSel{"isCentSel", true, "Centrality selection?"}; Configurable isT0Ccent{"isT0Ccent", true, "Use T0C-based centrality?"}; Configurable isZvtxPosSel{"isZvtxPosSel", true, "Zvtx position selection?"}; - + Configurable isINELgt0{"isINELgt0", true, "Apply INEL > 0?"}; Configurable isApplyFT0CbasedOccupancy{"isApplyFT0CbasedOccupancy", false, "T0C Occu cut"}; Configurable applyNchSel{"applyNchSel", false, "Use mid-rapidity-based Nch selection"}; Configurable skipRecoColGTOne{"skipRecoColGTOne", true, "Remove collisions if reconstructed more than once"}; @@ -258,7 +258,8 @@ struct PiKpRAA { OccuCut, Centrality, VtxZ, - NchSel + NchSel, + INELgt0 }; enum TrkSelLabel { @@ -347,7 +348,7 @@ struct PiKpRAA { // define axes you want to use const std::string titlePorPt{v0Selections.usePinPhiSelection ? "#it{p} (GeV/#it{c})" : "#it{p}_{T} (GeV/#it{c})"}; const AxisSpec axisZpos{binsZpos, "Vtx_{z} (cm)"}; - const AxisSpec axisEvent{15, 0.5, 15.5, ""}; + const AxisSpec axisEvent{17, 0.5, 17.5, ""}; const AxisSpec axisNcl{161, -0.5, 160.5, "#it{N}_{cl} TPC"}; const AxisSpec axisPt{binsPt, "#it{p}_{T} (GeV/#it{c})"}; const AxisSpec axisPtV0s{binsPtV0s, "#it{p}_{T} (GeV/#it{c})"}; @@ -381,6 +382,7 @@ struct PiKpRAA { x->SetBinLabel(12, "Cent. Sel."); x->SetBinLabel(13, "VtxZ Sel."); x->SetBinLabel(14, "Nch Sel."); + x->SetBinLabel(15, "INEL > 0"); if (doprocessCalibrationAndV0s) { registry.add("NchVsNPV", ";Nch; NPV;", kTH2F, {{{nBinsNPV, minNpv, maxNpv}, {nBinsNch, minNch, maxNch}}}); @@ -553,6 +555,7 @@ struct PiKpRAA { LOG(info) << "\tccdbNoLaterThan=" << ccdbNoLaterThan.value; LOG(info) << "\tapplyNchSel=" << applyNchSel.value; + LOG(info) << "\tisINELgt0=" << isINELgt0.value; LOG(info) << "\tdetector4Calibration=" << detector4Calibration.value; LOG(info) << "\tv0TypeSelection=" << static_cast(v0Selections.v0TypeSelection); LOG(info) << "\tselElecFromGammas=" << v0Selections.selElecFromGammas; @@ -1366,6 +1369,41 @@ struct PiKpRAA { void processSim(aod::McCollisions::iterator const& mccollision, soa::SmallGroups const& collisions, BCsRun3 const& /*bcs*/, aod::FT0s const& /*ft0s*/, aod::McParticles const& mcParticles, TracksMC const& tracksMC) { + // Only INEL > 0 generated collisions + // By counting number of primary charged particles in |eta| < 1 + if (isINELgt0) { + int nChMC{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()); + if (pdgParticle != nullptr) { + charge = pdgParticle->Charge(); + } else { + continue; + } + + // Is it a charged particle? + if (std::abs(charge) < kMinCharge) + continue; + + // Is it a primary particle? + if (!particle.isPhysicalPrimary()) + continue; + + nChMC++; + } + + // Only INEL > 0 generated events + if (!(nChMC > kZeroInt)) { + return; + } + } + const auto& nRecColls{collisions.size()}; registry.fill(HIST("NumberOfRecoCollisions"), nRecColls); @@ -1425,11 +1463,12 @@ struct PiKpRAA { auto charge{0.}; // Get the MC particle - auto* pdgParticle = pdg->GetParticle(particle.pdgCode()); - if (pdgParticle != nullptr) + const auto* pdgParticle = pdg->GetParticle(particle.pdgCode()); + if (pdgParticle != nullptr) { charge = pdgParticle->Charge(); - else + } else { continue; + } // Is it a charged particle? if (std::abs(charge) < kMinCharge) @@ -2141,6 +2180,13 @@ struct PiKpRAA { registry.fill(HIST("EventCounter"), EvCutLabel::VtxZ); } + if (isINELgt0) { + if (!col.isInelGt0()) { + return false; + } + registry.fill(HIST("EventCounter"), EvCutLabel::INELgt0); + } + return true; }