I want to know how to determine if a track has ended in order to record total energy deposition of the track, the particle decay time and so on. I’ve tried two methods so far: one looks at the track ID - if the track ID of the current step is not equal to the previous step, it is said that the track has ended; the other one uses track status - if the status of the current track equals to fStopAndKill then the track has ended. Two methods produce completely different results and I’m very confused about which one is correct. (The second method gives me ~55% neutrons created in water being captured by nuclei but the first one doesn’t have neutrons captured at all.)
I’ve also made aware today the following:
Primary tracks have a track ID = 1, secondary tracks have an ID > 1. NOTE: Primary tracks of hadrons may “lose” their ID in some inelastic hadronic interactions, since they are considered as secondary products due to the fact that the interaction partners are indistinguishable. However, particles like electrons do not “lose” their ID. https://www.ge.infn.it/geant4/training/ptb_2009/day4/solutions_day4_partIII.html
I’m more confused after reading this. How do I work around this when I want to record the hadron information?
I thought my question is quite trivial but I can’t find answer anywhere on the internet…
Many thanks in advance,