An introduction to the Geant4 Monte Carlo simulation toolkit
The GEANT4 toolkit - Uniud
Transcript of The GEANT4 toolkit - Uniud
![Page 1: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/1.jpg)
The GEANT4 toolkit
Alessandro De AngelisUniversity of Udine and INFN Trieste
L’Aquila, September 2001
![Page 2: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/2.jpg)
2
Layout
n Monte Carlo simulation of experiments and detectorsn GEANT4: philosophy, history, futuren The physics of GEANT4n Miscellaneous featuresn Things one has to don Experience with GEANT4: an example
![Page 3: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/3.jpg)
3
Monte Carlo simulation
n First used for particle transport by Wilson n Wilson 1952, Phys. Rev. 86:261
“The procedure used was a simple graphical and mechanical one. The distance into the lead was broken into intervals of one-fifth of a radiation length (about 1 mm). The electrons or photons were followed through successive intervals and their fate in passing through a given interval was decided by spinning a wheel of chance; the fate being read from one of a family of curves drawn on a cylinder…A word about the wheel of chance. The cylinder, 4 in. outside diameter by 12 in. long is driven by a high speed motor geared down by a ratio 20 to 1. The motor armature is heavier than the cylinder and determines where the cylinder stops. The motor was observed to stop at random and, in so far as the cylinder is concerned, its randomness is multiplied by the gear ratio…”
n It’s impossible to conceive a modern detector w/o simulationn And it has to be Monte Carlo, otherwise…
Rossi and Greisen 1941, Rev. Mod. Phys. 13:240
n MC simulation: proposed by Ulam and von Neumannn Ulam and von Neumann 1947, Bull. Am. Math. Soc. 53:1120
![Page 4: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/4.jpg)
4
Requirements of a simulation software
n Accuracy in the simulation of em interactions, down to low energies
n Reasonable simulation of hadronic interactions
n Plus technical requirements: a well written code n Modularity
n Easy to add different generatorsn Easy to add new physics routines
n Friendly interfaces & Good documentationn Maintenabilityn Support on different platforms
![Page 5: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/5.jpg)
5
The shoplist before GEANT4
n Mostly GEANT (3)n Developed at CERN (1982-1994)n Proprietary EM routinesn Can bind several hadronic codes (GHEISHA is the most common)n Includes user-friendly geometry description, visualization…
A plus: easy-to-use
n The reference for electromagnetic physics: EGS (4)n Long development and debugging at SLAC/LNL/KEK (1966-1985)n Most commonly used in couple with FLUKA for hadronic interactionsn A bit unfriendly
n Geometry difficult to define, no facilities, no visualization...n Cross sections computed by an offline preprocessor, PEGS
n (Still the reference now for dosimetry, where one shouldn’t be wrong)
n Plus a small market for LEPSIM-DELSIM, GISMO...
![Page 6: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/6.jpg)
6
GEANT4: philosophy, history, future
n Geant4 (G4) is the successor of GEANT3n Geant4 redesigns a major package of CERN software for the
next generation of HEP experiments using an ObjectOriented philosophyn A variety of new requirements also came from heavy ion
physics, CP violation physics, cosmic ray physics, medical applications and space science applications
n In order to meet such requirements, a large degree of functionality and flexibility are provided: G4 is not only for HEP
n Final aim: more precise than EGS, more friendly than G3
![Page 7: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/7.jpg)
7
Why moving to G4 ?
n Limitations of GEANT3 maintenance n Because of too complex structure driven by too many historical
reasons, it became impossible to add a new feature or to hunt a bug. n Limitation of FORTRAN
n Shortage of man power at CERN n Limitation of “central center” supports n Worldwide collaboration
n Adoption of the most recent software engineering methodologies n Choice of Objectorientation and C++
![Page 8: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/8.jpg)
8
History of G4
n Dec 94 Project startsn Apr 97 First alpha release n Jul 98 First beta release n Dec 98 Release 0.0 n Jun 01 - Release 3.2 (complete list of physics processes)
n Maintainment & upgrade expected for at least 10 yearsn Continuously developed: 2 major releases each year + monthly
internal tag (frequent bug fixes, new features, new examples)
![Page 9: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/9.jpg)
9
Basic structure of G4
n > 700,000 lines of code (one year ago…)
![Page 10: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/10.jpg)
10
Many contributors...
![Page 11: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/11.jpg)
11
The physics of GEANT4
n Several solutions proposed in the libraryn EM
n Standard (G3)n Low energy
n Hadronicn GHEISHAn New models
n An open system to new inputsn Good framework such that new models can be integrated
![Page 12: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/12.jpg)
12
Confrontation with data
n Many comparisons made, and results publishedn A lot of comparisons are ongoing, starting
n within the collaborations (eg in experiment groups) n LHC (ATLAS, CMS, LHCb, ALICE)n BaBar (migrating from Geant3)n GLAST
n in groups in fields other than HEP/AstroParticlen diverse uses (eg medical, ..)
n often small groups
![Page 13: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/13.jpg)
13
ElectroMagnetic processes
n Gammas: n Gamma Conversion, Compton scattering, Photo-electric effectn Rayleigh, Reflection, Refraction, Absorption, Scintillation
n Leptons(e, mu) + charged particles(hadrons, ions):n Ionisation, Bremstrahlung, Energy loss, Multiple scattering, transition radiation,
Synchrotron radiation, Cerenkov
n High energy muons and lepton-hadron interactions
n For the low energy part, massive use of experimental tables (shells etc.)
n Goal: from 250 eV (and below) to the PeV (and beyond)
![Page 14: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/14.jpg)
14
EM physics performance
All processes at least at level of Geant-3
n New processes: Transition radiation,
optical...n Multiple Scattering: new model
n no path length restrictionn added lateral displacement
n measured effect on result
n Energy Loss: two approachesn two approaches: differential and integraln several alternatives: PAI model (thin), ...
n Hard processesn hadronic resonances can be seen (future)
![Page 15: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/15.jpg)
15
Lower limits for validity
Geant3.21 10 keVEGS4 1 keVGeant4 “standard models”
- Photoelectric effect 10 keV- Compton effect 10 keV- Bremsstrahlung 1 keV- Ionisation (δ-rays) 1 keV- Multiple scattering 1 keV
Goal for G4 low-energy models 250 eV
![Page 16: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/16.jpg)
16
Tests (high level): Shower profile
1 GeV electron in H2O
G4, DataG3
n Very good agreement seen with the data
![Page 17: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/17.jpg)
17
![Page 18: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/18.jpg)
18
Results of tests on EM Processes
n Several comparisons presented n with data (and Geant3 simulation)n standard EM processes
showed better agreement with data than G3n Better performance on EM showers
![Page 19: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/19.jpg)
19
Hadronic physics processes
n Large variety of models according to the energyn String models
(interfaced with Pythia7 for hard scattering)n Cascaden Evaporationn Break-up
n µ-nucleus interactions, photo-fission, meson photoproduction
n A lot of activity, debugging and tests look somehow frightening...
![Page 20: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/20.jpg)
20
Miscellaneous features
n Cutoffsn Geometry & utilitiesn Hits and digitsn Fast simulationn Visualization
![Page 21: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/21.jpg)
21
Cutoffs
n Coherent “production cuts”n validity range of models fully exploited
n yet processes can ask to override when they need to (treatment of boundary effects)
n Cuts in range rather than energyn Geant3 used cuts in energy - inefficient
n It makes poor sense to use the energy cutoff. n Range of 10 keV gamma in Si ~ a few cm n Range of 10 keV electron in Si ~ a few micron
n Cutoff represents the accuracy of the stopping position. It does not mean that the track is killed at the corresponding energy.
n significant gain in results quality vs CPU usage
n Users can impose a cut in energy, track length, TOF ..
![Page 22: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/22.jpg)
22
Geometry & utilities
n Boolean solidsn new solids from Union, Intersection, Subtraction n of two solids + a transformation
n g3tog4
n Fieldn tracking in EM field
![Page 23: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/23.jpg)
23
Hits and digits
n Each “Logical Volume” can have a pointer to a sensitive detector
n A hit is a snapshot of the physical interaction of a track or anaccumulation of interactions of tracks in the sensitive detectorn A sensitive detector creates hit(s) using the information given in
G4Step object. The user has to provide his/her own implementation of the detector response
n A digitization is created with one or more hits and/or other digits by an explicit implementation derived from G4VDigitizerModule
![Page 24: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/24.jpg)
24
Fast simulation
n GEANT4 allows to perform full simulation and fast simulation in the same environmentn Shower parametrisations etc.
n The fast simulation produces the same objects as the full simulation (tracks, clusters etc.)
n Flexibilityn Activate fast/full simulation by detectorn Parallel geometriesn Activate fast/full simulation by particle type
![Page 25: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/25.jpg)
25
Visualization
n You can visualize detector, hits and trajectoriesn Geant4 provides interfaces to graphics drivers
n DAWNn RayTracern OPACS n OpenGL n OpenInventor n VRML
n GUI
![Page 26: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/26.jpg)
26
Things one has to do
n In general starting from the study of a manual is not the most effective way...
n Go to www.cern.ch/geant4n download and installn Many platforms
n Run an example and see how it is donen But a “windows-like” command is also available
![Page 27: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/27.jpg)
27
Documentation and examples
n Documentation:n Getting started & installation guiden User guide for application & toolkit developern Software & physics reference manuals
n Six novice examplesn simple detectorsn different experiment typesn demonstrate essential capabilities
and 3+ advanced examples
![Page 28: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/28.jpg)
28
Novice examples
n Transport of a non-interacting particle through a slabn Track in a simplified tracking detectorn Electromagnetic shower (full)n Particle collisionn Parametrised electromagnetic showern Optical photon
![Page 29: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/29.jpg)
29
Advanced examples
n Two are relevant for astroparticle:n xray_telescope, illustrating
an application for the study of the radiation background in a typical X-ray telescope
n gammaray_telescope, illustrating a detector “a la AGILE/GLAST” (Giannitrapani, Longo, Santin)
![Page 30: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/30.jpg)
30
Experience with Geant4
n Production release in usen used, got feedback
n customer care, customer care, customer caren first results confirm some of G4’s strengths
n in EM physics, geometry, hadronic physics
n First EM physics (showers) benchmarks G4/G3n Geant4 gives better physics at the same speedn Geant4 gives better speed for same physics
n But bugs still exist...
![Page 31: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/31.jpg)
31
Custom example: GLAST
n γ telescope on satellite for the range 20 MeV-300 GeVn hybrid tracker + calorimeter
n International collaboration US-France-Italy-Japan-Sweden-Germany
n Timescale: 2006-2010 (->2015)
n Wide range of physics objectives:n Gamma astrophysicsn Fundamental physics
n Needs gamma simulation in trackers/calos at different details; hadrons
Trac
ker
Calorimeter
![Page 32: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/32.jpg)
32
The architecture we want
PhysSim Digit Recon
Geom
Simdata
Realdata
FAS
T
From any pointto graphics
![Page 33: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/33.jpg)
33
The beginning: GISMO
n The GLAST simulation has been done, from the beginning, using C++ and with OO technologies in mind
n GISMO was the choice n No other candidate present at that moment (apart from standard Fortran
MC)
n GLAST core software group already experienced with GISMO (SLAC used it for other experiments)
![Page 34: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/34.jpg)
34
Characteristics of GISMO
n Takes care of tracking, Eloss etc.
n Secondaty processes: EGS4, GHEISHA wrapped in
![Page 35: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/35.jpg)
35
From GISMO to G4
n Whyn GISMO is now quite obsoleten It is no more officially supported (and developed)n Physics needed some manpowern GEANT4 has arrived in the meanwhile
n More flexible, maintainable and so onn Well supported and used by several experiments
n Proved reliable for space applications (XRayTel and GammaRayTel)
![Page 36: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/36.jpg)
36
The chain (for now)
n Geometry input by XML filen Incoming fluxes by standard GEANT4 modulesn Simulation with standard GEANT4 physics modules (for the em
processes also the low energy extensions)n Persistency of the output
n ASCII filen ROOT file
n Digitization of the MC hitsn Analysis and Event Display n Validation with real data
![Page 37: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/37.jpg)
37
XML for geometry description
n A specific DTD for the GLAST geometryn A C++ hierarchy of classes for the XML interface (detModel)n Many clients
n Simulationn Reconstructionn Analysisn Event display
n Interfaces forn VRML output for the geometryn HTML documentationn GEANT4 geometry descriptionn ROOTn Java (partial)
![Page 38: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/38.jpg)
38
XML: VRML output
![Page 39: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/39.jpg)
39
XML: GEANT4 interface
![Page 40: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/40.jpg)
40
For a more precise digitization of the tracker signalElectron motion in Si: simulation using HEED + GARFIELD/MAXWELL => charge sharing Parametrization to be interfaced to the G4 simulation
Digitizations
![Page 41: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/41.jpg)
41
Event Display
n Various possibilities now in evaluation phasen WIRED2n ROOT (directly linked to the G4 simulation output)
![Page 42: The GEANT4 toolkit - Uniud](https://reader030.fdocuments.in/reader030/viewer/2022012019/616882f7d394e9041f70168c/html5/thumbnails/42.jpg)
42
Conclusions
n G4 is suitable as a MC toolkit for HEP and astroparticle applications n Strong points are the open structure and the easyness of use
n (I did not stress many facilities you will find in the web site: definition of materials, compounds, units...)
n The HEP/AP community is quickly acquiring a good experience
n G4 validation with real data is progressing fast
n G4 is easy to integrate with other software
n G4 is becoming the standard de facto for detector simulations
The software is profiting of tests within an extended community