|
|
|
|
|
Introduction to Geant4
Lectures by Andrea dell'Acqua (CERN)
From the Ann Arbor Workshop on Geant4 26 February to 2 March, 2001.
|
|
Exercise N03A
This is the first of two exercises that are found in Lecture 9, Particles and Physics Processes. Exercise 3A begins on slide number 19.
Steps ExN03A
- ConstructProcess for a geantino
The aim of the exercise is to add particles and physics processes and to define cuts for these particles in the physics list.
- A geantino is a geometrical probe, only the transportation process must be registered with it.
void ExN01PhysicsList::ConstructProcess()
{
AddTransportation();
}- ConstructProcess for gammas
Void MyPhysicsList::ConstructProcess()
{
AddTransportation();
ConstructEM();
}
void MyPhysicsList::ConstructEM()
{
G4ParticleDefinition* particle = G4Gamma::GammaDefinition();
G4ProcessManager *pmanager = particle->GetProcessManager();
G4PhotoElectricEffect *thePhotoElectricEffect = new G4PhotoElectricEffect;
G4ComptonScattering *theComptonScattering = new G4ComptonScattering;
G4GammaConversion *theGammaConversion = new G4GammaConversion;
pmanager->AddDiscreteProcess(thePhotoElectricEffect);
pmanager->AddDiscreteProcess(theComptonScattering);
pmanager->AddDiscreteProcess(theGammaConversion);
}
- Go into FramePhysicsList and add geantino, electron, positron, mu+ and mu- into ConstructParticle().
- Go into ConstructProcess() and add processes for the particles you just defined.
- geantinos only need transportation
- electrons need the multiple scattering (G4MultipleScattering), the ionisation (G4eIonisation), the bremsstrahlung (G4eBremsstrahlung) to be added. In the case of positron, add the annihilation (G4eplusAnnihilation).
- add processes for the muons too (G4MultipleScattering, G4MuIonisation, G4MuBremsstrahlung, G4MuPairProduction)
- Add cuts for these particles in SetCuts().
- Use ExampleN02 for reference (don't copy&paste into the blue. Try and understand what is happening.)
- To find a particle into the particle table, use either the particle iterator or the FindParticle() method.
- Shoot an electron (we are using the same geometry as in the Frame example). See if a shower develops in the calorimeter.
Definitions
- The G4VUserPhysicsList class is the base class which one has to derive from to specify all particles and physics processes to be used in the simulation.
- SetCuts() is a virtual method of the class G4VUserPhysicsList to be implemented in order to set the cut in range for each particle.
- The G4ParticleDefinition class provides a representation of a particle.
- Each particle is represented by its own class.
- The classes contain properties which characterize individual particles.
- Except for lifetime, decay table and the "stable" flag, these attributes are read-only and cannot be changed without rebuilding the libraries.
- Particles are static objects belonging to the individual particle classes.
- The class G4ParticleTable is a collection of defined particles. It provides a series of utility methods to retrieve particle definitions.
- FindParticle(G4String name) find the particle by name
- FindParticle(G4int PDGencoding) find the particle by its PDG code
- G4ProcessManager is a member of G4ParticleDefinition and keeps a list of processes a particle can undergo.
- G4VProcess is a class that is provided as the base class for all physics processes.
- Physics processes describe the interaction of particles with matter. Geant4 has seven major categories of physics processes.
- electromagnetic, hadronic, transportation, decay, optical, photolepton_hadron, parameterisation
- Transportation, propagating particles in space, is treated as a process. Therefore, it must be defined for all particles.
- ConstructProcess() is a pure virtual method which is used to create physics processes and register them to particles.
Helpful Links
- To review how to implement the ConstructParticle() method from the G4VUserPhysicsList in order to create all particles which are needed in the simulation, view slide number 6.
- To see an example of how to ease the implementation of the SetCuts() method, begin on slide number 9.
- Start with slide number 15 in order to see the three virtual methods that describe all physics processes. This slide also lists other classes that are used as base classes for simple processes.
- To see more about the G4ProcessManager, look at slide number 16.
Checklist
- Did you remember to inherit from the G4VUserPhysicsList and implement the three methods?
- ConstructParticle() Particle Construction
- ConstructProcess() Physics Processes
- SetCuts() Cut Values (in stopping range)
- Did you explicitly declare the particle classes somewhere in the program so that the compiler will recognize the classes and make the particle object available?
- Is the G4Transportation class registered with all of your particle classes? To see how to add the method, view slide 17.
- Did you remember that for each particle that is declared in ConstructParticle(), you must have use of the G4ProcessManager attached to the particle and register all relevant physics processes by using the AddProcess(G4VProcess *) method?
Back to the Geant4 Lectures
![]()
For information: wlap@umich.edu http://www.umich.edu/~wlap Last modified: syscmd(date)