Problem 173 - G4UserSpecialCuts neutron example in Application Developers Guide can lead to crash
Summary: G4UserSpecialCuts neutron example in Application Developers Guide can lead to...
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: processes/transportation (show other problems)
Version: 2.0
Hardware: PC Linux
: P5 trivial
Assignee: Michel.Maire
URL:
Depends on:
Blocks:
 
Reported: 2000-11-23 04:09 CET by dbailey
Modified: 2001-01-09 09:08 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 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.