Electrons not stopping at boundary

I am using Geant4.10.7.1 on Linux Ubuntu 20.04.2.

If I launch electrons (in a vacuum) at a surface then I can see that they stop at the first surface by debugging with gdb and stepping through PostStepDoIt and AlongStepDoIt.

However, if I detect the electrons and store the trajectory information in a file and then launch the electrons again from that file, I find the electrons do not stop at the first boundary, but they will stop at that boundary if they are backscattered. The electrons behave as if I launched them from inside the material. The boundary process is started, seemingly in the same way, in both cases. Can someone suggest a possible cause or maybe something I should be checking when debugging ?


Hello all, I found the cause of the problem.


please, share :slight_smile:

I think maybe the answer occrred to me as I was writing the first post! I stated: “The electrons behave as if I launched them from inside the material.”. Well I wasn´t launching them inside the material, but because of a scaling problem, I was launching the particles very close to a boundary, so the boundary was not recognised by the particles when they moved towards it. When the particles were launched further away from the boundary, there was not a problem.