Title: Overview of the
1Overview of the
Object Oriented Simulation Toolkit
- Maria Grazia Pia
- INFN Genova, Italy and CERN/IT
- Maria.Grazia.Pia_at_cern.ch
2Once upon a time there was a X-ray telescope...
Courtesy of NASA/CXC/SAO
3Chandra X-ray Observatory Status
Update September 14, 1999 MSFC/CXC CHANDRA
CONTINUES TO TAKE SHARPEST IMAGES EVER TEAM
STUDIES INSTRUMENT DETECTOR CONCERN Normally
every complex space facility encounters a few
problems during its checkout period even though
Chandras has gone very smoothly, the science and
engineering team is working a concern with a
portion of one science instrument. The team is
investigating a reduction in the energy
resolution of one of two sets of X-ray detectors
in the Advanced Charge-coupled Device Imaging
Spectrometer (ACIS) science instrument. A series
of diagnostic activities to characterize the
degradation, identify possible causes, and test
potential remedial procedures is underway. The
degradation appeared in the front-side
illuminated Charge-Coupled Device (CCD) chips of
the ACIS. The instruments back-side illuminated
chips have shown no reduction in capability and
continue to perform flawlessly.
An excerpt of a press release
Courtesy of NASA/CXC/SAO
4What can affect CCDs on X-ray astronomy missions?
- Radiation belt electrons?
- Scattered in the mirror shells?
- Effectiveness of Magnetic brooms
- Electron damage mechanism? - NIEL?
- Other particles? Protons, cosmics
- Path to CCD? Wall penetration?
- Proposal set the problem up in Geant4 as a
case-study.
5XMM
6ESA Space Environment Effects Analysis Section
RGS
EPIC
Q2
Q1
Q1
7ESA Space Environment Effects Analysis Section
CCD displacement damage front vs.
back-illuminated.
30 mm Si ? 1.5 MeV p
30 mm
2 mm
30 mm
2 mm
Active layerPassive layer
Electron deflector
Low-E (100 keV to few MeV), low-angle (0-5)
proton scatteringObscure problem not much
analysed
8How well can Geant4 simulate low energy protons?
Courtesy of R. Gotta, Thesis
9What happened next?
XMM was launched on 10 December 1999 from Kourou
EPIC image of the two flaring Castor components
and the brighter YY Gem
Courtesy of
10Outline
- What is Geant?
- Status of Geant3 and motivations for Geant4
- The Geant4 RD phase RD44
- The Geant4 Collaboration
- The role of software engineering and OO technology
- Main features of the Geant4 toolkit
- the kernel
- geometry
- physics
- other tools
- Performance
- A selection of Geant4 applications
- Conclusions
11The role of Geant
- Geant is a simulation tool, that provides a
general infrastructure for - the description of geometry and materials
- particle transport and interaction with matter
- the description of detector response
- visualisation of geometries, tracks and hits
- The user develops the specific code for
- the primary event generator
- the geometrical description of the set-up
- the digitisation of the detector response
12The past Geant3
- Geant 3
- has been used by most major HEP experiments
- Frozen since March 1994 (Geant3.21)
- 200K lines of code
- equivalent of 50 man-years, along 15 years
- used also in nuclear physics experiments, medical
physics, radiation background studies, space
applications etc. - The result is a complex system
- because its problem domain is complex
- because it requires flexibility for a variety of
applications - because its management and maintenance are
complex - It is not self-sufficient
- hadronic physics is not native, it is handled
through the interface to external packages
13New simulation requirements
- Physics extensions to high energies
- LHC, cosmic ray experiments...
- Physics extensions to low energies
- space applications, medical physics, X-ray
analysis, astrophysics, nuclear and atomic
physics... - Reliable hadronic physics
- not only for calorimetry, but also for PID
applications (CP violation experiments) - ...etc.
- Very high statistics to be simulated
- robustness and reliability for large scale
production - Exchange of CAD detector descriptions
- Transparent physics for validation of physics
results
- User requirements formally collected and coded
according to PSS05 standard - Geant4 User Requirements Document
14What is Geant4?
- OO toolkit for the simulation of next generation
HEP detectors - ...of the current generation too
- ...not only of HEP detectors
- already used also in nuclear physics, medical
physics, space applications, radiation background
studies etc. - It is also an experiment of distributed software
production and management, as a large
international collaboration with the
participation of various experiments, labs and
institutes - It is also an experiment of application of
rigorous software engineering and Object Oriented
technologies to the HEP environment
15Approved as RD end 1994 (RD44) gt 100 physicits
and software engineers 40 institutes,
international collaboration responded to DRCC/LCB
- Milestones end 1995
- OO methodology, problem domain analysis, full
OOAD - tracking prototype, performance evaluation
- Milestones spring 1997
- ?-release with the same functionality as Geant
3.21 - persistency (hits), ODBMS
- transparency of physics models
- Milestone July 1998
- public ?-release
- Milestone end 1998
- production release Geant4.0, end of the RD
phase
- All milestones have been met by RD44
- Reconfiguration at the end of the RD phase
- International Geant4 Collaboration sincel
1/1/1999 - Management of the production phase
- Continuing RD also in the production phase
16Geant4 Collaboration
- New organization for the production phase, MoU
based - Distribution, development and User Support
- Atlas, BaBar, CMS, HARP, LHCB
- CERN, JNL,KEK, SLAC, TRIUMF
- ESA, Frankfurt Univ., IGD, IN2P3, Karolinska
Inst., Lebedev, TERA - COMMON (Serpukov, Novosibirsk, Pittsburg etc.)
- other memberships currently being discussed
- Collaboration Board
- manages resources and responsibilities
- Technical Steering Board
- manages scientific and technical matters
- Working Groups
- do maintenance, development, QA, etc.
Members of National Institutes, Laboratories and
Experiments participating in Geant4 Collaboration
acquire the right to the Production Service and
User Support For others free code and user
support on best effort basis
Budker Inst. of Physics IHEP Protvino MEPHI
Moscow Pittsburg University
17Software Engineering
Software Engineering plays a fundamental role in
Geant4
- Software process
- based on Booch methodology
- spiral type, with cycles of design-implementation
iterations - OOAD
- Development
- Evolution
- Maintenance
- in a worldwide collaboration!
- Software process
- User requirements
- OOAD
- Quality Assurance
- User Requirements
- Collected initially and systematically updated
- Coded according to ESA PSS-05 standard
18OO technologies
- OO design fundamental for distributed parallel
approach - every part can be developed, refined,
maintained independently - Problem domain decomposition and OOAD result
into a unidirectional dependency of class
categories
- Transparency
- decoupling from implementation
- Flexibility
- alternative models and implementations
- Interface to external software, without
dependencies - databases for persistency
- visualisation libraries
- tools for UI
- etc.
- Open to evolution
- extensibility, implementation of new models and
algorithms without interfering with existing
software - the user can extend the toolkit with his/her
model and data
19Geant4 architecture
exploits advanced Software Engineering techniques
and Object Oriented technology to achieve
transparency of physics implementation.
20Quality Assurance
- Testing
- Unit testing
- in most cases down to class level granularity
- Integration testing
- sets of logically connected classes
- Test-bench for each category
- eg. test-suite of 375 tests for hadronic physics
parameterised models - System testing
- exercising all Geant4 functionalities in
realistic set-ups - Physics testing
- comparisons with experimental data
- Performance Benchmarks
- Extensive use of Quality Assurance systems
- fundamental for a toolkit of wide public use
- Commercial tools
- Insure, Logiscope etc.
- C coding guidelines
- scripts to verify their applications
automatically - Code inspections
- within working groups and across groups
21Standards
Based on standards, ISO and de facto
- OpenGL e VRML for graphics
- CVS for code management
- C as programming language
- STEP
- engineering and CAD systems
- ODMG
- RD45
- Units
- Geant4 is independent from the system of units
- all numerical quantities expressed with their
units explicitly - user not constrained to use any specific system
of units
Have you heard of the incident with NASAs Mars
Climate Orbiter (125 million)?
22What is needed to run Geant4
- Platforms
- DEC, HP, IMB-AIX, SUN, (SGI) native compilers,
g - Linux g
- Windows-NT Visual C
- Commercial software
- ObjectStore STL (optional)
- Free software
- CVS
- gmake, g
- CLHEP
- Graphics
- OpenGL, X11, OpenInventor, DAWN, VRML...
- OPACS, GAG, MOMO...
- Persistence
- it is possible to run in transient mode
- in persistent mode use a HepDB interface, ODMG
standard
23The Geant4 kit
- Code
- 1M lines of code, 2000 classes
- (continuously growing)
- publicly available from the web
- Documentation
- 6 manuals
- publicly available from the web
- Examples
- distributed with the code
- navigation between documentation and examples code
24The kernel
- Run and event
- the Run Manager can handle multiple events
- possibility to handle the pile-up
- multiple runs in the same job
- with different geometries, materials etc.
- powerful stacking mechanism
- three levels by default handle trigger studies,
loopers etc.
- Tracking
- decoupled from physics all processes handled
through the same abstract interface - tracking is independent from particle type
- it is possible to add new physics processes
without affecting the tracking
- Geant4 has only production thresholds, no
tracking cuts - all particles are tracked down to zero range
- energy, TOF ... cuts can be defined by the user
25Geometry
Role detailed detector description and efficient
navigation
- Multiple representations
- CGS (Constructed Solid Geometries)
- simple solids
- STEP extensions
- polyhedra,, spheres, cylinders, cones, toroids,
etc. - BREPS (Boundary REPresented Solids)
- volumes defined by boundary surfaces
- include solids defined by NURBS (Non-Uniform
Rational B-Splines) - External tool for g3tog4 geometry conversion
- CAD exchange
- interface through ISO STEP (Standard for the
Exchange of Product Model Data) - Fields
- of variable non-uniformity and differentiability
- use of various integrators, beyond Runge-Kutta
- time of flight correction along particle transport
26Things one can do with Geant4 geometry
One can do operations with solids
These figures were visualised with Geant4 Ray
Tracing tool
...and one can describe complex geometries, like
Atlas silicon detectors
27A selection of geometry applications
BaBar at SLAC
XMM-Newton (ESA)
ATLAS at LHC, CERN
GLAST (NASA)
CMS at LHC, CERN
Borexino at Gran Sasso Lab.
28Processes
- Processes describe how particles interact with
material or with a volume itself - Three basic types
- At rest process
- (e.g. decay at rest)
- Continuous process
- (e.g. ionization)
- Discrete process
- (e.g. decay in flight)
- Transportation is a process
- interacting with volume boundary
- A process which requires the shortest interaction
length limits the step
29Physics
- From the Minutes of LCB (LHCC Computing Board)
meeting on 21 October, 1997
It was noted that experiments have requirements
for independent, alternative physics models. In
Geant4 these models, differently from the concept
of packages, allow the user to understand how the
results are produced, and hence improve the
physics validation. Geant4 is developed with a
modular architecture and is the ideal framework
where existing components are integrated and new
models continue to be developed.
30The approach to physics
- Ample variety of independent, alternative physics
models available in Geant4 - No more black boxes of packages
- Users are directly exposed to the physics they
use in their simulation - This approach is fundamental for the validation
of the experiments physics results
31Transparency of Geant4 physics
- No hard coded numbers
- Explicit use of units throughout the code
- Separation between the calculation of cross
sections and the generation of the final state - Calculation of cross-sections independent from
the way they are accessed (data files, analytical
formulae etc.) - Distinction between processes and models
- Cuts in range (rather than in energy, as usual)
- consistent treatment of interactions near
boundaries between materials - Modular design, at a fine granularity, to expose
the physics - physics independent from tracking
- Public distribution of the code, from one
reference repository worldwide
32Physics general features
- Abstract interface to physics processes
- tracking independent from processes
- Distinction between processes and models
- often multiple models for the same process
- Data encapsulation and polymorfism
- Transparent access to cross sections, from files,
interpolation from tables, analytical formulae
etc. - Distinction between the calculation of cross
sections and their use - Calculation of the final state independent from
tracking - Uniform treatment of electromagnetic and hadronic
physics - Open system
- Users can easily create and use their own models
33Data libraries
- Systematic collection and evaluation of
experimental data from many sources worldwide - Databases
- ENDF/B, JENDL, FENDL, CENDL, ENSDF,JEF, BROND,
EFF, MENDL, IRDF, SAID, EPDL, EEDL, EADL, SANDIA,
ICRU etc. - Collaborating distribution centres
- NEA, LLNL, BNL, KEK, IAEA, IHEP, TRIUMF, FNAL,
Helsinki, Durham, Japan etc. - The use of evaluated data is important for the
validation of physics results of the experiments
34Electromagnetic physics
- Comparable to Geant3 and EGS already in the
?-release - Substantial further extensions
- Multiple alternatives for various processes
- High energy extensions
- models for ? up to PeV
- fundamental for LHC experiments, cosmic ray
experiments etc. - Low energy extensions
- e,? down to 250 eV
- (EGS, ITS etc. to 1 keV, Geant3 to 10 keV))
- low energy hadrons and ions models based on
Ziegler and ICRU data and parametrisations - models for antiprotons (positrons in progress)
- fundamental for space and medical applications,
neutrino experiments, antimatter spectroscopy etc.
35E.M. processes in Geant4
- multiple scattering
- energy loss
- Bremsstrahlung
- ionisation
- annihilation
- photoelectric effect
- Compton scattering
- pair production
- synchrotron radiation
- transition radiation
- Cherenkov
- Rayleigh effect
- rifraction
- reflection
- absorption
- scintillation
- fluorescence
- Auger (in progress)
36Selection of e.m. physics results
Backscattering
Multiple scattering
37Low energy e.m. extensions
Fundamental for space and medical applications,
neutrino experiments, antimatter spectroscopy etc.
Barkas effect models for antiprotons
- e,? down to 250 eV (positrons in progress)
- (EGS, ITS to 1 keV, Geant3 to 10 keV)
Low energy hadrons and ions models based on
Ziegler and ICRU data and parameterisations
38Low energy e.m. extensions
ESA Space Environment Effects Analysis Section
Cosmic rays, jovian electrons
X-Ray Surveys of Asteroids and Moons
Solar X-rays, e, p
Geant3.21
ITS3.0, EGS4
Courtesy SOHO EIT
Geant4
Induced X-ray line emission indicator of target
composition (100 mm surface layer)
C, N, O line emissions included
39Low energy e.m. extensions
Brachytherapy at IST Genova, Italian National
Institute for Cancer Research
- Photon attenuation coefficient in water
- 1.000.000 photons generated,
- 120 sec on an Intel PC 300 MHz
Courtesy of IST
40High energy e.m. extensions
Models for muons extended up to the PeV scale
High energy m Courtesy of L3
41Examples of application of Geant4 e.m. physics
Sampling calorimeter
Courtesy of CMS
42Hadronic physics
- Completely different approach w.r.t. the past
- transparent
- native
- no longer interface to external packages
- clear separation between data and their use in
algorithms - Cross section data sets
- transparent and interchangeable
- Final state calculation
- models by particle, energy, material
43Completeness of Geant4 hadronic physics
- Ample variety of models
- the most complete hadronic simulation kit on the
market - alternative and complementary models
- it is possible to mix-and-match, with fine
granularity - data-driven, parameterised and theoretical models
- Consequences for the users
- no more confined to the black box of one package
- the user has control on the physics used in the
simulation, which contributes to the validation
of physics results
44Hadronic physicsParameterised and data-driven
models (1)
- Based on experimental data
- Some models originally from GHEISHA
- completely reengineered into OO design
- refined physics parameterisations
- New parameterisations
- pp, elastic differential cross section
- nN, total cross section
- pN, total cross section
- np, elastic differential cross section
- ?N, total cross section
- ?N, coherent elastic scattering
p elastic scattering on Hydrogen
45Hadronic physicsParameterised and data-driven
models (2)
- Other models are completely new, such as
- stopping particles (?- , K- )
- neutron transport
- isotope production
- All databases existing worldwide used in neutron
transport - Brond, CENDL, EFF, ENDFB, JEF, JENDL, MENDL etc.
46Hadronic physicsTheoretical models
- They fall into different parts
- the evaporation phase
- the low energy range, pre-equilibrium, O(100
MeV), - the intermediate energy range, O(100 MeV) to O(5
GeV), intra-nuclear transport - the high energy range, hadronic generator
régime - Geant4 provides complementary theoretical models
to cover all the various parts - Geant4 provides alternative models within the
same part - All this is made possible by the powerful Object
Oriented design of Geant4 hadronic physics - Easy evolution new models can be easily added,
existing models can be extended
47A sample from theory-driven models
48An example of user application
CMS HCAL (H2 1996) Test-Beam Setup
Courtesy of CMS Collaboration
49Event biasing
- Geant4 provides facilities for event biasing
- The effect consists in producing a small number
of secondaries, which are artificially recognized
as a huge number of particles by their
statistical weights - Event biasing can be used, for instance, for the
transportation of slow neutrons or in the
radioactive decay simulation
50Other components
- Materials
- elements, isotopes, compounds, chemical formulae
- Particles
- all PDG data
- and more, for specific Geant4 use, like ions
- Hits Digi
- to describe detector response
- Persistency
- possibility to run in transient or persistent
mode - no dependence on any specific persistency model
- persistency handled through abstract interfaces
to ODBMS
- Visualisation
- Various drivers
- OpenGL, OpenInventor, X11, Postscript, DAWN,
OPACS, VRML - User Interfaces
- Command-line, Tcl/Tk, Tcl/Java, batchmacros,
OPACS, GAG, MOMO - automatic code generation for geometry and
materials - Interface to Event Generators
- through ASCII file for generators supporting
/HEPEVT/ - abstract interface to Lund
51Modules for space applications
Delayed radioactivity
General purpose source particle module
INTEGRAL and other science missions
Low-energy e.m. extensions
Particle source and spectrum
Geological surveys of asteroids
Sector Shielding Analysis Tool
CAD tool front-end
Instrument design purposes
Dose calculations
52Fast simulation
- Geant4 allows to perform full simulation and
fast simulation in the same environment - Geant4 parameterisation produces a direct
detector response, from the knowledge of particle
and volume properties - hits, digis, reconstructed-like objects (tracks,
clusters etc.) - Great flexibility
- activate fast /full simulation by detector
- example full simulation for inner detectors,
fast simulation per calorimeters - activate fast /full simulation by geometry
region - example fast simulation in central areas and
full simulation near cracks - activate fast /full simulation by particle type
- example in e.m. calorimeter e/?
parameterisation and full simulation of hadrons - parallel geometries in fast/full simulation
- example inner and outer tracking detectors
distinct in full simulation, but handled together
in fast simulation
53Example of integrated Fast/Full Simulation
application
- BaBar Object-oriented Geant4-based Unified
Simulation (BOGUS) - Integrated framework for Fast and Full simulation
- Fast simulation available for public use since
February 1999 - Integrated in BaBar environment
- primary generators, reconstruction, OODB
persistency - parameters for materials and geometry shared with
reconstruction applications
Courtesy of G. Cosmo
54Performance
- Various Geant4 - Geant3.21 comparisons
- realistic detector configurations
- results and plots in
- Geant4 Web Gallery (from Geant4 homepage)
- RD44 Status Report, 1995
- Benchmark in liquid Argon/Pb calorimeter
- at comparable physics performance Geant4 is
faster than (fully optimised) Geant3.21 by - a factor gt3 using exactly the same cuts
- a factor gt10 optimising Geant4 cuts, while
keeping the same physics performance - at comparable speed Geant4 physics performance is
greatly superior to Geant3.21 - Benchmark in thin silicon layer
- at comparable physics performance Geant4 is 25
faster than Geant3.21 (single volume, single
material)
55Geant4 features relevant for medical applications
- The transparency of physics
- Advanced functionalities in every domain
geometry, physics, visualisation etc. - Extensibility in any domain to satisfy new user
requirements - thanks to OO technology
- open design new physics, new features can be
easily added, without any perturbation to the
existing code - Adopts standards wherever available (de jure or
de facto) - Use of evaluated data libraries
- Quality Assurance based on sound software
engineering - Subject to independent validation by a large user
community worldwide - User support organization by a large
international Collaboration of experts
56Bragg peak, Magic cube data and Geant4
Experimental data Bragg peak of a 270 MeV/u
carbon ion beam
Geant4 and experimental data, PSI test with
proton beam
distance(cm)
Courtesy of INFN Torino
57Brachyterapy at Nat. Inst. Cancer Research, Genova
- The source holder is a standard endobronchial
treatment catheter, the chamber is a 0.6 cc
Capintec chamber connected to a Capintec 192
electrometer - The IST group follows the direction of Basic
Dosimetry on Radiotherapy with Brachytherapy
Source of the Italian Association of Biomedical
Physics (AIFB)
The custom calibration plexiglas jig, used for in
air measurements.
Source anisotropy Geant4 simulation
Courtesy of S. Agostinelli, R. Corvo, F.
Foppiano, S. Garelli, G. Sanguineti, M. Tropeano
58CT interface and treatment planning
- Two possible approaches
- CT interface Geant4 full simulation
- CT interface Geant4 fast simulation
- (physics processes parameterised through an
analytical treatment) - Geant-based tools for
- inverse planning
- technique of active dose delivery
- Software interface for Geant4 that reads input
data in DICOM3 format under development at
Medical Dept., University of Piemonte Orientale
and INFN Torino
Courtesy of V. Rolando, Univ. Piemonte Orientale
59Geant4 for scatter compensation in Megavoltage 3D
CT
- Use GEANT4 to obtain digitally reconstructed
radiographs (DRRs), including full scatter
simulation - This represents a great improvement over
approaches based on ray-casting
Courtesy of IST Genova
60In vivo dosimetry for mammography
- TLD characterization for mammography screening
- simulation of dose deposition and glow curve
- Mammography simulation
- Goal minimize dose on patient
- Comparison between experimental data TLD in vivo
dosimetry and Geant4 simulation - Activity at Medical Physics Dept., Umberto I
Hospital of Ordine Mauriziano, Torino - in progress
61Risk factors
- Performance and adequacy of C and OO
technologies for HEP simulation were considered
risk factors at the beginning of the project - clearly demonstrated that Geant4 satisfies the
requirements for use in HEP simulation - Now?
- Maturity of the HEP community
- to appreciate the need of a new simulation
environment - to work in a simulation environment based on
advanced software engineering - to invest in learning new technologies
62An ambitious project
What if the geometry to describe with Geant4 were
DNA and the process were mutagenesis?
Study of radiation damage at the cellular and DNA
level in the space radiation environment
- Multi-disciplinary Collaboration of
- astrophysicists and space scientists
- particle physicists
- medical physicists
- biologists
- physicians
- Other applications (not only in space domain)
- INFN (Genova, Torino, Cosenza)
- ESA
- CERN
- Istituto Nazionale per la Ricerca sul Cancro
Karolinska Institute - PSI
- Università del Piemonte Orientale
- Università di Pisa
- First phase of the project User Requirements
63Conclusions
Geant4 has successfully coped with a variety of
challenges
- The software challenge
- first successful attempt to redesign a major
package of HEP software adopting an Object
Oriented environment and a rigorous approach to
advanced software engineering - The functionality challenge
- a variety of requirements from many application
domains (HEP, space, medical etc.) - The physics challenge
- transparency
- extended coverage of physics processes across a
wide energy range, with alternative models
- The performance challenge
- mandatory for large scale HEP experiments and for
other complex applications - The distributed software development
- OOAD has provided the framework for distributed
parallel development - The management challenge
- a well defined, and continuously improving,
software process has allowed to achieve the goals - The user support challenge
- the user community is distributed worldwide,
operating in a variety of domains
Geant4 represents a successful experience for the
future generation of experiments
64Documentation
http//wwwinfo.cern.ch/asd/geant4/geant4.html
- User Documentation
- Introduction to Geant4
- Installation Guide
- Geant4 Users Guide - For Application Developers
- for those wishing to use Geant4
- Geant4 Users Guide - For Toolkit Developers
- for those wishing to extend Geant4 functionality
- Software Reference Manual
- documentation of the public interface of all
Geant4 classes - Physics Reference Manual
- extended documentation on Geant4 physics
- Examples
- a set of Novice, Extended and Advanced examples
illustrating the main functionalities of Geant4
in realistic set-ups - The Gallery
- a web collection of performance and physics
evaluations - http//wwwinfo.cern.ch/asd/geant4/reports/gallery/
- Publication and Results web page
- http//wwwinfo.cern.ch/asd/geant4/reports/reports.
html - Italian Geant4 web site
- httpwww.ge.infn.it/geant4/