Exercises - Day 3

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:

  • Modular Physics List
  • Physics Constructors:
    • Electromagnetic physics
    • Hadronic physics (elastic processes)
    • Hadronic physics (inelastic processes)

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:

  • PhysicsList
  • PhysicsListMessenger
  • Various physics constructors

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:
  • What are the base classes of the following user classes?
    • PhysicsList
    • PhysicsListMessenger
    • PhysicsEMElectronPenelope
  • Which classes must be implemented in the user physics constructors?
  • Which physics processes are instantiated in the following electromagnetic physics constructors?
    • PhysicsEMElectronPenelope
    • PhysicsEMPhotonEPDL
  • Which physics processes and models are instantiated in the following hadronic physics constructors? Also specify the energy values limiting the applicability of the models, if explicitly set in the physics constructor (if they are not set default values are assumed):
    • PhysicsHEHadronIonLElastic
    • PhysicsHIProtonNeutron
  • Which commands are defined in the physics list messenger (class PhysicsListMessenger)? Specify the command names and the purpose of the commands.

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:

  • electromagnetic physics for charged hadrons and ions: low energy models
  • electromagnetic physics for electrons: penelope models
  • electromagnetic physics for photons: penelope models
  • electromagnetic physics for positrons: standard models
  • elastic hadronic physics for hadrons and ions: LElastic model
  • inelastic hadronic physics for protons and neutrons: binary model
  • inelastic hadronic physics for ions: binary model
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:
  • primary beam energy of 50 MeV,
  • sigma equals to 300 keV
  • incident angle of 45 degree
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:

  • the multiple scattering process,
  • the Livermore library-based processes for ionization and Bremsstrahlung,
  • and the step limiter process.
As the next step, assign the process objects to the process manager. Note:
  • The implementation of the ConstructProcess method in the class PhysicsEMElectronPenelope might be a useful starting point.
  • In the source file, don't forget to include the header files according to the considered physics process classes.

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):

  • In which class can you define this option?

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

  • Multiple scattering (G4MultipleScattering)
  • and ionization (G4hLowEnergyIonisation of the Low Energy package).
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:
  • Hint: See the table in the section "Energy losses of slow positive hadrons".
  • What are the different models?
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"):
  • What is the name of this member function?
  • What arguments does it require?

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:

  • Update the class replacing the Binary cascade model with the Bertini cascade model, in the same energy range. The model for Bertini cascade is G4CascadeInterface().
  • Include a new model to describe proton inelastic scattering from energies larger than 10 GeV (e.g. up to 25 GeV). You may use the low-energy parametrized model G4LEProtonInelastic. You should instantiate the model, set its application energy range, and register it to the proper process (G4ProtonInelasticProcess). Notice: allow a slight overlap in the energy range of the models.
  • For proton inelastic scattering exists a specialized cross section model, which is G4ProtonInelasticCrossSection (the default model is G4HadronInelasticDataSet). Instantiate the cross section model, and register it to the G4ProtonInelasticProcess, using the AddDataSet() method.

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 note: 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.