Problem 1463

Summary: /run/setCut UI command not applied to gamma electron
Product: Geant4 Reporter: Iwan Cornelius <iwancornelius>
Component: runAssignee: asai
Status: RESOLVED FIXED    
Severity: normal CC: kurasige
Priority: P5    
Version: 9.6   
Hardware: All   
OS: All   

Description Iwan Cornelius 2013-04-04 10:57:27 CEST
Hello, 

Probably not a bug per se, just unusual behaviour in /run/setCut UI command used to set default cut value. One would expect this to be applied to all particles, instead one gets the following behaviour: 

/run/setCut 2 mm 

### === G4UAtomicDeexcitation::InitialiseForNewRun()

========= Table of registered couples ==============================

Index : 0     used in the geometry : Yes     recalculation needed : No 
 Material : G4_WATER
 Range cuts        :  gamma  10 um     e-  10 um     e+  10 um  proton 2 mm 
 Energy thresholds :  gamma  250 eV     e-  14.0748 keV    e+  13.8544 keV proton 200 keV
 Region(s) which use this couple : 
    DefaultRegionForTheWorld

====================================================================


(ie cuts not applied to electrons and gammas). However, if we use particle specific cuts UI such as:

Idle> /run/setCutForAGivenParticle gamma 1 mm 
Idle> /run/setCutForAGivenParticle e- 1 mm    
Idle> /run/dumpCouples                        

========= Table of registered couples ==============================

Index : 0     used in the geometry : Yes     recalculation needed : Yes
 Material : G4_WATER
 Range cuts        :  gamma  1 mm     e-  1 mm     e+  10 um  proton 2 mm 
 Energy thresholds :  is not ready to print
 Region(s) which use this couple : 
    DefaultRegionForTheWorld

we get the expected behaviour. 

It would be a good idea to modify /run/setCut behaviour so as to apply default cut to all particles. In this way users get a more intuitive experience, potentially saving on dev time. 

Hope this helps. 

Regards, 
Iwan
Comment 1 kurasige 2013-04-10 05:57:25 CEST
If you want to activate default cut value (i.e. cut value given by /run/setCut command), you need to invoke G4VUserPhysicsList::SetCutsWithDefault()
http://www-geant4.kek.jp/lxr/source/run/src/G4VUserPhysicsList.cc#L387
in SetCuts method of your PhysicsList.

In other words, if you use  G4VUserPhysicsList::SetCutValue(G4double aCut, const G4String& name) in your physics list, default cut value will not be applied for the particle type.

If you want to change cut values different from the default cut values for certain particle type, you can use
/run/setCutForAGivenParticle command.