Skip to content

Commit 1bc4765

Browse files
fmazzascFrancesco Mazzaschi
andauthored
[PWGLF] Fix filling of weak decaying daughters (#12347)
Co-authored-by: Francesco Mazzaschi <fmazzasc@alipap1.cern.ch>
1 parent e4c2b90 commit 1bc4765

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353

5454
#include "Math/Vector4D.h"
5555
#include "TRandom3.h"
56+
#include <TMCProcess.h>
5657

5758
#include <algorithm>
5859
#include <cmath>
@@ -988,6 +989,7 @@ struct nucleiSpectra {
988989
if (particle.isPhysicalPrimary()) {
989990
flags |= kIsPhysicalPrimary;
990991
nuclei::hGenNuclei[iS][particle.pdgCode() < 0]->Fill(1., particle.pt());
992+
// antinuclei from B hadrons are classified as physical primaries
991993
if (particle.has_mothers()) {
992994
for (auto& motherparticle : particle.mothers_as<aod::McParticles>()) {
993995
if (std::find(nuclei::hfMothCodes.begin(), nuclei::hfMothCodes.end(), std::abs(motherparticle.pdgCode())) != nuclei::hfMothCodes.end()) {
@@ -998,7 +1000,10 @@ struct nucleiSpectra {
9981000
}
9991001
}
10001002
}
1001-
} else if (particle.has_mothers()) {
1003+
} else if (particle.getProcess() == TMCProcess::kPDecay) {
1004+
if (!particle.has_mothers()) {
1005+
continue; // skip secondaries from weak decay without mothers
1006+
}
10021007
flags |= kIsSecondaryFromWeakDecay;
10031008
for (auto& motherparticle : particle.mothers_as<aod::McParticles>()) {
10041009
motherPdgCode = motherparticle.pdgCode();

0 commit comments

Comments
 (0)