Tracking stops prematurely in magnetic field

I am simulating electron precipitation into a planetary atmosphere with a magnetic field. When I turn off the magnetic field everything works as expected, the electrons slow down in the atmosphere and eventually stop. When I turn the magnetic field on, however, this does not happen. Instead my electrons stop seemingly arbitrarily. They aren’t cut off by a fixed number of steps or some low energy threshold or (as far as I can tell) by some distance traveled.

I am using the DormandPrince745 stepper and have set the largest allowable step size to be several times the radius of my planet (as recommended in the docs). Has anyone encountered this problem before and knows how to solve it?

I am using Geant v11.0.0 on Mac OS X 11.4

Hi Gabriel

Maybe you can have a look at the GetMaxLoopCount() method in the G4PropagatorInField class. I’m not an expert but when I read your question this came to mind. Moreover, If I remember correctly this loop count doesn’t give a warning nor uses an energy threshold. Maybe someone more experienced can confirm.

You were exactly correct! There was a maximum loop count of 1000 (I guess set by default) which was causing my tracks to terminate. Thank you!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.