Exercises and Solutions - Day 3 (May 21st)

Exercises: Exercises of the day

Exercises and solutions - Part III

The solutions are indicated in red.

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:

Code can be found
here.

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

#include "PhysicsEMMuonStandard.hh"
#include "G4ParticleDefinition.hh"
#include "G4MuonPlus.hh"
#include "G4MuonMinus.hh"
#include "G4ProcessManager.hh"
#include "G4MultipleScattering.hh"
#include "G4MuIonisation.hh"
#include "G4MuBremsstrahlung.hh"
#include "G4MuPairProduction.hh"



void PhysicsEMMuonStandard::ConstructProcess() {

  G4ParticleDefinition* particle = 0;
  G4ProcessManager* processManager = 0;

  // *************
  // *** Muon+ ***
  // *************

  G4MultipleScattering* muonPlusMultipleScatteringProcess = new G4MultipleScattering();
  G4MuIonisation* muonPlusIonisationProcess = new G4MuIonisation();
  G4MuBremsstrahlung* muonPlusBremsstrahlungProcess = new G4MuBremsstrahlung();
  G4MuPairProduction* muonPlusPairProductionProcess = new G4MuPairProduction();

  particle = G4MuonPlus::MuonPlus(); 
  processManager = particle -> GetProcessManager();
  processManager -> AddProcess(muonPlusMultipleScatteringProcess, -1, 1, 1);
  processManager -> AddProcess(muonPlusIonisationProcess,-1, 2, 2);
  processManager -> AddProcess(muonPlusBremsstrahlungProcess, -1, 3, 3);
  processManager -> AddProcess(muonPlusPairProductionProcess, -1, 4, 4);

  // *************
  // *** Muon- ***
  // *************

  G4MultipleScattering* muonMinusMultipleScatteringProcess = new G4MultipleScattering();
  G4MuIonisation* muonMinusIonisationProcess = new G4MuIonisation();
  G4MuBremsstrahlung* muonMinusBremsstrahlungProcess = new G4MuBremsstrahlung();
  G4MuPairProduction* muonMinusPairProductionProcess = new G4MuPairProduction();

  particle = G4MuonMinus::MuonMinus(); 
  processManager = particle -> GetProcessManager();
  processManager -> AddProcess(muonMinusMultipleScatteringProcess, -1, 1, 1);
  processManager -> AddProcess(muonMinusIonisationProcess,-1, 2, 2);
  processManager -> AddProcess(muonMinusBremsstrahlungProcess, -1, 3, 3);
  processManager -> AddProcess(muonMinusPairProductionProcess, -1, 4, 4);
}
Code can be found here.
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.
This is similar to what done for exercise 3.3 before. Namely:
update the header file as shown, adding a new data member for the muon physics constructor
 private:
 ...
  static G4VPhysicsConstructor* emMuon;
Then update the code file:
 #include "PhysicsEMMuonStandard.hh"
 ...
 G4VPhysicsConstructor* PhysicsList::emMuon = 0;
 ...
 void PhysicsList::RegisterPhysConstructor(const G4String& constrName) 
 {
  ...
  //Register EM physics for muons, similarly to what done before
  if (emMuon == 0)
  {
    if (constrName == "EM-Muon")
    	emMuon = new PhysicsEMMuonStandard();
    if (emMuon) RegisterPhysics(emMuon);
  }
 } 
The code can be found here.