DepositionGeant4: limit maximum track length
Closes #238 (closed).
This limits the track length to 100 * max_dist
, where max_dist
is a rough estimate for the longest distance in the world box (actually it is just the sum of the edges, as the exact value does not matter).
I tried with different values, and I found 100 is a good balance. For the example given in #238 (closed), this corresponds to a distance of maximum track length of 54m.
In the example, the amount of collected charges is identical for a factor of 5 (2.7m) and a factor of 500 (270m). For a factor of 500, the simulation time was a bit too long for my taste tough, so I think 100 is a good value that should make sure the simulation does not get stuck for too long while trying to minimize the risk that something still happens.