Seminario Geant4 INFN

Download Report

Transcript Seminario Geant4 INFN

http://cern.ch/geant4/geant4.html
http://www.ge.infn.it/geant4/
Usage and results
Maria Grazia Pia
INFN Genova
[email protected]
http://www.ge.infn.it/geant4/training/
Maria Grazia Pia
Budker Inst. of Physics
IHEP Protvino
MEPHI Moscow
Pittsburg University
Today’s exercise
A real-life example
– simulation + analysis in a simple
experimental set-up
By-products
– an overview of Geant4
Tomorrow’s lecture
Applications and results of Geant4
– large-scale HEP experiments
– small-scale HEP experiments
– astroparticle experiments
– space science
– radiotherapy
– an overview of OO Analysis Tools
– a practical example how to use
Geant4 and AIDA/Anaphe
– an introduction to software process
– an introduction to basics concepts
of OO technology
Maria Grazia Pia
Discussion
through a real-life
simulation + analysis
and AIDA+Anaphe
http://cern.ch/geant4/
http://www.ge.infn.it/geant4/
http://cern.ch/anaphe/
Maria Grazia Pia
INFN Genova
[email protected]
Maria Grazia Pia
Budker Inst. of Physics
IHEP Protvino
MEPHI Moscow
Pittsburg University
The experimental set-up of our exercise
A simple configuration, consisting of
– a tracking detector
– an electromagnetic calorimeter
– a system of anti-coincidences
What happens in our detectors
– incident particles interact in the
experimental set-up
– secondary particles may be generated
and interact too
– detectors and their read-out electronics
record the effects produced by primary
and secondary particles
Maria Grazia Pia
What shall we do now?
Sit in front of a PC and start writing code…
Wonder what we want to do…
Ask our boss what he wants us to do…
Chat with collaborators in the experiment…
Ask and think and plan and analyse and design and develop and test and get feedback
and ask and think and plan and analyse and design and develop and test and get feedback
and ask and think and…
Software process
Maria Grazia Pia
The software life-cycle
A software process
- provides guidance to a team’s activities
- specifies which work products should be produced and when
- offers criteria for monitoring and measuring the project’s products and activities
Advantages of
iterative and incremental
development
Complexity is never overwhelming
– only tackle small bits at a time
Early feedback from using the software
– provides input to the analysis of
subsequent iterations
Developers’ skills can grow with the
project
– don’t need to apply latest
techniques/technology at the start
Requirements can be modified
– each iteration is a mini-project (analysis,
design…)
Maria Grazia Pia
Software Process
SEI’s definition:
A set of activities, methods, practices and transformations that people
use to develop and maintain software and associated products
Three key components:
the people involved
the organization of the development process
the technology used
Reference for guidance and assessment
Capability Maturity Model (CMM)
SPICE/ISO 15504
Various software process models
USDP / RUP
OPEN
OOSP
XP, Agile etc.
Maria Grazia Pia
USDP
waterfall
Best practices
The goal:
– to ensure the production of high-quality software
– that meets the needs of its end users
– within a predictable schedule and budget
The way to progress is to study and
improve the way software is produced
– better technology only helps once the
organizational framework is set
– there is evidence that going for new technology
instead of improving the process can make
things worst
A set of “best practices” for software
development teams
– considered conventional wisdom by
methodology pratictioners
Maria Grazia Pia
The inception phase
Formulating the scope of the project
– capturing the context and the most important requirements and constraints
Planning
– project plan, risk management, staffing etc.
Synthesizing a candidate architecture
– to demonstrate feasibility through some kind of proof of concept
Preparing the environment for the project
Capture User Requirements
Select a simulation framework
Identify a candidate architecture
Maria Grazia Pia
Capture User Requirements
Define the scope of the software system to be built
(“what it should do”)
Maria Grazia Pia
1 . G e n e ra l
U R 1.1 C onfigure the R u n
U R 1.2 C onfigure the E ven t Loop
2 . D e s c rip tio n o f th e e x p e rim e n ta l s e t -u p
U R 2.1 D escribe a g eo m etrical set-u p : a S i-W tracker, a
C sI calorim eter and an anti-coincidence system
m ade out of plastic scintillators.
U R 2.2 R ecord th e co o rd in ates o f im p act of tracks in
the layers of the tracker. R ecord the energy
release in the strips of the tracker.
U R 2.3 R ecord the en erg y d ep o sited in each elem ent of
the calo rim eter at every event.
U R 2.4 R ecord the en erg y d e p o sited in each elem ent of
the an tico in cid en ce at every event.
U R 2.5 D ig itise the hits, setting a threshold for the
energy deposit in the tracker.
U R 2.6 G enerate a trig g er signal com bining signals from
different detectors.
3 . P h ys ic s
U R 3.1 G enera te p rim ary even ts according to various
distributions relevant to gam m a astrophysics
U R 3.2 A ctivate electro m ag n etic processes appropriate
to the energy range of the experim ent.
U R 3.3 A ctivate h ad ro n ic processes appropriate to the
energy range of the experim ent.
Maria Grazia Pia
4 . A n a lys is
U R 4.1 P lot the x-y d istrib u tio n of im pact of the track.
U R 4.2 P lot h isto g ram s during the sim ulation execution.
U R 4.3 S tore significant quantities in a n tu p le (energy
release in the strips, hit strips) for further analys is.
U R 4.4 P lot the en erg y d istrib u tio n in the calorim eter.
5 . V is u a lis a tio n
U R 5.1 V isualise the experim ental set-u p .
U R 5.2 V isualise tracks in the experim ental set-up.
U R 5.3 V isualise h its in the experim ental set-up.
6 . U s e r In te rfa c e
U R 6.1 C o n fig u re th e tracker, by m odifying the num ber
of active planes, the pitch of the strips, the area
of silicon tiles, the m aterial of the converter
U R 6.2 C o n fig u re th e calo rim eter, by m odifying the
num ber of active elem ents, the num ber of layers.
U R 6.3 C o n fig u re th e so u rce .
U R 6.4 C o n fig u re d ig itisatio n by m odifying threshold
U R 6.5 C o n fig u re th e h isto g ram s
7 . P e rs is te n c y
U R 7.1 P roduce an interm ediate o u tp u t of the sim ulation
at the level of hits in the tracker.
U R 7.2 S to re significant results in F IT S form at.
U R 7.3 R ead in an interm ediate output for further
elaboration.
User Requirements
Select a simulation framework
Maria Grazia Pia
Lifetime of LHC software = 25 yrs
WWW
Thanks to Dino Ferrero Merlino(IT
Maria Grazia Pia
The zoo
EGS4, EGS5, EGSnrc
Geant3, Geant4
MARS
MCNP, MCNPX, A3MCNP, MCNP-DSP, MCNP4B
MVP, MVP-BURN
Penelope
Peregrine
Tripoli-3, Tripoli-3 A, Tripoli-4
...and I probably forgot some more
Many codes not publicly distributed
A lot of business around MC
DPM
EA-MC
FLUKA
GEM
HERMES
LAHET
MCBEND
MCU
MF3D
NMTC
MONK
MORSE
RTS&T-2000
SCALE
TRAX
VMC++
Monte Carlo codes presented at the MC200 Conference, Lisbon, October 2000
Maria Grazia Pia
What is
?
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.
–
–
–
–
Geant4 provides a general infrastructure for
modeling geometry and materials
particle transport and interactions with matter
describing detector response
visualisation of geometries, tracks and hits
–
–
–
Maria Grazia Pia
The user develops specific code for
the primary event generator
the geometrical description of the set-up
the digitisation of the detector response
The Toolkit approach
A toolkit is a set of compatible components
–
–
–
–
–
each component is specialised for a specific functionality
each component can be refined independently to a great detail
components can be integrated at any degree of complexity
it is easy to provide (and use) alternative components
the simulation application can be customised by the user according to
his/her needs
– maintenance and evolution - both of the components and of the user
application - is greatly facilitated
...but what is the price to pay?
– the user is invested of a greater responsibility
– he/she must critically evaluate what he/she needs and wants to use
Maria Grazia Pia
Geant4
architecture
Software Engineering
plays a fundamental role in Geant4
Interface to
external
products w/o
dependencies
Domain
decomposition
hierarchical
structure of
sub-domains
User Requirements
• formally collected
• systematically updated
• PSS-05 standard
Software Process
• spiral iterative approach
• regular assessments and improvements (SPI process)
• monitored following the ISO 15504 model
• OOAD
• use of CASE tools
• openness to extension and evolution
• contribute to the transparency of physics
• interface to external software without dependencies
Object Oriented methods
Uni-directional
flow of
dependencies
Maria Grazia Pia
• commercial tools
Quality Assurance
• code inspections
• automatic checks of coding guidelines
• testing procedures at unit and integration level
• dedicated testing team
Use of Standards
• de jure and de facto
Identify a candidate architecture
Maria Grazia Pia
Maria Grazia Pia
The elaboration
Refining the vision
– a solid understanding of the most critical use cases
Defining, validating and refining the architecture
Iteration plans for the construction phase
Putting in place the development environment
Architecture (based on the Geant4 framework)
Use case realizations
Priorities of requirements: plan iterations
Maria Grazia Pia
Physics
Detector
description
Management
Detector
response
Visualisation
Primary event generation
Analysis
Maria Grazia Pia
Architecture
Initialisation
m a in
Ru n m a n a g e r
1 : in i t i a l iz e
user d et ect o r
co n st ru c t io n
u s e r p h y sic s
l is t
2 : co nst ruc t
Describe a
geometrical set-up:
3 : m at e rial c o n s t r u c t io n
a Si-W tracker, a CsI
calorimeter and an
4 : g e o m e t r y c o n s t r u c t io n anti-coincidence
system made out of
5 : w o r ld v o l u m e
plastic scintillators.
6 : c o n st r u c t
7 : p h y sic s p r o c e s s c o n s t r u c t io
Maria Grazia Pia
Activate
electromagnetic/hadronic 8 : s e t c u t s
processes appropriate to the
energy range of the experiment
Beam On
m a in
Ru n M a n a g e r
1 : Be a m On
Ge o m e t r y
m a n ag e r
Ev e n t
g e n e ra t o r
2 : c lo s e
3 : g e n e ra t e o n e e ve n t
Generate primary events
according to various distributions
relevant to gamma astrophysics
4 : proc ess o ne ev e nt
5 : o p en
Maria Grazia Pia
Eve n t
M an a g e r
Event processing
Ev en t
m anag er
St ac k in g
ma nage r
Trac k in g
m anag er
St e pp in g
m anag er
Use r sensit iv e
det ec t o r
1 : pop
2 : pro c ess o ne t r ack
3 : St ep p in g
4 : gen er at e hit s
5 : sec o nd ar ies
6 : pu sh
Maria Grazia Pia
Record the coordinates of
impact of tracks in the tracker
layers
Record the energy deposited in
each element of the calorimeter at
every event
The kernel
Run and event
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
Maria Grazia Pia
The construction
Completing the
– analysis
– design
– development
– testing
of all required functionality
Maria Grazia Pia
Maria Grazia Pia
Detailing the
design
Materials
Describe a
geometrical set-up:
a Si-W tracker, a CsI
calorimeter and an
anti-coincidence
system made out of
plastic scintillators.
Different kinds of materials can be defined
– isotopes
G4Isotope
– elements
G4Element
– molecules
G4Material
– compounds and mixtures
G4Material
Attributes associated:
–
–
–
–
temperature
pressure
state
density
Maria Grazia Pia
Geometry
Role: detailed detector description
and efficient navigation
Chandra
Multiple representations
ATLAS
(same abstract interface)
BaBar
CSG (Constructed Solid Geometries)
- simple solids
ATLAS
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)
CAD exchange: ISO STEP interface
Fields: of variable non-uniformity and differentiability
Borexino
Maria Grazia Pia
External tool for g3tog4 geometry conversion
CMS
How to define detector geometry
Three conceptual layers
– G4VSolid: shape, size
– G4LogicalVolume: daughter volumes, material, sensitivity etc.
– G4VPhysicalVolume: position, rotation
Placement: one positioned volume
Repeated: a volume placed many times
placement
repeated
– reduces use of memory
– Replica: simple repetition (e.g. divisions)
– Parameterised
G4VSolid
G4LogicalVolume
G4Material
G4Box
G4Tubs
Maria Grazia Pia
G4VisAttributes
G4VSensitiveDetector
G4VPhysicalVolume
G4PVPlacement
G4PVParametrized
Read-out Geometry
Readout geometry is a virtual and artificial geometry
it is associated to a sensitive detector
can be defined in parallel to the real detector geometry
helps optimising the performance
Maria Grazia Pia
Maria Grazia Pia
DetectorConstruction
// Calorimeter Structure (CALLayerX + CALLayerY)
// Solid
solidCALLayerX = new G4Box("CALLayerX",
CALSizeXY/2, CALSizeXY/2, CALBarThickness/2);
// Logical volume
logicCALLayerX = new
G4LogicalVolume(solidCALLayerX, CALMaterial,
"CALLayerX");
// Physical volume
for (G4int i = 0; i < NbOfCALLayers; i++)
{
physiCALLayerY = new G4PVPlacement(…);
physiCALLayerX = new G4PVPlacement(…);
…
}
Maria Grazia Pia
Hits and Digis
A sensitive detector creates hits
using the information provided
by G4Step
One can store various types of
information in a hit
– position and time of the step
– momentum and energy of the
track
– energy deposition of the step
– geometrical information
– etc.
Record the coordinates of impact of
tracks in the layers of the tracker.
Record the energy deposited in each
element of the calorimeter at every event.
A Digi represents a detector output
– e.g. ADC/TDC count, trigger signal
A Digi is created with one or more
hits and/or other digits
Hits collections are accessible
– through G4Event at the end of an event
– through G4SDManager during
processing an event
The digitise() method of each
G4VDigitizerModule must be explicitly
invoked by the user’s code
– e.g. in the UserEventAction
Maria Grazia Pia
Hits and Digis
Maria Grazia Pia
Hits in our example
Each tracker hit contains the following information:
ID of the event (this is important for multiple events run)
Energy deposition of the particle in the strip
Number of the strip
Number of the plane
Type of the plane
Position of the hit (x,y,z) in the reference frame of the payload
Maria Grazia Pia
Generating primary particles
Generate primary events
according to various
distributions relevant to 
astrophysics
Interface to Event Generators
– through ASCII file for generators supporting /HEPEVT/
– abstract interface to Lund++
Various utilities provided within the Geant4 Toolkit
– ParticleGun
beam of selectable particle type, energy etc.
– GeneralParticleSource
provides sophisticated facilities to model a particle source
used to model space radiation environments, sources of radioactivity in
underground experiments etc.
– you can write your own, inheriting from G4VUserPrimaryGeneratorAction
Particles
– all PDG data
– and more, for specific Geant4 use, like ions
Maria Grazia Pia
Primary generator in our example
GammaRayTelParticleGenerationAction and its Messenger are
responsible for the generation of primary particles and the
related configuration through the UI
Define the incident flux of particles:
– from a specific direction
– or from an isotropic background
Choose also between two spectral options:
– monochromatic
– or with a power-law dependence
The particle generator parameters are accessible through the UI
– /gun/ tree
Maria Grazia Pia
Physics
Activate electromagnetic and hadronic processes
appropriate to the energy range of the experiment
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
Physics: general features
Ample variety of physics functionalities
Modular design, at a fine granularity, to expose the physics
Uniform treatment of electromagnetic and hadronic processes
Abstract interface to physics processes
– tracking independent from physics
Distinction between processes and models
– often multiple models for the same physics process (complementary/alternative)
Transparency (supported by encapsulation and polymorfism)
– calculation of cross-sections independent from the way they are accessed (data
files, analytical formulae etc.)
– distinction between the calculation of cross sections and their use
– calculation of the final state independent from tracking
Open system
– users can easily create and use their own models
Maria Grazia Pia
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
41
Processes
Processes describe how particles interact with material or with a volume
Three basic types
– At rest process
(eg. decay at rest)
– Continuous process
(eg. ionization)
– Discrete process
(eg. 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
Electromagnetic physics
 electrons and positrons
 , X-ray and optical photons
 muons
 charged hadrons
 ions
energy
loss
Comparable to Geant3 already in the a release (1997)
Further extensions (facilitated by the OO technology)
High energy extensions
–
needed for LHC experiments, cosmic ray experiments…
Low energy extensions
–
fundamental for space and medical applications, dark matter
and n experiments, antimatter spectroscopy etc.
Multiple scattering
Bremsstrahlung
Ionisation
Annihilation
Photoelectric effect
Compton scattering
Rayleigh effect
 conversion
e+e- pair production
Synchrotron radiation
Transition radiation
Cherenkov
Refraction
Reflection
Absorption
Scintillation
Fluorescence
Auger (in progress)
Alternative models for the same process
All obeying to the same abstract Process interface  transparent to tracking
Maria Grazia Pia
Standard electromagnetic processes
1 keV up to O(100 TeV)
Multiple scattering
– new model (by L. Urbán)
– computes mean free path length and
lateral displacement
New energy loss algorithm
– optimises the generation of d rays near
boundaries
Multiple scattering
6.56 MeV proton , 92.6 mm Si
Old plot,
further
improvements
Geant4 with a new
model
Geant3
data
Variety of models for ionisation and
energy loss
– including PhotoAbsorption Interaction
model (for thin layers)
Many optimised features
– Secondaries produced only when needed
– Sub-threshold production
Maria Grazia Pia
J.Vincour and P.Bem Nucl.Instr.Meth. 148. (1978) 399
Low Energy electromagnetic Processes: e, 
Maria Grazia Pia
shell effects
Low energy e.m.
extensions
Fundamental for
neutrino/dark matter
experiments, space and
medical applications,
antimatter spectroscopy
etc.
e, down to 250 eV
(EGS4, ITS to 1 keV, Geant3 to 10 keV)
Based on EPDL97, EEDL and
EADL evaluated data libraries
Geant4 LowEn
NIST
m /r (cm 2 /g) in iron
1000
100
Barkas effect
(charge dependence)
models for negative hadrons
Photon attenuation
protons
10
1
antiprotons
0.1
0.01
0.01
0.1
Maria
Grazia Pia
Photon Energy (MeV)
1
10
Bragg peak
Hadron and ion models
based on Ziegler and ICRU
data and parameterisations
ions
GammaRayTelPhysicsList
…
if (particleName == "gamma") {
// gamma
pManager->AddDiscreteProcess(new G4PhotoElectricEffect());
pManager->AddDiscreteProcess(new G4ComptonScattering());
pManager->AddDiscreteProcess(new G4GammaConversion());
} else if (particleName == "e-") {
// electron
pManager->AddProcess(new G4MultipleScattering(),-1, 1,1);
pManager->AddProcess(new G4eIonisation(),
-1, 2,2);
pManager->AddProcess(new G4eBremsstrahlung(), -1,-1,3);
} else if (particleName == "e+") {
// positron
pManager->AddProcess(new G4MultipleScattering(),-1, 1,1);
pManager->AddProcess(new G4eIonisation(),
-1, 2,2);
pManager->AddProcess(new G4eBremsstrahlung(), -1,-1,3);
pManager->AddProcess(new G4eplusAnnihilation(), 0,-1,4);
select physics
processes to be
activated for each
particle type
…
SetCutValue(cutForGamma, "gamma");
SetCutValue(cutForElectron, "e-");
SetCutValue(cutForElectron, "e+");
Maria Grazia Pia
set production thresholds
Highlights of Geant4
Hadronic Physics
and more about
Electromagnetic Physics
in tomorrow’s lecture …
Maria Grazia Pia
Now we can run our
simulation, track
particles, produce
showers and record
the effects in the
detectors…
…but our job is not limited to simulation only
Maria Grazia Pia
Collaborating Frameworks
In our application:
Simulation
– to model the experimental setup and generate effects from particle interactions
User Interface
– to control configuration and flow of execution
Visualisation
– detector geometry, particle tracks, hits etc.
Analysis
– histogramming of physics quantities
Maria Grazia Pia
Components and Frameworks
Frameworks are composed of components
Abstract Interfaces de-couple components and frameworks
Frameworks
– correlated groups of classes (components) together with their interactions
– re-usable (generic) designs of a software system on a very high abstraction level
– flow of control is bi-directional between application and the framework library
Component
– a correlated group of classes together with their interactions
– reusable design of (part of) a software system on a low or medium abstraction level
Weakly coupled components and frameworks have large advantages
– ease of re-use of component or framework
– flexibility through independence of implementation
– maintainability through independent evolution of components
Maria Grazia Pia
Interface to external tools in Geant4
Through abstract interfaces
no dependence
minimize coupling of components
Similar approach
Visualisation
(G)UI
Persistency
Analysis
The user is free to choose the concrete
system he/she prefers for each component
Maria Grazia Pia
Visualisation in Geant4
Visualise the experimental set-up
Visualise tracks in the experimental set-up
Visualise hits
Control of several kinds of visualisation
– detector geometry
– particle trajectories
– hits in the detectors
Using abstract G4VisManager class
– takes 3-D data from geometry/track/hits
– passes on to abstract visualization driver
G4VGraphicsSystem (initialization)
G4VSceneHandler (processing 3-D data for visualisation)
G4VViewer (rendering the processed 3-D data)
Various drivers
– OpenGL, OpenInventor, X11, Postscript, DAWN, OPACS, VRML…
Maria Grazia Pia
User Interface in Geant4
Two phases of user user actions
Configure the tracker, by modifying the number of
active planes, the pitch of the strips, the area of
silicon tiles, the material of the converter
Configure the calorimeter, by modifying the
number of active elements, the number of layers
Configure the source
Configure digitisation by modifying the threshold
Configure the histograms
– setup of simulation
– control of event generation and processing
User Interface category separated from actual command interpreter
(intercoms)
– using abstract G4UIsession class
– several implementations exist
command-line (batch and terminal)
GUIs (X11/Motif, GAG, MOMO, OPACS, Java)
Automatic code generation for geometry and materials (GGE, GPE)
Maria Grazia Pia
Persistency in Geant4
Produce an intermediate
output of the simulation at the
level of hits in the tracker
Geant4 Persistency makes run, event, hits, digits and geometry
information be persistent, to be read back later by user programs
– no dependence on any specific persistency model
– use industrial standard ODMG C++ binding and HepODBMS as persistency interface
Possibility to run in transient or persistent mode
“Parallel World” approach
Tim e
F ile
O b je ct D a ta b a se
P e rsiste n t
O b je ct
Store( )
Tra n sie n t
C o n stru cto r
O b je ct
Retrieve( ) D e stru cto r
G 4 P e rsiste n cy
G4 kernel objects have
corresponding “P”
objects in G4Persistency
G4Run
 G4PRun
G4Event  G4PEvent
G4Hit
 G4PHit
:
:
Inherits from HepPersObj
in HepODBMS
G 4 K e rn e l
G 4 A pplica tio n
G 4 A pplica tio n
Maria Grazia Pia
Data members of transient and persistent objects are copied by Store( ) and Retrieve( )
The analysis framework
Plot the x-y distribution of impact of
the track
Plot the energy distribution in the
calorimeter.
Store significant quantities in a ntuple
(energy release in the strips, hit strips)
for further analysis
Plot histograms during the simulation
execution.
COLT
Lizard
JAS
OpenScientist
Maria Grazia Pia
AIDA
Abstract Interfaces for Data Analysis (in HEP)
“The goals of the AIDA project are to define abstract interfaces for common
physics analysis tools, such as histograms. The adoption of these interfaces should
make it easier for developers and users to select to use different tools without
having to learn new interfaces or change their code. In addition it should be
possible to exchange data (objects) between AIDA compliant applications.”
(http://aida.freehep.org)
Unify/standardize “look and feel” for various tools
– there is no longer “only one tool”
Provide flexibility to interchange implementations of these interfaces
– can use specific features of specific tools w/o change!
Allows and try to re-use existing packages
– even across “language boundaries”
e.g., C++ analysis using Java Histograms
Minimize coupling between components
Maria Grazia Pia
Abstract Interfaces
Only pure virtual methods, inheritance only from
other Abstract Interfaces
Components use other components only through
their Abstract Interfaces
Defines a kind of a “protocol” for a component
Maximize flexibility and re-use of packages
Allow each component to develop independently
De-couple the implementation of a component from its use
Maria Grazia Pia
Use of Components with Abstract Interfaces
User Code uses only Interface classes
– IHistogram1D* hist = histoFactory-> create1D(‘track quality’, 100, 0., 10.)
Actual implementations are
selected at run-time
User Code
– loading of shared libraries
No change at all to user
code but keep freedom
to choose implementation
– flexible
– customizable
Maria Grazia Pia
Histo-IF
HistoHistoImpl. 1
Impl. 2
Fitter-IF
FitterImpl.
X
FitterImpl. Y
Architectural issue: Components
Identify components by functionality
Define “protocol” using Abstract Interfaces
Emphasize separation of different aspects for each component
– example: Histogram
statistical entity (density distribution of a physics quantity)
view of a “collection of data points”
(which can be a density distribution but also a detector efficiency curve)
command to manipulate/store/plot/fit/...
“User’s view” is different from “developer’s view”
– separate Abstract Interfaces for both aspects
UserInterface as a separate component
– by definition couples to most of the other components
– promotes weak coupling between the other components
– interfaces to scripting and/or GUI
Maria Grazia Pia
Initial categories and dependencies
Maria Grazia Pia
Anaphe: what it is
Modular (OO/C++) replacement of CERNLIB
functionality for use in HEP experiments
– memory management
– I/O
– foundation classes
– histogramming
– minimizing/fitting
– visualization
– interactive data analysis
Trying to use standards wherever possible
Trying to re-use existing class libraries
Maria Grazia Pia
Maria Grazia Pia
Anaphe Abstract Interfaces
Maria Grazia Pia
Anaphe components
Maria Grazia Pia
Lizard
Un tool di analisi interattiva AIDA compatibile
–
–
–
–
–
Python scripting
Visualizzazione con Qt
Istogrammi HTL (via AIDA)
Persistenza con Objectivity (o “licence-free”)
Fitting con NAG Libraries (o Minuit)
Componenti disponibili come shared libraries
– indipendenti dal linguaggio di scripting
Maria Grazia Pia
Design and implementation
in our example
Based on AIDA
– independent from any concrete Analysis Tool
Java Analysis Studio
Online histogramming
– provides fast feedback
Maria Grazia Pia
Are we done?
Not yet…
Did we satisfy all the original requests?
Which element of the design does a requirement correspond to?
Which requirement does a design element correspond to?
Same for the implementation…
Did we test that each requirement has been correctly satisfied?
Did we provide documentation for usage?
Where are we now in the process of producing our software product?
Maria Grazia Pia
Traceability
Traceability is the ability to trace a project element to other related project elements
From RUP
Maria Grazia Pia
A simple example of
traceability through
User Requirements,
Design,
Implementation,
Test
Iterative and
incremental process
Every release cycle
increments the
functionality, until all
requirements are
satisfied
Maria Grazia Pia
UR
D esign and Im plem entation
Test
1.1
G am m aR ayT elR unA ction
Start R un
1.2
2.1
G am m aR ayT elE ventA ction
G am m aR ayT elD etectorC onstruction
M anage E vents
V isualisation
2.2
G am m aR ayT elT rackerSD
H istogram m ing and O utput File
2.3
2.4
G am m aR ayT elC A lorim eterSD
G am m aR ayT elA nticoincidenceSD
H istogram m ing and O utput File
H istogram m ing andO utput File
2.5
G am m aR ayT elD igitizer
O utput File
2.6
3.1
(not yet)
G am m aR ayT elPrim aryG eneratorA ction
V isualization
3.2
G am m aR ayT elPhysicsList
H istogram m ing and V isualization
3.3
4.1
(not yet)
G am m aR ayT elA nalysis
H istogram , Plotting
4.2
G am m aR ayT elA nalysis
H istogram , Plotting
4.3
4.4
G am m aR ayT elA nalysis
(not yet)
H istogram files
5.1
G am m aR ayT elV isM anager
V isualization
5.2
5.3
G am m aR ayT elV isM anager
(not yet)
V isualization
6.1
G am m aR ayT elD etectorM essenger
U I and V isualization
6.2
6.3
G am m aR ayT elD etectorM essenger
G am m aR ayT elPrim aryG eneratorM essenger
U I and V isualization
U I and V isualization
6.4
G am m aR ayT elD igitizerM essenger
O utput File
6.5
7.1
G am m aR ayT elA nalysisM essenger
G am m aR ayT elA nalysis
Plotting, H istogram m ing
Plotting
7.2
(not yet)
7.3
(not yet)
The transition phase
In most cases our software is used in
the wider context of an experiment
–
–
–
–
documentation
training collaborators to use our software
feedback from users
maintenance
…start an evolutionary cycle for a new version of our software
Geant4 GammaRayTelescope advanced example
Developed by Riccardo Giannitrapani, Francesco Longo, Giovanni Santin (INFN TS/UD)
http://www.ge.infn.it/geant4/examples/gammaray_telescope/index.html
geant4/examples/advanced/gammaray_telescope/
Maria Grazia Pia
GLAST -ray telescope
Credit: Hytec
GLAST
Maria Grazia Pia
Courtesy of F. Longo and R. Giannitrapani, GLAST
Geant4 advanced examples
-ray telescope
X-ray telescope
Underground physics and radiation background
X-ray fluorescence
Brachytherapy
Full scale applications showing physics guidelines,
advanced interactive facilities and usage of OO
Analysis Tools in real-life set-ups
fluorescence
Fe lines
Maria Grazia Pia
GaAs lines