Uh oh!
There was an error while loading. Please reload this page.
Fix seg fault caused by stale particle indices after coalescence from HF decays - #2416
Conversation
REQUEST FOR PRODUCTION RELEASES: This will add The following labels are available |
alcaliva
commented
Jul 27, 2026
Hi @sawenzel , @jackal1-66 , @fgrosa , |
alcaliva
commented
Jul 27, 2026
I think I found the reason why the code crashes only for deuterons, while it works fine for ^3He. In the case of deuteron production, the same nucleon can satisfy the coalescence condition with more than one partner. Since, at every successful coalescence, doCoal() replaces one particle and removes the remaining nucleons from the event record, the precomputed particle index lists become invalid for the subsequent loops. I added a return immediately after a successful coalescence in the decay mode. The standard event-wide coalescence workflow remains unchanged. |
fgrosa
commented
Jul 28, 2026
Hi @alcaliva it looks good to me, but maybe @fmazzasc is the one who should have a look, since he implemented the coalescence for nuclei from decays |
alcaliva
commented
Jul 28, 2026
Hi Fabrizo, thanks. Indeed, I've discussed also with @fmazzasc but maybe, could you have another look? |
Uh oh!
There was an error while loading. Please reload this page.
Fix a segmentation fault in the coalescence afterburner by returning immediately after successful coalescence in a heavy-hadron decay. When coalescence occurs, one or more nucleons are removed from the event, invalidating the stored particle indices. If the loops continue, the code may attempt to access an invalid index and crash.
This PR proposes a minimal fix for the analysis of deuterons from Λb decays, but the same fix should probably be applied to all occurrences.
@fgrosa , @MRazza879