diff --git a/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx b/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx index 7ff39d98b09..ff9152a8a0c 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 isDeu = particle.pdgCode() > 0; + registry.fill(HIST("Generated/hRejectedNativeDeuterons"), isDeu ? 0.5f : 1.5f); + if (settingsCoalescence.doMCGenCoalescence.value) { + if (isDeu) { + 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: