Problem 485

Summary: Null momentum for particle leads to exception
Product: Geant4 Reporter: Gabriele Cosmo <Gabriele.Cosmo>
Component: geometry/magneticfieldAssignee: John Apostolakis <John.Apostolakis>
Status: RESOLVED FIXED    
Severity: major CC: Vladimir.Grichine, Witold.Pokorski
Priority: P5    
Version: other   
Hardware: PC   
OS: Linux   
URL: /afs/cern.ch/user/r/ribon/public/bug.tar.gz

Description Gabriele Cosmo 2003-05-08 11:23:41 CEST
Running the provided test application with magnetic-field will lead to
the G4Exception reported below, apparently due to a zero momentum vector
associated to the particle (e-).
The same application did not crash in previous versions of the toolkit.

From a first debug attempt it seems the responsible is the result of the
following call in G4PropagatorInField.cc (line 224):

s_length_taken = GetChordFinder()->AdvanceChordLimited(
                             CurrentState,    // Position & velocity
                             h_TrialStepSize,
                             fEpsilonStep);
to be 0, therefore causing the direction to become a null vector.

 -----------------------------------------------------------
    *** Dump for solid - solidActive ***
    ===================================================
 Solid type: G4Box
 Parameters:
    half length X: 2 mm
    half length Y: 1000 mm
    half length Z: 1000 mm
-----------------------------------------------------------
Position:

p.x() = -2 mm
p.y() = -205.5727622335138 mm
p.z() = -33.88894338724185 mm

Direction:

v.x() = 0
v.y() = 0
v.z() = 0

Proposed distance :

snxt = 9e+99 mm

G4Box::DistanceToOut() - Invalid enum

*** G4Exception: Aborting execution ***
Comment 1 Gabriele Cosmo 2003-05-08 11:25:59 CEST
The problem has been reproduced and a fix is currently under testing.
Comment 2 Gabriele Cosmo 2003-05-16 06:06:59 CEST
The problem is now fixed in tag "geomvol-V05-01-00" and will be included
in the next reference tag and public patch.