the geant4 toolkit - uniud
TRANSCRIPT
The GEANT4 toolkit
Alessandro De AngelisUniversity of Udine and INFN Trieste
L’Aquila, September 2001
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
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
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
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...
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
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++
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)
9
Basic structure of G4
n > 700,000 lines of code (one year ago…)
10
Many contributors...
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
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
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)
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)
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
16
Tests (high level): Shower profile
1 GeV electron in H2O
G4, DataG3
n Very good agreement seen with the data
17
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
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...
20
Miscellaneous features
n Cutoffsn Geometry & utilitiesn Hits and digitsn Fast simulationn Visualization
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 ..
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
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
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
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
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
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
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
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)
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...
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
32
The architecture we want
PhysSim Digit Recon
Geom
Simdata
Realdata
FAS
T
From any pointto graphics
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)
34
Characteristics of GISMO
n Takes care of tracking, Eloss etc.
n Secondaty processes: EGS4, GHEISHA wrapped in
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)
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
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)
38
XML: VRML output
39
XML: GEANT4 interface
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
41
Event Display
n Various possibilities now in evaluation phasen WIRED2n ROOT (directly linked to the G4 simulation output)
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