From 875b8f70673a2b8b59cc1df41a8bd3c7a27651ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Mon, 30 Nov 2026 11:02:51 +0100 Subject: [PATCH 1/6] Unify coalesced particles and add monitoring Update hadronnucleicorrelation.cxx Update histogram filling for proton and deuteron particles Update particle processing functions to include histogram option --- .../Tasks/Nuspex/hadronnucleicorrelation.cxx | 567 ++++++++++-------- 1 file changed, 316 insertions(+), 251 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx b/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx index 71d3dcd51ce..e74e8a33400 100644 --- a/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx +++ b/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx @@ -563,6 +563,20 @@ struct HadronNucleiCorrelation { registry.add("Generated/hAntiDeuteronsVsPt", "hAntiDeuteronsVsPt", {HistType::kTH1D, {ptAxisGen}}); registry.add("Generated/hProtonsVsPt", "hProtonsVsPt", {HistType::kTH1D, {ptAxisGen}}); registry.add("Generated/hAntiProtonsVsPt", "hAntiProtonsVsPt", {HistType::kTH1D, {ptAxisGen}}); + + if (settingsCoalescence.doMCGenCoalescence.value) { + // Original generated particles before coalescence + registry.add("Generated/Coal/hOriginalDeuteronsVsPt", "hOriginalDeuteronsVsPt", {HistType::kTH1D, {ptAxisGen}}); + registry.add("Generated/Coal/hOriginalAntiDeuteronsVsPt", "hOriginalAntiDeuteronsVsPt", {HistType::kTH1D, {ptAxisGen}}); + registry.add("Generated/Coal/hOriginalProtonsVsPt", "hOriginalProtonsVsPt", {HistType::kTH1D, {ptAxisGen}}); + registry.add("Generated/Coal/hOriginalAntiProtonsVsPt", "hOriginalAntiProtonsVsPt", {HistType::kTH1D, {ptAxisGen}}); + + // Generated particles after coalescence + registry.add("Generated/Coal/hCoalescedDeuteronsVsPt", "hCoalescedDeuteronsVsPt", {HistType::kTH1D, {ptAxisGen}}); + registry.add("Generated/Coal/hCoalescedAntiDeuteronsVsPt", "hCoalescedAntiDeuteronsVsPt", {HistType::kTH1D, {ptAxisGen}}); + registry.add("Generated/Coal/hCoalescedProtonsVsPt", "hCoalescedProtonsVsPt", {HistType::kTH1D, {ptAxisGen}}); + registry.add("Generated/Coal/hCoalescedAntiProtonsVsPt", "hCoalescedAntiProtonsVsPt", {HistType::kTH1D, {ptAxisGen}}); + } } else if (settingsCoalescence.doMCGenCoalescence.value) { LOG(fatal) << "This is not a Gen Run but the Gen coalescence is required. Turn off doMCGenCoalescence"; } @@ -837,22 +851,316 @@ struct HadronNucleiCorrelation { } } + /// Prepare generated particles for processing, including optional MC coalescence simulation. + template + auto prepareGenParticlesForProcessing(TParticles const& mcParticles, bool fillhisto = false) + { + // Local representation of a generated particle. + struct GenCoalescenceCandidate { + GenCoalescenceCandidate(float pt, + float eta, + float phi, + int pdg, + float vx, + float vy, + float vz, + float vt, + bool physicalPrimary) + : mKinematics{pt, eta, phi}, + mPdg{pdg}, + mVx{vx}, + mVy{vy}, + mVz{vz}, + mVt{vt}, + mPhysicalPrimary{physicalPrimary} + { + } + [[nodiscard]] float pt() const { return mKinematics.pt(); } + [[nodiscard]] float eta() const { return mKinematics.eta(); } + [[nodiscard]] float phi() const { return mKinematics.phi(); } + + [[nodiscard]] float px() const { return pt() * std::cos(phi()); } + [[nodiscard]] float py() const { return pt() * std::sin(phi()); } + [[nodiscard]] float pz() const { return mKinematics.pz(); } + + [[nodiscard]] float vx() const { return mVx; } + [[nodiscard]] float vy() const { return mVy; } + [[nodiscard]] float vz() const { return mVz; } + [[nodiscard]] float vt() const { return mVt; } + + [[nodiscard]] float mass() const + { + switch (std::abs(mPdg)) { + case PDG_t::kProton: + return o2::track::PID::getMass(o2::track::PID::Proton); + case PDG_t::kNeutron: + return o2::constants::physics::MassNeutron; + case o2::constants::physics::Pdg::kDeuteron: + return o2::track::PID::getMass(o2::track::PID::Deuteron); + default: + LOG(fatal) << "Unhandled pdg " << mPdg; + return 0.f; + } + } + [[nodiscard]] float energy() const { return std::hypot(mKinematics.p(), mass()); } + [[nodiscard]] float rapidity() const { return mKinematics.rapidityForMass(mass()); } + [[nodiscard]] float y() const { return rapidity(); } + [[nodiscard]] bool isPhysicalPrimary() const { return mPhysicalPrimary; } + [[nodiscard]] int pdgCode() const { return mPdg; } + + private: + GenCandidate mKinematics; + + int mPdg = 0; + float mVx = 0.f; + float mVy = 0.f; + float mVz = 0.f; + float mVt = 0.f; + + bool mPhysicalPrimary = false; + }; + + std::vector particlesToProcess; + particlesToProcess.reserve(mcParticles.size()); + + for (const auto& particle : mcParticles) { + switch (particle.pdgCode()) { + case PDG_t::kProton: + case PDG_t::kProtonBar: + case PDG_t::kNeutron: + case PDG_t::kNeutronBar: + case o2::constants::physics::Pdg::kDeuteron: + case -o2::constants::physics::Pdg::kDeuteron: + particlesToProcess.emplace_back(particle.pt(), + particle.eta(), + particle.phi(), + particle.pdgCode(), + particle.vx(), + particle.vy(), + particle.vz(), + particle.vt(), + particle.isPhysicalPrimary()); + break; + default: + break; + } + } + + if (settingsCoalescence.doMCGenCoalescence.value) { // Simulate coalescence of p+n -> d and pbar+nbar -> dbar + + if (fillhisto) { + for (const auto& particle : particlesToProcess) { // Fill histograms for original generated particles before coalescence + switch (particle.pdgCode()) { + case PDG_t::kProton: + registry.fill(HIST("Generated/Coal/hOriginalProtonsVsPt"), particle.pt()); + break; + case PDG_t::kProtonBar: + registry.fill(HIST("Generated/Coal/hOriginalAntiProtonsVsPt"), particle.pt()); + break; + case o2::constants::physics::Pdg::kDeuteron: + registry.fill(HIST("Generated/Coal/hOriginalDeuteronsVsPt"), particle.pt()); + break; + case -o2::constants::physics::Pdg::kDeuteron: + registry.fill(HIST("Generated/Coal/hOriginalAntiDeuteronsVsPt"), particle.pt()); + break; + default: + break; + } + } + } + + std::vector consumed(particlesToProcess.size(), false); + std::vector deuterons; + + // Try p+n -> d and pbar+nbar -> dbar independently. + for (const int sign : {+1, -1}) { + const int protonPDG = sign * PDG_t::kProton; + const int neutronPDG = sign * PDG_t::kNeutron; + const int deuteronPDG = sign * o2::constants::physics::Pdg::kDeuteron; + + for (size_t ip = 0; ip < particlesToProcess.size(); ++ip) { + if (consumed[ip] || particlesToProcess[ip].pdgCode() != protonPDG) { + continue; + } + + const auto& proton = particlesToProcess[ip]; + + for (size_t in = 0; in < particlesToProcess.size(); ++in) { + if (consumed[in] || particlesToProcess[in].pdgCode() != neutronPDG) { + continue; + } + + const auto& neutron = particlesToProcess[in]; + + const float ep = proton.energy(); + const float en = neutron.energy(); + + // Propagate the particle freezing out first to the freeze-out time of the other particle + float xp = proton.vx(); + float yp = proton.vy(); + float zp = proton.vz(); + const float tp = proton.vt(); + + float xn = neutron.vx(); + float yn = neutron.vy(); + float zn = neutron.vz(); + const float tn = neutron.vt(); + + const float commonTime = std::max(static_cast(tp), static_cast(tn)); + + if (tp < commonTime) { + const float dt = commonTime - tp; + xp += proton.px() / ep * dt; + yp += proton.py() / ep * dt; + zp += proton.pz() / ep * dt; + } + + if (tn < commonTime) { + const float dt = commonTime - tn; + xn += neutron.px() / en * dt; + yn += neutron.py() / en * dt; + zn += neutron.pz() / en * dt; + } + + // Velocity of the p-n centre-of-mass frame. + const float totalE = ep + en; + const float totalPx = proton.px() + neutron.px(); + const float totalPy = proton.py() + neutron.py(); + const float totalPz = proton.pz() + neutron.pz(); + + const float bx = totalPx / totalE; + const float by = totalPy / totalE; + const float bz = totalPz / totalE; + + const float beta2 = bx * bx + by * by + bz * bz; + if (beta2 >= 1.) { + continue; + } + + const float gamma = 1. / std::sqrt(1. - beta2); + + // Boost the proton momentum into the p-n rest frame. + // In that frame p_p* = -p_n*, therefore |p_p*| is the relative momentum entering the coalescence cut. + float pxStar = proton.px(); + float pyStar = proton.py(); + float pzStar = proton.pz(); + + if (beta2 > 0.) { + const float betaDotP = bx * proton.px() + by * proton.py() + bz * proton.pz(); + + const float factor = ((gamma - 1.) * betaDotP / beta2) - gamma * ep; + + pxStar += factor * bx; + pyStar += factor * by; + pzStar += factor * bz; + } + + const float pRelative = std::sqrt(pxStar * pxStar + pyStar * pyStar + pzStar * pzStar); + + if (pRelative >= settingsCoalescence.pMax.value) { + continue; + } + + // The two particles have already been propagated to equal time in the lab. Transform their spatial separation to the pair CM frame. + float dx = xp - xn; + float dy = yp - yn; + float dz = zp - zn; + + if (beta2 > 0.) { + const float betaDotR = bx * dx + by * dy + bz * dz; + const float factor = (gamma - 1.) * betaDotR / beta2; + + dx += factor * bx; + dy += factor * by; + dz += factor * bz; + } + + const float rRelative = std::sqrt(dx * dx + dy * dy + dz * dz); + + if (rRelative >= settingsCoalescence.rMax.value) { + continue; + } + + // Successful coalescence: remove the constituent proton and neutron and replace them by a deuteron carrying their total three-momentum + consumed[ip] = true; + consumed[in] = true; + + const float deuteronPt = std::hypot(totalPx, totalPy); + const float deuteronPhi = std::atan2(totalPy, totalPx); + const float deuteronEta = std::asinh(totalPz / std::max(deuteronPt, 1.e-12f)); + + deuterons.emplace_back(deuteronPt, + deuteronEta, + deuteronPhi, + deuteronPDG, + 0.5f * (xp + xn), + 0.5f * (yp + yn), + 0.5f * (zp + zn), + commonTime, + proton.isPhysicalPrimary() && neutron.isPhysicalPrimary()); + break; + } + } + } + + // Construct the post-coalescence particle list. + std::vector coalescedParticles; + coalescedParticles.reserve(particlesToProcess.size() + deuterons.size()); + + for (size_t i = 0; i < particlesToProcess.size(); ++i) { + if (!consumed[i]) { + coalescedParticles.push_back(std::move(particlesToProcess[i])); + } + } + + for (auto& deuteron : deuterons) { + coalescedParticles.push_back(std::move(deuteron)); + } + + particlesToProcess = std::move(coalescedParticles); + if (fillhisto) { + for (const auto& particle : particlesToProcess) { // Fill histograms after coalescence + switch (particle.pdgCode()) { + case PDG_t::kProton: + registry.fill(HIST("Generated/Coal/hCoalescedProtonsVsPt"), particle.pt()); + break; + case PDG_t::kProtonBar: + registry.fill(HIST("Generated/Coal/hCoalescedAntiProtonsVsPt"), particle.pt()); + break; + case o2::constants::physics::Pdg::kDeuteron: + registry.fill(HIST("Generated/Coal/hCoalescedDeuteronsVsPt"), particle.pt()); + break; + case -o2::constants::physics::Pdg::kDeuteron: + registry.fill(HIST("Generated/Coal/hCoalescedAntiDeuteronsVsPt"), particle.pt()); + break; + default: + break; + } + } + } + } + return particlesToProcess; + } + // Single pass over the particles of one generated collision: charged-primary multiplicity // (|eta| < 1) for the mixing bins and the pairing candidates template - GenCollisionCache buildGenCollisionCache(TParticles const& particles) + GenCollisionCache buildGenCollisionCache(TParticles const& mcParticles) { GenCollisionCache colCache; - for (const auto& mcParticle : particles) { - addGenCandidate(mcParticle, colCache); + const auto particlesToProcess = prepareGenParticlesForProcessing(mcParticles); + for (const auto& particle : particlesToProcess) { + addGenCandidate(particle, colCache); + } - if (!mcParticle.isPhysicalPrimary()) { + for (const auto& particle : mcParticles) { + if (!particle.isPhysicalPrimary()) { continue; } - if (std::abs(mcParticle.eta()) > 1.0f) { + if (std::abs(particle.eta()) > 1.0f) { continue; } - TParticlePDG* p = pdgDB->GetParticle(mcParticle.pdgCode()); + TParticlePDG* p = pdgDB->GetParticle(particle.pdgCode()); if (!p) { // unknown PDG code (e.g. exotic fragments not in the database) continue; } @@ -1734,251 +2042,8 @@ struct HadronNucleiCorrelation { void processSameEventGen(SimCollisions::iterator const&, SimParticles const& mcParticles) { - registry.fill(HIST("Generated/hNEventsMC"), 0.5); - - // Local representation of a generated particle. - struct GenCoalescenceCandidate { - GenCoalescenceCandidate(float pt, - float eta, - float phi, - int pdg, - float vx, - float vy, - float vz, - float vt, - bool physicalPrimary) - : mKinematics{pt, eta, phi}, - mPdg{pdg}, - mVx{vx}, - mVy{vy}, - mVz{vz}, - mVt{vt}, - mPhysicalPrimary{physicalPrimary} - { - } - [[nodiscard]] float pt() const { return mKinematics.pt(); } - [[nodiscard]] float eta() const { return mKinematics.eta(); } - [[nodiscard]] float phi() const { return mKinematics.phi(); } - - [[nodiscard]] float px() const { return pt() * std::cos(phi()); } - [[nodiscard]] float py() const { return pt() * std::sin(phi()); } - [[nodiscard]] float pz() const { return mKinematics.pz(); } - - [[nodiscard]] float vx() const { return mVx; } - [[nodiscard]] float vy() const { return mVy; } - [[nodiscard]] float vz() const { return mVz; } - [[nodiscard]] float vt() const { return mVt; } - - [[nodiscard]] float mass() const - { - switch (std::abs(mPdg)) { - case PDG_t::kProton: - return o2::track::PID::getMass(o2::track::PID::Proton); - case PDG_t::kNeutron: - return o2::constants::physics::MassNeutron; - case o2::constants::physics::Pdg::kDeuteron: - return o2::track::PID::getMass(o2::track::PID::Deuteron); - default: - LOG(fatal) << "Unhandled pdg " << mPdg; - return 0.f; - } - } - [[nodiscard]] float energy() const { return std::hypot(mKinematics.p(), mass()); } - [[nodiscard]] float rapidity() const { return mKinematics.rapidityForMass(mass()); } - [[nodiscard]] float y() const { return rapidity(); } - [[nodiscard]] bool isPhysicalPrimary() const { return mPhysicalPrimary; } - [[nodiscard]] int pdgCode() const { return mPdg; } - - private: - GenCandidate mKinematics; - - int mPdg = 0; - float mVx = 0.f; - float mVy = 0.f; - float mVz = 0.f; - float mVt = 0.f; - - bool mPhysicalPrimary = false; - }; - - std::vector particlesToProcess; - particlesToProcess.reserve(mcParticles.size()); - - for (const auto& particle : mcParticles) { - switch (particle.pdgCode()) { - case PDG_t::kProton: - case PDG_t::kProtonBar: - case PDG_t::kNeutron: - case PDG_t::kNeutronBar: - case o2::constants::physics::Pdg::kDeuteron: - case -o2::constants::physics::Pdg::kDeuteron: - particlesToProcess.emplace_back(particle.pt(), - particle.eta(), - particle.phi(), - particle.pdgCode(), - particle.vx(), - particle.vy(), - particle.vz(), - particle.vt(), - particle.isPhysicalPrimary()); - break; - default: - break; - } - } - - if (settingsCoalescence.doMCGenCoalescence.value) { - std::vector consumed(particlesToProcess.size(), false); - std::vector deuterons; - - // Try p+n -> d and pbar+nbar -> dbar independently. - for (const int sign : {+1, -1}) { - const int protonPDG = sign * PDG_t::kProton; - const int neutronPDG = sign * PDG_t::kNeutron; - const int deuteronPDG = sign * o2::constants::physics::Pdg::kDeuteron; - - for (size_t ip = 0; ip < particlesToProcess.size(); ++ip) { - if (consumed[ip] || particlesToProcess[ip].pdgCode() != protonPDG) { - continue; - } - - const auto& proton = particlesToProcess[ip]; - - for (size_t in = 0; in < particlesToProcess.size(); ++in) { - if (consumed[in] || particlesToProcess[in].pdgCode() != neutronPDG) { - continue; - } - - const auto& neutron = particlesToProcess[in]; - - const float ep = proton.energy(); - const float en = neutron.energy(); - - // Propagate the particle freezing out first to the freeze-out time of the other particle - float xp = proton.vx(); - float yp = proton.vy(); - float zp = proton.vz(); - const float tp = proton.vt(); - - float xn = neutron.vx(); - float yn = neutron.vy(); - float zn = neutron.vz(); - const float tn = neutron.vt(); - - const float commonTime = std::max(static_cast(tp), static_cast(tn)); - - if (tp < commonTime) { - const float dt = commonTime - tp; - xp += proton.px() / ep * dt; - yp += proton.py() / ep * dt; - zp += proton.pz() / ep * dt; - } - - if (tn < commonTime) { - const float dt = commonTime - tn; - xn += neutron.px() / en * dt; - yn += neutron.py() / en * dt; - zn += neutron.pz() / en * dt; - } - - // Velocity of the p-n centre-of-mass frame. - const float totalE = ep + en; - const float totalPx = proton.px() + neutron.px(); - const float totalPy = proton.py() + neutron.py(); - const float totalPz = proton.pz() + neutron.pz(); - - const float bx = totalPx / totalE; - const float by = totalPy / totalE; - const float bz = totalPz / totalE; - - const float beta2 = bx * bx + by * by + bz * bz; - if (beta2 >= 1.) { - continue; - } - - const float gamma = 1. / std::sqrt(1. - beta2); - - // Boost the proton momentum into the p-n rest frame. - // In that frame p_p* = -p_n*, therefore |p_p*| is the relative momentum entering the coalescence cut. - float pxStar = proton.px(); - float pyStar = proton.py(); - float pzStar = proton.pz(); - - if (beta2 > 0.) { - const float betaDotP = bx * proton.px() + by * proton.py() + bz * proton.pz(); - - const float factor = ((gamma - 1.) * betaDotP / beta2) - gamma * ep; - - pxStar += factor * bx; - pyStar += factor * by; - pzStar += factor * bz; - } - - const float pRelative = std::sqrt(pxStar * pxStar + pyStar * pyStar + pzStar * pzStar); - - if (pRelative >= settingsCoalescence.pMax.value) { - continue; - } - - // The two particles have already been propagated to equal time in the lab. Transform their spatial separation to the pair CM frame. - float dx = xp - xn; - float dy = yp - yn; - float dz = zp - zn; - - if (beta2 > 0.) { - const float betaDotR = bx * dx + by * dy + bz * dz; - const float factor = (gamma - 1.) * betaDotR / beta2; - - dx += factor * bx; - dy += factor * by; - dz += factor * bz; - } - - const float rRelative = std::sqrt(dx * dx + dy * dy + dz * dz); - - if (rRelative >= settingsCoalescence.rMax.value) { - continue; - } - - // Successful coalescence: remove the constituent proton and neutron and replace them by a deuteron carrying their total three-momentum - consumed[ip] = true; - consumed[in] = true; - - const float deuteronPt = std::hypot(totalPx, totalPy); - const float deuteronPhi = std::atan2(totalPy, totalPx); - const float deuteronEta = std::asinh(totalPz / std::max(deuteronPt, 1.e-12f)); - - deuterons.emplace_back(deuteronPt, - deuteronEta, - deuteronPhi, - deuteronPDG, - 0.5f * (xp + xn), - 0.5f * (yp + yn), - 0.5f * (zp + zn), - commonTime, - proton.isPhysicalPrimary() && neutron.isPhysicalPrimary()); - break; - } - } - } - - // Construct the post-coalescence particle list. - std::vector coalescedParticles; - coalescedParticles.reserve(particlesToProcess.size() + deuterons.size()); - - for (size_t i = 0; i < particlesToProcess.size(); ++i) { - if (!consumed[i]) { - coalescedParticles.push_back(std::move(particlesToProcess[i])); - } - } - - for (auto& deuteron : deuterons) { - coalescedParticles.push_back(std::move(deuteron)); - } - - particlesToProcess = std::move(coalescedParticles); - } + const auto particlesToProcess = prepareGenParticlesForProcessing(mcParticles, true); // Pairing candidates are collected during the QA loop below (which already visits every particle) GenCollisionCache genCache; @@ -2091,7 +2156,7 @@ struct HadronNucleiCorrelation { void processMixedEventGen(SimCollisions const& mcCollisions, SimParticles const& mcParticles) { - // One pass per collision: multiplicity for the mixing bins + pairing candidates. + // Prepare multiplicity and pairing candidates once per collision. // The mixing loop below never touches the MC particle table again. std::unordered_map genCaches; genCaches.reserve(mcCollisions.size()); From 536ce9c4f36d7274663130fc3a4b93238f3e44f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Mon, 30 Nov 2026 11:27:44 +0100 Subject: [PATCH 2/6] Refactor rapidity calculation and update template type --- PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx b/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx index e74e8a33400..d4627e295a5 100644 --- a/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx +++ b/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx @@ -211,11 +211,8 @@ struct HadronNucleiCorrelation { [[nodiscard]] float pz() const { return ptVal * std::sinh(etaVal); } [[nodiscard]] float p() const { return std::hypot(ptVal, pz()); } [[nodiscard]] float energyForMass(const float mass) const { return std::hypot(p(), mass); } - [[nodiscard]] float rapidityForMass(const float mass) const - { - const float e = energyForMass(mass); - return 0.5f * std::log((e + pz()) / (e - pz())); - }; + static float computeRapidity(float pt, float pz, float mass) { return std::asinh(pz / std::hypot(pt, mass)); } + [[nodiscard]] float rapidityForMass(const float mass) const { return computeRapidity(pt(), pz(), mass); }; [[nodiscard]] float mass(const int pdg) const { switch (pdg) { @@ -823,8 +820,8 @@ struct HadronNucleiCorrelation { // Generated-level candidate selection, shared by same- and mixed-event processing: // same cuts as the pairing (primary if requested, |eta| <= etaCut, PDG code of one of the two species) - template - void addGenCandidate(TParticle const& particle, GenCollisionCache& colCache) + template + void addGenCandidate(Tp const& particle, GenCollisionCache& colCache) { if (isPrim && !particle.isPhysicalPrimary()) { return; From 3d73aa922573366cb3adb4ca8f91a4ad6037c51a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Mon, 30 Nov 2026 11:29:28 +0100 Subject: [PATCH 3/6] Update hadronnucleicorrelation.cxx --- PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx b/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx index d4627e295a5..a7230b5db51 100644 --- a/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx +++ b/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx @@ -849,8 +849,8 @@ struct HadronNucleiCorrelation { } /// Prepare generated particles for processing, including optional MC coalescence simulation. - template - auto prepareGenParticlesForProcessing(TParticles const& mcParticles, bool fillhisto = false) + template + auto prepareGenParticlesForProcessing(Tps const& mcParticles, bool fillhisto = false) { // Local representation of a generated particle. struct GenCoalescenceCandidate { @@ -1141,8 +1141,8 @@ struct HadronNucleiCorrelation { // Single pass over the particles of one generated collision: charged-primary multiplicity // (|eta| < 1) for the mixing bins and the pairing candidates - template - GenCollisionCache buildGenCollisionCache(TParticles const& mcParticles) + template + GenCollisionCache buildGenCollisionCache(Tps const& mcParticles) { GenCollisionCache colCache; const auto particlesToProcess = prepareGenParticlesForProcessing(mcParticles); From 2817d16484e65d85fe797a5dfc7039fa00305c04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Mon, 30 Nov 2026 11:33:30 +0100 Subject: [PATCH 4/6] Update hadronnucleicorrelation.cxx --- PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx b/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx index a7230b5db51..749477dea8b 100644 --- a/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx +++ b/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx @@ -212,7 +212,7 @@ struct HadronNucleiCorrelation { [[nodiscard]] float p() const { return std::hypot(ptVal, pz()); } [[nodiscard]] float energyForMass(const float mass) const { return std::hypot(p(), mass); } static float computeRapidity(float pt, float pz, float mass) { return std::asinh(pz / std::hypot(pt, mass)); } - [[nodiscard]] float rapidityForMass(const float mass) const { return computeRapidity(pt(), pz(), mass); }; + [[nodiscard]] float rapidityForMass(const float mass) const { return computeRapidity(pt(), pz(), mass); } [[nodiscard]] float mass(const int pdg) const { switch (pdg) { From ce6c460459cf1b2b8a1fcd2ebab36019efa603c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Mon, 30 Nov 2026 11:42:44 +0100 Subject: [PATCH 5/6] Refactor initialization and parameter naming --- PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx b/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx index 749477dea8b..61dddd18ad7 100644 --- a/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx +++ b/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx @@ -863,7 +863,7 @@ struct HadronNucleiCorrelation { float vz, float vt, bool physicalPrimary) - : mKinematics{pt, eta, phi}, + : mKinematics{.ptVal=pt, .etaVal=eta, .phiVal=phi}, mPdg{pdg}, mVx{vx}, mVy{vy}, @@ -2186,7 +2186,7 @@ struct HadronNucleiCorrelation { PROCESS_SWITCH(HadronNucleiCorrelation, processMixedEventGen, "processMixedEventGen", false); }; -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +WorkflowSpec defineDataProcessing(ConfigContext const& context) { - return WorkflowSpec{adaptAnalysisTask(cfgc)}; + return WorkflowSpec{adaptAnalysisTask(context)}; } From 35a63fd6b0a28fc5fa8145acd5bad5c49508d355 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Mon, 30 Nov 2026 10:43:34 +0000 Subject: [PATCH 6/6] Please consider the following formatting changes --- PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx b/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx index 61dddd18ad7..7ff39d98b09 100644 --- a/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx +++ b/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx @@ -863,7 +863,7 @@ struct HadronNucleiCorrelation { float vz, float vt, bool physicalPrimary) - : mKinematics{.ptVal=pt, .etaVal=eta, .phiVal=phi}, + : mKinematics{.ptVal = pt, .etaVal = eta, .phiVal = phi}, mPdg{pdg}, mVx{vx}, mVy{vy},