Problem 173

Summary: G4UserSpecialCuts neutron example in Application Developers Guide can lead to crash
Product: Geant4 Reporter: dbailey
Component: processes/transportationAssignee: Michel.Maire
Status: RESOLVED FIXED    
Severity: trivial    
Priority: P5    
Version: 2.0   
Hardware: PC   
OS: Linux   

Description dbailey 2000-11-23 04:09:32 CET
In Section 3.18.7 of the Application Developers Guide, it gives an example using
G4UserSpecialCuts for neutrons. I copied this example, but if (as unfortunately
can very occasionally happen) a neutron is produced at rest, the program crashes
and it can take some time to figure out why.

The Guide says to use
   "pmanager->AddProcess(new G4UserSpecialCuts(),0,-1,1);"
but replacing this with
   "pmanager->AddProcess(new G4UserSpecialCuts(),-1,-1,1);"
solves the problem.

I guess this may be because the current default G4UserSpecialCuts returns NULL
for AtRestDoIt, and seems to only operate for PostStepDoIt.

If my understanding of G4UserSpecialCuts is correct, I suggest modifying the
example in the guide to be consistant with the default G4UserSpecialCuts. Even if
one doesn't run into the crash, the apparent inconsistency is confusing to a new
user trying to understand the use of ordering parameters.
Comment 1 Michel.Maire 2001-01-09 09:08:59 CET
You are right. The doc has been modified, according your suggestion.