Skip to content

Commit a603c0c

Browse files
committed
Fix seg fault caused by stale particle indices after coalescence from HF decays
1 parent f3990a8 commit a603c0c

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

MC/config/common/external/generator/CoalescencePythia8.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ bool CoalescencePythia8(Pythia8::Event& event, std::vector<unsigned int> inputPd
152152
for (int iN{0}; iN < neutrons[iC].size(); ++iN) {
153153
if (nuclearMask & (1 << kDeuteron)) {
154154
coalHappened |= doCoal(event, iC, pdgList[kDeuteron], massList[kDeuteron], trivialCoal, coalescenceRadius, nuclFromDecay, protons[iC][iP], neutrons[iC][iN]);
155+
if (nuclFromDecay && coalHappened) {
156+
return true;
157+
}
155158
}
156159
if (nuclearMask & (1 << kTriton)) {
157160
for (int iN2{iN + 1}; iN2 < neutrons[iC].size(); ++iN2) {

0 commit comments

Comments
 (0)