Particle Stuck with no warning or error

I have run into a strange problem in GEANT which I suspect has to do with the scale of my simulation.

I have an 80,000km tall column of atmosphere and space through which I am propagating electrons (the column itself is made up of ~40 different subsection to simulate variable density and composition). At the edges and top of my column I have a 100km thick sensitive detector with the G4_Galactic material assigned to it. When I run this simulation some of my particles will get stuck.

The sticking always happens in the sensitive detector. When this happens GEANT gets stuck and appears to repeat the same process indefinitely. It switches between transportation in my detector and in my world volume. When in the world volume the distance of the next step is always 0 and it is generally small in the detector.

Whats weird about this is that, unlike when a particle is normally stuck, GEANT does not warn me or resolve the problem. It simply continues to propagate the particle creating a massive memory leak.

My first assumption was that the issue was an error in my geometry, I adjusted the parameters of my sensitive detector to make sure that there was no overlap between it and the atmospheric column, all to no avail. I eventually ran a simulation once I introduced a small (1 meter) overlap between the detector and my atmosphere.

After a small update to my geometry (introducing more layers to my atmosphere for accuracy), the problem returned. This time no matter what I do I can not resolve the issue.

My suspicion is that my problem is arising from a floating point precision error. Another thing I’ve noticed is that whenever it gets stuck GEANT is attempting to make a small step. On my most recent failed run the step length was .0047. I would imagine that 12 orders of magnitude is too much for a float or double to handle.

If I am correct about my problem is there any way to resolve it? A way to set a minimum step length perhaps? If I am wrong about my problem but anyone has some insight into what might be going on I would be grateful to hear that as well. Thank you in advance!

In your case, indeed you may want to tune the geometrical tolerance to the size of your world volume. See in the documentation how to do that:

This might help.

1 Like

Thank you very much! After modifying my simulation executes without fault!