From a586772bf67be2cab0772b89df33aeebfa6d7b5f Mon Sep 17 00:00:00 2001 From: Alberto Caliva Date: Thu, 18 Jun 2026 16:23:16 +0200 Subject: [PATCH 1/2] Add centrality selection and histos for re-weighting --- .../Nuspex/coalescenceTreeProducer.cxx | 51 ++++++++++++++++--- 1 file changed, 45 insertions(+), 6 deletions(-) diff --git a/PWGLF/TableProducer/Nuspex/coalescenceTreeProducer.cxx b/PWGLF/TableProducer/Nuspex/coalescenceTreeProducer.cxx index f196e0ed8ff..ebc8746d1ff 100644 --- a/PWGLF/TableProducer/Nuspex/coalescenceTreeProducer.cxx +++ b/PWGLF/TableProducer/Nuspex/coalescenceTreeProducer.cxx @@ -27,6 +27,7 @@ /// /// \author Alberto CalivĂ  +#include #include #include #include @@ -39,6 +40,7 @@ #include #include #include +#include #include #include // IWYU pragma: keep (do not replace with Math/Vector3Dfwd.h) @@ -65,6 +67,8 @@ using namespace o2::constants::math; constexpr double massHypertriton = 2.99116; +using GenCollisionsMc = soa::Join; + // Lightweight particle container struct ReducedParticle { int64_t idPart = 0; @@ -85,6 +89,8 @@ struct CoalescenceTreeProducer { // Configurable analysis parameters Configurable zVtxMax{"zVtxMax", 10.f, "Maximum |z vertex| in cm"}; + Configurable multMin{"multMin", 0.f, "Lower edge of the multiplicity/centrality interval (%)"}; + Configurable multMax{"multMax", 90.f, "Upper edge of the multiplicity/centrality interval (%)"}; Configurable etaMax{"etaMax", 1.5f, "Maximum |eta| for generated particles"}; Configurable pRhoMax{"pRhoMax", 0.5f, "Maximum Jacobi p_rho in GeV/c"}; Configurable pLambdaMax{"pLambdaMax", 0.5f, "Maximum Jacobi p_lambda in GeV/c"}; @@ -112,8 +118,17 @@ struct CoalescenceTreeProducer { registry.add("eventCounter", "event Counter", HistType::kTH1F, {{5, 0, 5, "counter"}}); registry.get(HIST("eventCounter"))->GetXaxis()->SetBinLabel(1, "Before z-vertex cut"); registry.get(HIST("eventCounter"))->GetXaxis()->SetBinLabel(2, "After z-vertex cut"); - registry.get(HIST("eventCounter"))->GetXaxis()->SetBinLabel(3, "After non-empty constituent lists"); - registry.get(HIST("eventCounter"))->GetXaxis()->SetBinLabel(4, "After non-empty candidate lists"); + registry.get(HIST("eventCounter"))->GetXaxis()->SetBinLabel(3, "After multiplicity selection"); + registry.get(HIST("eventCounter"))->GetXaxis()->SetBinLabel(4, "After non-empty constituent lists"); + registry.get(HIST("eventCounter"))->GetXaxis()->SetBinLabel(5, "After non-empty candidate lists"); + + // Multiplicity distribution + registry.add("multDistribution", "multiplicity distribution", HistType::kTH1F, {{200, 0, 100, "Multiplicity (%)"}}); + + // pt distributions of constituents (to be used for re-weighting) + registry.add("ptProtons", "ptProtons", HistType::kTH1F, {{200, 0, 10, "p_{T} (GeV/c)"}}); + registry.add("ptNeutrons", "ptNeutrons", HistType::kTH1F, {{200, 0, 10, "p_{T} (GeV/c)"}}); + registry.add("ptLambdas", "ptLambdas", HistType::kTH1F, {{200, 0, 10, "p_{T} (GeV/c)"}}); // Output tree for bound-state candidates treeBoundState.setObject(new TTree("BoundStateTree", "Tree for coalescence")); @@ -231,7 +246,7 @@ struct CoalescenceTreeProducer { Preslice mcParticlesPerMcCollision = o2::aod::mcparticle::mcCollisionId; // Process Hypertriton - void processHypertriton(aod::McCollisions const& collisions, aod::McParticles const& mcParticles) + void processHypertriton(GenCollisionsMc const& collisions, aod::McParticles const& mcParticles) { // Loop over MC collisions for (const auto& collision : collisions) { @@ -246,7 +261,16 @@ struct CoalescenceTreeProducer { // Event counter after z-vertex cut registry.fill(HIST("eventCounter"), 1.5); - // To be implemented: maybe add INEL>0 selection + // Multiplicity Distribution + const float multiplicityPerc = collision.centFT0M(); + registry.fill(HIST("multDistribution"), multiplicityPerc); + + // Multiplicity selection + if (multiplicityPerc < multMin || multiplicityPerc > multMax) + continue; + + // Event counter multiplicity selection + registry.fill(HIST("eventCounter"), 2.5); // Get particles in this MC collision const auto mcParticlesThisMcColl = mcParticles.sliceBy(mcParticlesPerMcCollision, collision.globalIndex()); @@ -284,6 +308,21 @@ struct CoalescenceTreeProducer { if (std::abs(particle.pdgCode()) == PDG_t::kLambda0) { lambdas.push_back({particle.globalIndex(), particle.pdgCode(), particle.vx(), particle.vy(), particle.vz(), particle.vt(), particle.px(), particle.py(), particle.pz()}); } + + // Rapidity selection + if (std::abs(particle.y()) > yMax) + continue; + + // Pt distributions of constituents + if (std::abs(particle.pdgCode()) == PDG_t::kProton) { + registry.fill(HIST("ptProtons"), particle.pt()); + } + if (std::abs(particle.pdgCode()) == PDG_t::kNeutron) { + registry.fill(HIST("ptNeutrons"), particle.pt()); + } + if (std::abs(particle.pdgCode()) == PDG_t::kLambda0) { + registry.fill(HIST("ptLambdas"), particle.pt()); + } } // end of loop over MC particles // Reject events that do not contain at least one proton, one neutron, and one lambda @@ -291,7 +330,7 @@ struct CoalescenceTreeProducer { continue; // Event counter: events containing all three constituent species - registry.fill(HIST("eventCounter"), 2.5); + registry.fill(HIST("eventCounter"), 3.5); // Count matter and antimatter candidates in the event Long64_t nCandidatesMatter(0); @@ -321,7 +360,7 @@ struct CoalescenceTreeProducer { continue; // Event counter: number of events with at least one candidate - registry.fill(HIST("eventCounter"), 3.5); + registry.fill(HIST("eventCounter"), 4.5); // Store number of candidates per event nMatterCandidatesPerEvent = nCandidatesMatter; From 391891d62f1c835d8771c9ab73b688e9628b943b Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Thu, 18 Jun 2026 14:24:47 +0000 Subject: [PATCH 2/2] Please consider the following formatting changes --- PWGLF/TableProducer/Nuspex/coalescenceTreeProducer.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PWGLF/TableProducer/Nuspex/coalescenceTreeProducer.cxx b/PWGLF/TableProducer/Nuspex/coalescenceTreeProducer.cxx index ebc8746d1ff..999b52ab6aa 100644 --- a/PWGLF/TableProducer/Nuspex/coalescenceTreeProducer.cxx +++ b/PWGLF/TableProducer/Nuspex/coalescenceTreeProducer.cxx @@ -27,7 +27,10 @@ /// /// \author Alberto CalivĂ  -#include +#include "PWGLF/DataModel/mcCentrality.h" + +#include "Common/DataModel/Centrality.h" + #include #include #include @@ -40,7 +43,6 @@ #include #include #include -#include #include #include // IWYU pragma: keep (do not replace with Math/Vector3Dfwd.h)