Introduction to GEANT4

From UCL HEP PBT Wiki

Jump to: navigation, search
m
m
Line 110: Line 110:
== <span style="color:#000080"> Physics processes </span> ==  
== <span style="color:#000080"> Physics processes </span> ==  
 +
<span style="color:#ff0000"> G4VUserPhysicsList </span> is a mandatory user class. It has three methods:
 +
 +
* ConstructParticles(): define all necessary particles; 
 +
* ConstructProcesses(): define all necessary processes and assign them to proper particles;
 +
* SetCuts(): define production thresholds (in terms of range);
 +
 +
GEANT4 provides a variety of physics processes of particle interactions with matter. There are seven categories of processes provided by GEANT4:
 +
 +
# electromagnetic
 +
** standard
 +
** low Energy (Livermore Library / Penelope)
 +
# hadronic
 +
# decay
 +
# photolepton-hadron
 +
# optical
 +
# parameterization
 +
# transportation 
 +
 +
This example shows how to define your own class from the G4VUserPhysicsList base class.
 +
 +
 +
<span style="color:#800000"> MyPhysicsList :: MyPhysicsList(): G4VUserPhysicsList() </span>
 +
<span style="color:#800000"> { </span>
 +
<span style="color:#800000"> //Define production thresholds </span>
 +
<span style="color:#800000"> defaultCutValue = 1.0*cm; </span>
 +
<span style="color:#800000"> } </span>
 +
<span style="color:#800000"> void MyPhysicsList :: ConstructParticles() </span>
 +
<span style="color:#800000"> { </span>
 +
<span style="color:#800000"> //Define the particles </span>
 +
<span style="color:#800000"> G4Electron::ElectronDefinition(); </span>
 +
<span style="color:#800000"> G4Positron::PositronDefinition(); </span>
 +
<span style="color:#800000"> G4Gamma::GammaDefinition(); </span>
 +
<span style="color:#800000"> } </span>
 +
<span style="color:#800000"> void MyPhysicsList :: SetCuts() </span>
 +
<span style="color:#800000"> { </span>
 +
<span style="color:#800000"> //Set the production threshold </span>
 +
<span style="color:#800000"> SetCutsWithDefault(); </span>
 +
<span style="color:#800000"> } </span>   
== <span style="color:#000080"> Generate primary particles </span> ==  
== <span style="color:#000080"> Generate primary particles </span> ==  

Revision as of 09:28, 7 July 2014

Personal tools