From 8cafed7eda9770ef43a1ca633c3d4394584b56ce Mon Sep 17 00:00:00 2001 From: Francesco Mazzaschi Date: Thu, 31 Jul 2025 11:00:04 +0200 Subject: [PATCH] Fix filling of weak decaying daughters --- PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx b/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx index f1c60d198e1..5891997bc54 100644 --- a/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx +++ b/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx @@ -53,6 +53,7 @@ #include "Math/Vector4D.h" #include "TRandom3.h" +#include #include #include @@ -988,6 +989,7 @@ struct nucleiSpectra { if (particle.isPhysicalPrimary()) { flags |= kIsPhysicalPrimary; nuclei::hGenNuclei[iS][particle.pdgCode() < 0]->Fill(1., particle.pt()); + // antinuclei from B hadrons are classified as physical primaries if (particle.has_mothers()) { for (auto& motherparticle : particle.mothers_as()) { if (std::find(nuclei::hfMothCodes.begin(), nuclei::hfMothCodes.end(), std::abs(motherparticle.pdgCode())) != nuclei::hfMothCodes.end()) { @@ -998,7 +1000,10 @@ struct nucleiSpectra { } } } - } else if (particle.has_mothers()) { + } else if (particle.getProcess() == TMCProcess::kPDecay) { + if (!particle.has_mothers()) { + continue; // skip secondaries from weak decay without mothers + } flags |= kIsSecondaryFromWeakDecay; for (auto& motherparticle : particle.mothers_as()) { motherPdgCode = motherparticle.pdgCode();