The GEANT4 toolkit Alessandro De Angelis University of Udine and INFN Trieste L Aquila, September 2001
Layout Monte Carlo simulation of experiments and detectors GEANT4: philosophy, history, future The physics of GEANT4 Miscellaneous features Things one has to do Experience with GEANT4: an example 2
Monte Carlo simulation It s impossible to conceive a modern detector w/o simulation And it has to be Monte Carlo, otherwise Rossi and Greisen 1941, Rev. Mod. Phys. 13:240 MC simulation: proposed by Ulam and von Neumann Ulam and von Neumann 1947, Bull. Am. Math. Soc. 53:1120 First used for particle transport by Wilson 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 3
Requirements of a simulation software Accuracy in the simulation of em interactions, down to low energies Reasonable simulation of hadronic interactions Plus technical requirements: a well written code Modularity Easy to add different generators Easy to add new physics routines Friendly interfaces & Good documentation Maintenability Support on different platforms 4
The shoplist before GEANT4 Mostly GEANT (3) Developed at CERN (1982-1994) Proprietary EM routines Can bind several hadronic codes (GHEISHA is the most common) Includes user-friendly geometry description, visualization A plus: easy-to-use The reference for electromagnetic physics: EGS (4) Long development and debugging at SLAC/LNL/KEK (1966-1985) Most commonly used in couple with FLUKA for hadronic interactions A bit unfriendly Geometry difficult to define, no facilities, no visualization... Cross sections computed by an offline preprocessor, PEGS (Still the reference now for dosimetry, where one shouldn t be wrong) Plus a small market for LEPSIM-DELSIM, GISMO... 5
GEANT4: philosophy, history, future Geant4 (G4) is the successor of GEANT3 Geant4 re designs a major package of CERN software for the next generation of HEP experiments using an Object Oriented philosophy A variety of new requirements also came from heavy ion physics, CP violation physics, cosmic ray physics, medical applications and space science applications In order to meet such requirements, a large degree of functionality and flexibility are provided: G4 is not only for HEP Final aim: more precise than EGS, more friendly than G3 6
Why moving to G4? Limitations of GEANT3 maintenance Because of too complex structure driven by too many historical reasons, it became impossible to add a new feature or to hunt a bug. Limitation of FORTRAN Shortage of man power at CERN Limitation of central center supports World wide collaboration Adoption of the most recent software engineering methodologies Choice of Object orientation and C++ 7
History of G4 Dec 94 Project starts Apr 97 First alpha release Jul 98 First beta release Dec 98 Release 0.0 Jun 01 - Release 3.2 (complete list of physics processes) Maintainment & upgrade expected for at least 10 years Continuously developed: 2 major releases each year + monthly internal tag (frequent bug fixes, new features, new examples) 8
Basic structure of G4 > 700,000 lines of code (one year ago ) 9
Many contributors... 10
The physics of GEANT4 Several solutions proposed in the library EM Standard (G3) Low energy Hadronic GHEISHA New models An open system to new inputs Good framework such that new models can be integrated 11
Confrontation with data Many comparisons made, and results published A lot of comparisons are ongoing, starting within the collaborations (eg in experiment groups) LHC (ATLAS, CMS, LHCb, ALICE) BaBar (migrating from Geant3) GLAST in groups in fields other than HEP/AstroParticle diverse uses (eg medical,..) often small groups 12
ElectroMagnetic processes Gammas: Gamma Conversion, Compton scattering, Photo-electric effect Rayleigh, Reflection, Refraction, Absorption, Scintillation Leptons(e, mu) + charged particles(hadrons, ions): Ionisation, Bremstrahlung, Energy loss, Multiple scattering, transition radiation, Synchrotron radiation, Cerenkov High energy muons and lepton-hadron interactions For the low energy part, massive use of experimental tables (shells etc.) Goal: from 250 ev (and below) to the PeV (and beyond) 13
EM physics performance All processes at least at level of Geant-3 New processes: Transition radiation, optical... Multiple Scattering: new model no path length restriction added lateral displacement measured effect on result Energy Loss: two approaches two approaches: differential and integral several alternatives: PAI model (thin),... Hard processes hadronic resonances can be seen (future) 14
Lower limits for validity Geant3.21 10 kev EGS4 1 kev Geant4 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 15
Tests (high level): Shower profile 1 GeV electron in H2O G4, Data G3 Very good agreement seen with the data 16
17
Results of tests on EM Processes Several comparisons presented with data (and Geant3 simulation) standard EM processes showed better agreement with data than G3 Better performance on EM showers 18
Hadronic physics processes Large variety of models according to the energy String models (interfaced with Pythia7 for hard scattering) Cascade Evaporation Break-up µ-nucleus interactions, photo-fission, meson photoproduction A lot of activity, debugging and tests look somehow frightening... 19
Miscellaneous features Cutoffs Geometry & utilities Hits and digits Fast simulation Visualization 20
Cutoffs Coherent production cuts validity range of models fully exploited yet processes can ask to override when they need to (treatment of boundary effects) Cuts in range rather than energy Geant3 used cuts in energy - inefficient It makes poor sense to use the energy cut off. Range of 10 kev gamma in Si ~ a few cm Range of 10 kev electron in Si ~ a few micron Cut off represents the accuracy of the stopping position. It does not mean that the track is killed at the corresponding energy. significant gain in results quality vs CPU usage Users can impose a cut in energy, track length, TOF.. 21
Geometry & utilities Boolean solids new solids from Union, Intersection, Subtraction of two solids + a transformation g3tog4 Field tracking in EM field 22
Hits and digits Each Logical Volume can have a pointer to a sensitive detector A hit is a snapshot of the physical interaction of a track or an accumulation of interactions of tracks in the sensitive detector 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 A digitization is created with one or more hits and/or other digits by an explicit implementation derived from G4VDigitizerModule 23
Fast simulation GEANT4 allows to perform full simulation and fast simulation in the same environment Shower parametrisations etc. The fast simulation produces the same objects as the full simulation (tracks, clusters etc.) Flexibility Activate fast/full simulation by detector Parallel geometries Activate fast/full simulation by particle type 24
Visualization You can visualize detector, hits and trajectories Geant4 provides interfaces to graphics drivers GUI DAWN RayTracer OPACS OpenGL OpenInventor VRML 25
Things one has to do In general starting from the study of a manual is not the most effective way... Go to www.cern.ch/geant4 download and install Many platforms Run an example and see how it is done But a windows-like command is also available 26
Documentation and examples Documentation: Getting started & installation guide User guide for application & toolkit developer Software & physics reference manuals Six novice examples simple detectors different experiment types demonstrate essential capabilities and 3+ advanced examples 27
Novice examples Transport of a non-interacting particle through a slab Track in a simplified tracking detector Electromagnetic shower (full) Particle collision Parametrised electromagnetic shower Optical photon 28
Advanced examples Two are relevant for astroparticle: xray_telescope, illustrating an application for the study of the radiation background in a typical X-ray telescope gammaray_telescope, illustrating a detector a la AGILE/GLAST (Giannitrapani, Longo, Santin) 29
Experience with Geant4 Production release in use used, got feedback customer care, customer care, customer care first results confirm some of G4 s strengths in EM physics, geometry, hadronic physics First EM physics (showers) benchmarks G4/G3 Geant4 gives better physics at the same speed Geant4 gives better speed for same physics But bugs still exist... 30
Custom example: GLAST Tracker γ telescope on satellite for the range 20 MeV-300 GeV hybrid tracker + calorimeter International collaboration US- France-Italy-Japan-Sweden- Germany Timescale: 2006-2010 (->2015) Calorimeter Wide range of physics objectives: Gamma astrophysics Fundamental physics Needs gamma simulation in trackers/calos at different details; hadrons 31
The architecture we want Geom FAST Phys Sim Digit Sim data Recon Real data From any point to graphics 32
The beginning: GISMO The GLAST simulation has been done, from the beginning, using C++ and with OO technologies in mind GISMO was the choice No other candidate present at that moment (apart from standard Fortran MC) GLAST core software group already experienced with GISMO (SLAC used it for other experiments) 33
Characteristics of GISMO Takes care of tracking, Eloss etc. Secondaty processes: EGS4, GHEISHA wrapped in 34
From GISMO to G4 Why GISMO is now quite obsolete It is no more officially supported (and developed) Physics needed some manpower GEANT4 has arrived in the meanwhile More flexible, maintainable and so on Well supported and used by several experiments Proved reliable for space applications (XRayTel and GammaRayTel) 35
The chain (for now) Geometry input by XML file Incoming fluxes by standard GEANT4 modules Simulation with standard GEANT4 physics modules (for the em processes also the low energy extensions) Persistency of the output ASCII file ROOT file Digitization of the MC hits Analysis and Event Display Validation with real data 36
XML for geometry description A specific DTD for the GLAST geometry A C++ hierarchy of classes for the XML interface (detmodel) Many clients Simulation Reconstruction Analysis Event display Interfaces for VRML output for the geometry HTML documentation GEANT4 geometry description ROOT Java (partial) 37
XML: VRML output 38
XML: GEANT4 interface 39
Digitizations For a more precise digitization of the tracker signal Electron motion in Si: simulation using HEED + GARFIELD/MAXWELL => charge sharing Parametrization to be interfaced to the G4 simulation 40
Event Display Various possibilities now in evaluation phase WIRED2 ROOT (directly linked to the G4 simulation output) 41
Conclusions G4 is suitable as a MC toolkit for HEP and astroparticle applications Strong points are the open structure and the easyness of use (I did not stress many facilities you will find in the web site: definition of materials, compounds, units...) The HEP/AP community is quickly acquiring a good experience G4 validation with real data is progressing fast G4 is easy to integrate with other software G4 is becoming the standard de facto for detector simulations The software is profiting of tests within an extended community 42