Simulation of HEP experiments the Geant 4 toolkit
Tommaso Boccali
SNS, INFN Pisa
Outline
Simulation – a step towards physical understanding
How do we simulate today a HEP experiment?
The Geant4 toolkit
Why?
First of all, why do we simulate at all?
A lot of experiments in the past were without detailed simulations … and they worked!
Short answer: today’s theories do not predict such an overwhelming hint from data in most interesting measurements
And, moreover, we want are interested not only in discovery - see what LEP has
done J/Psi discovery
Detailed tests of theories: when the precision level required for validating/discarding a theory is high, effects due to the “bias”
introduced by the detector are not negligible
Finite resolution
non-homogeneity
Particle misidentification
such that we cannot simply look at the data and say “Oh, it is
clear that the answer is X”
“B” events
theory data simulation
simulation
Hadronic physics
Even the theorists are not able to present analytical results for x-sections
Parton showers, string models …
Sometimes the best thing they provide are code to generate primary interactions
In some sense, Monte Carlo code has become the
“equation”
So, the more subtle is the hint we want to look at, the more detailed the simulation must be
We have to thrust the background distributions to a level much greater than before
We need a tool capable to simulate (realistically) particle interactions with matter from the scale
of the TeV: primary particles generated in LHC collisions
of the keV: delta rays from secondary (tertiary…) particles leaving energy for ionization in our detectors
10
9keV 1
TeV
1 =
Correct physics simulation needed for ~ 9 orders of magnitude
Geant 4: what is it?
Once upon a time … a Fortran code called Geant 3 was used to simulate virtually all the HEP
experiments of the ‘80-’90
Very well tested, at the heart of the LEP Simulation
Agreement in physics up or better than % level
A product at the end of lifetime …
Fortran is not suited for a 10x complexity
Fortran is not maintainable for ~20 years
Visible energy in ALEPH (calo+tracker), DT vs MC
Geant 4
The project started in 94 with the aim to completely rewrite Geant3
To use new technologies (C++)
To implement all the lessons learned
To use new data and ideas for calibrations
March 25
th2004: Geant 4 6.1 Release
Geant4
Collaborators also from non- member institutions, including
Budker Inst. of Physics IHEP Protvino MEPHI Moscow Pittsburg University
Helsinki Inst. Ph.
PPARC Univ. Barcelona
HARP
Lebedev
What exactly is G4?
It is not a program … there is nothing to run but examples when you download it
It a is a toolkit: a set of libraries which know how to
Handle a complex geometry
Treat decays / energy loss of all the common particles
Extend its capabilities with user code
New physics inputs
New features: visualization, data analysis
Analogy with a real experiment
Define a Geometry Define physics
Define primary particles (the beam)
Beam ON!
(N events)
Analyze data Construct the detector
Well, usually not done by us ;)
Build an accelerator
Switch it on
Let it run, and save data
Plot histograms, and eventually
Geometry
Define a Geometry Define physics
Define primary particles (the beam)
Beam ON!
(N events)
Analyze data
1. Define a detector
1. Shapes of each single component (a screw, a silicon wafer, a power
cable)
1. Box
2. Cylinder
3. …
2. Hierarchical placement of each component
3. Materials used
4. Define passive and active materials, instrumented with measurement capabilities
1. For these, define format of read
data, as close as possible to the real data taken with the apparatus
Complex facilities
Not only easy volumes, but also
Polycones
Useful for HEP detectors,
useful with cylindrical symmetry
Boolean solids
G4UnionSolid G4SubtractionSolid G4IntersectionSolid
Level of complexity…
CMS Tracker Simulation
900 different components defined
20000 sensitive detector
200000 global objects in the simulation
600 materials and composite materials
Materials…
For some kind of “easy” physics, the definition of materials provides enough informations:
double density = 1.390*g/cm3;
double density = 1.390*g/cm3;
double a = 39.95*g/mole;
double a = 39.95*g/mole;
G4Material*
G4Material* lArlAr ==
new G4Materialnew G4Material("liquidArgon",z=18.,a,density);("liquidArgon",z=18.,a,density);
a = 1.01*g/mole;
a = 1.01*g/mole;
G4Element*
G4Element* elHelH ==
new G4Elementnew G4Element("Hydrogen",symbol="("Hydrogen",symbol="H",zH",z=1.,a);=1.,a);
a = 16.00*g/mole;
a = 16.00*g/mole;
G4Element*
G4Element* elOelO ==
new G4Elementnew G4Element("Oxygen",symbol="("Oxygen",symbol="O",zO",z=8.,a);=8.,a);
density = 1.000*g/cm3;
density = 1.000*g/cm3;
G4Material* H2O = G4Material* H2O =
new G4Materialnew G4Material("Water",density,ncomp=2);("Water",density,ncomp=2);
H2OH2O->->AddElementAddElement(elH(elH, , natomsnatoms==22););
H2OH2O->->AddElementAddElement(elO(elO, , natomsnatoms==11););
…
Materials also define automatically the “material budget of a detector”
“Quantity of matter” seen by a particle starting from the interaction point
Two parameters are used:
Electromagnetic interactions: X/X0 is the number of radiation lengths of the given detector
A radiation length is the distance in which an (high energy) electron loses all but 1/e of its energy
Hadronic interactions: λ/λ0 is the same due to hadronic effects (nuclear interaction length)
The same for nuclear interactions; used in hadronic calorimeters
CMS Tracker
CMS Hadron Calo
Physics…
It is completely unrealistic to try and develop a physics
model which covers different particles and energy ranges…
Like: model for LHC physics, model for TeVatron physics
Please note it now: it is NOT the LHC physics (qq → Hqq);
it is only the physics of particle-matter interaction
Define a Geometry Define physics
Define primary particles (the beam)
Beam ON!
(N events)
Analyze data
E>75 GeV model E<100 GeV
model
Hadronic inelastic interactions
G4 allows more than a single
physics model to contribute to the simulation of the interactions
Physics processes are defined with
a given energy range
a given particle type
By combining these wisely and paying some attention at the overlaps, a model for the
interesting field can be constructed
A different approach…
Particle type Process type
Energy range
But …
This needs expertise from the user
It is easy to forget processes and so generate invalid simulations
Often more than 1 physics model is available for the same range:
You can decide to use the more detailed or the fastest…
at a price!
compt: Total cross sections from a parametrisation.
Good description from 10 KeV to (100/Z) GeV.
Concept of “range”
Given a process, the user can define how accurate it has to be
The more accurate = the slower !
Consider Brem photon emission in a material
The charged track loses energy, and a photon is emitted.
In principle, infrared divergence which would lead to infinite # of photons of E→0
Range
We have to specify a minimum range for the
process: the charged track always loses correctly
energy, but we can veto the creation of photons with Range smaller than a threshold
Passive materials: if the track goes inside a block of iron, there is no point in generating particles which would not exit from that – set range of the order of the volume size.
In an active detector, no need to simulate particle
which would give effects below the experimental
resolution.
Calorimeters
Classic example, an electron enters the calorimeters
Where/when to stop the showers?
In principle, G4 could simulate electrons down to O(eV) – hours needed to simulate an event
What is usually done is to try and simulate events with increasing cuts, and define a point in which the price performance ratio is considered
acceptable
500 MeV proton in a LAr-Pb (ATLAS) sampling calorimeter
Range at 1.5 mm
Corresponds to 450 keV in LAr
Corresponds to 2 MeV in Pb
Silicon detectors in CMS
Strip pitch in ~100 µm
No need to produce delta rays
which would travel less than 10 µm
Pb
LAr LAr Pb
A few examples…
● EM physics
“standard” processes valid from ~ 1 keV to ~ PeV
“low-energy” valid from 250 eV to ~ PeV
optical photons
● Weak physics
decay of subatomic particles
radioactive decay of nuclei
● Hadronic physics
pure hadronic processes valid from 0 to ~100 TeV
γ−, µ− and e-nuclear valid from 10 MeV to ~TeV
● Parameterized or “fast simulation” physics
● Tracking physics
● Particle transportation in the field
A review…
Standard em processes:
Gamma
Photo-electric effect
Compton scattering
Electro, muon pair production
Electron
e ionization
e bremsstrahlung
e+e- annihilation
Syncrotron radiation
Muons
mu ionization
Mu bremsstrahlung
e+e- pair production
Charged hadrons
Hadron ionization
All charged particles
Multiple scattering
Transition radiation
Scintillation
Cerenkov radiation
A review…
Hadronic processes:
At rest
Stopped mu, p, K, anti- proton
Elastic
Same processes for all the hadrons
Inelastic
Different processes for each hadron
Photo-nuclear, electro- nuclear, muon-nuclear
Ions (for example, Fe+++)
Radioactivity!
Capture
Neutron capture
Fission
Neutron-induced, de- excitation
Most of these are data driven – eagerly waiting for
declassified declassified
data!Hadronic models
At rest In flight Direct implementations Cross sections Models Isotope production Event biasing
Direct impl. Direct impl. Theory framework
High energy Spallation framework Cascade Precompound
Direct impl.
Direct impl.
Frag function impl. Process
Direct impl. Direct impl.
Direct impl.
Transport utility String parton
String fragmenation util. Evaporation util. Direct impl.
Frag function intfc Direct impl.
Processes
Basic distinction:
Continuous processes: ionization, multiple scattering
Energy loss is continuous and not localized
Discrete: decay, Compton scattering, annihilation
These are the ones limiting the step length
How does it work?
When a particle is under study, all of the possible energy losses mechanisms and decay processes must be able to “interfere” with the particle
A step is a “time” quantum for a particle traveling in a material
Start of step point End of step point
The Step
The step length is limited by the processes of the particle: for example, after a few mm, the particle can decay
Each physics process must propose a step length
Given a lifetime for a decay, a random number is thrown and the resulting distance before decaying is returned
The “physical step length” is the minimum of all proposed lengths
If the minimum between that step and the distance to the next detector is taken
The beam
Well, not really the beam! In most HEP cases, Geant 4 is not starting from e+e- (pp), but it is interfaced via to specialized codes for the simulation of primary
interactions
Pythia
CompHEP
ALPGEN
…
Geant 4 is able to read directly the output of these programs, and treat these particles as “the beam”
Exception: test beam simulations
The beam is a single particle thrown inside the experimental setup
Define a Geometry Define physics
Define primary particles (the beam)
Beam ON!
(N events)
Analyze data
How an event is processed
List of primary particles
Track next particle
Push secondaries in the list
Interaction particle-matter
Out of the world, decayed or stopped
List of particles to be tracked
Simulation of the response of a detector
Some volumes are special:
they are “active” in the real detector.
Data is read from these in real world
Geant 4 allows to simulate their response:
Special user code is needed
The output of this code must be as close as possible to the real response
Usually experimental parameterization used
Energy deposit in the strip
ADC counts
Visualization
With complex geometries, often the best way to debug it to see …
Holes in the geometry
Overlapping volumes
Geant 4 provides natively (3) visualization features, most notably OpenGL
This means geometry, tracks, etc can be
visualized without any user code
Visualization
LCD in JAS3
GLAST
BaBar Offline
Geant4 BaBar Offline
BaBar Online
Validation
So, most of the HEP community is / will be using Geant4
The standard of the Physics simulation must be very high
Huge effort on validation
Compton Scattering
Data , G4 LowE , G4 standard
Rayleigh Scattering
Data , G4 LowE
Stopping Power
Data , G4 LowE , G4 Standard
Pair Production
Data, G4 LowE, G4 Standard
Multiple Scattering (1)
π Production from 730 MeV p
(LEP Model)
π Production from 730 MeV p
(Bertini Model)
From the experiments point of view…
Use test beam data
CMS HCAL1 7 17 1 7 17 1 7 17 1 7 17
ηηηη 8888
77776666 55554444 33332222 1111
φφφφ
Crystal 25
Just a glimpse …
Geant 4 is aimed / supported / funded mostly by HEP experiments, but is is becoming a de-facto standard
Medical applications
Simulation of radiotherapic apparata
Simulation of dose absorption in human tissues
Space applications
Detectors
Damages from high energy cosmic rays
Effects of cosmic rays on astronauts
Industrial applications
CCD of digital cameras
Implantation of oxides in silicon wafers
Simulation
Simulation of dose deposit by radiotherapy in human tissues
Very useful to plan therapy cycles…
γ astrophysics
γγγγγγγγ-ray bursts-ray burstsray burstsray burstsray burstsray burstsray burstsray bursts
AGILE
GLAST
Typical telescope:
Tracker
Calorimeter Anticoincidence
γ conversion
electron interactions
multiple scattering
δ-ray production
charged particle tracking
GLAST
GLAST
NASA mission
Conclusions
There are few doubts that Geant 4 will the the tool used to simulate HEP experiments at least for the next decade
It is still under validation, but
Already delivers physics performance better or equal to the Geant 3 ones
It is almost as fast
Not an easy achievement Fortran vs C++
Where to start from?
Geant 4 provides a nice & easy roadmap
http://conferences.fnal.gov/g4tutorial/
A complete CD is present, in Linux and WinXP versions
Complete class documentation
http://cern.ch/geant4
Packaged Examples:
A number of easy examples there
If we have time, we can try one…