Problem 778

Summary: secondaries with NAN as momentum direction
Product: Geant4 Reporter: gum
Component: processes/hadronicAssignee: Gunter.Folger
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 7.1   
Hardware: PC   
OS: Linux   

Description gum 2005-08-04 21:54:27 CEST
We have this code in UserSteppingAction:

G4Track* theTrack = theStep->GetTrack();
const G4DynamicParticle* aParticle = theTrack->GetDynamicParticle();
G4ThreeVector aMomentum = aParticle->GetMomentumDirection();
G4double vx = aMomentum.x();
G4int ix = isnan(vx);
if(ix != 0){
    G4cout << " PROBLEM! " << theTrack->GetCreatorProcess()->GetProcessName() <<
std::flush << G4endl;
}

This is what the program writes (rare case but it happens) when we are using the
simulation engine: QGSP_BIC 1.2

PROBLEM! ProtonInelastic

and this, when we use for the simulation engine  QGSC 2.9

PROBLEM!  NeutronInelastic
Comment 1 Hans-Peter.Wellisch 2005-08-08 03:38:59 CEST
Hi Peter,

  thank you for reporting this. The hadronic frameworks check on exit, if there
are nans around in any of the secondaries. I do this for energy and momenta in
production. It is not clear to me, how momentum direction can contain a nan,
while momentum does not, but I'll add a check on momentum direction in the next
update.

Since your check is in the stepping action, I am not totally sure that it is
actually hadronics that is faulty. This may as well happen during
transportation. Can you place the check in the stacking action, or
alternatively check the step number?

Many greetings,

Hans-Peter.
Comment 2 Gunter.Folger 2006-10-31 03:31:59 CET
Additional checks in since 8.0