Problem 965

Summary: PenelopeRayleigh crashes for low-energy photons in Air
Product: Geant4 Reporter: marcus.h.mendenhall
Component: processes/electromagnetic/lowenergyAssignee: Luciano Pandola <pandola>
Status: RESOLVED FIXED    
Severity: major CC: luciano.pandola
Priority: P5    
Version: 9.0   
Hardware: Apple   
OS: Mac OS X   

Description marcus.h.mendenhall 2007-08-29 17:15:05 CEST
This problem arose within my own code, but is easily reproducible running TestEm1, so I will show it there.  When I was simulating hadron transport through a complex target, including the air around it, I started getting hangs in which G4 would slowly consume all memory on my machine, and loop forevery trying to track.  A bit of poking around showed that PenelopeRayleigh was returning a 0 mean free path for low-energy gammas (around its cutoff at 250 eV).  This seems to happen with 

Here is a script which demonstrates it within TestEm1

/testem/det/setMat Air
/testem/phys/addPhysics penelope
/run/initialize
/gun/particle gamma
/gun/energy 251 eV
/tracking/verbose 1
/run/beamOn 1

this causes infinite looping with zero step length.
Here is a bit of output:

-MeanFreePath = 0[cm]
-G4VDiscreteProcess::PostStepGetPhysicalInteractionLength [ PenRayleigh]
- Particle type - gamma
-   mass:        0[GeV]
-   charge:      0[e]
-   Direction x: 0.151605, y: -0.401562, z: -0.903196
-   Total Momentum = 2.51e-07[GeV]
-   Momentum: 3.80529e-08[GeV], y: -1.00792e-07[GeV], z: -2.26702e-07[GeV]
-   Total Energy   = 2.51e-07[GeV]
-   Kinetic Energy = 2.51e-07[GeV]
- MagneticMoment  [MeV/T]: 0
-   ProperTime     = 0[ns]
- in Material  Air

and so forth.

I have only checked it on my MacOSX install but I don't think it is platform specific, since it happens for all versions of Geant4 from 4.8.1p02 to 4.9 with different options on the compilers, etc.
Comment 1 Maria.Grazia.Pia 2007-08-29 19:55:12 CEST
The problem report is assigned to the developer expert in Penelope processes.

Best wishes,
Maria Grazia Pia
Comment 2 Luciano Pandola 2007-09-03 11:46:26 CEST
Thanks for reporting the problem. The problem happened at very low energy for compound materials that are defined with mass fraction rather than atom numbers. The problem has been identified and fixed. The fix will be available in the next Geant4 public release.