Git repo

The source code repository in CERN Gitlab is here:

After setting up Gitlab, the code can be cloned like so:

git clone ssh://


Geant4 website
Developer guide
Source reference (LXR)
Geant4 twiki


Set up

The simulations need cmake, Geant4 and Root. The script sets up Geant4 and Root from AFS and runs cmake and make. The outputs go into ./build/. To rebuild the code, make can be run in the build directory or in a simulation subdirectory of build. If adding or removing source files, you may need to rerun cmake from the build directory, like so:
cd build
cmake ..


The executables in the build directories can be run in interactive mode. E.g:
cd build/lead_glass
The number of threads can be specified with "-t " where is the number, e.g. on a quad core PC; "-t 4"

An example macro file is provided for batch runs:

cd build/lead_glass
./lead_glass -m e-_3GeV.mac
hadd e-_3GeV.root lead_glass*.root
Note that there will be n threads plus one files matching lead_glass*.root. The format of species + charge + '_' + energy + '.root' is understood by the plotting macros.


In each build directory is a plots.C macro with some histogramming options for various variables of interest. They can be executed with Root like so:
cd build/lead_glass
root 'plots.C("+", "3GeV", "interaction_depth")'
Note that the macro will try to open Root files with the format specified above, using the charge and energy specified. It will try to plot electrons, muons, pions, protons and neutrons, if Root files are available.



Based on the NA62 MC source code, since they use the same OPAL blocks.
  • Pion interaction depths:
    50MeV_pi_bragg.png 500MeV_pi_interaction.png
The Bragg peak is visible for 50MeV Pions. In the second image, 500MeV Pions are shown interacting inside the block in blue, and not interacting in the block in red. A narrow peak is found for non-interacting Pions. Note the end point of the energy distribution is $p_{beam} c + m_{\pi^\pm} c^2$.


Using some code from the NA62 Cedar detector simulation, but simplified for BCC type detectors.
  • Photon multiplicity of negative 5GeV particles in Nitrogen at 2bar:
  • Total energy loss of positive 1, 3, 5 and 7GeV particles in Nitrogen at 2bar:
    2bar_1GeV.png 2bar_3GeV.png 2bar_5GeV.png 2bar_7GeV.png

-- TimBrooks - 2015-11-18

Topic attachments
I Attachment History Action Size Date Who Comment
PNGpng 2bar_-5GeV.png r2 r1 manage 11.6 K 2015-12-01 - 17:17 TimBrooks Cherenkov photon multiplicity at 2bar
PNGpng 2bar_1GeV.png r2 r1 manage 11.7 K 2015-11-19 - 20:22 TimBrooks Cherenkov energy losses at 2bar
PNGpng 2bar_3GeV.png r2 r1 manage 11.7 K 2015-11-19 - 20:26 TimBrooks Cherenkov energy losses at 2bar
PNGpng 2bar_5GeV.png r2 r1 manage 11.8 K 2015-11-19 - 20:26 TimBrooks Cherenkov energy losses at 2bar
PNGpng 2bar_7GeV.png r2 r1 manage 11.7 K 2015-11-19 - 20:27 TimBrooks Cherenkov energy losses at 2bar
PNGpng 500MeV_pi_interaction.png r1 manage 12.9 K 2015-11-18 - 21:31 TimBrooks Pion interaction depths
PNGpng 50MeV_pi_bragg.png r1 manage 8.9 K 2015-11-18 - 21:31 TimBrooks Pion interaction depths

This topic: BL4S > WebHome > SimulationSoftware
Topic revision: r4 - 2015-12-07 - TimBrooks
This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback