Exercises - Day 3 (May 21st)

Content:
Introduction
Exercises
Part I
Part II
Part III

Solutions:
Part I
Part II
Part III

Web:
SW references

Manual:
Appl. Dev. Man

Presentations:
Slides

Main:
Main

Introduction

Today's exercises cover the following items:

The Geant4 application example, which is presented on the main page, serves again as the basis of the exercises. Do not use the example with your modifications from yesterday, but download again the original tar-ball (you may find the instructions on the main page).
The exercises of today include the modification and/or extension of the following classes:

Exercises

Part I - Introductory exercises

Exercise 3-1
Get familiar with the classes of the example application, which are subject of the exercises: PhysicsList and various concrete physics constructor classes. Also try to understand the class hierarchies (abstract base class, concrete user implementation) of the relevant classes.

The following diagrams shows the class hierarchies for the physics list and various physics constructors (click here for a files: A, B, C):

Class Diagram 3A (Day 3)

Class Diagram 3B (Day 3)

Class Diagram 3C (Day 3)

Answer following questions:

Exercise 3-2
Based on the provided macro file electronbeam.mac try to create a new macro file (protonbeam.mac) for a primary proton beam, which contains the following physics setup:

For each of above physics components a physics constructor is already implemented. Use the PhysicsList class to determine the parameters of the command
/physics/physConstructor
which activate the various constructors listed above. Furthermore, adapt the beam parameters according to the following values: Run the Geant4 application example using the new macro file for protons.

Once your macro file is completed and the application runs successfully, try to to add the visualization functionality as shown in the macro electronbeam_vis.mac to your proton macro file. Add a line setting the color of proton tracks to yellow. Rerun the application with the modified macro file.

Part II - Electromagnetic physics

Exercise 3-3*
You can find
here the header file for a new physics constructor class (PhysicsEMElectronEEDL), which should construct electromagnetic (EM) processes of electrons. Implement the method ConstructProcess (in a new file PhysicsEMElectronEEDL.cc), in order that it instantiates the classes representing:

As the next step, assign the process objects to the process manager. Note:

Exercise 3-4
Integrate the physics constructor class of the previous exercise into the example application: A user should be able to activate via a macro command the EM physics for electrons defined in PhysicsEMElectronEEDL as an alternative option to the penelope physics (PhysicsEMElectronPenelope):

Exercise 3-5
The physics constructor class PhysicsEMHadronIonLowEnergy instantiates electromagnetic physics processes for charged hadrons and ions. The included processes are:

The class G4hLowEnergyIonisation allows for the possibility of activating optional electron stopping power models for protons and alpha particles based on different parametrisations. Retrieve the names of these models from the Geant4 physics reference manual: The two last models in the table are the default ones for protons and alpha particles, respectively. In the PhysicsEMHadronIonLowEnergy class of the example application try to set an optional model for each by using the according public member function of G4hLowEnergyIonisation. Retrieve the class method in the Geant4 application developers manual (see the section "Low Energy Electromagnetic Processes"):

Part III - Hadronic and Muon Physics

Exercise 3-6
The processes to describe inelastic interactions of protons and neutrons are included in the G4VPhysicsConstructor class called PhysicsHIProtonNeutron.cc.
Inelastic interactions of protons are described by the Binary Cascade model (G4BinaryCascade) between 0 and 10 GeV.
For this exercise:

Exercise 3-7
During the simulation (e.g. when primaries are high-energy protons or neutrons) you may produce secondary pions (or you may take pions as primaries). For pions the decay process is active, so they may decay and produce muons. In the physics list provided in the example, muons are defined as particles, but no processes are registered for them. It means that they would be tracked by Geant4 without undergoing any interaction.
The purpose of this exercise is to create a new physics constructor class (as done for exercise 3-2) which implements electromagnetic processes for muons in its ConstructProcess() method. The header file for this class is
here.
The processes to be registered to the muon ProcessManager are: G4MuMultipleScattering, G4MuIonisation, G4MuBremsstrahlung and G4MuPairProduction. The first three processes (multiple scattering, ionisation and bremsstrahlung) have AlongStep() and PostStep() action, while muon pair production has only PostStep() (namely it is a discrete process). Notice: you have to take into account both negative and positive muons (G4MuonMinus and G4MuonPlus).
Important notice: Don't forget to integrate the physics constructor class of the previous exercise into the full example application. The physics constructor should be registered in the general physics list when the user gives a proper messenger command.