Problem 360

Summary: Exception when tracking pi0
Product: Geant4 Reporter: Ivana.Hrivnacova
Component: particlesAssignee: kurasige
Status: CLOSED LATER    
Severity: major    
Priority: P2    
Version: 4.0   
Hardware: PC   
OS: Linux   
URL: /afs/cern.ch/user/i/ivana/public/g4exception/*

Description Ivana.Hrivnacova 2002-02-28 03:39:20 CET
After update to Geant4 patch1 (31 January 2002) we are getting
exception:
G4VProcess::SubtractNumberOfInteractionLengthLeft()  negative
currentInteractionLength

After tracing where it comes from I reproduced this
within example N03 by changing primary generator particle to pi0.
The problem becomes when in G4Decay the pi0 products (gammas)
are boosted (G4DecayProducts::Boost) - after boosting one
of products gets "nan" energy.

I put in:
/afs/cern.ch/user/i/ivana/public/g4exception
the modifications I did in exampleN03 to reproduce
this problem plus the output with this exception.
Comment 1 kurasige 2002-03-05 18:01:59 CET
This G4exception occurs only by using gcc version 2.96 on Redhat 7.X. This
version of gcc is a flawed version which has -never- been officially released
by GNU. I recommend you to use gcc version 2.95 or gcc-egcs 2.91 which
are officially supported by Geant4 group.
Comment 2 Gabriele Cosmo 2002-03-07 01:16:59 CET
I can confirm that the crash occurs only with compiler gcc-2.96 (in RH 7.0/1/2).
I also verified on the latest gcc-3.0.4 on a RH-7.2 system; here the test runs
fine...
Comment 3 Gabriele Cosmo 2002-10-22 02:24:59 CEST
Ivana Hrivnakova writes:

 We have experienced again this problem
 with Geant4.4.1 + patch01
 with gcc 3.1 (on RH 7.1) and gcc 3.2 (I don't know
 the system exactly) when using
 granular shared libraries with optimization;

 the problem disappears when
 source/particles/management/G4DynamicParticle.cxx
 source/particles/management/G4DynamicProducts.cxx
 are compiled without optimization.
Comment 4 Gabriele Cosmo 2002-10-22 02:24:59 CEST
Ivana Hrivnakova writes:

 We have experienced again this problem
 with Geant4.4.1 + patch01
 with gcc 3.1 (on RH 7.1) and gcc 3.2 (I don't know
 the system exactly) when using
 granular shared libraries with optimization;

 the problem disappears when
 source/particles/management/G4DynamicParticle.cxx
 source/particles/management/G4DynamicProducts.cxx
 are compiled without optimization.
Comment 5 Gabriele Cosmo 2002-10-22 02:34:59 CEST
I verified that on gcc-3.2 (RH-7.2) the problem can be reproduced (using
also static libraries). Change the gun particle to 'pi0' in exampleN03.in
(examples/novice/N03) and shoot a reasonable statistics (5 events) at
300 MeV ...
Comment 6 Gabriele Cosmo 2003-03-07 02:32:59 CET
Christophe Delaere (delaere@fynu.ucl.ac.be) reports:
>
> I've the following problem for some events (~1/100) in my simulation.
> *****************************************************************************
> * G4Track Information:   Particle = gamma,   Track ID = 3,   Parent ID = 1
> *****************************************************************************
>
> Step#    X(mm)    Y(mm)    Z(mm) KinE(MeV)  dE(MeV) StepLeng TrackLeng
> NextVolume ProcName
>     0      416    -13.8      -12       nan        0        0         0
> target initStep
>     1      375    -47.2     68.3       nan        0       96        96
> expHall Transportation
> G4VProcess::SubtractNumberOfInteractionLengthLeft()  negative
> currentInteractionLength
>
> *** G4Exception: Aborting execution ***
> Aborted
>
> My configuration is quite different:
>
> G4 v 4.5.0
> RH 8.0 - gcc 3.2
>
> I'm shooting ~20MeV neutrons on a H2O target with some B10 in it. I'm using
> the LHEP_PRECO_HP physics list.
>
> Hope this information can help you,
> Christophe.
Comment 7 kurasige 2003-03-24 17:35:59 CET
The problem was simply a matter of a missing protection of 'sqrt' in
G4DynamicParticle::Set4Momentum().
The tag partman-V05-00-06 includes the fix.