Geant4 User's Guide
For Application Developers Getting Started with Geant4 |
2.5 How to Specify Physics Processes
2.5.1 Physics Processes
Physics processes describe how particles interact with materials. Geant4
provides seven major categories of processes:
All physics processes are derived from the G4VProcess base class. Its virtual methods
The following are specialized base classes to be used for simple processes:
G4VAtRestProcess | - processes with only AtRestDoIt |
G4VContinuousProcess | - processes with only AlongStepDoIt |
G4VDiscreteProcess | - processes with only PostStepDoIt |
In order to validate processes, they should be registered with the particle's G4ProcessManager. Process ordering information is included by using the AddProcess() and SetProcessOrdering() methods. For registration of simple processes, the AddAtRestProcess(), AddContinuousProcess() and AddDiscreteProcess() methods may be used.
G4ProcessManager is able to turn some processes on or off during a run by using the ActivateProcess() and InActivateProcess() methods. These methods are valid only after process registration is complete, so they must not be used in the PreInit phase.
The G4VUserPhysicsList class creates and attaches G4ProcessManager objects to all particle classes defined in the ConstructParticle() method.
For example, if just the G4Geantino particle class is required, only the transportation process need be registered. The ConstructProcess() method would then be implemented as follows:
void ExN01PhysicsList::ConstructProcess() { // Define transportation process AddTransportation(); } |
Source listing 2.5.1 Register processes for a geantino. |
Here, the AddTransportation() method is provided in the G4VUserPhysicsList class to register the G4Transportation class with all particle classes. The G4Transportation class (and/or related classes) describes the particle motion in space and time. It is the mandatory process for tracking particles.
In the ConstructProcess() method, physics processes should be created and registered with each particle's instance of G4ProcessManager.
An example of process registration is given in the G4VUserPhysicsList::AddTransportation() method.
Registration in G4ProcessManager is a complex procedure for other processes and particles because the relations between processes are crucial for some processes. Please see Section 5.2 and the example codes.
An example of electromagnetic process registration for photons is shown below:
void MyPhysicsList::ConstructProcess() { // Define transportation process AddTransportation(); // electromagnetic processes ConstructEM(); } void MyPhysicsList::ConstructEM() { // Get the process manager for gamma G4ParticleDefinition* particle = G4Gamma::GammaDefinition(); G4ProcessManager* pmanager = particle->GetProcessManager(); // Construct processes for gamma G4PhotoElectricEffect * thePhotoElectricEffect = new G4PhotoElectricEffect(); G4ComptonScattering * theComptonScattering = new G4ComptonScattering(); G4GammaConversion* theGammaConversion = new G4GammaConversion(); // Register processes to gamma's process manager pmanager->AddDiscreteProcess(thePhotoElectricEffect); pmanager->AddDiscreteProcess(theComptonScattering); pmanager->AddDiscreteProcess(theGammaConversion); } |
Source listing 2.5.2 Register processes for a gamma. |