In studying Geant4 neutron transport, we were suprised to find that thermal neutrons in mineral oil apparently travelled an average of only 6_mm from the track creation point. At first, we thought we had found a real bug in the neutron code, but it turns out it has nothing to do with the neutron models. The problem is in the Geant4 tracking code: a suspended track's "Vertex" information is re-initialized to new values each time tracking resumes on that track. [Specifically, G4TrackingManager::ProcessOneTrack() calls G4SteppingManager::SetInitialStep(fpTrack), which always re-initializes the "Vertex" information to the track's current position, direction, etc., regardless of the value of the track's CurrentStepNumber.] This is incorrect behavior, since the "Vertex" information is supposed to reflect the values of position, direction, etc., at the actual _creation_ of the track. In our case, the elastic neutron interaction process suspends the neutron track after every step, so the difference between the retrieved "Vertex" position and the final track position was just the length of the last step. This was confusing, to say the least. A simple solution is to check the current step number in G4SteppingManager::SetInitialStep(), and only set the track's "Vertex" data if the current step number is zero. http://citnp.caltech.edu/kamland/montecarlo/KLG4sim/G4SteppingManager.cc.patch After applying the described fix, the difference between neutron track vertex and final positions is indeed as it should be.
Thank you for reporting. It will be fixed by the tracking category working group.
This problem will be fixed in the next release.