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
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.
Additional checks in since 8.0