Retrieve position at a given time

Please fill out the following information to help in answering your question, and also see tips for posting code snippets. If you don’t provide this information it will take more time to help with your problem!

_Geant4 Version:_geant4-11.1.2
_Operating System:_linux
_Compiler/Version:_gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
_CMake Version:_cmake version 3.22.1


I would like to know if it is possible to have a particle’s position at a given time; I am able to have the position, momentum, energy, etc., for every pre- and post-step. However, the time interval is not constant. I mean, I have the position but at different intervals of time for different particles.
I would like to use this information to animate the process, but not inside Geant 4.

Thank you.


Right. The step-by-step information is not uniform in time, because Geant4 isn’t a “time based” simulation, it’s “interaction based.” However, I think that if you store “rich trajectories” then you get additional information, including intermediate points interpolated for you between steps.