The solutions are indicated in blue.
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:
#include "G4CascadeInterface.hh" void PhysicsHIProtonNeutron::ConstructProcess() { ... //Replace Binary cascade with Bertini cascade (G4CascadeInterface()) in the same energy range G4CascadeInterface* protoBertiniCascadeModel = new G4CascadeInterface(); protonBertiniCascadeModel -> SetMinEnergy(protonBinaryMinEnergy); protonBertiniCascadeModel -> SetMaxEnergy(protonBinaryMaxEnergy); G4ProtonInelasticProcess* protonInelasticProcess = new G4ProtonInelasticProcess("inelastic-proton"); //Register the model to the proton process protonInelasticProcess -> RegisterMe(protonBertiniCascadeModel); }
#include "G4LEProtonInelastic.hh" ... void PhysicsHIProtonNeutron::ConstructProcess() { ... // We instantiate a new model for proton inelastic interaction (LEP parametrized model) in // energy range from 10 to 25 GeV. We allow a small overlap with the previous model (Bertini or // Binary cascade), so set the minimum energy for the LEP model to 9.5 GeV G4LEProtonInelastic* protonLEInelastic = new G4LEProtonInelastic(); protonLEInelastic->SetMinEnergy(9.5*GeV); protonLEInelastic->SetMaxEnergy(25*GeV); //Now register the model to the proton inelastic process protonInelasticProcess->RegisterMe(protonLEInelastic); }
#include "G4ProtonInelasticCrossSection.hh" ... void PhysicsHIProtonNeutron::ConstructProcess() { ... G4ProtonInelasticCrossSection* protonInelasticCrossSection = new G4ProtonInelasticCrossSection(); //now the cross section set is registered to the proton inelastic model protonInelasticProcess -> AddDataSet(protonInelasticCrossSection); }
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).
Note: 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+/-: Common Definitions ***
// ***********************************
G4MultipleScattering* muonMultipleScatteringProcess = new G4MultipleScattering();
G4MuIonisation* muonIonisationProcess = new G4MuIonisation();
G4MuBremsstrahlung* muonBremsstrahlungProcess = new G4MuBremsstrahlung();
G4MuPairProduction* muonPairProductionProcess = new G4MuPairProduction();
// *************
// *** Muon+ ***
// *************
particle = G4MuonPlus::MuonPlus();
processManager = particle -> GetProcessManager();
processManager -> AddProcess(muonMultipleScatteringProcess, -1, 1, 1);
processManager -> AddProcess(muonIonisationProcess,-1, 2, 2);
processManager -> AddProcess(muonBremsstrahlungProcess, -1, 3, 3);
processManager -> AddProcess(muonPairProductionProcess, -1, 4, 4);
// *************
// *** Muon- ***
// *************
particle = G4MuonMinus::MuonMinus();
processManager = particle -> GetProcessManager();
processManager -> AddProcess(muonMultipleScatteringProcess, -1, 1, 1);
processManager -> AddProcess(muonIonisationProcess,-1, 2, 2);
processManager -> AddProcess(muonBremsstrahlungProcess, -1, 3, 3);
processManager -> AddProcess(muonPairProductionProcess, -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.