12.07.2015 Views

Geant4 User's Guide for Application Developers - Geant4 - CERN

Geant4 User's Guide for Application Developers - Geant4 - CERN

Geant4 User's Guide for Application Developers - Geant4 - CERN

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

G4VContinuousProcessProcesses with only AlongStepDoItG4VDiscreteProcessprocesses with only PostStepDoItGetting Started with <strong>Geant4</strong>- Running a Simple ExampleAnother 4 virtual classes, such as G4VContinuousDiscreteProcess, are provided <strong>for</strong> complex processes.2.5.2. Managing ProcessesThe G4ProcessManager class contains a list of processes that a particle can undertake. It has in<strong>for</strong>mation on theorder of invocation of the processes, as well as which kind of DoIt method is valid <strong>for</strong> each process in the list. AG4ProcessManager object corresponds to each particle and is attached to the G4ParticleDefiniton class.In order to validate processes, they should be registered with the particle's G4ProcessManager. Process orderingin<strong>for</strong>mation is included by using the AddProcess() and SetProcessOrdering() methods. For registrationof 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, sothey must not be used in the PreInit phase.The G4VUserPhysicsList class creates and attaches G4ProcessManager objects to all particle classes defined inthe ConstructParticle() method.2.5.3. Specifying Physics ProcessesG4VUserPhysicsList is the base class <strong>for</strong> a "mandatory user class" (see Section 2.1), in which all physics processesand all particles required in a simulation must be registered. The user must create a class derived fromG4VUserPhysicsList and implement the pure virtual method ConstructProcess().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:Example 2.17. Register processes <strong>for</strong> a geantino.void ExN01PhysicsList::ConstructProcess(){// Define transportation processAddTransportation();}Here, the AddTransportation() method is provided in the G4VUserPhysicsList class to register theG4Transportation class with all particle classes. The G4Transportation class (and/or related classes) describes theparticle motion in space and time. It is the mandatory process <strong>for</strong> tracking particles.In the ConstructProcess() method, physics processes should be created and registered with each particle'sinstance of G4ProcessManager.An example of process registration is given in the G4VUserPhysicsList::AddTransportation() method.Registration in G4ProcessManager is a complex procedure <strong>for</strong> other processes and particles because the relationsbetween processes are crucial <strong>for</strong> some processes. Please see Section 5.2 and the example codes.An example of electromagnetic process registration <strong>for</strong> photons is shown below:14

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!