Institut f¨ur Experimentelle Kernphysik (EKP) Prof. Dr. M. Feindt, Dr. M. Kreps, Dr. T. Kuhr C. Hackstein, D. Zander, Dr. A. Zupanc
5. November 2009
Computerpraktikum zur Vorlesung Teilchenphysik f¨ ur Fortgeschrittene Introduction to GEANT, Part 1
About GEANT
In experimental particle physics, Monte Carlo methods (simulations) are used for desi- gning detectors, understanding their behavior and comparing experimental data to theo- ry. The Monte Carlo production proceeds in two steps: event generation and detector response simulation. In the first step, sets of outgoing particles produced in the collisions of particles in the accelerator, calledevents, are generated. Then, the detector response to these particles is simulated using GEANT package. GEANT is a toolkit for the simulation of the passage of particles through matter. Its areas of application include high energy, nuclear and accelerator physics, as well as studies in medical and space science.
GEANT includes facilities for handling geometry, tracking, detector response, run management, visualization and user interface:
• Geometry is an analysis of the physical layout of the experiment, including detectors, absorbers, etc., and considering how this layout will affect the path of particles in the experiment.
• Tracking is simulating the passage of a particle through matter. This involves con- sidering possible interactions and decay processes.
• Detector response is recording when a particle passes through the volume of a de- tector, and approximating how a real detector would respond.
• Run management is recording the details of each run (a set of events), as well as setting up the experiment in different configurations between runs.
• Geant4 offers a number of options for visualization, including OpenGL, and a fami- liar user interface, based on Tcsh.
Installing and starting the software
The files needed for this tutorial as well as the complete source code can be found in the tar–Archiv on the website of the course or can be directly copied during the exercises from: /home/staff/zupanc/exercises/geant4 tutorial.tar.gz.
For the simulation of the events we will use GEANT 4, while for the analysis we will use ROOT. Both packages can be found in the archive.
• First unpack the archive:
> tar xzvf geant4_tuorial.tar.gz
• Now go into the new directory
”geant4 tutorial“ and start the script which sets some environment variables, then change to the directory
”TutorialApplication“:
> cd geant4_tutorial
> source setup.[c]sh
> cd TutorialApplication
Repeat this procedure for every new shell you start up to run the tutorial application.
• To execute the tutorial application, you have to start ROOT as follows:
> root run_g4.C
The macro loads all necessary GEANT libraries and the graphical interface to the tutorial simulation application. (The command line within ROOT is called
”root[n]“, where n between the square brackets indicates the number of executed operations.)
Commands of the GEANT - interface
During the start of ROOT in the directory
”geant4 tutorial/TutorialApplication“ an instance of the TutorialApplication-class with the name
”app“ will be created. A gra- phical display is created as well and the following operations can be executed using the
”app“ pointer to the application class:
• root[] app->InitMC(<filename>);
initialize GEANT with a geometry described in the file <filename>.
• root[] app->SetPrimaryPDG(<pdg code>);
set the type of the primary particle (e.g. <pdg code>= 22 is a γ).
• root[] app->SetPrimaryMomentum(<momentum[GeV]>);
set the momentum of the primary particle in units of [GeV].
• root[] app->RunMC(<n>);
simulate <n> events.
• root[] .L <macroname>.C
load a ROOT macro with the name<macroname>.
• root[] <macroname>();
execute the ROOT macro.
• root[] .q exit ROOT.
1 Interaction of photons
Determination of the statistical frequency of the Compton effect and pair production as a function of the photon energy.
1.1 Exercise:
Shot photons with a energy of 1 and 30 MeV into a small lead volume (2 cm × 4 cm × 4 cm) and classify the occured processes.
1.2 Instruction
• Start ROOT:
> cd geant4_tutorial
> source setup.[c]sh
> cd TutorialApplication
> root run_g4.C
• Decrease the
”cutoffs“ inGEANT:
root[] gMC->SetCut("CUTELE",0.0005);
root[] gMC->SetCut("CUTGAM",0.0005);
• Load the geometry g1:
root[] app->InitMC("geometry/g1");
• Choose photon as the primary particle with a momentum of 0.003 GeV. (see chapter 2.)
root[] app->SetPrimaryPDG(22);
root[] app->SetPrimaryMomentum(0.003);
• Analyze the frequency of the different elementary processes (Compton scattering and pair production) and draw a histogram (pencil and paper).
• Repeat this exercise with different momenta.
• Use iron instead of lead.
For this purpose the file
”TutorialApplication/geometry/g1.C“ has to be changed.
Tip: There is a list of produced particles of the event. Start theROOTbrowser und look at the
”Geant4/TParticles“ folder. (double click).
2 Electromagnetic interaction
2.1 Exercise:
• Part 1:
Shot photons with energies more than 1 GeV into the lead block from the previous exercise. Create a histogram of the x-positions of the first pair production process and determine the radiation length which corresponds to the thickness, after which about 54% of the photons have created an electron pair.
• Part 2:
Analyze the process of the shower evolution (starting point, width, depth, fluctua- tions) within a larger block for electrons with higher energies (some GeV) .
2.2 Instruction
• Part 1:
Geometry: TutorialApplication/geometry/g1 Primary particle: γ
Momentum: 1.0 GeV
Fill a histogram with the travelling distance of the photons until the first process.
Tip 1:Activate with the right mouse button within theROOTwindow the display of the axis in the
”Detector View“.
Tip 2: There is a ROOT macro called
”XofFirstSecondary.C“, which determines the starting point of the first secondary particles.
root[] .L XofFirstSecondary.C root[] XofFirstSecondary()
• Part 2:
Geometry: TutorialApplication/geometry/g2 Primary particle: e−
Momentum: 3 GeV
Tip: There are automatically created histograms with the energy deposition in lon- gitudinal and transverse direction. These can be found with the ROOT browser:
The histograms are in the folder
”Geant4/Histograms“ and can be clicked within the Browser (see tip of exercise 3).