Maria grazia pia infn genova geant4 collaboration x i giornate sui rivelatori torino 1 2 march 2001
Download
1 / 153

Maria Grazia Pia INFN Genova Geant4 Collaboration X I Giornate sui Rivelatori - PowerPoint PPT Presentation


  • 155 Views
  • Uploaded on

Maria Grazia Pia INFN Genova Geant4 Collaboration X I Giornate sui Rivelatori Torino, 1-2 March 2001. Introduction. Author: Maria Grazia Pia. Geant4 Training Kit. An example of how simulation can be mission-critical. Courtesy of NASA/CXC/SAO. Chandra X-ray Observatory Status Update

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Maria Grazia Pia INFN Genova Geant4 Collaboration X I Giornate sui Rivelatori' - doris


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Maria grazia pia infn genova geant4 collaboration x i giornate sui rivelatori torino 1 2 march 2001

Maria Grazia Pia

INFN Genova

Geant4 Collaboration

XI Giornate sui Rivelatori

Torino, 1-2 March 2001


Introduction

Introduction

Author: Maria Grazia Pia

Geant4 Training Kit



Chandra 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 Chandra’s 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 instrument’s 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


What can affect ccd s on x ray astronomy missions
What can affect CCD’s on X-ray astronomy missions?

  • Radiation belt electrons?

  • Scattered in the mirror shells?

  • Effectiveness of Magnetic “brooms”

  • Electron damage mechanism? - NIEL?

  • Other particles? Protons, cosmic rays?

  • Path to CCD? Wall penetration?

  • Proposal: set the problem up in Geant4 as a case-study



Courtesy of

ESA Space Environment &

Effects Analysis Section

RGS

EPIC

Q2

Q1

Q1


EPIC

RGS

Courtesy of

ESA Space Environment &

Effects Analysis Section

CCD displacement damage: front vs. back-illuminated.

30 mm Si  ~1.5 MeV p+

2 mm

30 mm

2 mm

30 mm

Active layerPassive layer

“Electron deflector”

Low-E (~100 keV to few MeV), low-angle (~0°-5°) proton scattering:Obscure problem; not much analysed


How well can geant4 simulate low energy protons
How well can Geant4 simulate low energy protons?

Courtesy of R. Gotta, Thesis


What happened next
What 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


The role of simulation

design of the experimental set-up

evaluation and definition of the potential physics output of the project

evaluation of potentialrisks to the project

assessment of the performance of the experiment

development, test and optimisation of reconstruction and physics analysis software

contribution to the calculation and validation of physics results

The scope of these lectures (and of Geant4) encompasses the simulation of the passage of particles through matter

there are other kinds of simulation components, such as physics event generators, detector/electronics response generators, etc.

often the simulation of a complex experiment consists of several of these components interfaced to one another

The role of simulation

Simulation plays a fundamental role in various domains and phases of an experimental physics project


Domains of application
Domains of application

  • HEP, nuclear, astrophysics and astro-particle physics experiments

    • the most “traditional” field of application

  • Radiation studies

    • evaluation of safety constraints and shielding for the experimental apparatus and human beings, on earth and in space

  • Medical applications

    • radiotherapy

    • design of instruments for therapeutic use

  • Biological applications

    • radiation effects (in human beings, food etc.), at cellular and DNA level

  • …and more


What is required

Modeling the experimental set-up

Tracking particles through matter

Interaction of particles with matter

Modeling the detector response

Run and event control

Accessory utilities(random number generators, PDG particle information, physical constants, system of units etc.)

User interface

Interface to event generators

Visualisation (of the set-up, tracks, hits etc.)

Persistency

Analysis

What is required


Fast and full simulation
Fast and full simulation

  • Usually in a typical HEP experiment there are two types of simulations

  • Fast simulation

    • mainly used for feasibility studies and quick evaluations

    • coarse set-up description and physics modeling

    • usually directly interfaced to event generators

  • Full simulation

    • used for precise physics and detector studies

    • requires a detailed description of the experimental set-up and a complex physics modeling

    • usually interfaced to event generators and event reconstruction

  • Traditionally fast and full simulation are done by different programs and are not integrated in the same environment

    • complexity of maintenance and evolution

    • possibility of controversial results


The zoo
The zoo

NMTC

HERMES FLUKA

EA-MC

DPM

SCALE

GEM

MF3D

EGS4, EGS5, EGSnrc

MCNP, MCNPX, A3MCNP, MCNP-DSP, MCNP4B

Penelope

Geant3, Geant4

Tripoli-3, Tripoli-3 A, Tripoli-4

Peregrine

MVP, MVP-BURN

MARS

MCU

MORSE

TRAX

MONK

MCBEND

VMC++

LAHET

RTS&T-2000

...and I probably forgot some more

Many codes not publicly distributed

A lot of business around MC

Monte Carlo codes presented at the MC200 Conference, Lisbon, October 2000


Integrated suites vs specialised codes

Pro:

the specific issue is treated in great detail

sometimes the package is based on a wealth of specific experimental data

simple code, usually relatively easy to install and use

Contra:

a typical experiment covers many domains, not just one

domains are often inter-connected

Pro:

the same environment provides all the functionality

Contra:

it is more difficult to ensure detailed coverage of all the components at the same high quality level

monolithic: take all or nothing

limited or no options for alternative models

usually complex to install and use

difficult maintenance and evolution

Integrated suites vs specialised codes

Specialised packages cover a specific simulation domain

Integrated packages cover all/many simulation domains


The toolkit approach
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

  • components can work together to handle inter-connected domains

  • 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 and decide what he/she needs and wants to use


The role of geant
The role of Geant

  • Geant has been 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 description of the detector response


The past geant3
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


New simulation requirements

High statistics to be simulated

robustness and reliability for large scale production

Exchange of CAD detector models

especially relevant for large scale experiments

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.

New simulation requirements

User requirements formally collected and coded according to PSS-05 standard

Geant4 User Requirements Document


What is geant4
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, astrophysics, medical physics, space applications, radiation background studies etc.

  • It is also a successful experiment of distributed software production and management, as a large international collaboration with the participation of various experiments, labs and institutes

  • It is also a successful experiment of application of rigorous software engineering and Object Oriented technologies to the HEP environment


  • 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 R&D phase

    All milestones have been met by RD44

    Reconfiguration at the end of the R&D phase

    International Geant4 Collaboration since 1/1/1999

    Management of the production phase

    Continuing R&D also in the production phase

    RD44

    • Approved as R&D end 1994

      • > 100 physicists and software engineers

      • ~ 40 institutes, international collaboration

      • responded to DRCC/LCB


    Geant4 collaboration

    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

    maintenance, development, QA, etc.

    Geant4 Collaboration

    MoU based

    Distribution, development and User Support

    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


    Software engineering

    Software engineering

    Geant4

    rigorous approach to software


    Outline
    Outline

    • Motivations for software engineering in HEP

    • The software process

    • Components of the software life-cycle

    • Object Oriented technologies

    • Brief digression on basic OO concepts

    • OOAD in Geant4

    • Quality Assurance

    • Standards


    The benefits of software engineering
    The benefits of software engineering

    The goal: producing better software at lower cost, within predictable resource allocations and time estimates, and happier users of the software

    • the peopleinvolved

    • the organization of the development process

    • the technology used

    Three key components:

    • 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

    • The practices of SPI are well established, and have been applied in a large number of organizations for several years

      • the results prove that the economical benefits are largely worth the investment

      • early defect detection, time to market, and quality also improve, to the point that the return on investment for SPI is about 500%


    Software life cycle

    Various phases:

    User Requirements definition

    Software Requirements definition

    Architectural Design

    Detailed Design and construction

    Delivery to the user

    Operations

    Frequently the tasks of different life cycle phases are performed somewhat in parallel

    to consider them disjoint in time is a simplification

    It is however important

    to distinguish them logically

    to identify documents that are the outcome of the various phases

    Software life-cycle


    The software process
    The software process

    • Complex domain, evolving, with many types of models available

    • Examples of software process models:

    • The Waterfall model

      • analysis  design  coding

      • each phase starts following the completion of the previous one

    • The Iterative Incremental Development model

      • cycles of analysis  design  coding, with incremental refinement

    It is the set of actions, tasks and procedures involved in producing a software system, through its life-cycle


    Software process standards

    Capability Maturity Model

    Software Engineering Institute

    SPICE, ISO 15504

    the path to an international standard

    PSS-05, ECSS

    ESA

    Development or Engineering processes: system and software requirements analysis, software design, software construction, software integration and unit testing, software maintenance

    Documentation

    Configuration and Change Management

    Problem Resolution

    Quality Assurance and Measurement

    System Testing, Acceptance and Releasing

    Verification and Validation

    Reviews, Audits and Joint Reviews

    Project tasks Management

    Improvement Process

    Process Establishment

    Human resource Management

    Infrastructure

    User Support, Distribution

    Software process standards

    Process categories

    Primary life-cycle of software development

    Supporting life-cycle

    Management process

    Organizational life-cycle

    User-supplier processes

    etc.


    Why software engineering in hep
    Why software engineering in HEP?

    • Software engineering is somewhat new to the HEP environment

      • other engineering branches more consolidated in this environment (mechanics, electronics, accelerators etc.)

    • Benefits derive from a rigorous approach to software

      • the lesson can be learned from the world of software professionals!

      • even the most talented professionals need an organized environment to do cooperative work

      • advanced technology cannot be fully effective without an organizational framework

    Software Engineering plays a fundamental role in Geant4

    Software process

    SPI

    User requirements

    OOAD

    Quality Assurance


    The software process in geant4

    OOAD

    testing

    implementation

    The software process in Geant4

    • a large international collaboration

    • complex software

    • mature categories in production and maintenance mode as well as categories in full development

    • sensitive and mission-critical user applications

    • product with a long life-time

    • Spiral-type life-cycle model adopted in most domains

      • both iterative and incremental

    A challenge:

    • Software Process Improvement

      • understand, determine and propose procedures to software development and maintenance

      • gradual process, life-cycle driven

      • regular assessment, according to the ISO 15504 model


    Requirements
    Requirements

    Requirements are the quantifiable and verifiable

    • behavioursthat a system must possess

    • constraintsthat a system must work within

      User requirements

    • this phase defines the scope of the system

      Software requirements

    • this is the analysis phase of a software project

    • builds a model describing what the software has to do (not how to do it)

  • Requirements are subject to evolution in the lifetime of a software project!

    • ability to cope with the evolution of the requirements


  • Geant4 requirements
    Geant4 requirements

    • Geant4 has adopted a rigorous approach to requirements

      • user requirements collected from the user communities in the initial phase

      • coded according the PSS-05 software engineering standard

      • continuously updated

    • Geant4 User Requirements Document


    Object oriented technology
    Object Oriented technology

    • OO technology is built upon a sound engineering foundation, whose elements are called the object model

    • The object model encompasses the principles of

      • abstraction

      • encapsulation

      • modularity

      • hierarchy

      • typing

      • concurrency

      • persistence

    • brought together in a synergistic way

      Geant4 is based on Object Oriented technology


    What is an object
    What is an object?

    G. Booch (in OOAD with Applications):

    • “An object has state, behavior and identity; the structure and behavior of similar objects are defined in their common class”.


    Some fundamental concepts in ood 1
    Some fundamental concepts in OOD -1

    • The Open Closed Principle

    • Open for extension, Closed for modification

      • A software module that is designed to be reusable, maintainable and robust must be extensible without requiring modification

      • new features are added by adding new code, rather than by changing old, already working, code

      • The primary mechanisms behind are abstraction and polymorphism

    • The Liskov Substitution Principle

    • Functions that use pointers or references to base classes must be able to use objects of derived classes without knowing it

      • Derived types must be substitutable for their base types

      • It is an important feature for conforming to the OCP


    Some fundamental concepts in ood 2
    Some fundamental concepts in OOD -2

    • The Dependency Inversion Principle

    • Modules that implement high level policy should not depend on the modules that implement low level details

      • Both high level policy and low level details should depend on abstractions

      • This ensures reusability and maintainability

      • The interdependence makes a design rigid, fragile and immobile: a single change triggers a cascade of changes in dependent modules

    • The Interface Segregation Principle

    • Clients should not be forced to depend on interfaces that they do not use

      • Polluted interfaces generate unnecessary couplings

      • We want to separate interfaces whenever possible to avoid the disadvantages of couplings


    Analysis
    Analysis

    Webster definitions:

    • separation or breaking up of a whole into its fundamental elements or component parts

    • a detailed examination of anything complex

    • the practice of proving a mathematical proposition by assuming the result and reasoning back to the data or already established principles

      In the software world:

    • it is the decomposition of a problem into its constituent parts

    • it is accomplished by beginning with a set of stated requirements, and reasoning back from those requirements to a set of established software components and structures

    • OOA is the act of determining the abstractions that underlie the requirements

    • In OOA the components are objects and their collaborations


    Design
    Design

    • Design embodies the set of decisions that determine how the components will look like

    • In OOD typically class inheritance and composition hierarchies are among the decisions

    • OOA and OOD cooperate synergically

      • they are best done concurrently

    • The output of OOAD is a set of class and object diagrams, showing

      • the static structure

      • the collaborations


    Uml unified modeling language
    UML: Unified Modeling Language

    UML is theindustry-standard language for specifying, visualising, constructing and documenting the design of software systems

    • UML represents a unification of the concepts and notations previously in use (Booch, OMT, Jcobson)

    • UML has a standard data representation (the Meta-Model)

      • the Meta-Model is a description of UML in UML

      • it describes the objects, attributes and relationships necessary to represents the concepts of UML within a software application

    • UML notation is comprised of two major subdivisions:

      • a notation for modeling thestatic elementsof a design (classes, attributes, relationships...)

      • a notation for modeling thedynamic elementsof a design (objects, messages, finite state machines...)


    C++

    • OO technology and C++ are not equivalent!

      • OO methodologies can be implemented in a variety of languages, not only in C++

      • One can write procedural code in C++, that is not object oriented

    • C++ provides many features that make it suitable for OO implementations of large scale software projects

    • An overview of C++ language features and OO technology is beyond the scope of these lectures

    • Many textbooks, courses and online material are available as learning aids, eg.

      • I. Pohl, OO programming using C++

      • S. B. Lippman, J. Lajoie, C++ primer

      • B. Stroustrup, The C++ programming language

      • G. Booch, OO analysis and design

      • R. Martin, Designing OO C++ applications using the Booch method


    Oo technology in geant4

    Openness 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

    Transparency

    decoupling from implementation

    OO technology in Geant4

    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

    Booch methodology adopted for OOAD

    • choice resulting from a thorough study of various models

    Flexibility

    • alternative models and implementations

      Interface to external software, without dependencies

    • databases for persistency

    • visualisation libraries

    • tools for UI

    • etc.


    Geant4 architecture
    Geant4 architecture

    exploits advanced Software Engineering techniques and Object Orientedtechnology to achieve transparency of physics implementation.


    Oo design an example of top level design
    OO design: an example of top level design


    Oo design an example of a detailed design
    OO design: an example of a detailed design

    Class diagram of Low Energy e.m. processes: hadrons


    Quality assurance

    Commercial tools

    Insure++, CodeWizard, Workshop etc.

    C++ coding guidelines

    scripts to verify their applications automatically

    Code inspections

    within working groups and across groups

    Walk-throughs with specialized tools for monitoring against violations of coding rules

    Checks on run-time memory management

    Checks forviolations of the dependency structure of categories

    Performance benchmarks and monitoring

    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

    Quality Assurance

    Extensive use of QA systems in Geant4

    fundamental for a toolkit of wide public use


    Standards

    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

    Standards

    Geant4 adopts standards, ISO and de facto

    • OpenGL e VRML for graphics

    • CVSfor code management

    • C++as programminglanguage

    • STEP

      engineering and CAD systems

    • ODMG

      RD45

    Have you heard of the “incident” with NASA’s Mars Climate Orbiter ($125 million)?


    Data libraries
    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


    Physics
    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.”


    The approach to physics
    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


    Features of geant4 physics

    Abstract interface to physics processes

    tracking independent from the type of process

    Distinction between processes and models

    often multiple models for the same process

    The generation of the final state is independent from the access and use of cross sections and from tracking

    Transparent access to

    cross sections (formulae, data sets etc.)

    models underlying physics processes

    An abundant set of electromagnetic and hadronicphysics processes and models, both complementary and alternative

    Use of public evaluated databases

    Features of Geant4 Physics

    • OOD allows to implement or modify any physics process without changing other parts of the software

      open to extension and evolution

    The transparency of the physics implementation contributes to the validation of experimental physics results


    The geant4 kit
    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


    What is needed to run geant4

    Platforms

    DEC, HP, SUN: 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

    What is needed to run Geant4

    Geant4 source code and libraries are freely available at

    http://wwwinfo.cern.ch/asd/geant4/source/source.html


    Documentation

    User Documentation

    Introduction to Geant4

    Installation Guide

    Geant4 User’s Guide - For Application Developers

    for those wishing to use Geant4

    Geant4 User’s 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

    Documentation

    http://wwwinfo.cern.ch/asd/geant4/geant4.html


    User support
    User support

    • The Geant4 User Support covers the

      • provision of help and analysis of code-related problems

      • the consultancy

      • the requests for enhancement or new developments

      • the investigation of anomalous results

    • The User Support is provided by the Geant4 Collaboration

    • Major advantages for the users of this distributed approach are:

      • a large number of people performs the support, and always on the domain of their competence or even on the code they developed themselves;

      • a large number of contact/reference points for the users are available, avoiding the channeling of all problems through the same support people and thus improving efficiency

    • Geant4 User Support is extensively described at

    • http://wwwinfo.cern.ch/asd/geant4/G4UsersDocuments/Welcome/IntroductionToGeant4/html/introductionToGeant4.html#7


    Kernel

    Kernel

    Author: Makoto Asai

    Geant4 Training Kit


    Run

    • As an analogy of the real experiment, a run of Geant4 starts with “Beam On”.

    • Within a run, the user cannot change

      • detector geometry

      • settings of physics processes

        ---> detector is inaccessible during a run

    • Conceptually, a run is a collection of events which share the same detector conditions.


    Event
    Event

    • At beginning of processing, an event contains primary particles. These primaries are pushed into a stack.

    • When the stack becomes empty, processing of an event is over.

    • G4Event class represents an event. It has following objects at the end of its processing.

      • List of primary vertexes and particles

      • Trajectory collection (optional)

      • Hits collections

      • Digits collections (optional)


    Track
    Track

    • Track is a snapshot of a particle

    • Step is a “delta” information to a track

    • A track is made out of three layers of class objects.

      • G4Track

        • Position, volume, track length, global ToF

        • ID of itself and mother track

      • G4DynamicParticle

        • Momentum, energy, local time, polarization

        • Pre-fixed decay channel

      • G4ParticleDefinition

        • Shared by all G4DynamicParticle of same type

        • Mass, lifetime, charge, other physical quantities

        • Decay table


    Step

    • Step has two points and also “delta” information of a particle (energy loss on the step, time-of-flight spent by the step, etc.).

    End of step point

    Step

    Begin of step point

    Boundary

    Trajectory

    • Trajectory is a record of a track history. It stores some information of all steps done by the track as objects of G4TrajectoryPoint class.


    How geant4 runs
    How Geant4 runs

    • Initialization

      • Construction of material and geometry

      • Construction of particles, physics processes and calculation of cross-section tables

    • “Beam-On” = “Run”

      • Close geometry --> Optimize geometry

      • Event Loop

        ---> More than one runs with different

        geometrical configurations



    Beam on
    Beam on

    loop



    Detector description

    Detector Description

    Authors: John Apostolakis and Gabriele Cosmo

    Geant4 Training Kit


    Concepts for detector description
    Concepts for Detector Description

    The following concepts will be described:

    • Material

    • Detector Geometry

    • Sensitive Volumes

    • Hits


    Definition of materials
    Definition of Materials

    • Different kinds of materials can be defined:

      • isotopes <> G4Isotope

      • elements <> G4Element

      • molecules <> G4Material

      • compounds and mixtures <> G4Material

    • Attributes associated:

      • temperature, pressure, state, density


    Creating a detector volume

    Start with its Shape & Size

    Box 3x5x7 cm, sphere R=8m

    Add properties:

    material, B/E field,

    make it sensitive

    Place it in another volume

    in one place

    repeatedly using a function

    Creating a Detector Volume

    Solid

    Logical Volume

    Physical volume


    Define detector geometry
    Define detector geometry

    • Three conceptual layers

      • G4VSolid -- shape, size

      • G4LogicalVolume -- daughter phys. volumes,

        material, sensitivity, user limits, etc.

      • G4VPhysicalVolume -- position, rotation


    Detector geometry solids
    Detector geometry: Solids

    • Many Solids exist in G4 (G4VSolid)

      • CSG solids

        • G4Box, G4Tubs, G4Cons, G4Trd, etc.

        • Analogous to simple GEANT3 solids

      • BREP solids

        • G4BREPSolidPolycone, G4BSplineSurface, etc.

      • Boolean solids

        • G4UnionSolid, G4SubtractionSolid, etc.

      • STEP interface

        • to import BREP solid models from CAD systems


    Solids
    Solids

    STEP compliant solid modeller

    • Constructed Solids (CSGs)

      • Boxes, Cylinders, Spherical shells

    • Boundary Represented(BREPs)

      • any order surface, NURBS

        Could be:

    • User defined: 7 functions

      • inside, distance in/out (x2), extent


    What is a brep
    What is a BREP?

    • BREP=Boundary Represented Solid

    • Listing all its surfaces specifies a solid

      • e.g. 6 squares for a cube

    • Surfaces can be

      • planar, 2nd or higher order

      • Splines, B-Splines, NURBS

        • NURBS=Non-Uniform B-Splines


    How we use cad geometries
    How we use CAD geometries

    • Our BREP library contains all code

      • needed for ISO STEP AP203

    • We import the solid descriptions of detector models from CAD systems

      • for example from Euclid & Pro/Engineer

        • using STEP AP203 files

    • So we support tracking in boundary represented solids created in CAD


    Physical volumes
    Physical Volumes

    • Placement: it is one positioned volume

    • Repeated: a volume placed many times

      • can represent any number of volumes

      • reduces use of memory.

      • Replica: simple repetition, like G3 divisions

      • Parameterised

    • A mother volume can contain either

      • many placement volumes OR

      • one repeated volume

    placement

    repeated


    Magnetic field
    Magnetic field

    • In order to propagate a particle inside a field (e.g. magnetic, electric or both), we integrate the equation of motion of the particle in the field.

    • In general this is best done using a Runge-Kutta method for the integration of ordinary differential equations. Several Runge-Kutta methods are available.

    • In specific cases other solvers can also be used:

      • In a uniform field, as the analytical solution is known.

      • In a nearly uniform field, where we perturb it.


    Things one can do with geant4 geometry
    Things 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


    A selection of geometry applications

    Chandra

    A selection of geometry applications

    BaBar at SLAC

    XMM-Newton (ESA)

    GLAST

    ATLAS at LHC, CERN

    CMSat LHC, CERN

    Borexino at Gran Sasso Lab.


    Magnetic field1
    Magnetic field

    • Once a method is chosen that allows G4 to calculate the track's motion in a field, we break up this curved path into linear chord segments.

    • We determine the chord segments so that they closely approximate the curved path.

    • We use the chords to interrogate the Navigator, to see whether the track has crossed a volume boundary.


    Magnetic field2
    Magnetic field

    • You can set the accuracy of the volume intersection,

      • by setting a parameter called the “miss distance”

        • it is a measure of the error in whether the approximate track intersects a volume.

        • Default “miss distance” is 3 mm.

    • One step can consist of more than one chords.

      • In some cases, one step consists of several turns.

    miss distance

    Step

    Chords

    real trajectory


    Readout geometry
    Readout geometry

    • Readout geometry is a virtual and artificial geometry which can be defined in parallel to the real detector geometry.

    • A readout geometry is optional.

    • Each one is associated to a sensitive detector.


    Sensitive detector and hit
    Sensitive detector and Hit

    • Hit is a snapshot of the physical interaction of a track or an accumulation of interactions of tracks in the sensitive region of your 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.

    • Hit objects are collected in a G4Event object at the end of an event.


    You can store various types information by implementing your own concrete Hit class.

    For example:

    Position and time of the step

    Momentum and energy of the track

    Energy deposition of the step

    Geometrical information

    or any combination of above

    Digit represents a detector output (e.g. ADC/TDC count, trigger signal).

    Digit is created with one or more hits and/or other digits by a concrete implementation derived from G4VDigitizerModule.

    Hits

    Digitisation


    Electromagnetic physics

    Electromagnetic Physics own concrete Hit class.

    Authors: M. Maire, P. Nieminen, M.G. Pia, L. Urban

    Geant4 Training Kit


    Processes
    Processes own concrete Hit class.

    • 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


    Electromagnetic physics1

    It handles own concrete Hit class.

    electrons and positrons

    g, X-ray and optical photons

    muons

    charged hadrons

    ions

    Comparable to Geant3 already in the 1st a release (1997)

    High energy extensions

    fundamental for LHC experiments, cosmic ray experiments etc.

    Low energy extensions

    fundamental for space and medical applications, neutrino experiments, antimatter spectroscopy etc.

    Alternative models for the same physics process

    Electromagnetic physics

    multiple scattering

    Cherenkov

    transition radiation

    ionisation

    Bremsstrahlung

    annihilation

    photoelectric effect

    Compton scattering

    Rayleigh effect

    g conversion

    e+e- pair production

    refraction

    reflection

    absorption

    scintillation

    synchrotron radiation

    fluorescence

    Augereffect(in progress)

    energy loss


    Oo design
    OO design own concrete Hit class.

    Top level class diagram of electromagnetic physics

    Alternative models, obeying the same abstract interface, are provided for the same physics interaction


    Production thresholds
    Production thresholds own concrete Hit class.

    • No tracking cuts, only production thresholds

      • thresholds for producing secondaries are expressed in range, universal for all media

      • converted into energy for each particle and material

    • It makes better sense to use the range cut-off

      • Range of 10 keV gamma in Si ~ a few cm

      • Range of 10 keV electron in Si ~ a few micron


    Effect of production thresholds

    Liquid own concrete Hit class.

    Ar

    Liquid

    Ar

    Pb

    Pb

    Effect of production thresholds

    DCUTE= 455 keV

    In Geant3

    500 MeV incident proton

    one must set the cut for delta-rays (DCUTE) either to the Liquid Argon value, thus producing many small unnecessary d-rays in Pb,

    Threshold in range: 1.5 mm

    or to the Pb value, thus killing the d-rays production everywhere

    455 keV electron energy in liquid Ar

    2 MeV electron energy in Pb

    DCUTE= 2 MeV


    Standard electromagnetic processes
    Standard electromagnetic processes own concrete Hit class.

    Shower profile, 1 GeV e- in water

    • Photons

      • Compton scattering

      • g conversion

      • photoelectric effect

    • Electrons and positrons

      • Bremsstrahlung

      • ionisation

        • continuous energy loss from Bremsstrahlung and ionisation

      • d ray production

      • positron annihilation

      • synchrotron radiation

    • Charged hadrons

    J&H Crannel - Phys. Rev. 184-2 August69


    Features of standard e m processes
    Features of Standard e.m. processes own concrete Hit class.

    Multiple scattering

    6.56 MeV proton , 92.6 mm Si

    • Multiple scattering

      • new model

      • computes mean free path length and lateral displacement

    • Ionisation features

      • optimise the generation of d rays near boundaries

    • Variety of models for ionisation and energy loss

      • including the PhotoAbsorption Interaction model

    • Differential and Integral approach

      • for ionisation, Bremsstrahlung, positron annihilation, energy loss and multiple scattering

    J.Vincour and P.Bem Nucl.Instr.Meth. 148. (1978) 399


    Photo absorption ionisation model

    Ionisation energy loss produced by charged particles in thin layers of absorbers

    Photo Absorption Ionisation Model

    Ionisation energy loss distribution produced by pions, PAI model

    3 GeV/c p in 1.5 cm Ar+CH4

    5 GeV/c p in 20.5 mm Si


    Low energy e m extensions
    Low energy e.m. extensions layers of absorbers

    Fundamental for space and medical applications, neutrino experiments, antimatter spectroscopy etc.

    Low energy hadrons and ions models based on Ziegler and ICRU data and parameterisations

    e,down to 250 eV

    Geant3 down to 10 keV

    (positrons in progress)

    Barkas effect:

    models for antiprotons

    Photon transmissionon 1 mm Al


    Low energy extensions e g

    Based on EPDL97, EEDL and EADL evaluated data libraries layers of absorbers

    cross sections

    sampling of the final state

    Photoelectric effect

    Compton scattering

    Rayleigh scattering

    Bremsstrahlung

    Ionisation

    Fluorescence

    Geant3.21

    Geant4

    C, N, O line emissions included

    Low energy extensions: e-,g

    250 eV up to 100 GeV

    10 keV limit

    250 eV limit


    Example of application of geant4 low energy e m processes
    Example of application of Geant4 Low Energy e.m. processes layers of absorbers

    water

    Fe

    Photon attenuation coefficient

    Comparison of Geant4 electromagnetic processes with NIST data


    Low energy extensions hadrons and ions
    Low energy extensions: hadrons and ions layers of absorbers

    Various models, depending on the energy range and the charge

    • E > 2 MeV Bethe-Bloch

    • 1 keV < E < 2 MeV  parameterisations

      • Ziegler 1977, 1985

      • ICRU 1993

      • corrections due to chemical formulae of materials

      • nuclear stopping power

    • E < 1 keV  free electron gas model

    • Barkas effect taken into account

      • quantum harmonic oscillator model


    Muon processes
    Muon processes layers of absorbers

    Validity range: 1 keV up to 1000 PeV scale

    • High energy extensions based on theoretical models

    • Bremsstrahlung

    • Ionisation and d ray production

    • e+e- Pair production

    • simulation of ultra-high energy and cosmic ray physics


    Processes for optical photons
    Processes for optical photons layers of absorbers

    • Optical photon its wavelength is much greater than the typical atomic spacing

    • Production of optical photons in HEP detectors is mainly due to Cherenkov effect and scintillation

    • Optical properties, e.g. dielectric coefficient, surface smoothness, can be set to a G4LogicalVolume

    • Processes in Geant4

      • in-flight absorption

      • Rayleigh scattering

      • reflection and refraction on medium boundaries

    Track of a photon entering a light concentrator CTF-Borexino


    Examples of application of geant4 e m physics
    Examples of application of Geant4 e.m. physics layers of absorbers

    The plot is the visible energy in silicon as a function

    of the energy of the incident electron

    The experimental results are from:

    Sicapo Collaboration, NIM A332 (85-90) 1993

    Sampling calorimeter


    Hadronic physics

    Hadronic Physics layers of absorbers

    Authors: M.G. Pia


    Hadronic physics1
    Hadronic physics layers of absorbers

    • 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

    • 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

    The user has control on the physics used in the simulation, which contributes to the validation of physics results


    Hadronic physics parameterised and data driven models 1

    Based on experimental data layers of absorbers

    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

    Hadronic physicsParameterised and data-driven models (1)

    p elastic scattering on Hydrogen


    Hadronic physics parameterised and data driven models 2

    Other models are completely new, such as layers of absorbers

    stopping particles (- , K- )

    neutron transport

    isotope production

    Stopping p

    absorption

    Neutrons

    Courtesy of CMS

    nuclear deexcitation

    MeV

    Energy

    Hadronic physicsParameterised and data-driven models (2)

    • Allexisting databases worldwide used in neutron transport

    • Brond, CENDL, EFF, ENDFB, JEF, JENDL, MENDL etc.


    Hadronic physics theoretical models
    Hadronic physics layers of absorbersTheoretical 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



    An example of user application

    1 layers of absorbers

    2

    3

    4

    5

    6

    7

    8

    9

    10

    11

    12

    13

    14

    15

    16

    17

    18

    19

    20

    21

    22

    23

    24

    25

    26

    27

    152 cm Copper + 189 mm Plastic

    An example of user application

    CMS HCAL Test-Beam Setup

    Courtesy of CMS Collaboration


    Event biasing
    Event biasing layers of absorbers

    • 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


    Fast simulation

    Fast Simulation layers of absorbers

    Author: Marc Verderi

    A shortcut to the tracking

    Geant4 Training Kit


    Fast simulation1
    Fast simulation layers of absorbers

    • Geant4 allows to perform full simulation and fast simulationin the same environment

    • Geant4parameterisationproduces 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


    Generalities
    Generalities layers of absorbers

    • Fast Simulation, also called parameterisation, is a shortcut to the tracking.

    • Fast Simulation allows you to take over the tracking to implement your own fast physics and detector response.

    • The classical use case of fast simulation is the shower parameterisation where the typical several thousand steps per GeV computed by the tracking are replaced by a few ten of deposits per GeV.

    • Parameterisations are generally experiment dependent.


    Parameterisation features

    Parameterisations take place in an envelope. This is typically the mother volume of a sub-system or of a large module of such a sub-system.

    Parameterisations are often particle type dependent and/or may apply only to some.

    They are often not applied in complicated regions.

    Parameterisation features


    Summary picture of fast simulation mechanism

    The Fast Simulation components are indicated in blue. typically the mother volume of a sub-system or of a large module of such a sub-system.

    When the G4Track travels inside the volume of the envelope, the G4FSMP looks for a G4FastSimulationManager.

    If one exists, at the beginnig of each step in the envelope, the models are messaged to check for a trigger.

    In case a trigger is issued, the model is applied at the point the G4track is.

    Otherwise, the tracking proceeds with a normal step.

    Summary Picture of Fast Simulation Mechanism

    « envelope »

    (G4LogicalVolume)

    G4FastSimulationManager

    ModelForElectrons

    Placements

    ModelForPions

    G4Track

    G4ProcessManager

    Process xxx

    Multiple Scattering

    G4FastSimulationManagerProcess

    G4Transportation


    Example of integrated fast full simulation application
    Example of integrated Fast/Full Simulation application typically the mother volume of a sub-system or of a large module of such a sub-system.

    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


    Visualisation and g ui

    Visualisation and (G)UI typically the mother volume of a sub-system or of a large module of such a sub-system.

    Authors: Hajime Yoshida and Satoshi Tanaka

    Geant4 Training Kit


    Introduction1
    Introduction typically the mother volume of a sub-system or of a large module of such a sub-system.

    • Geant4 Visualisation must respond to varieties of user requirements. For example,

      • Quick response to survey successive events

      • Impressive special effects for demonstration

      • High-quality output to prepare journal papers

      • Flexible camera control for debugging geometry

      • Highlighting overlapping of physical volumes

      • Interactive picking of visualised objects

      • Etc.


    Visualisable objects 1
    Visualisable Objects (1) typically the mother volume of a sub-system or of a large module of such a sub-system.

    • You can visualise simulation data such as:

      • Detector components

      • A hierarchical structure of physical volumes

      • A piece of physical volume, logical volume, and solid

      • Particle trajectories and tracking steps

      • Hits of particles in detector components

    • Visualisation is performed either with commands or by writing C++ source codes of user-action classes


    Visualisable objects 2
    Visualisable Objects (2) typically the mother volume of a sub-system or of a large module of such a sub-system.

    You can also visualise other user defined objects such as:

    • A polyline, that is, a set of successive line segments for, e.g., coordinate axes

    • A marker which marks an arbitrary 3D position,for, e.g., eye guides

    • Texts, i.e., character strings for description, comments, or titles


    Visualisation drivers
    Visualisation Drivers typically the mother volume of a sub-system or of a large module of such a sub-system.

    • Visualisation drivers are interfaces to 3D graphics software

    • You can select yourfavourite one(s) depending on your purposes such as

      • Demo

      • Preparing precise figures for journal papers

      • Publication of results on Web

      • Debugging geometry

      • Etc


    Available graphics software
    Available Graphics Software typically the mother volume of a sub-system or of a large module of such a sub-system.

    • By default, Geant4 provides visualisation drivers, i.e. interfaces, for

      • DAWN : Technical High-quality PostScript output

      • OPACS: Interactivity, unified GUI

      • OpenGL: Quick and flexible visualisation

      • OpenInventor: Interactivity, virtual reality, etc.

      • RayTracer : Photo-realistic rendering

      • VRML: Interactivity, 3D graphics on Web


    Sample visualisation 1
    Sample Visualisation (1) typically the mother volume of a sub-system or of a large module of such a sub-system.


    Sample visualisation 2
    Sample Visualisation (2) typically the mother volume of a sub-system or of a large module of such a sub-system.


    Sample visualisation 3
    Sample Visualisation (3) typically the mother volume of a sub-system or of a large module of such a sub-system.


    Select g ui
    Select (G)UI typically the mother volume of a sub-system or of a large module of such a sub-system.

    Geant4 provides the following interfaces for various (G)UI:

    • G4UIterminal: C-shell like character terminal

    • G4UItcsh: tcsh-like character terminal with command completion, history, etc.

    • G4UIGAG: Java based GUI

    • G4UIOPACS: OPACS-based GUI, command completion, etc.

    • G4UIBatch: Batch job with macro file

    • G4UIXm: Motif-based GUI, command completion, etc.


    Useful gui tools released by geant4 developers
    Useful GUI Tools Released by Geant4 Developers typically the mother volume of a sub-system or of a large module of such a sub-system.

    • GGE: Geometry editor based on Java GUI

      • http://erpc1.naruto-u.ac.jp/~geant4

    • GPE: Physics editor based on Java GUI

      • http://erpc1.naruto-u.ac.jp/~geant4

    • OpenScientist, OPACS: Flexible analysis environments

      • http://www.lal.in2p3.fr/OpenScientist

      • http://www.lal.in2p3.fr/OPACS


    Persistency

    Persistency typically the mother volume of a sub-system or of a large module of such a sub-system.

    Author: Youhei Morita

    Geant4 Training Kit


    Category requirements
    Category Requirements typically the mother volume of a sub-system or of a large module of such a sub-system.

    • Geant4 Persistency makes run, event, hits, digits and geometry information be persistent, to be read back later by user programs

    • Geant4 shall make use of industrial standard ODMG C++ binding and HepODBMS as persistency interface

    • Kernel part of Geant4 should not be affected by the choice of persistency mechanism (Geant4 should be able to run with or without persistency mechanism)


    What is object persistency
    What is “object persistency” ? typically the mother volume of a sub-system or of a large module of such a sub-system.

    • Persistent object lives beyond an application process, may be accessed by other processes.

    • When an object is “deactivated”, state of the object are stored into the database system. Once “activated”, the state information of the object is read back from the database.


    What is odmg
    What is ODMG ? typically the mother volume of a sub-system or of a large module of such a sub-system.

    • Object Database Management Group

      a non-profit consortium of vendors and interested parties who collaborate to develop and promote standards for object database management systems (ODBMS). http://www.odmg.org/

    • ODBMS Standard Documents ODMG 2.0 released in 1997

      • Object Model

      • Object Definition Language

      • Object Query Language

      • Language Bindings to C++, SmallTalk, Java


    C binding of odmg
    C++ Binding of ODMG typically the mother volume of a sub-system or of a large module of such a sub-system.

    • Design persistent class using ODL (Object Definition Language)

      class G4PEvent : public HepPersObj

      { 

      public: persistent-capable base class

      G4PEvent();

      :

      private:

      G4Pint eventID;  persistent-capable type

      :

      }

    • Compile ODL files (schema) to schema metadata, C++ header files, wrapper C++ source code.

      ex. Objectivity/DB:ooddlx preprocessor processes *.ddl files into *.hh, *_ref.hh, *_ddl.cc files, and stores schema metadata into a federated database file.


    What is hepodbms
    What is HepODBMS ? typically the mother volume of a sub-system or of a large module of such a sub-system.

    • C++ class library that provides a simplified and consistent interface to underlying ODMG-compliant Object Database Management System

    • Current implementation is based on Objectivity/DB

    • Goals:

      • an insulation layer to minimize dependencies on a given database vendor or release.

      • high level base classes that encapsulate features such as clustering and locking strategies, database session

      • transaction control, event collections, selection predicates, tagDB access and calibration

      • whilst not introducing any significant performance or storage overhead

    • See Also:

      http://wwwinfo.cern.ch/asd/lhc++/HepODBMS/user-guide/H1Introduction.html


    Persistency in geant4

    Retrieve( ) typically the mother volume of a sub-system or of a large module of such a sub-system.

    Inherits from HepPersObj

    in HepODBMS

    Store( )

    Persistency in Geant4

    G4 kernel objects have corresponding “P” objects in G4Persistency

    G4Run G4PRun

    G4Event G4PEvent

    G4Hit G4PHit

    ::

    • “Parallel World” approachData members of transient and persistent objects are copied by Store( ) and Retrieve( )


    Persistency in geant4 2

    G4PersistencyMessenger typically the mother volume of a sub-system or of a large module of such a sub-system.

    G4UImessenger

    G4PersistencyManager

    G4VPersistencyManager

    G4TransactionManager

    HepDbApplication

    G4PersistentSubDbMan

    G4PersistentSubMan

    G4PersistentEventMan

    G4RunManager

    Persistency in Geant4 (2)

    Transient G4 objects are “stored” by G4RunManager through abstract interface of G4VPersistencyManager.

    Database file names are given via G4PerrsistencyMessenger.

    Interface to HepODBMS transactions are “wrapped” at G4TransactionManager.

    Data member copy of transient and persistent objects are handled by G4PersistentEventMan, G4PersistentHitMan, etc.

    • Top Level Class Diagram


    Example database configuration

    exampleSchema typically the mother volume of a sub-system or of a large module of such a sub-system.

    Boot

    file

    FDDB

    System

    exampleFD

    Boot

    file

    FDDB

    System

    Runs

    Events

    Geometry

    Example Database Configuration

    $OO_FD_BOOT

    “gmake newfd”

    Lock Server

    oocheckls

    oolockserver

    ookillls

    oodump

    PersistentEx01/02

    readDB

    hits2digits


    Overview of applications

    Overview of applications typically the mother volume of a sub-system or of a large module of such a sub-system.

    Authors: M.G. Pia


    Example of application babar
    Example of application: BaBar typically the mother volume of a sub-system or of a large module of such a sub-system.

    Courtesy of D. Wright, Geant4 Workshop 2000


    An example of application atlas cms
    An example of application: Atlas, CMS typically the mother volume of a sub-system or of a large module of such a sub-system.

    A CMS test beam set-up


    Studies for a future linear collider
    Studies for a future linear collider typically the mother volume of a sub-system or of a large module of such a sub-system.

    Courtesy of P. Mora de Freitas, Geant4 Workshop 2000


    Anomalous typically the mother volume of a sub-system or of a large module of such a sub-system.

    cosmic rays

    Galactic and extra-galactic

    cosmic rays

    Jovian

    electrons

    Neutrinos

    Solar

    X-rays

    Trapped

    particles

    Induced

    emission

    Solar flare neutrons

    and g-rays

    Solar flare electrons,

    protons, and heavy ions


    Modules for space applications
    Modules for space applications typically the mother volume of a sub-system or of a large module of such a sub-system.

    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


    Low energy e m extensions1

    ESA Space Environment & typically the mother volume of a sub-system or of a large module of such a sub-system.

    Effects Analysis Section

    Low energy e.m. extensions

    Cosmic rays,

    jovian electrons

    X-Ray Surveys ofPlanets, Asteroids and Moons

    Solar X-rays, e, p

    Geant3.21

    ITS3.0, EGS4

    Courtesy SOHO EIT

    Induced X-ray line emission:indicator of target composition(~100 mm surface layer)

    Geant4

    C, N, O line emissions included

    Bepi Colombo


    Space applications

    Chandra typically the mother volume of a sub-system or of a large module of such a sub-system.

    Space applications

    XMM

    GLAST

    X-ray telescopes

    Planetary missions

    g-ray telescopes

    etc.


    Geant4 provides various features relevant for medical applications

    The transparency of physics

    Advanced functionalities

    in geometry, physics, visualisation etc.

    Extensibility to satisfy new user requirements thanks to the OO technology

    Quality Assurance based on sound software engineering

    Use of evaluated data libraries

    Subject to independent validation by a large user community worldwide

    User support organization by a large international Collaboration of experts

    Adopts standardswherever available

    (de jure or de facto)


    Bragg peak magic cube data and geant4
    Bragg peak, Magic cube data and Geant4 applications

    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


    Dosimetric Studies applications

    Pixel Ionisation Chamber

    Relative dose with 6 MeV photon beam

    Deposited energy vs Depth in water

    and experimental data


    Brachytherapy applications

    A medical therapy used for cancer treatments

    Radioactive sources are used to deposit therapeutic doses near tumors while preserving surrounding healthy tissues

    allows a complete flexible description of the real geometry

    Anisotropy

    Radioactive Decay Module is capable of handling the generation of the whole radioactive chain of the 192Ir source

    The dose deposition is not isotropic due to source geometry and auto-absorption, encapsulation and shielding effects


    Ct interface and treatment planning
    CT interface and treatment planning applications

    CT images were used to define the geometry - a thorax slice from a Rando anthropomorphic phantom.

    Courtesy of LIP and IPOFG-CROC (Coimbra delegation of the Portuguese Oncology Institute)

    The beam used was a photon beam at 6 MV, from a Siemens KD2. The radiation field used was a 15x15 cm2.


    An ambitious project

    - applicationssponsored project, in collaboration with

    An ambitious project

    What if the geometry to describe with Geant4 were DNAand the process were mutagenesis?

    • Multi-disciplinary Collaboration of

      • astrophysicists and space scientists

      • particle physicists

      • medical physicists

      • biologists

      • physicians

    Study of radiation damage at the cellular and DNA level in the space radiation environment

    INFN (Genova, Torino, Cosenza)

    ESA

    CERN

    Ist. Naz. per la Ricerca sul Cancro

    Karolinska Institute

    PSI

    Universitàdel Piemonte Orientale

    1st phase: User Requirements

    Other applications (not only in the space domain)


    Performance
    Performance applications

    Various Geant4 - Geant3.21 comparisons

    • realistic detector configurations

    • results and plots in Geant4 Web Gallery, 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 >3using exactly the same cuts

      • a factor >10optimising 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% fasterthan Geant3.21 (single volume, single material)


    Risk factors
    Risk factors applications

    • Performance and adequacy of C++ and OO technologies for HEP simulation were considered risk factors at the beginning of the project

      It has been 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


    Conclusions

    The software challenge applications

    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

    Conclusions

    Geant4 has successfully coped with a variety of challenges

    Geant4 represents a successful experience for the future generation of experiments


    References
    References applications

    • Geant4 web home page

    • http://wwwinfo.cern.ch/asd/geant4/geant4.html

    • Geant4-Italy web home page

    • http://www.ge.infn.it/geant4/

    • Geant4 User Documentation http://wwwinfo.cern.ch/asd/geant4/G4UsersDocuments/Overview/html/index.html

    • Geant4 results and publications http://wwwinfo.cern.ch/asd/geant4/reports/reports.html

    • RD44 web home page

    • http://wwwinfo.cern.ch/asd/geant/geant4.html


    Whom to contact
    Whom to contact applications

    • If you need any further information or user support, please contact your Technical Board representative

    • For Italy: Maria Grazia Pia (INFN Genova), [email protected]

    • Other TSB representatives listed on Geant4 web pages


    Suggested oo c books
    Suggested OO/C++ books applications

    • I. Pohl, OO programming using C++

    • S. B. Lippman, J. Lajoie, C++ primer

    • B. Stroustrup, The C++ programming language

    • S. Meyers, Effective C++

    • S. Meyers, More effective C++

    • M. Cline et al., C++ FAQs

    • G. Booch, OO analysis and design

    • R. Martin, Designing OO C++ applications using the Booch method

    • E. Gamma et al., Design Patterns

    • M. Fowler, UML distilled

    • G. Booch et al., The Unified Modeling Language, User Guide


    Acknowledgements
    Acknowledgements applications

    • Many people have helped me directly or indirectly to make these lectures possible; many thanks to all my colleagues of the Geant4 Collaboration, and in particular to

    • The Geant4 Training Kit authors and Editors,for preparing, editing and assembling the training modules

    • Eamonn Daly, Ramon Nartallo and Petteri Nieminen (ESA), for their material on X-ray telescopes

    • Simone Giani (CERN), for many stimulating discussions on the role of simulation and of Geant4

    • Michel Maire (LAPP), for his historical overview of Geant down to its origins

    • Many Geant4 Users (from all over the world),for providing plots and results from their Geant4-based applications

    • The Organizers of this School,for the invitation to give these lectures

    • The Students of this School, for providing the motivation to stay up late in the night to prepare these lectures...


    ad