Top Banner
The Geant4 Kernel: The Geant4 Kernel: Status and Recent Status and Recent Developments Developments John Apostolakis, Gabriele Cosmo John Apostolakis, Gabriele Cosmo – CERN / PH – CERN / PH Makoto Asai – SLAC Makoto Asai – SLAC On behalf the Geant4 collaboration On behalf the Geant4 collaboration April 2005 April 2005
38

The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

Mar 28, 2015

Download

Documents

Lisbeth Slay
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

The Geant4 Kernel: The Geant4 Kernel: Status and Recent Status and Recent DevelopmentsDevelopments

John Apostolakis, Gabriele Cosmo – CERN / PHJohn Apostolakis, Gabriele Cosmo – CERN / PHMakoto Asai – SLACMakoto Asai – SLAC

On behalf the Geant4 collaborationOn behalf the Geant4 collaborationApril 2005April 2005

Page 2: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

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

OverviewOverview

Structure of Geant4 toolkitStructure of Geant4 toolkit HighlightsHighlights

Events, runs, trackingEvents, runs, tracking FoundationsFoundations GeometryGeometry Efficiency improvementEfficiency improvement

SummarySummary

Page 3: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

Toolkit structureToolkit structure

Page 4: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

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

Geant4 structureGeant4 structure Geant4 consists of 17 categories.Geant4 consists of 17 categories.

Developed and maintained by Working Developed and maintained by Working

Groups responsible for each category.Groups responsible for each category.

Interfaces between categories largely Interfaces between categories largely

stable, with some evolution.stable, with some evolution.

Geant4 KernelGeant4 Kernel Handles run, event, track, step, hit, Handles run, event, track, step, hit,

trajectory, etc.trajectory, etc.

Provides frameworks of geometrical Provides frameworks of geometrical

representation and physics processes, representation and physics processes,

and interfaces to visualization and GUI. and interfaces to visualization and GUI.

Geant4

ReadoutVisuali zation

Persis tency

Run

Event

Inter faces

Tracking

Digits + Hits

Processes

Track

Geometry Particle

Graphic _reps

Material

Intercoms

Global

Page 5: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

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

Geant4 kernel categoriesGeant4 kernel categories RunRun

Overall management, run controlOverall management, run control Event loop, pile-up handlingEvent loop, pile-up handling

EventEvent Processing one eventProcessing one event Stack mechanism Stack mechanism Primary event generation, radioactive Primary event generation, radioactive

sourcesource TrackingTracking

Processing one trackProcessing one track Managing one stepManaging one step

Detector readoutDetector readout Hit scoring, tallyingHit scoring, tallying

TrackTrack Track, step Track, step

Process/managementProcess/management Abstract definition of processAbstract definition of process

GeometryGeometry Geometrical descriptionGeometrical description NavigationNavigation Electromagnetic fieldElectromagnetic field

ParameterizationParameterization Framework of shower Framework of shower

parameterizationparameterization MaterialMaterial

Material, element, isotopeMaterial, element, isotope ParticlesParticles

Particle definitionParticle definition Graphics_repsGraphics_reps

Visualization attributesVisualization attributes IntercomsIntercoms

UI command definition and UI command definition and interpretationinterpretation

GlobalGlobal Basic classesBasic classes

Page 6: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

Configuration, eventsConfiguration, events

Page 7: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

June 18, 1999June 18, 1999 J. Apostolakis for Geant4 collaborationJ. Apostolakis for Geant4 collaboration 77

Run: configuresRun: configures A Run is a series of events/tracks with common:A Run is a series of events/tracks with common:

Setup (geometry / materials)Setup (geometry / materials) Physics list (processes / production thresholds)Physics list (processes / production thresholds) Primary generatorPrimary generator

Each of these is necessary. Run enables user to define Each of these is necessary. Run enables user to define them:them:

In a general predefined way (via RunManager)In a general predefined way (via RunManager) In a fine grained way, for use in external frameworks (new)In a fine grained way, for use in external frameworks (new)

The run controlsThe run controls The ordering of creating, invoking other simulation partsThe ordering of creating, invoking other simulation parts The locking of the geometry for active simulation The locking of the geometry for active simulation

Note: One computing process can have many runsNote: One computing process can have many runs

Page 8: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

June 18, 1999June 18, 1999 J. Apostolakis for Geant4 collaborationJ. Apostolakis for Geant4 collaboration 88

Event: groups tracks & hitsEvent: groups tracks & hits An event is the An event is the interaction interaction of a set of of a set of primariesprimaries In Geant4 it can collect the resulting informationIn Geant4 it can collect the resulting information

In the form of In the form of hitshits, created by , created by sensitive detectorssensitive detectors User can define own hitsUser can define own hits

The event manages handling of tracksThe event manages handling of tracks It maintains stacks for inactive tracksIt maintains stacks for inactive tracks

Enables user to reorder tracks in simulation at no costEnables user to reorder tracks in simulation at no cost Simulates important first, check triggers and only then do the rest. Simulates important first, check triggers and only then do the rest.

3 default stacks for urgent, suspended and “postponed-to-next-3 default stacks for urgent, suspended and “postponed-to-next-event” tracks.event” tracks.

User can increase the number of stacksUser can increase the number of stacks

Page 9: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

June 18, 1999June 18, 1999 J. Apostolakis for Geant4 collaborationJ. Apostolakis for Geant4 collaboration 99

Tracking and physicsTracking and physics

Tracking is generalTracking is general same for all particle typessame for all particle types different list of processes for each particledifferent list of processes for each particle

The ordering is important The ordering is important It messages theIt messages the

sensitive detectors and user actionssensitive detectors and user actions The user chooses the physics of each particleThe user chooses the physics of each particle

Choosing an existing configuration (eg a physics list)Choosing an existing configuration (eg a physics list) Modifying one or creating their own Modifying one or creating their own

So anyone can add or replace a physics modelSo anyone can add or replace a physics model simply, without restrictions or problemssimply, without restrictions or problems

Page 10: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

June 18, 1999June 18, 1999 J. Apostolakis for Geant4 collaborationJ. Apostolakis for Geant4 collaboration 1010

Geant4 kernel: otherGeant4 kernel: other

Hits & digitizationHits & digitization Experiment specific hitsExperiment specific hits

Handles event pileup Handles event pileup using new readout using new readout

categorycategory

MaterialsMaterials isotopes, elements,isotopes, elements, compounds, ... compounds, ...

ParticlesParticles properties from PDGproperties from PDG

Intercoms: Intercoms: ccommunicateommunicate between categories, between categories, from UI to kernel from UI to kernel

GeometryGeometry hierarchy or flathierarchy or flat performantperformant

Page 11: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

‘‘Foundations’ Foundations’

1.1. UnitsUnits2.2. MaterialsMaterials3.3. ParticlesParticles4.4. User InterfaceUser Interface

Page 12: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

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

Units, Material, ParticlesUnits, Material, Particles

Unit SystemUnit System Internal unit system used in Geant4 is Internal unit system used in Geant4 is

completely hidden completely hidden not only from user’s code but also from not only from user’s code but also from

Geant4 source code implementation.Geant4 source code implementation.

All numbers must given with their unit:All numbers must given with their unit:

kineticEnergy = 1.24 kineticEnergy = 1.24 ** MeVMeV;;

To get a number, must divided by a proper To get a number, must divided by a proper

unit.unit.

cout << eDep cout << eDep / MeV/ MeV << “ << “

[MeV]” ;[MeV]” ;

This unit conventions make the source This unit conventions make the source

code more readablecode more readable

MaterialsMaterials Describe element composition, densityDescribe element composition, density Other properties can be associatedOther properties can be associated

Optical, ionization potential, .. Optical, ionization potential, ..

ParticlesParticles Properties from PDGProperties from PDG Includes resonances & ions Includes resonances & ions Each particle has its physics listEach particle has its physics list For unstable particles, it isFor unstable particles, it is

Responsible for decay modesResponsible for decay modes

IntercomsIntercoms: : ccommunicateommunicate between categories, between categories, from UI to kernel from UI to kernel

Page 13: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

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

Intercoms: commandingIntercoms: commanding

This systems enable the user to communicate with a This systems enable the user to communicate with a running application.running application.

A built-in run-time command canA built-in run-time command can Change an option ( eg type of primary particle )Change an option ( eg type of primary particle ) Choose a visualisation systemChoose a visualisation system

The user can extend it easilyThe user can extend it easily GATE provided a system to create a geometry setup GATE provided a system to create a geometry setup

dynamically at run-timedynamically at run-time ATLAS choose between a number of setup configurations, ATLAS choose between a number of setup configurations,

at run-timeat run-time

Page 14: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

GeometryGeometry

Creating a setupCreating a setupFacilities & toolsFacilities & toolsNavigatingNavigating

Page 15: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

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

Key geometry capabilitiesKey geometry capabilities Describing a setup as hierarchy or ‘flat’ structureDescribing a setup as hierarchy or ‘flat’ structure

Describing setups up to millions of volumesDescribing setups up to millions of volumes Tools for creating & checking complex structuresTools for creating & checking complex structures

Navigating fast in complex geometry modelNavigating fast in complex geometry model Automatic optimizationAutomatic optimization

Geometry models can be ‘dynamic’ Geometry models can be ‘dynamic’ Changing the setup at run-timeChanging the setup at run-time

Parallel geometriesParallel geometries For hits/readout, biasing/scoring, fast simulation. For hits/readout, biasing/scoring, fast simulation.

Defining geometrical ‘regions’Defining geometrical ‘regions’ For physics optimization: choice of production threshold, triggering of For physics optimization: choice of production threshold, triggering of

fast simulation. fast simulation.

Page 16: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

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

Describing a setupDescribing a setup Large choice of shape (Large choice of shape (solidsolid))

From simple (CSGs) to complex.From simple (CSGs) to complex. A A logical volumelogical volume contains subvolumes and attributes. contains subvolumes and attributes.

field, material, visual properties, field, material, visual properties, A A physical volumephysical volume represents one or many volume instances represents one or many volume instances

A single copy (A single copy (in the case of a placementin the case of a placement)) A replicated volume represents any number of sub-volumes:A replicated volume represents any number of sub-volumes:

Regular slices of a parent (Regular slices of a parent (in a division or replicain a division or replica), or ), or Arbitrary sub-volumes with parameterized attributes (Arbitrary sub-volumes with parameterized attributes ( in parameterised volin parameterised vol))

Solid type, sizes, positioning, material can be varied in a user-defined Solid type, sizes, positioning, material can be varied in a user-defined parameterisation.parameterisation.

Complex structures with millions of volumes possibleComplex structures with millions of volumes possible Using hierarchy and logical/physical volumesUsing hierarchy and logical/physical volumes Using replica/divisions and parameterisations.Using replica/divisions and parameterisations.

Page 17: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

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

SolidsSolids

• BREP solidsBREP solids• Listing all its surfaces specifies a solidListing all its surfaces specifies a solid

• e.g. 6 squares for a cubee.g. 6 squares for a cube

• Surfaces can beSurfaces can be• planar, 2planar, 2ndnd or higher order or higher order: elementary BREPS: elementary BREPS

• Few BREPS pre-definedFew BREPS pre-defined• Box, cons, tubs, sphere, torus, polycone, polyhedraBox, cons, tubs, sphere, torus, polycone, polyhedra

• Specific solids• G4Polycone, G4Polyhedra, G4Hype, …• G4TwistedTubs, G4TwistedBox, G4TwistedTrap

• Boolean solids– Composed from unions, subtractions, intersections

• CSG (Constructed Solid Geometry) (Constructed Solid Geometry) • Simple basic shapes: box, cone, cylinder…• Analogous to simple GEANT3 solids

• Latest feature - Ability to compute the volume of any solid / shape

Page 18: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

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

Scintillation in Borexino

3-D view from a CT image

Mercury Magnetospheric OrbiterMercury Magnetospheric Orbiter

Page 19: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

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

Facilities for Facilities for describing setupsdescribing setups

ReflectReflect part of a structure part of a structure A hierarchy can be reflected A hierarchy can be reflected

Example pictured aboveExample pictured above

Characterize parts with common Characterize parts with common attributes (attributes (regionsregions))

Region & attributes can be Region & attributes can be propagated to sub-volumespropagated to sub-volumes

Calculate Calculate the volume of a solid the volume of a solid the the massmass of a portion of a setup. of a portion of a setup.

DebugDebug the geometry setup the geometry setup see next slidesee next slide

An assembly can represent a An assembly can represent a regular patternregular pattern of positioned of positioned volumesvolumes

structures which are hard to structures which are hard to describe with simple replicas or describe with simple replicas or parameterised volumesparameterised volumes

structures which may consist of structures which may consist of different shapesdifferent shapes

An Assembly withits four imprints.

Page 20: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

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

Tools for debugging Tools for debugging geometriesgeometries

An An overlapping volumeoverlapping volume is a volume which is a volume which protrudes from its mother volume or overlaps a protrudes from its mother volume or overlaps a sibling volume.sibling volume.

Utilities for detecting wrong positioningUtilities for detecting wrong positioning Graphical Graphical externalexternal tools tools (DAVID, OLAP)(DAVID, OLAP) KernelKernel run-time commands run-time commands

Using different techniques and tunable according Using different techniques and tunable according to geometry setup complexityto geometry setup complexity

New ability to do some New ability to do some checkschecks during during trackingtracking

Geant4 normally does not check for malformed geometries at tracking time

Page 21: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

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

Cou

rtes

y T

. Ers

mar

k, K

TH

Sto

ckh

olm

Space Environments Space Environments and Effects Sectionand Effects Section

Page 22: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

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

Creating and Importing/exporting Creating and Importing/exporting geometry setupsgeometry setups

A setup can be described either in C++ code orA setup can be described either in C++ code or using a simple tool, the Geant4 Geometry Editorusing a simple tool, the Geant4 Geometry Editor Imported (or exported) from external XML format (eg GDML)Imported (or exported) from external XML format (eg GDML) through other tools, eg interactively in GATE. through other tools, eg interactively in GATE.

GDMLGDML provides XML formatted files provides XML formatted files For storage and input of geometryFor storage and input of geometry For interchange of setups between applicationsFor interchange of setups between applications

First implementation of GDML First implementation of GDML writerwriter Included as of GDML 2.0.0. See Included as of GDML 2.0.0. See http://cern.ch/gdmlhttp://cern.ch/gdml Capable of streaming out simple Capable of streaming out simple placementplacement-based geometries to file-based geometries to file

Extension to GDML now providedExtension to GDML now provided Schema supporting replicas and parameterized volumesSchema supporting replicas and parameterized volumes

Generates persistent map of transformationsGenerates persistent map of transformations Additional solids supportedAdditional solids supported Further extension, refinements planned.Further extension, refinements planned.

R. Chytracek

W. Pokorski

Page 23: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

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

Navigation & optimisationNavigation & optimisation

Navigation usesNavigation uses ‘ ‘smart voxelssmart voxels’ ’ techniquetechnique optimises optimises search for intersectionssearch for intersections Efficiently uses memory at price of limited ‘startup’ costEfficiently uses memory at price of limited ‘startup’ cost

For the most complex setups, can tune these further.For the most complex setups, can tune these further. During tracking, quickly searches hierarchy of virtual During tracking, quickly searches hierarchy of virtual

divisionsdivisions In complex setups, this automatic 3d-voxelisation In complex setups, this automatic 3d-voxelisation

provides speedupsprovides speedups Improvement of 20-30% compared with well-optimised Improvement of 20-30% compared with well-optimised

custom geometry setups using Geant 3.21custom geometry setups using Geant 3.21 Large factors for un-tuned setups.Large factors for un-tuned setups.

Page 24: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

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

Geometry optimization (details)Geometry optimization (details) ‘‘Smart voxelsSmart voxels’ technique ’ technique to optimise search for intersectionsto optimise search for intersections

At tracking time, searching is done in a hierarchy of virtual divisionsAt tracking time, searching is done in a hierarchy of virtual divisions Divisions sucessively along three cartesian dimensions Divisions sucessively along three cartesian dimensions No need to tune description of geometry setup, as in Geant 3.21No need to tune description of geometry setup, as in Geant 3.21

Does not require large memory or computing resourcesDoes not require large memory or computing resources Adopted and ‘tuned’ early in the Geant4 project (1995)Adopted and ‘tuned’ early in the Geant4 project (1995) Refinements enable user to reduce initialisation time and/or memory Refinements enable user to reduce initialisation time and/or memory

consumed even further for largest cases consumed even further for largest cases (D.Williams/S. Giani)(D.Williams/S. Giani).. Can handle well also ‘flat’ geometriesCan handle well also ‘flat’ geometries

in some cases 20 times or more faster than GEANT 3.21in some cases 20 times or more faster than GEANT 3.21 Latest:Latest: can usecan use 3D voxelization 3D voxelization also for also for parameterizedparameterized volumes volumes

Improves efficiency in setups where a large number of sub-volumes are Improves efficiency in setups where a large number of sub-volumes are placed in a 2 or 3 dimensional patternplaced in a 2 or 3 dimensional pattern

Page 25: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

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

Vertex Locator in LHCb

An event in the CMS detector.

A view of the Atlas detector

An event in the LHCb detector

A few example setupsfrom LHC experiments

Page 26: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

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

Alternative geometriesAlternative geometries

Geant4 can handle ‘dynamic’ Geant4 can handle ‘dynamic’ geometries which geometries which varyvary in time, in time, Switching between multiple geometry Switching between multiple geometry

setups in memory, one per run, and/orsetups in memory, one per run, and/or Modifying just a portion of a single ‘active’ Modifying just a portion of a single ‘active’

geometry setupgeometry setup Eg rotating one or more elementsEg rotating one or more elements

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

values

Page 27: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

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

DefaultRegion

Region B

D

C

Region B

Region B

Region A

C

C

RegionB

D

Detector RegionsDetector Regions A A regionregion represents a set of geometry represents a set of geometry volumes, typically of a volumes, typically of a sub-systemsub-system

Has a Has a cut in rangecut in range associated. A different associated. A different range cut for each particle is allowed in a range cut for each particle is allowed in a regionregion

Special “root-region” associated to the Special “root-region” associated to the worldworld volume. Default cut assigned to the volume. Default cut assigned to the world volumeworld volume

PropagationPropagation of region’s attributes triggered of region’s attributes triggered at initialization timeat initialization time

Memory managementMemory management through through registration/deregistration mechanismregistration/deregistration mechanism

Page 28: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

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

Tracking in fieldTracking in field

Charged particle tracking in external EM Charged particle tracking in external EM fieldfield Uniform or non-uniform fieldsUniform or non-uniform fields Magnetic, electric or combined fields.Magnetic, electric or combined fields.

Adaptable precision requirementsAdaptable precision requirements High precision where it is importantHigh precision where it is important

O(50 um) through 500 volumes (CMS)O(50 um) through 500 volumes (CMS) Tested for the high precision requirements Tested for the high precision requirements

in tracking ‘trigger’ muons and beams.in tracking ‘trigger’ muons and beams.

Page 29: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

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

Geometrical biasing & scoringGeometrical biasing & scoring ““Geometrical”Geometrical” biasing implementing importance weight associated to biasing implementing importance weight associated to

logical volumes logical volumes In a real user geometryIn a real user geometry In a In a parallel dedicated geometryparallel dedicated geometry

Different techniques implementedDifferent techniques implemented geometrgeometryy splitting and Russian roulette splitting and Russian roulette Weight roulette (or weight cutoff)Weight roulette (or weight cutoff) Simple weight window.Simple weight window.

Use cases collected from many application fields, ranging from radiation Use cases collected from many application fields, ranging from radiation shielding to dosimetry and fluencies calculationsshielding to dosimetry and fluencies calculations

Introduced abilities for Introduced abilities for parallel transportationparallel transportation and scoring and scoring An An advanced exampleadvanced example based on the based on the TiaraTiara experiment illustrates most of experiment illustrates most of

these featuresthese features Other biasing options implemented as physics processes or optionsOther biasing options implemented as physics processes or options

Enhanced interaction, leading particle options for particular processes.Enhanced interaction, leading particle options for particular processes.

Page 30: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

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

SummarySummary

The Geant4 kernel enables the toolkit userThe Geant4 kernel enables the toolkit user To track particles with customized physics To track particles with customized physics

configurations, and deposit hitsconfigurations, and deposit hits To describe geometrical setups of significant To describe geometrical setups of significant

complexity and navigate efficiently in thesecomplexity and navigate efficiently in these To change a geometry at run-timeTo change a geometry at run-time

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

Page 31: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

THE ENDTHE END

Page 32: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

Other slidesOther slides

Original, older or alternative slidesOriginal, older or alternative slides

Page 33: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

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

Reflection of volumes Reflection of volumes and hierarchiesand hierarchies

Reflection of volumes and hierarchies of volumes is possible through the Reflection of volumes and hierarchies of volumes is possible through the class class G4ReflectionFactoryG4ReflectionFactory

Applies to simple Applies to simple placements, replicas and dividedplacements, replicas and divided PVs PVs Does not currently apply to generic parameterised PVsDoes not currently apply to generic parameterised PVs Adopts decomposition of reflection transformationAdopts decomposition of reflection transformation Takes into account setting of attributes in the reflected counterpartTakes into account setting of attributes in the reflected counterpart

MaterialsMaterials Magnetic fieldsMagnetic fields Association to regionsAssociation to regions Visualization attributesVisualization attributes Biasing weights …Biasing weights …

The factory provides also query facilities for retrieving/determining reflected The factory provides also query facilities for retrieving/determining reflected volumesvolumes

Page 34: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

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

Other Development highlightsOther Development highlights

Detector descriptionDetector description New ways to New ways to createcreate geometries geometries Tools toTools to detect detect incorrect geometry definitions incorrect geometry definitions A different A different fieldfield for any volume (or volume tree) for any volume (or volume tree)

Overriding a global fieldOverriding a global field

Ability to reduce Ability to reduce initialisationinitialisation time time By saving/retrieving physics processes’ tableBy saving/retrieving physics processes’ table

Variance reduction / event biasingVariance reduction / event biasing Importance: Importance: biasing by geometrybiasing by geometry Leading particle biasing Leading particle biasing

Page 35: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

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

Improvements in GeometryImprovements in Geometry ReflectionReflection of volume hierarchies of volume hierarchies

Eg to create endcap geometryEg to create endcap geometry

Improved Improved voxelisationvoxelisation for performant navigation for performant navigation 3-D for parameterized volumes3-D for parameterized volumes

Now equal performance to ‘placed’ volumeNow equal performance to ‘placed’ volume Option to avoid voxelizing some volumesOption to avoid voxelizing some volumes

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

XML binding: GDML 1.0 releasedXML binding: GDML 1.0 released Specification & ImplementationSpecification & Implementation

Refinements currently on ‘hold’.Refinements currently on ‘hold’.

G Cosmo

R Chytracek

I Hrivnacova G Cosmo

V Grichine

G Cosmo

Page 36: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

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

Debugging geometriesDebugging geometries

It is easy to create It is easy to create overlappingoverlapping volumes volumes a volume that protrudes from its mother,a volume that protrudes from its mother, 2+ volumes that intersect in common mother2+ volumes that intersect in common mother

During tracking Geant4 does not check for During tracking Geant4 does not check for malformed geometries malformed geometries

The problem of detecting ‘The problem of detecting ‘significant’significant’ overlapsoverlaps is now addressed by is now addressed by DAVIDDAVID that intersects volumes directly that intersects volumes directly

( Uses graphical representations )( Uses graphical representations ) Created by S. Tanaka, released ca 1997 Created by S. Tanaka, released ca 1997

New New commandscommands to run verification tests to run verification tests Created by DC Williams; released in 4.0Created by DC Williams; released in 4.0

New New exampleexample with full tracking / navigation with full tracking / navigation Created by M Liendl; released in 5.0 Created by M Liendl; released in 5.0

Thanks to S. Tanaka

Page 37: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

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

CPU PerformanceCPU Performance

Our first simple benchmarks: Our first simple benchmarks: Geometry faster, EM shower setups: competitiveGeometry faster, EM shower setups: competitive

Performance in experimental setups (with Geant4 releases 2 and Performance in experimental setups (with Geant4 releases 2 and 3) was 3) was comparablecomparable to Geant3 to Geant3 few counterexamples, including BTeV ECAL.few counterexamples, including BTeV ECAL.

New performance New performance issuesissues arose with Geant4 4.0 arose with Geant4 4.0 and were addressed (in the patches & release 4.1)and were addressed (in the patches & release 4.1)

DifficultDifficult cases remain, including cases remain, including Some setups of EM showers and field propagation, factor ~ 2x Some setups of EM showers and field propagation, factor ~ 2x

Collecting a set of Collecting a set of benchmarksbenchmarks To follow computing performance regularlyTo follow computing performance regularly

GoalGoal is that Geant4 is at least as fast as Geant3 in almost all is that Geant4 is at least as fast as Geant3 in almost all casescases When its power is used.When its power is used.

Page 38: The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.

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

Geometry Modeler ConclusionsGeometry Modeler Conclusions The Geant4 geometry modeler allows for definition of The Geant4 geometry modeler allows for definition of

complex geometry setupscomplex geometry setups Easy integration of the geometry model in the user applicationEasy integration of the geometry model in the user application

Distinction between Distinction between logicallogical and and physical physical entitiesentities Memory optimisation and reuseMemory optimisation and reuse

Navigation and transportNavigation and transport in very complex models in very complex models Precise and efficient with advanced optimisation techniquesPrecise and efficient with advanced optimisation techniques

Geometry Geometry biasing biasing techniques (real or techniques (real or parallel geometryparallel geometry)) Special facilities allow forSpecial facilities allow for

Grouping of volumes for regular geometry patternsGrouping of volumes for regular geometry patterns Replica/reflectionReplica/reflection of composite structures of composite structures Characterisation of areas with common attributes (Characterisation of areas with common attributes (regionsregions)) DebuggingDebugging of the user-defined geometry of the user-defined geometry