51
Dr. Guy Tel-Zur 1 Computational Physics An Introduction to the Geant4 toolkit

Computational Physics An Introduction to the Geant4 toolkit

  • Upload
    olinda

  • View
    56

  • Download
    1

Embed Size (px)

DESCRIPTION

Computational Physics An Introduction to the Geant4 toolkit. Dr. Guy Tel- Zur. An Introduction to the Geant4 toolkit. Many of the slides are from a presentation by: J . Apostolakis , CERN for the Geant4 collaboration. Geant 4. Home page : http://geant4.cern.ch/ - PowerPoint PPT Presentation

Citation preview

Page 1: Computational Physics   An  Introduction to the   Geant4  toolkit

Dr. Guy Tel-Zur

1

Computational Physics An Introduction to the Geant4 toolkit

Page 2: Computational Physics   An  Introduction to the   Geant4  toolkit

An Introduction to the Geant4 toolkit

Many of the slides are from a presentation by: J. Apostolakis, CERN

for the Geant4 collaboration

Page 3: Computational Physics   An  Introduction to the   Geant4  toolkit

Geant4Home page: http://geant4.cern.ch/Important paper:

Geant4 – a simulation toolkitTutorial:

http://indico.cern.ch/conferenceOtherViews.py?view=standard&confId=58317

Live CD: https://twiki.cern.ch/twiki/bin/view/Geant4/Geant4CernVM 3

Page 4: Computational Physics   An  Introduction to the   Geant4  toolkit

4

OverviewSimulation packages/toolkits

Key capabilities and conceptsWhat it can do - highlights

Application areasWhat is inside – lightning tour

Brief highlights of capabilities Transparency of results

Open sourceGEANT4: the collaboration

Page 5: Computational Physics   An  Introduction to the   Geant4  toolkit

5

What can a simulation package or toolkit do ?A Package provides ‘general’ tools to

undertake (some or all) of the key tasks: tracking, and geometrical propagation modelling of physics interactions, visualization, persistency

and enable you to describe your setup’s detector geometry, radiation source, details of sensitive regions

Page 6: Computational Physics   An  Introduction to the   Geant4  toolkit

6

GEANT 4 Detector simulation tool-kit from HEP

full functionality: geometry, tracking, physics, I/O

offers alternatives, allows for tailoringSoftware Engineering and OO technology

provide the architecture & methods for maintaining it

Requirements from: current and future HEP experiments medical and space science applications

World-wide collaboration

Page 7: Computational Physics   An  Introduction to the   Geant4  toolkit

7

Key Capabilities ‘Kernel’: create, manage, move tracks

tracking, stacks, geometry, hits, …Extensible, flexible

Physics Processes X-section, final-state models for electromagnetic, hadronic, …

Can be ‘assembled’ for use in an application area Tools for faster simulation

‘Cuts’, framework shower parameterisation Event biasing, variance reduction.

Open interfaces for input/output User commands, visualization, persistency

Page 8: Computational Physics   An  Introduction to the   Geant4  toolkit

Brief HistoryGeant4 started as RD44 project

(1994-98) Amongst first OO in HEP, 1st for

simulation Dec 1998: 1st supported release

Geant4.0.0First uses in production in several

fields Space: 1999 XMM (X-ray telescope) HEP: 2001 BaBar, 2004

ATLAS/CMS/LHCbRegular public releases (1-2 per

year) Geant4 release 9.0 (Jun 07), 9.3 (Dec

09) Guy: Dec. 17, 2010: new release:

9.4

8

Page 9: Computational Physics   An  Introduction to the   Geant4  toolkit

APPLICATION AREAS

9

Page 10: Computational Physics   An  Introduction to the   Geant4  toolkit

HIGH ENERGY PHYSICS

11

Page 11: Computational Physics   An  Introduction to the   Geant4  toolkit

BaBar

12

Now simulating PEP beam line as well (-9m < zIP < 9m)

Courtesy of D.Wright (SLAC)

BaBar at SLAC was the pioneer experiment in HEP in use of Geant4 Started in 2000 Simulated several x

1010 events

Page 12: Computational Physics   An  Introduction to the   Geant4  toolkit

13

Pion longitudinal shower profile in stand-alone

ATLAS TileCal test-beam at 90o

Data

For Protons : -(20%-40%) at 10 λ.

MC within ~ ±10% up to 10 λ.

Thanks to Atlas Tilecal

Page 13: Computational Physics   An  Introduction to the   Geant4  toolkit

14Courtesy: CMSTalk of S. Banerjee, Geant4 Workshop 2009

Page 14: Computational Physics   An  Introduction to the   Geant4  toolkit

15

Page 15: Computational Physics   An  Introduction to the   Geant4  toolkit

16

Boulby Mine dark matter search Prototype Simulation

Courtesy of H. Araujo, A. Howard, IC London

LXeGXe

PMT

mirror

source

One High Energy event

Page 16: Computational Physics   An  Introduction to the   Geant4  toolkit

17Courtesy of V.D.Elvira (FNAL)

Geant4 for beam transportation

Page 17: Computational Physics   An  Introduction to the   Geant4  toolkit

AEROSPACE

18

Page 18: Computational Physics   An  Introduction to the   Geant4  toolkit

20

Page 19: Computational Physics   An  Introduction to the   Geant4  toolkit

g astrophysics

21

g-ray bursts

AGILE GLAST

Typical telescope: Tracker Calorimeter Anticoincidence

g conversion electron interactions multiple scattering d-ray production charged particle tracking

GLAST

GLAST

Page 20: Computational Physics   An  Introduction to the   Geant4  toolkit

Bepi Colombo: X-Ray Mineralogical Survey of Mercury

22

Alfonso Mantero, Thesis, Univ. Genova, 2002

Space Environments and Effects Section

BepiColomboESA cornerstone mission to Mercury

Courtesy of ESA Astrophysics

Page 21: Computational Physics   An  Introduction to the   Geant4  toolkit

PlanetoCosmicsGeant4 simulation of Cosmic Rays in planetary Atmo-/Magneto- spheres

23

Page 22: Computational Physics   An  Introduction to the   Geant4  toolkit

MEDICAL PHYSICS

24

Page 23: Computational Physics   An  Introduction to the   Geant4  toolkit

25

Page 24: Computational Physics   An  Introduction to the   Geant4  toolkit

26

http://top25.sciencedirect.com/index.php?subject_area_id=21

Page 25: Computational Physics   An  Introduction to the   Geant4  toolkit

A QUICK WALK THROUGH GEANT4

27

Page 26: Computational Physics   An  Introduction to the   Geant4  toolkit

Key Domains of the Simulation

28

Page 27: Computational Physics   An  Introduction to the   Geant4  toolkit

Top Level Category Diagram (part 1)

29

Page 28: Computational Physics   An  Introduction to the   Geant4  toolkit

30

Top Level Category Diagram (part 2)

Page 29: Computational Physics   An  Introduction to the   Geant4  toolkit

31

Describes a

Setup Hierarchy of volumes Many volumes

repeat Volume & sub-tree

Up to hundreds of thousands of volumes

Importing solids from CAD systems

Navigates in Detector

Locates a point Computes a step

Linear intersection

Geometry: what it does

Page 30: Computational Physics   An  Introduction to the   Geant4  toolkit

32

Electromagnetic physicsGammas:

Gamma-conversion, Compton scattering, Photo-electric effect

Leptons(e, m), charged hadrons, ions Energy loss (Ionisation, Bremstrahlung), Multiple scattering,

Transition radiation, Synchrotron radiation, e+ annihilation. Photons:

Cerenkov, Rayleigh, Reflection, Refraction, Absorption, Scintillation

High energy muonsA choice of implementations for most

processes “Standard”: performant when relevant physics above 1 KeV “Low Energy”: Extra accuracy for application delving below

1 KeV

Page 31: Computational Physics   An  Introduction to the   Geant4  toolkit

33

Hadronic processesHadronic physics is included in Geant4

a powerful and flexible framework and implementations of physics X-sections &

models.A variety of models and cross-sections

for each energy regime, particle type, material alternatives with different strengths and

computing resource requirementsComponents can be assembled in an

optimised way for each use case.

Page 32: Computational Physics   An  Introduction to the   Geant4  toolkit

Openness and ExtensibilityAs a toolkit with open-source code,

Geant4 can be extended in many ways Expected/simple

Creating a new shape (G4VSolid) Unusual, but predicted

New processes, for physics or user action Radical extensions

Reversing time (two ways) Creating ‘on-the-fly’ density for a material

(future) 34

Page 33: Computational Physics   An  Introduction to the   Geant4  toolkit

Practical considerations Starting off: what you need

Compatible platform Need CLHEP foundation class library One or more visualisation libraries (possibly from system, e.g. OpenGL)

CLHEP is used for key common classes ThreeVector (G4ThreeVector is a name for CLHEP::HepThreeVector) FourVector Random Number Generators, ..

Coding is needed – except if someone did it for you. Modify existing C++ ‘code’ to describe your setup Create you own class to describe eg a magnetic field.

35

Page 34: Computational Physics   An  Introduction to the   Geant4  toolkit

Platforms What works ‘best’ (used by developers, main

testing) Scientific Linux 4 or 5 and gcc 4.3 (HEP production) MacOS 10.5 Leopard

What we also support (tested + numerous users) Windows (XP) & Visual C++

numerous users What we expect to work

Other Linux flavours with gcc 4.1 and 4.3Possibly with fewer options, eg missing some visualisation

What others ‘ported’ and check Sun Solaris

36

Page 35: Computational Physics   An  Introduction to the   Geant4  toolkit

GEANT4 COLLABORATION

37

Page 36: Computational Physics   An  Introduction to the   Geant4  toolkit

Geant4 Collaboration

38

Collaborators also from non-member institutions, including

IHEPMEPHI Moscow

Jefferson Laboratory

Lebedev

TRIUMF

UK STFCLIP

Page 37: Computational Physics   An  Introduction to the   Geant4  toolkit

The Toolkit Examples

39

Three levels:

Page 38: Computational Physics   An  Introduction to the   Geant4  toolkit

Hands on!

• Time to get your hands on Geant4– Copy exercises– Your first run of a simple example

• To start, please look athttp://www.ifh.de/geant4/g4course2010

Else, if you have difficulty to reach that usehttp://www-zeuthen.desy.de/geant4/g4course2010

40

Page 39: Computational Physics   An  Introduction to the   Geant4  toolkit

41

User: geant, pw: geant2010IP = 192.168.11.128

Page 40: Computational Physics   An  Introduction to the   Geant4  toolkit

Example N02This example simulates a simplified fixed target experiment.

1- GEOMETRY DEFINITION

The setup consists of a target followed by six chambers of increasing transverse size. These chambers are located in a region called Tracker region. Their shape are boxes, constructed as parametrised volumes (ChamberParametrisation class).

The default geometry is constructed in DetectorConstruction class. One can change the material of the target and of the chambers interactively via the commands defined in the DetectorMessenger class.

In addition a transverse uniform magnetic field can be applied (see N02MagneticField and DetectorMessenger classes).

42

Page 41: Computational Physics   An  Introduction to the   Geant4  toolkit

43

2- PHYSICS LIST

The particle's type and the physic processes which will be available in this example are set in PhysicsList class.

In this example, all the so called 'electromagnetic processes' are introduced for gamma, charged leptons, and charged hadrons (see the method PhysicsList::ConstructEM()).

An important data member of this class is the defaultCutValue which defines the production threshold of secondary particles (only Ionisation and Bremsstrahlung processes are concerned by this CutValue). Notice that the CutValue must be given in unit of length, corresponding to the stopping range of the particle. It is automatically converted in energy for each material, and a table is printed in the method PhysicsList::SetCuts()

In addition the build-in interactive command: /process/(in)activate processName allows to activate/inactivate the processes one by one.

Page 42: Computational Physics   An  Introduction to the   Geant4  toolkit

44

3- RUNS and EVENTS

The primary kinematic consists of a single particle which hits the target perpendicular to the input face. The type of the particle and its energy are set in the PrimaryGeneratorAction class, and can be changed via the G4 build-in commands of ParticleGun class.

A RUN is a set of events.

The user has control: -at Begin and End of each run (class RunAction) -at Begin and End of each event (class EventAction) -at Begin and End of each track (class TrackingAction, not used here) -at End of each step (class SteppingAction)

The class SteppingVerbose prints some informations step per step, under the control of the command: /tracking/verbose 1 It inherits from G4SteppingVerbose, and has been setup here in order to illustrate how to extract informations from the G4 kernel during the tracking of a particle.

Page 43: Computational Physics   An  Introduction to the   Geant4  toolkit

45

4- USER' LIMITS

We illustrate how to introduce tracking constraints like maximum step length, minimum kinetic energy ..etc.., via G4UserLimits class. See DetectorConstruction and PhysicsList.

5- DETECTOR RESPONSE

A HIT is a record, track per track (even step per step), of all the informations needed to simulate and analyse the detector response.

In this example the Tracker chambers are considered as the detector. Therefore the chambers are declared 'sensitive detectors' (SD) in the DetectorConstruction class.

Then, a Hit is defined as a set of 4 informations per step, inside the chambers, namely: - the track identifier (an integer), - the chamber number, - the total energy deposit in this step, - the position of the deposit.

A given hit is an instance of the class TrackerHit which is created during the tracking of a particle, step by step, in the method TrackerSD::ProcessHits(). This hit is inserted in a HitsCollection. The HitsCollection is printed at the end of event (via the method TrackerSD::EndOfEvent()), under the control of the command: /hits/verbose 1

Page 44: Computational Physics   An  Introduction to the   Geant4  toolkit

46

6- VISUALIZATION

The Visualization Manager is set in the main(). The initialisation of the drawing is done via a set of /vis/ commands in the macro vis.mac. This macro is automatically read from the main when running in interactive mode.

The tracks are automatically drawn at the end of event and erased at the beginning of the next run.

The visualization (with OpenGL driver) assumes two things: 1- the visualisation & interfaces categories have been compiled with the environment variable G4VIS_BUILD_OPENGLX_DRIVER. 2- exampleN02.cc has been compiled with G4VIS_USE_OPENGLX.

(The same with DAWNFILE instead of OPENGLX)

Page 45: Computational Physics   An  Introduction to the   Geant4  toolkit

47

7- USER INTERFACES

The default command interface, called G4UIterminal, is done via standart cin/G4cout. On Linux and Sun-cc on can use a smarter command interface G4UItcsh. It is enough to set the environment variable G4UI_USE_TCSH before compiling exampleN02.cc

8- HOW TO START ?

- compile and link to generate an executable % cd N02 % gmake

- execute N02 in 'batch' mode from macro files (without visualization) % exampleN02 run1.mac

Page 46: Computational Physics   An  Introduction to the   Geant4  toolkit

48

- execute N02 in 'interactive mode' with visualization % exampleN02 .... Idle> type your commands. For instance: Idle> /run/beamOn 10 .... Idle> /control/execute run2.mac .... Idle> exit

Show in editor printout of exampleN02, see file: ./geant/exampleN02_printout.txt

Page 47: Computational Physics   An  Introduction to the   Geant4  toolkit

49

Page 48: Computational Physics   An  Introduction to the   Geant4  toolkit

The END

Page 49: Computational Physics   An  Introduction to the   Geant4  toolkit

51

Resources for more information Geant4 web site

http://cern.ch/geant4/ Geant4 Training Page

http://cern.ch/geant4/support/ and follow “Training” link,

Geant4 training INFN / EM ‘Low-energy’

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

Geant4 Workshops and Users Workshops presentations Latest at the home page,

previous at http://geant4.web.cern.ch/geant4/collaboration/meetings_minutes.html#G4workshops

Geant4 Physics WG web sites Which can all be found at

http://cern.ch/geant4/organisation/working_groups.html

Geant4 Low-Energy Electromagnetic WG web site

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

Geant4 EM (standard) see below

Geant4 Hadronic WG home Papers on G4 and its

validation “Geant4: a simulation

toolkit”, Nucl Instr and Methods A 506 (2003), 250-303

“Validation of GEANT4, an object-oriented MC toolkit for simulations in medical physics” J.F. Carrier et al, Med Phys 32 (2004), p 484.

Note: “Training” page is also directly accessed at http://cern.ch/geant4/milestones/training/training-milestone.html

ElectroMagnetic (standard) WG home page is at http://cern.ch/geant4/working_groups/electromagnetic/electromagneticWG.html

Page 50: Computational Physics   An  Introduction to the   Geant4  toolkit

52

Geant4 Capabilities & Use • Kernel: create geometry, hits, …• Physics Processes

– models for EM, hadronics, …– ‘assembled’ into physics lists for application area

• Tools for faster simulation– Shower parameterisation & Event biasing.

• Open interfaces for input/output– User commands, visualization

• Verification and validation for use cases• Using it

– via ready applications (eg GATE)– by starting with examples & customising

Page 51: Computational Physics   An  Introduction to the   Geant4  toolkit

54

Acknowledgements

Thanks to those who have contributed-to creating slides for tutorials / talk, that I borrowed

Thanks to all those who have contributed -to the development of Geant4, -to its validation for these and other application areas,

-to those who have applied it -particularly those who have given feedback.

Note that it is a large task to give credit to all of them individually.