- **Proposed solution.** Discard unwanted particles early
- Since the flag to save the particle is know at the end of Geant4 track
processing, the decision to keep it can be made without adding all of them
into the final container. This can be done by maintaining a stack of all
upstream tracks. For example,
- At some point in time we consider a chain of Geant4 tracks 6 $\to$ 7 $\to$ 8
which do not deposit any energy in the active detector volumes
- On the other hand, track 9 does produce a hit and we would like to keep it.
Therefore, at the next iteration, we will choose to keep its parent, track 6, but get rid of tracks 7 and 8