Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ struct HadronNucleiCorrelation {
struct : ConfigurableGroup {
std::string prefix = "Coalescence"; // JSON group name
Configurable<bool> doMCGenCoalescence{"doMCGenCoalescence", false, "do a simple coalescence on the generated level"};
Configurable<bool> 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
Expand Down Expand Up @@ -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<TH1>("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}});
Expand Down Expand Up @@ -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:
Expand Down
Loading