From fdf3e4a011a29513bf764411026f32476d47905e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Mon, 30 Nov 2026 16:56:14 +0100 Subject: [PATCH 1/2] Implement rejection of native deuterons in correlations Added functionality to reject native deuterons from generated-level correlations and updated histogram filling accordingly. --- .../Tasks/Nuspex/hadronnucleicorrelation.cxx | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx b/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx index 7ff39d98b09..42b000e85f1 100644 --- a/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx +++ b/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx @@ -99,6 +99,7 @@ struct HadronNucleiCorrelation { struct : ConfigurableGroup { std::string prefix = "Coalescence"; // JSON group name Configurable doMCGenCoalescence{"doMCGenCoalescence", false, "do a simple coalescence on the generated level"}; + Configurable rejectNativeDeuterons{"rejectNativeDeuterons", false, "reject input (anti)deuterons from generated-level correlations"}; // Coalescence parameters used in Eur. Phys. J. A 59 (2023) 72: // p_max = 0.148 GeV/c // r_max = 2 fm @@ -561,6 +562,12 @@ struct HadronNucleiCorrelation { registry.add("Generated/hProtonsVsPt", "hProtonsVsPt", {HistType::kTH1D, {ptAxisGen}}); registry.add("Generated/hAntiProtonsVsPt", "hAntiProtonsVsPt", {HistType::kTH1D, {ptAxisGen}}); + if (settingsCoalescence.rejectNativeDeuterons.value) { + auto hRejected = registry.add("Generated/hRejectedNativeDeuterons", "Rejected input (anti)deuterons", {HistType::kTH1D, {{2, 0.f, 2.f}}}); + hRejected->GetXaxis()->SetBinLabel(1, "Deuterons"); + hRejected->GetXaxis()->SetBinLabel(2, "Antideuterons"); + } + if (settingsCoalescence.doMCGenCoalescence.value) { // Original generated particles before coalescence registry.add("Generated/Coal/hOriginalDeuteronsVsPt", "hOriginalDeuteronsVsPt", {HistType::kTH1D, {ptAxisGen}}); @@ -921,6 +928,22 @@ struct HadronNucleiCorrelation { particlesToProcess.reserve(mcParticles.size()); for (const auto& particle : mcParticles) { + // Reject only deuterons from the input MC table, before task-level coalescence. + // Keep the original spectra for monitoring the generator contribution. + if (settingsCoalescence.rejectNativeDeuterons.value && std::abs(particle.pdgCode()) == o2::constants::physics::Pdg::kDeuteron) { + if (fillhisto) { + const bool isDeuteron = particle.pdgCode() > 0; + registry.fill(HIST("Generated/hRejectedNativeDeuterons"), isDeuteron ? 0.5f : 1.5f); + if (settingsCoalescence.doMCGenCoalescence.value) { + if (isDeuteron) { + registry.fill(HIST("Generated/Coal/hOriginalDeuteronsVsPt"), particle.pt()); + } else { + registry.fill(HIST("Generated/Coal/hOriginalAntiDeuteronsVsPt"), particle.pt()); + } + } + } + continue; + } switch (particle.pdgCode()) { case PDG_t::kProton: case PDG_t::kProtonBar: From 5172920fd720700991f93fe79dc8bfc15dcaf48d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Mon, 30 Nov 2026 17:06:11 +0100 Subject: [PATCH 2/2] Update hadronnucleicorrelation.cxx --- 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 42b000e85f1..ff9152a8a0c 100644 --- a/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx +++ b/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx @@ -932,10 +932,10 @@ struct HadronNucleiCorrelation { // Keep the original spectra for monitoring the generator contribution. if (settingsCoalescence.rejectNativeDeuterons.value && std::abs(particle.pdgCode()) == o2::constants::physics::Pdg::kDeuteron) { if (fillhisto) { - const bool isDeuteron = particle.pdgCode() > 0; - registry.fill(HIST("Generated/hRejectedNativeDeuterons"), isDeuteron ? 0.5f : 1.5f); + const bool isDeu = particle.pdgCode() > 0; + registry.fill(HIST("Generated/hRejectedNativeDeuterons"), isDeu ? 0.5f : 1.5f); if (settingsCoalescence.doMCGenCoalescence.value) { - if (isDeuteron) { + if (isDeu) { registry.fill(HIST("Generated/Coal/hOriginalDeuteronsVsPt"), particle.pt()); } else { registry.fill(HIST("Generated/Coal/hOriginalAntiDeuteronsVsPt"), particle.pt());