The Geant4 Geometry Modeler

Document Sample
The Geant4 Geometry Modeler Powered By Docstoc
					The Geant4 Kernel:
Status and Recent
Developments
 John Apostolakis, Gabriele Cosmo – CERN / PH
             Makoto Asai – SLAC
         On behalf the Geant4 collaboration
                     April 2005
                      Overview
   Structure of Geant4 toolkit
   Highlights
        Events, runs, tracking
        Foundations
        Geometry
        Efficiency improvement
   Summary

The Geant4 Kernel        J.A., M.A., G.C. for the Geant4 Collab., April 2005   2
Toolkit structure
         Geant4 structure
   Geant4 consists of 17 categories.                                              Geant4




       Developed and maintained by Working                   Visuali              Readout                    Inter
                                                               zation                                          faces

        Groups responsible for each category.
                                                                             Run                    Persis
       Interfaces between categories largely                                                        tency


        stable, with some evolution.                               Event
                                                                                              Tracking


   Geant4 Kernel
                                                                 Digits +                    Processes
                                                                    Hits
       Handles run, event, track, step, hit,
        trajectory, etc.                                                           Track



       Provides frameworks of geometrical                        Geometry                    Particle

        representation and physics processes,
        and interfaces to visualization and GUI.                  Graphic
                                                                    _reps
                                                                                              Material

                                                                                                             Intercoms

                                                                                    Global
    The Geant4 Kernel                  J.A., M.A., G.C. for the Geant4 Collab., April 2005                    4
                 Geant4 kernel categories
   Run                                                  Geometry
        Overall management, run control                      Geometrical description
        Event loop, pile-up handling                         Navigation
   Event                                                     Electromagnetic field
        Processing one event                            Parameterization
        Stack mechanism                                      Framework of shower
        Primary event generation, radioactive                 parameterization
         source                                          Material
   Tracking                                                  Material, element, isotope
        Processing one track                            Particles
        Managing one step                                    Particle definition
   Detector readout                                     Graphics_reps
        Hit scoring, tallying                                Visualization attributes
   Track                                                Intercoms
        Track, step                                          UI command definition and
   Process/management                                         interpretation
        Abstract definition of process                  Global
                                                              Basic classes

    The Geant4 Kernel                     J.A., M.A., G.C. for the Geant4 Collab., April 2005   5
Configuration, events
                         Run: configures
   A Run is a series of events/tracks with common:
               Setup (geometry / materials)
               Physics list (processes / production thresholds)
               Primary generator
        Each of these is necessary. Run enables user to define
         them:
               In a general predefined way (via RunManager)
               In a fine grained way, for use in external frameworks (new)
   The run controls
        The ordering of creating, invoking other simulation parts
        The locking of the geometry for active simulation
   Note: One computing process can have many runs

June 18, 1999                             J. Apostolakis for Geant4 collaboration   7
         Event: groups tracks & hits
   An event is the interaction of a set of primaries
   In Geant4 it can collect the resulting information
        In the form of hits, created by sensitive detectors
               User can define own hits
   The event manages handling of tracks
   It maintains stacks for inactive tracks
               Enables user to reorder tracks in simulation at no cost
                     Simulates important first, check triggers and only then do the rest.
               3 default stacks for urgent, suspended and “postponed-to-next-
                event” tracks.
                     User can increase the number of stacks


June 18, 1999                                 J. Apostolakis for Geant4 collaboration        8
    Tracking and physics
   Tracking is general
        same for all particle types
        different list of processes for each particle
               The ordering is important
   It messages the
        sensitive detectors and user actions
   The user chooses the physics of each particle
        Choosing an existing configuration (eg a physics list)
        Modifying one or creating their own
           So anyone can add or replace a physics model
                    simply, without restrictions or problems

June 18, 1999                             J. Apostolakis for Geant4 collaboration   9
                Geant4 kernel: other
   Hits & digitization                    Particles
      Experiment specific hits                 properties from PDG
     Handles event pileup
                                           Intercoms:
      using new readout
                                             communicate
       category
                                                between categories,
                                                from UI to kernel
   Materials
        isotopes, elements,
                                           Geometry
        compounds, ...
                                                hierarchy or flat
                                                performant

June 18, 1999                     J. Apostolakis for Geant4 collaboration   10
‘Foundations’
  1.   Units
  2.   Materials
  3.   Particles
  4.   User Interface
            Units, Material, Particles
Unit System
                                                        Materials
   Internal unit system used in Geant4 is                  Describe element composition, density
    completely hidden                                       Other properties can be associated
        not only from user’s code but also from                 Optical, ionization potential, ..
         Geant4 source code implementation.
                                                        Particles
   All numbers must given with their unit:
                                                            Properties from PDG
     kineticEnergy = 1.24 * MeV;
                                                            Includes resonances & ions
   To get a number, must divided by a proper               Each particle has its physics list
    unit.                                                   For unstable particles, it is
                                                                 Responsible for decay modes
     cout << eDep / MeV <<
        “ [MeV]” ;
   This unit conventions make the source                   Intercoms:
    code more readable                                        communicate
                                                                 between categories,
                                                                 from UI to kernel

The Geant4 Kernel                            J.A., M.A., G.C. for the Geant4 Collab., April 2005      12
             Intercoms: commanding
   This systems enable the user to communicate with a
    running application.
   A built-in run-time command can
        Change an option ( eg type of primary particle )
        Choose a visualisation system
   The user can extend it easily
        GATE provided a system to create a geometry setup
         dynamically at run-time
        ATLAS choose between a number of setup configurations,
         at run-time
The Geant4 Kernel             J.A., M.A., G.C. for the Geant4 Collab., April 2005   13
Geometry
Creating a setup
Facilities & tools

Navigating
           Key geometry capabilities
   Describing a setup as hierarchy or ‘flat’ structure
        Describing setups up to millions of volumes
        Tools for creating & checking complex structures
   Navigating fast in complex geometry model
        Automatic optimization
   Geometry models can be ‘dynamic’
        Changing the setup at run-time
   Parallel geometries
        For hits/readout, biasing/scoring, fast simulation.
   Defining geometrical ‘regions’
        For physics optimization: choice of production threshold, triggering of
         fast simulation.

The Geant4 Kernel                  J.A., M.A., G.C. for the Geant4 Collab., April 2005   15
                          Describing a setup
   Large choice of shape (solid)
        From simple (CSGs) to complex.
   A logical volume contains subvolumes and attributes.
        field, material, visual properties,
   A physical volume represents one or many volume instances
        A single copy (in the case of a placement)
        A replicated volume represents any number of sub-volumes:
              Regular slices of a parent (in a division or replica), or
              Arbitrary sub-volumes with parameterized attributes (in parameterised vol)
                       Solid type, sizes, positioning, material can be varied in a user-defined
                        parameterisation.
   Complex structures with millions of volumes possible
        Using hierarchy and logical/physical volumes
        Using replica/divisions and parameterisations.

The Geant4 Kernel                             J.A., M.A., G.C. for the Geant4 Collab., April 2005   16
                                  Solids
• CSG (Constructed Solid Geometry)
    • Simple basic shapes: box, cone, cylinder…
    • Analogous to simple GEANT3 solids
• Specific solids
    • G4Polycone, G4Polyhedra, G4Hype, …
    • G4TwistedTubs, G4TwistedBox, G4TwistedTrap

• Boolean solids
    – Composed from unions, subtractions, intersections
• BREP solids
    • Listing all its surfaces specifies a solid
         • e.g. 6 squares for a cube
    • Surfaces can be
         • planar, 2nd or higher order: elementary BREPS
    • Few BREPS pre-defined
         • Box, cons, tubs, sphere, torus, polycone, polyhedra
• Latest feature - Ability to compute the volume of any solid / shape
    The Geant4 Kernel                           J.A., M.A., G.C. for the Geant4 Collab., April 2005   17
Scintillation in Borexino


                                   3-D view from a CT image




    The Geant4 Kernel       J.A., M.A., G.C. for the Geant4 Collab., April 2005
                              Mercury Magnetospheric Orbiter                      18
                            Facilities for
                          describing setups
                                                       An assembly can represent a
   Reflect part of a structure                         regular pattern of positioned
        A hierarchy can be reflected                   volumes
              Example pictured above                       structures which are hard to
   Characterize parts with common                           describe with simple replicas or
    attributes (regions)                                     parameterised volumes
        Region & attributes can be                         structures which may consist of
         propagated to sub-volumes                           different shapes
   Calculate                                                                    An Assembly with
                                                                                 its four imprints.
        the volume of a solid
        the mass of a portion of a setup.
   Debug the geometry setup
        see next slide
The Geant4 Kernel                       J.A., M.A., G.C. for the Geant4 Collab., April 2005   19
      Tools for debugging
          geometries
    Geant4 normally does not check for malformed
    geometries at tracking time
    An overlapping volume is a volume which
     protrudes from its mother volume or overlaps a
     sibling volume.
    Utilities for detecting wrong positioning
       Graphical external tools (DAVID, OLAP)
       Kernel run-time commands
              Using different techniques and tunable according
               to geometry setup complexity
    New ability to do some checks during
     tracking
      The Geant4 Kernel                 J.A., M.A., G.C. for the Geant4 Collab., April 2005   20
                                                             Space Environments
                                                             and Effects Section




                                                                                        Courtesy T. Ersmark, KTH Stockholm
The Geant4 Kernel   J.A., M.A., G.C. for the Geant4 Collab., April 2005            21
    Creating and Importing/exporting
            geometry setups
   A setup can be described either in C++ code or
        using a simple tool, the Geant4 Geometry Editor
        Imported (or exported) from external XML format (eg GDML)
        through other tools, eg interactively in GATE.
   GDML provides XML formatted files                                                      R. Chytracek
        For storage and input of geometry
        For interchange of setups between applications                                    W. Pokorski
   First implementation of GDML writer
        Included as of GDML 2.0.0. See http://cern.ch/gdml
        Capable of streaming out simple placement-based geometries to file
   Extension to GDML now provided
        Schema supporting replicas and parameterized volumes
              Generates persistent map of transformations
        Additional solids supported
        Further extension, refinements planned.

The Geant4 Kernel                        J.A., M.A., G.C. for the Geant4 Collab., April 2005       22
          Navigation & optimisation
   Navigation uses ‘smart voxels’ technique optimises
    search for intersections
        Efficiently uses memory at price of limited ‘startup’ cost
              For the most complex setups, can tune these further.
        During tracking, quickly searches hierarchy of virtual
         divisions
   In complex setups, this automatic 3d-voxelisation
    provides speedups
        Improvement of 20-30% compared with well-optimised
         custom geometry setups using Geant 3.21
        Large factors for un-tuned setups.

The Geant4 Kernel                   J.A., M.A., G.C. for the Geant4 Collab., April 2005   23
    Geometry optimization (details)
     ‘Smart voxels’ technique to optimise search for intersections
          At tracking time, searching is done in a hierarchy of virtual divisions
                Divisions sucessively along three cartesian dimensions
                No need to tune description of geometry setup, as in Geant 3.21
          Does not require large memory or computing resources
                Adopted and ‘tuned’ early in the Geant4 project (1995)
                Refinements enable user to reduce initialisation time and/or memory
                 consumed even further for largest cases (D.Williams/S. Giani).
          Can handle well also ‘flat’ geometries
                in some cases 20 times or more faster than GEANT 3.21
     Latest: can use 3D voxelization also for parameterized volumes
          Improves efficiency in setups where a large number of sub-volumes are
           placed in a 2 or 3 dimensional pattern




    The Geant4 Kernel                     J.A., M.A., G.C. for the Geant4 Collab., April 2005   24
An event in the CMS detector.                                  An event in the LHCb detector




A few example setups
from LHC experiments




    The Geant4 Kernel                                              A view 2005          25
                                J.A., M.A., G.C. for the Geant4 Collab., Aprilof the Atlas
                                                                                      detector
                                                                      Vertex Locator in LHCb
Alternative geometries
   Geant4 can handle ‘dynamic’
    geometries which vary in time,
        Switching between multiple geometry
         setups in memory, one per run, and/or
        Modifying just a portion of a single ‘active’
         geometry setup
              Eg rotating one or more elements

   Geant4 also allows a parallel geometry description
        to trigger shower parameterizations
        to steer biasing with volumes ‘carrying’ importance
         values


The Geant4 Kernel                     J.A., M.A., G.C. for the Geant4 Collab., April 2005   26
Detector Regions                          A region represents a set of
                                           geometry volumes, typically of a
                                           sub-system
Default                                         Has a cut in range associated. A
Region          Region B     C                   different range cut for each particle is
                                                 allowed in a region

                                                Special “root-region” associated to the
 Region         Region A   Region                world volume. Default cut assigned to
                                                 the world volume
   B                         B

                                                Propagation of region’s attributes
                                                 triggered at initialization time
 D                               D
     C          Region B     C                  Memory management through
                                                 registration/deregistration mechanism


 The Geant4 Kernel               J.A., M.A., G.C. for the Geant4 Collab., April 2005   27
                     Tracking in field
   Charged particle tracking in external EM
    field
        Uniform or non-uniform fields
        Magnetic, electric or combined fields.
   Adaptable precision requirements
        High precision where it is important
              O(50 um) through 500 volumes (CMS)
        Tested for the high precision requirements
         in tracking ‘trigger’ muons and beams.

The Geant4 Kernel             J.A., M.A., G.C. for the Geant4 Collab., April 2005   28
    Geometrical biasing & scoring
   “Geometrical” biasing implementing importance weight associated to
    logical volumes
        In a real user geometry
        In a parallel dedicated geometry
   Different techniques implemented
        geometry splitting and Russian roulette
        Weight roulette (or weight cutoff)
        Simple weight window.
   Use cases collected from many application fields, ranging from radiation
    shielding to dosimetry and fluencies calculations
   Introduced abilities for parallel transportation and scoring
   An advanced example based on the Tiara experiment illustrates most of
    these features
   Other biasing options implemented as physics processes or options
        Enhanced interaction, leading particle options for particular processes.


The Geant4 Kernel                     J.A., M.A., G.C. for the Geant4 Collab., April 2005   29
                       Summary
   The Geant4 kernel enables the toolkit user
        To track particles with customized physics
         configurations, and deposit hits
        To describe geometrical setups of significant
         complexity and navigate efficiently in these
        To change a geometry at run-time


   For more see http://cern.ch/geant4

The Geant4 Kernel          J.A., M.A., G.C. for the Geant4 Collab., April 2005   30
THE END
       Other slides

Original, older or alternative slides
                    Reflection of volumes
                      and hierarchies
   Reflection of volumes and hierarchies of volumes is possible through the
    class G4ReflectionFactory

        Applies to simple placements, replicas and divided PVs
        Does not currently apply to generic parameterised PVs
        Adopts decomposition of reflection transformation
        Takes into account setting of attributes in the reflected counterpart
             Materials
             Magnetic fields
             Association to regions
             Visualization attributes
             Biasing weights …
        The factory provides also query facilities for retrieving/determining reflected
         volumes

The Geant4 Kernel                        J.A., M.A., G.C. for the Geant4 Collab., April 2005   33
         Other Development highlights

   Detector description
        New ways to create geometries
        Tools to detect incorrect geometry definitions
        A different field for any volume (or volume tree)
              Overriding a global field
   Ability to reduce initialisation time
        By saving/retrieving physics processes’ table
   Variance reduction / event biasing
        Importance: biasing by geometry
        Leading particle biasing
The Geant4 Kernel                    J.A., M.A., G.C. for the Geant4 Collab., April 2005   34
         Improvements in Geometry
   Reflection of volume hierarchies                                                    I Hrivnacova
        Eg to create endcap geometry                                                        G Cosmo
                                                                                           V Grichine
   Improved voxelisation for performant navigation
        3-D for parameterized volumes
              Now equal performance to ‘placed’ volume                                       G Cosmo
        Option to avoid voxelizing some volumes

   ‘Illegal’ geometries detected & rejected                                                  G Cosmo
        E.g. incompatible daughters (placed & parameterized)

   XML binding: GDML 1.0 released                                                         R Chytracek
              Specification & Implementation
                       Refinements currently on ‘hold’.


The Geant4 Kernel                            J.A., M.A., G.C. for the Geant4 Collab., April 2005        35
                          Debugging geometries
    It is easy to create overlapping volumes
                a volume that protrudes from its mother,
                2+ volumes that intersect in common mother
         During tracking Geant4 does not check for
          malformed geometries
    The problem of detecting ‘significant’
     overlaps is now addressed by
         DAVID that intersects volumes directly
               ( Uses graphical representations )
                       Created by S. Tanaka, released ca 1997
         New commands to run verification tests
                       Created by DC Williams; released in 4.0
         New example with full tracking / navigation
                       Created by M Liendl; released in 5.0


    The Geant4 Kernel                                                                     Thanks
                                                J.A., M.A., G.C. for the Geant4 Collab., April 2005   to S. Tanaka
                                                                                                             36
                    CPU Performance
   Our first simple benchmarks:
        Geometry faster, EM shower setups: competitive
   Performance in experimental setups (with Geant4 releases 2 and
    3) was comparable to Geant3
        few counterexamples, including BTeV ECAL.
   New performance issues arose with Geant4 4.0
        and were addressed (in the patches & release 4.1)
   Difficult cases remain, including
        Some setups of EM showers and field propagation, factor ~ 2x
   Collecting a set of benchmarks
        To follow computing performance regularly
   Goal is that Geant4 is at least as fast as Geant3 in almost all
    cases
        When its power is used.
The Geant4 Kernel                  J.A., M.A., G.C. for the Geant4 Collab., April 2005   37
 Geometry Modeler Conclusions
      The Geant4 geometry modeler allows for definition of
       complex geometry setups
           Easy integration of the geometry model in the user application
      Distinction between logical and physical entities
           Memory optimisation and reuse
      Navigation and transport in very complex models
           Precise and efficient with advanced optimisation techniques
      Geometry biasing techniques (real or parallel geometry)
      Special facilities allow for
           Grouping of volumes for regular geometry patterns
           Replica/reflection of composite structures
           Characterisation of areas with common attributes (regions)
           Debugging of the user-defined geometry

The Geant4 Kernel                  J.A., M.A., G.C. for the Geant4 Collab., April 2005   38

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:46
posted:8/8/2012
language:Latin
pages:38