Problem 240

Summary: track "vertex" information lost for suspended tracks
Product: Geant4 Reporter: gas
Component: trackingAssignee: Takashi.Sasaki
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 3.0   
Hardware: All   
OS: All   
URL: http://citnp.caltech.edu/kamland/montecarlo/KLG4sim/G4SteppingManager.cc.patch

Description gas 2001-04-02 19:12:42 CEST
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.
Comment 1 Makoto.Asai 2001-04-02 20:49:59 CEST
Thank you for reporting.
It will be fixed by the tracking category working group.
Comment 2 Takashi.Sasaki 2001-05-10 01:42:59 CEST
This problem will be fixed in the next release.