Problem 778 - secondaries with NAN as momentum direction
Summary: secondaries with NAN as momentum direction
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: processes/hadronic (show other problems)
Version: 7.1
Hardware: PC Linux
: P3 normal
Assignee: Gunter.Folger
URL:
Depends on:
Blocks:
 
Reported: 2005-08-04 21:54 CEST by gum
Modified: 2006-10-31 03:31 CET (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
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