Seminario Geant4 INFN
Download
Report
Transcript Seminario Geant4 INFN
Overview of the
Geant4 OO Simulation Toolkit
Maria Grazia Pia
INFN Genova, Italy and CERN/IT
[email protected]
S. Agostinelli, S. Chauvie, F. Foppiano, P. Nieminen, S. Garelli, V. Rolando
32nd Meeting of the Proton Therapy Cooperative Group
Uppsala, 16 April 2000
http://www.ge.infn.it/geant4/talks/Uppsala/index.html
Maria Grazia Pia
1
Outline
What is Geant?
Status of Geant3 and motivations for Geant4
The Geant4 R&D phase: RD44
The role of software engineering and OO technology
Main features of the Geant4 toolkit
the kernel
physics
other tools
Performance
The Geant4 Collaboration
A selection of Geant4 applications
Conclusions
Maria Grazia Pia
2
The 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
Maria Grazia Pia
3
The 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
Maria Grazia Pia
4
New simulation requirements
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
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.
User requirements formally collected and coded according to PSS05 standard
Geant4 User Requirements Document
Maria Grazia Pia
5
What 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
Maria Grazia Pia
6
A bit of history...
Approved as R&D end 1994 (RD44)
>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
Maria Grazia Pia
Milestone: July 1998
public -release
Milestone: end 1998
production release: Geant4.0, end of the
R&D phase
All milestones have been met by RD44
Reconfiguration at the end of the R&D
phase
International Geant4 Collaboration sincel
1/1/1999
Management of the production phase
Continuing R&D also in the production
phase
7
Software Engineering
Software Engineering plays a fundamental role in Geant4
Software process
User requirements
OOAD
Quality Assurance
User Requirements
Maria Grazia Pia
Collected initially and
systematically updated
Coded according to
ESA PSS-05 standard
Software process
based on Booch methodology
spiral type, with cycles of
design-implementation
iterations
OO Analysis
OO Design
Evolution
Maintenance
in a worldwide collaboration!
8
OO 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
Open to evolution
Flexibility
alternative models and implementations
Interface to external software, without
dependencies
extensibility, implementation of new
models and algorithms without
interfering with existing software
the user can extend the toolkit with
his/her model and data
databases for persistency
visualisation libraries
tools for UI
etc.
Maria Grazia Pia
9
Quality Assurance
Extensive use of Quality
Assurance systems
fundamental for a toolkit of wide
public use
Commercial tools
Testing
Unit testing
Integration testing
Insure++, Logiscope etc.
scripts to verify their applications
automatically
within working groups and across
groups
Maria Grazia Pia
exercising all Geant4
functionalities in realistic set-ups
Physics testing
eg.: test-suite of 375 tests for
hadronic physics parameterised
models
System testing
Code inspections
sets of logically connected classes
Test-bench for each category
C++ coding guidelines
in most cases down to class level
granularity
comparisons with experimental
data
Performance Benchmarks
10
Standards
Based on standards, ISO e de facto
STEP
engineering and CAD systems
ODMG
RD45
OpenGL e VRML for graphics
CVS for code management
C++ as programming
language
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 “accident” with NASA’s Mars Climate Orbiter ($125 million)?
Maria Grazia Pia
11
What is needed to run Geant4
Platforms
AIX, HP, DEC, Sun, (SGI):
native compilers, , g++
Linux: g++
Windows-NT: Visual C++
Commercial software
CVS
gmake, g++
CLHEP
Maria Grazia Pia
OpenGL, X11, OpenInventor,
DAWN, VRML...
OPACS, GAG, MOMO...
Persistence
ObjectStore STL (optional)
Free software
Graphics
it is possible to run in transient
mode
in persistent mode use a HepDB
interface, ODMG standard
12
The 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
Maria Grazia Pia
13
The kernel
Run and event
the Run Manager can handle multiple events
multiple runs in the same job
possibility to handle the pile-up
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
Maria Grazia Pia
14
Geometry
Role: detailed detector description and efficient navigation
CAD exchange
interface through ISO STEP (Standard for the Exchange of Product Model Data)
Multiple representations
CGS (Constructed Solid Geometries)
STEP extensions
simple solids
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
Fields
of variable non-uniformity and differentiability
use of various integrators, beyond Runge-Kutta
time of flight correction along particle transport
Maria Grazia Pia
15
Processes
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
Maria Grazia Pia
16
Physics
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.”
Maria Grazia Pia
17
The approach to physics
Ample variety of independent, alternative physics
models available in Geant4
No more black boxes of packages
The users are directly exposed to the physics they use
in their simulation
This approach is fundamental for the validation of the
experiments’ physics results
Maria Grazia Pia
18
Transparency 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
Maria Grazia Pia
19
Physics: 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
Maria Grazia Pia
20
Data 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
Maria Grazia Pia
21
Electromagnetic 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
fundamental for space and medical applications, neutrino experiments, antimatter
spectroscopy etc.
Maria Grazia Pia
22
E.M. processes in Geant4
multiple scattering
transition radiation
energy loss
Cherenkov
Bremsstrahlung
Rayleigh effect
ionisation
rifraction
annihilation
reflection
photoelectric effect
absorption
Compton scattering
scintillation
pair production
fluorescence
synchrotron radiation
Auger (in progress)
Maria Grazia Pia
23
Hadronic 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
Maria Grazia Pia
24
Completeness
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
Maria Grazia Pia
25
Hadronic physics
Parameterised and data-driven models
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
Maria Grazia Pia
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.
26
Hadronic physics
Theoretical 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
Maria Grazia Pia
27
Event 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
Maria Grazia Pia
28
Other components
Materials
elements, isotopes, compounds, chemical
formulae
Visualisation
Particles
all PDG data
and more, for specific Geant4 use, like ions
User Interfaces
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
Maria Grazia Pia
Various drivers
OpenGL, OpenInventor, X11,
Postscript, DAWN, OPACS, VRML
Command-line, Tcl/Tk, Tcl/Java,
batch+macros, 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++
29
ESA projects in Geant4
Low energy extensions of
electromagnetic physics
Source Particle Module
Radioactivity Decay
Module
Sector Shielding Analysis
Tool
CAD Tool Front-End
Maria Grazia Pia
30
Fast 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
Maria Grazia Pia
31
Performance
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 >3 using exactly the same cuts
a factor >10 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)
Maria Grazia Pia
32
Geant4 Collaboration
New organization for the production
phase, MoU based
Geant4 distribution, development and
User Support
Atlas, BaBar, CMS, LHCB
CERN, KEK, SLAC, TRIUMF, JNL
ESA, Frankfurt Univ, INFN, IN2P3,
Karolinska Inst., Lebedev, TERA
COMMON (Serpukov, Novosibirsk,
Pittsburg etc.)
Collaboration Board
manages resources and responsibilities
Technical Steering Board
manages scientific and technical
matters
manages the Production Service and
User Support
Working Groups
do maintenance, development, QA,
user support etc.
other memberships currently being discussed
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
Maria Grazia Pia
33
Bragg 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)
Maria Grazia Pia
34
Brachyterapy at Nat. Inst. Cancer Research, Genova
S. Agostinelli, R. Corvo, F. Foppiano, S. Garelli, G. Sanguineti
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.
Maria Grazia Pia
35
CT 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 developed at Medical Dept., University of Piemonte
Orientale and INFN Torino
Maria Grazia Pia
36
Geant4 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 raycasting
Maria Grazia Pia
37
In 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
Maria Grazia Pia
38
An 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
ESA-sponsored project,
in collaboration with INFN
INFN (Genova, Torino, Cosenza)
Istituto Nazionale per la Ricerca sul
Cancro
Università del Piemonte Orientale
ESA
CERN
Karolinska Institute
Maria Grazia Pia
Multi-disciplinary Collaboration of
astrophysicists and space
scientists
particle physicists
medical physicists
biologists
physicians
First phase of the project:
User Requirements
Other applications (not only in space
programmes)
39
Geant4 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
Maria Grazia Pia
40
Documentation
http://wwwinfo.cern.ch/asd/geant4/geant4.html
User Documentation
Introduction to Geant4
Installation Guide
Geant4 User’s Guide - For Application
Developers
Geant4 User’s Guide - For Toolkit
Developers
for those wishing to extend Geant4
functionality
Software Reference Manual
for those wishing to use Geant4
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
documentation of the public interface of all
Geant4 classes
Physics Reference Manual
extended documentation on Geant4 physics
Maria Grazia Pia
41