54
Introduction Introduction to to Geant4 Geant4 John Apostolakis (CERN) John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Geant4 Tutorial Course @ LAPP, Nov 2008 Nov 2008 Original slides by Makoto Asai Original slides by Makoto Asai (SLAC) (SLAC) Geant4 ver 9.1

Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Embed Size (px)

Citation preview

Page 1: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

IntroductionIntroductiontoto

Geant4Geant4

John Apostolakis (CERN)John Apostolakis (CERN)

Geant4 Tutorial Course @ LAPP, Nov Geant4 Tutorial Course @ LAPP, Nov 20082008

Original slides by Makoto Asai (SLAC)Original slides by Makoto Asai (SLAC)

Geant4 ver 9.1

Page 2: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 22

ContentsContents General introduction General introduction

and brief historyand brief history

Highlights of user Highlights of user

applications applications

Geant4 kernelGeant4 kernel

Basic concepts and Basic concepts and

kernel structurekernel structure

User classesUser classes

Geant4 licenseGeant4 license

Page 3: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

General introduction General introduction and brief historyand brief history

Page 4: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 44

What is Geant4?What is Geant4? Geant4 is the successor of GEANT 3, the world-standard toolkit for HEP Geant4 is the successor of GEANT 3, the world-standard toolkit for HEP

detector simulation.detector simulation.

A variety of A variety of requirements requirements have been taken into account from have been taken into account from

heavy ion physics, CP violation physics, cosmic ray physics, heavy ion physics, CP violation physics, cosmic ray physics,

astrophysics, space science and medical applications. astrophysics, space science and medical applications.

In order to meet such requirements, a large degree of In order to meet such requirements, a large degree of functionality functionality

and and flexibility flexibility are provided.are provided.

Geant4 is one of the first successful attempt to Geant4 is one of the first successful attempt to re-design re-design a major a major

package of HEP software for the next (now current!) generation of package of HEP software for the next (now current!) generation of

experiments using an Object-Oriented environment. experiments using an Object-Oriented environment.

G4 is not only for HEP but goes well beyond it.G4 is not only for HEP but goes well beyond it.

Page 5: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 55

Flexibility of Geant4Flexibility of Geant4 In order to meet wide variety of In order to meet wide variety of requirements requirements from various application from various application

fields, a large degree of functionality and fields, a large degree of functionality and flexibility flexibility are provided. are provided.

Geant4 has many types of geometrical descriptions to describe most Geant4 has many types of geometrical descriptions to describe most

complicated and realistic complicated and realistic geometries geometries

CSG, BREP and Boolean CSG, BREP and Boolean solidssolids

Placing Placing volumes volumes one at a time or either replicated, grouped or reflectedone at a time or either replicated, grouped or reflected

XML interfaceXML interface

Everything is Everything is open open to the user, e.g. offers ato the user, e.g. offers a

Choice of Choice of physics physics processes/models, (even creating your own)processes/models, (even creating your own)

Choice of GUI/Visualization, persistency, histogramming technologiesChoice of GUI/Visualization, persistency, histogramming technologies

Page 6: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 66

Physics in Geant4Physics in Geant4 It is rather unrealistic to develop one set of physics models to cover all It is rather unrealistic to develop one set of physics models to cover all

applications over the full variety of particles and/or energy rangeapplications over the full variety of particles and/or energy range Different needs for accuracy, computing speed, ..Different needs for accuracy, computing speed, ..

Wider coverage of requirements comes from mixture of modeling Wider coverage of requirements comes from mixture of modeling

approaches: theory-driven, parameterized formulae and ‘data-driven’ (e.g. approaches: theory-driven, parameterized formulae and ‘data-driven’ (e.g.

neutron). neutron). Using the C++ polymorphism mechanism, both cross-sections and Using the C++ polymorphism mechanism, both cross-sections and

models (final state generation) can be combined in arbitrary manners models (final state generation) can be combined in arbitrary manners

into one particular process.into one particular process.

Geant4 offers processes for all important interactions:

ElectroMagnetic (EM)HadronicOptical photonPhoton- hadron lepton-hadron

DecayShower parameterizationEvent biasing techniques And you can create and plug-in more

Page 7: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 88

Geant4 – Its historyGeant4 – Its history Dec ’94 - Project startDec ’94 - Project start

Dec ’98 - First Geant4 public release – version 0.0Dec ’98 - First Geant4 public release – version 0.0

……

December 2005 - Geant4 version 8.0 releaseDecember 2005 - Geant4 version 8.0 release

May 2007 - Geant4 version 8.3 releaseMay 2007 - Geant4 version 8.3 release

June 2007 - Geant4 version 9.0 releaseJune 2007 - Geant4 version 9.0 release

December 2007 – Geant4 version December 2007 – Geant4 version 9.1 release9.1 release

Sept 2008 – Geant4 Sept 2008 – Geant4 9.1 patch 03 9.1 patch 03

Ongoing and upcoming developmentsOngoing and upcoming developments

June 2008 – Geant4 9.2 beta: open previewing of developments in 9.2June 2008 – Geant4 9.2 beta: open previewing of developments in 9.2

1919thth December 2008 – Geant4 version 9.2 release (scheduled) December 2008 – Geant4 version 9.2 release (scheduled)

We currently provide two to three public releases every year.We currently provide two to three public releases every year.

Bimonthly beta releases are available to the registered beta-testers.Bimonthly beta releases are available to the registered beta-testers.

Current version

Page 8: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 99

Geant4 – Its historyGeant4 – Its history Dec ’94 - Project startDec ’94 - Project start

Dec ’98 - First Geant4 public release – version 0.0Dec ’98 - First Geant4 public release – version 0.0

……

December 2006 - Geant4 version 8.0 releaseDecember 2006 - Geant4 version 8.0 release

June 2006 – Geant4 version 8.1 release, June 2006 – Geant4 version 8.1 release,

Dec 2006 - Geant4 version 8.2 releaseDec 2006 - Geant4 version 8.2 release

May 2007 - Geant4 version 8.3 releaseMay 2007 - Geant4 version 8.3 release

June 2007 - Geant4 version 9.0 releaseJune 2007 - Geant4 version 9.0 release

December 2007 – Geant4 version 9.2 releaseDecember 2007 – Geant4 version 9.2 release

Sept 2008 – GEant4 9.1 patch 03 Sept 2008 – GEant4 9.1 patch 03

June 2008 – Geant4 9.2 beta (Open beta release)June 2008 – Geant4 9.2 beta (Open beta release)

1919thth December 2008 – Geant4 version 9.2 release (scheduled) December 2008 – Geant4 version 9.2 release (scheduled)

We currently provide two to three public releases every year.We currently provide two to three public releases every year.

Bimonthly beta releases are available to the registered beta-testers.Bimonthly beta releases are available to the registered beta-testers.

Current version

Page 9: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

1010

Geant4 Geant4 CollaborationCollaboration

Collaborators also from non-member institutions, including

IHEP, MEPHI Moscow

LIPLisbonInstitutePhysics

TRIUMF

Lebedev

STFC (UK)

Page 10: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 1111

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

Page 11: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Highlights ofHighlights ofUsers ApplicationsUsers Applications

To provide you some ideas how Geant4 would be utilized…

Page 12: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 1313

BaBarBaBar BaBar at SLAC is the pioneer experiment in HEP in use of Geant4BaBar at SLAC is the pioneer experiment in HEP in use of Geant4

Geant4 use started in 2000Geant4 use started in 2000 Simulated > 5*10Simulated > 5*1099 events so far events so far Produced at 20 sites in North America and EuropeProduced at 20 sites in North America and Europe Average production rate in mid-2007: 6.1 x 10Average production rate in mid-2007: 6.1 x 1077 events/week events/week

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

Courtesy of D.Wright (SLAC)

Page 13: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 1414December 2004

Page 14: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 1515

Boulby Mine dark matter search Boulby Mine dark matter search Prototype SimulationPrototype Simulation

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

LXe

GXe

PMT

mirror

source

One High Energy event

Page 15: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 1616

Geant4 for beam Geant4 for beam transportationtransportation

Courtesy of V.D.Elvira (FNAL)

Page 16: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

1818Courtesy of S.Incerti (IN2P3/CNRS)

Page 17: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 1919

X-Ray Surveys of X-Ray Surveys of Asteroids and MoonsAsteroids and Moons

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

Cosmic rays,jovian electrons

Geant3.21Geant3.21

G4 “standard”G4 “standard”

Geant4 low-EGeant4 low-E

Solar X-rays, e, p

Courtesy SOHO EIT

C, N, O line emissions includedC, N, O line emissions included

ESA Space Environment & Effects Analysis SectionGeant4 in space Geant4 in space

sciencescience

Page 18: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 2020

Page 19: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Basic conceptsBasic conceptsand kernel structureand kernel structure

Page 20: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 2222

Terminology (jargon)Terminology (jargon) Run, event, track, step, step pointRun, event, track, step, step point Track Track trajectory, step trajectory, step trajectory point trajectory point ProcessProcess

At rest, along step, post stepAt rest, along step, post step Cut = production thresholdCut = production threshold Sensitive detector, hit, hits collectionSensitive detector, hit, hits collection

Page 21: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 2323

Run in Geant4Run in Geant4 As an analogy of the real experiment, a run of Geant4 starts with As an analogy of the real experiment, a run of Geant4 starts with

“Beam On”.“Beam On”.

Within a run, the user cannot changeWithin a run, the user cannot change

detector setupdetector setup

settings of physics processessettings of physics processes

A run is a set of events which share the same detector and physics A run is a set of events which share the same detector and physics

conditions.conditions.

A run consists of one event loop.A run consists of one event loop.

At the beginning of a run, geometry is optimized for navigation and cross-At the beginning of a run, geometry is optimized for navigation and cross-

section tables are calculated according to materials appear in the geometry section tables are calculated according to materials appear in the geometry

and the cut-off values defined. and the cut-off values defined.

G4RunManagerG4RunManager class manages processing a run, a run is represented by class manages processing a run, a run is represented by

G4RunG4Run class or a user-defined class derived from G4Run. class or a user-defined class derived from G4Run.

A run class may have a summary results of the run.A run class may have a summary results of the run.

G4UserRunActionG4UserRunAction is the optional user hook. is the optional user hook.

Page 22: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 2424

Event in Geant4Event in Geant4 An event is the basic unit of simulation in Geant4.An event is the basic unit of simulation in Geant4.

At beginning of processing, primary tracks are generated. These At beginning of processing, primary tracks are generated. These

primary tracks are pushed into a stack. primary tracks are pushed into a stack.

A track is popped up from the stack one by one and “A track is popped up from the stack one by one and “trackedtracked”. ”.

Resulting secondary tracks are pushed into the stack.Resulting secondary tracks are pushed into the stack.

This “tracking” lasts as long as the stack has a track.This “tracking” lasts as long as the stack has a track.

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

G4Event G4Event class represents an event. It has following objects at the end class represents an event. It has following objects at the end

of its (successful) processing. of its (successful) processing.

List of primary vertices and particles (as input)List of primary vertices and particles (as input)

Hits and Trajectory collections (as output)Hits and Trajectory collections (as output)

G4EventManagerG4EventManager class manages processing an event. class manages processing an event.

G4UserEventActionG4UserEventAction is the optional user hook. is the optional user hook.

Page 23: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 2525

Track in Geant4Track in Geant4 Track is a Track is a snapshotsnapshot of a particle: of a particle:

It has physical quantities of It has physical quantities of current instancecurrent instance only. It does not only. It does not

record its previous state or any other quantities.record its previous state or any other quantities. Step is a “delta” information to a track. Track is not a collection Step is a “delta” information to a track. Track is not a collection

of steps. of steps. Instead, a track is being updated during at each step.Instead, a track is being updated during at each step. The track object is The track object is deleted deleted whenwhen

it goes out of the world volume,it goes out of the world volume, it disappears (by e.g. decay, inelastic scattering),it disappears (by e.g. decay, inelastic scattering), it goes down to zero kinetic energy it goes down to zero kinetic energy

and no “AtRest” additional process is required, orand no “AtRest” additional process is required, or the user decides to kill it (‘artificially’).the user decides to kill it (‘artificially’).

No track object persists at the end of event.No track object persists at the end of event.

To record of tracks, you must use trajectory class objects.To record of tracks, you must use trajectory class objects. G4TrackingManagerG4TrackingManager processes a track, which is represented by processes a track, which is represented by

G4TrackG4Track class. class. G4UserTrackingActionG4UserTrackingAction is an optional user hook. is an optional user hook.

Page 24: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 2626

Step in Geant4Step in Geant4 A step has A step has

two points: at its start (we call it pre-step) and end (post-step) two points: at its start (we call it pre-step) and end (post-step) – see figure– see figure

““delta” information on the step’s energy loss, time-of-flight, …delta” information on the step’s energy loss, time-of-flight, … Each point knows its Each point knows its volume volume (and (and materialmaterial). ).

When a step is limited by a volume boundary, the end point physically When a step is limited by a volume boundary, the end point physically

stands on the boundary, and it stands on the boundary, and it logically belongs to the next volumelogically belongs to the next volume.. Because this step knows materials of two volumes, Because this step knows materials of two volumes, boundary boundary

processes processes such as transition radiation, reflection & refraction can be such as transition radiation, reflection & refraction can be

simulated.simulated. G4SteppingManager G4SteppingManager class manages processing a step, a step is represented class manages processing a step, a step is represented

by by G4StepG4Step class. class. G4UserSteppingActionG4UserSteppingAction is the optional user hook. is the optional user hook.

Pre-step pointPost-step point

StepBoundary

Page 25: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 2727

Trajectory and trajectory pointTrajectory and trajectory point Track does not keep its trace. No track object persists at the end of event.Track does not keep its trace. No track object persists at the end of event. G4TrajectoryG4Trajectory is the class which copies some of G4Track information. is the class which copies some of G4Track information.

G4TrajectoryPointG4TrajectoryPoint is the class which copies some of G4Step information. is the class which copies some of G4Step information. G4Trajectory has a vector of G4TrajectoryPoint.G4Trajectory has a vector of G4TrajectoryPoint. At the end of event processing, G4Event has a collection of At the end of event processing, G4Event has a collection of

G4Trajectory objects.G4Trajectory objects. /tracking/storeTrajectory must be set to 1./tracking/storeTrajectory must be set to 1.

Keep in mind the distinction.Keep in mind the distinction. G4Track G4Track G4Trajectory, G4Step G4Trajectory, G4Step G4TrajectoryPoint G4TrajectoryPoint

Given G4Trajectory and G4TrajectoryPoint objects persist till the end of an Given G4Trajectory and G4TrajectoryPoint objects persist till the end of an

event, you should be careful not to store too many trajectories.event, you should be careful not to store too many trajectories. E.g. avoid for high energy EM shower tracks.E.g. avoid for high energy EM shower tracks.

G4Trajectory and G4TrajectoryPoint store only the minimum information.G4Trajectory and G4TrajectoryPoint store only the minimum information. You can create your own trajectory / trajectory point classes to store You can create your own trajectory / trajectory point classes to store

information you need. G4VTrajectory and G4VTrajectoryPoint are base information you need. G4VTrajectory and G4VTrajectoryPoint are base

classes.classes.

Page 26: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 2828

Particle in Geant4Particle in Geant4 A particle in Geant4 is represented by three layers of classes.A particle in Geant4 is represented by three layers of classes. G4TrackG4Track

Position, geometrical information, etc.Position, geometrical information, etc. This is a class representing a particle to be tracked.This is a class representing a particle to be tracked.

G4DynamicParticleG4DynamicParticle "Dynamic" physical properties of a particle, such as momentum, energy, "Dynamic" physical properties of a particle, such as momentum, energy,

spin, etc.spin, etc. Each G4Track object has its own and unique G4DynamicParticle object.Each G4Track object has its own and unique G4DynamicParticle object. This is a class representing an individual particle.This is a class representing an individual particle.

G4ParticleDefinitionG4ParticleDefinition "Static" properties of a particle, such as charge, mass, life time, decay "Static" properties of a particle, such as charge, mass, life time, decay

channels, etc.channels, etc. G4ProcessManager which describes processes involving to the particleG4ProcessManager which describes processes involving to the particle All G4DynamicParticle objects of same kind of particle share the same All G4DynamicParticle objects of same kind of particle share the same

G4ParticleDefinition.G4ParticleDefinition.

Page 27: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 2929

Tracking and processesTracking and processes Geant4 tracking is general. Geant4 tracking is general.

It is independent to It is independent to

the particle type the particle type

the physics processes involving to a particlethe physics processes involving to a particle

It gives the chance to all processes It gives the chance to all processes

To contribute to determining the step lengthTo contribute to determining the step length

To contribute any possible changes in physical quantities of To contribute any possible changes in physical quantities of

the trackthe track

To generate secondary particlesTo generate secondary particles

To suggest changes in the state of the trackTo suggest changes in the state of the track

e.g. to suspend, postpone or kill it.e.g. to suspend, postpone or kill it.

Page 28: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 3030

Processes in Geant4Processes in Geant4 In Geant4, particle transportation is a process as well, by which a particle In Geant4, particle transportation is a process as well, by which a particle

interacts with geometrical volume boundaries and field of any kind.interacts with geometrical volume boundaries and field of any kind.

Because of this, shower parameterization process can take over from Because of this, shower parameterization process can take over from

the ordinary transportation without modifying the transportation the ordinary transportation without modifying the transportation

process.process.

Each particle has its own list of applicable processes. At each step, all Each particle has its own list of applicable processes. At each step, all

processes listed are invoked to get proposed physical interaction lengths.processes listed are invoked to get proposed physical interaction lengths.

The process which requires the shortest interaction length (in space-time) The process which requires the shortest interaction length (in space-time)

limits the step. limits the step.

Each process has one or combination of the following natures.Each process has one or combination of the following natures.

AtRestAtRest

e.g. muon decay at reste.g. muon decay at rest

AlongStep (a.k.a. continuous process)AlongStep (a.k.a. continuous process)

e.g. Celenkov processe.g. Celenkov process

PostStep (a.k.a. discrete process)PostStep (a.k.a. discrete process)

e.g. decay on the flye.g. decay on the fly

Page 29: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 3131

Track statusTrack status At the end of each step, according to the processes involved, the state At the end of each step, according to the processes involved, the state

of a track may be changed.of a track may be changed. The user can also change the status in The user can also change the status in UserSteppingActionUserSteppingAction.. Statuses shown in Statuses shown in yellowyellow are artificial, i.e. Geant4 kernel won’t set are artificial, i.e. Geant4 kernel won’t set

them, but the user can set.them, but the user can set.

fAlivefAlive Continue the tracking.Continue the tracking.

fStopButAlivefStopButAlive The track has come to zero kinetic energy, but still AtRest process The track has come to zero kinetic energy, but still AtRest process

to occur.to occur. fStopAndKillfStopAndKill

The track has lost its identity because it has decayed, interacted or The track has lost its identity because it has decayed, interacted or gone beyond the world boundary.gone beyond the world boundary.

Secondaries will be pushed to the stack.Secondaries will be pushed to the stack. fKillTrackAndSecondariesfKillTrackAndSecondaries

Kill the current track and also associated secondaries.Kill the current track and also associated secondaries. fSuspendfSuspend

Suspend processing of the current track and push it and its Suspend processing of the current track and push it and its secondaries to the stack.secondaries to the stack.

fPostponeToNextEventfPostponeToNextEvent Postpone processing of the current track to the next event. Postpone processing of the current track to the next event. Secondaries are still being processed within the current event.Secondaries are still being processed within the current event.

Page 30: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 3232

Step statusStep status Step status is attached to G4StepPoint to indicate why that particular Step status is attached to G4StepPoint to indicate why that particular

step was determined.step was determined. Use “Use “PostPostStepPoint” to get the status of this step.StepPoint” to get the status of this step. ““PrePreStepPoint” has the status of the previous step.StepPoint” has the status of the previous step.

fWorldBoundaryfWorldBoundary Step reached the world boundaryStep reached the world boundary

fGeomBoundary fGeomBoundary Step is limited by a volume boundary except the worldStep is limited by a volume boundary except the world

fAtRestDoItProc, fAlongStepDoItProc, fPostStepDoItProcfAtRestDoItProc, fAlongStepDoItProc, fPostStepDoItProc Step is limited by a AtRest, AlongStep or PostStep processStep is limited by a AtRest, AlongStep or PostStep process

fUserDefinedLimit fUserDefinedLimit Step is limited by the user Step limitStep is limited by the user Step limit

fExclusivelyForcedProc fExclusivelyForcedProc Step is limited by an exclusively forced (e.g. shower Step is limited by an exclusively forced (e.g. shower

parameterization) process parameterization) process fUndefined fUndefined

Step not defined yetStep not defined yet

If you want to identify If you want to identify the first step in a volumethe first step in a volume, pick , pick fGeomBoundaryfGeomBoundary status in status in PreStepPointPreStepPoint. .

If you want to identify If you want to identify a step getting out of a volumea step getting out of a volume, pick , pick fGeomBoundaryfGeomBoundary status in status in PostStepPointPostStepPoint

StepPreStepPo

int

PostStepPoint

Page 31: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 3333

Cuts in Geant4Cuts in Geant4 A Cut in Geant4 is a A Cut in Geant4 is a production thresholdproduction threshold..

Not tracking cut, which does not exist in Geant4 as default.Not tracking cut, which does not exist in Geant4 as default. All tracks are traced down to zero kinetic energy.All tracks are traced down to zero kinetic energy.

It is applied It is applied onlyonly for physics processes that have infrared for physics processes that have infrared

divergencedivergence Much detail will be given at later talks on physics.Much detail will be given at later talks on physics.

Page 32: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 3434

Extract useful informationExtract useful information Given geometry, physics and primary track generation, Geant4 does Given geometry, physics and primary track generation, Geant4 does

proper physics simulation “silently”. proper physics simulation “silently”.

You have to add a bit of code to You have to add a bit of code to extract information useful to youextract information useful to you..

There are two ways:There are two ways:

Use user hooks (G4UserTrackingAction, G4UserSteppingAction, Use user hooks (G4UserTrackingAction, G4UserSteppingAction,

etc.)etc.)

You have an access to almost all informationYou have an access to almost all information

Straight-forward, but do-it-yourselfStraight-forward, but do-it-yourself

Use Geant4 scoring functionalityUse Geant4 scoring functionality

Assign Assign G4VSensitiveDetectorG4VSensitiveDetector to a volume to a volume

Hits collectionHits collection is automatically stored in G4Event object, and is automatically stored in G4Event object, and

automatically accumulated if automatically accumulated if user-defined Runuser-defined Run object is used. object is used.

Use user hooks (G4UserEventAction, G4UserRunAction) to get Use user hooks (G4UserEventAction, G4UserRunAction) to get

event / run summaryevent / run summary

Page 33: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 3535

Unit systemUnit system Internal unit system used in Geant4 is completely hidden not only Internal unit system used in Geant4 is completely hidden not only

from user’s code but also from Geant4 source code implementation.from user’s code but also from Geant4 source code implementation.

Each hard-coded number must be multiplied by its proper unit.Each hard-coded number must be multiplied by its proper unit.

radius = 10.0 radius = 10.0 ** cmcm;;

kineticE = 1.0 kineticE = 1.0 ** GeVGeV;;

To get a number, it must be divided by a proper unit.To get a number, it must be divided by a proper unit.

G4cout << eDep G4cout << eDep / MeV/ MeV << “ [MeV]” << G4endl; << “ [MeV]” << G4endl;

Most of commonly used units are provided and user can add his/her Most of commonly used units are provided and user can add his/her

own units.own units.

By this unit system, source code becomes more readable and By this unit system, source code becomes more readable and

importing / exporting physical quantities becomes straightforward.importing / exporting physical quantities becomes straightforward.

For particular application, user can change the internal unit to For particular application, user can change the internal unit to

suitable alternative unit without affecting to the result.suitable alternative unit without affecting to the result.

Page 34: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 3636

G4cout, G4cerrG4cout, G4cerr

G4coutG4cout and and G4cerrG4cerr are are ostream ostream objects defined by Geant4.objects defined by Geant4.

G4endlG4endl is also provided. is also provided.

G4coutG4cout << ”Hello Geant4!” << << ”Hello Geant4!” << G4endlG4endl;;

SomeSome GUIs are buffering output streams so that they display print-outs GUIs are buffering output streams so that they display print-outs

on another window or provide storing / editing functionality.on another window or provide storing / editing functionality.

The user should not use std::cout, etc.The user should not use std::cout, etc.

The user should not use std::cin for input. Use user-defined commands The user should not use std::cin for input. Use user-defined commands

provided by intercoms category in Geant4.provided by intercoms category in Geant4.

Ordinary file I/O is OK.Ordinary file I/O is OK.

Page 35: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 3737

Geant4 kernelGeant4 kernel Geant4 consists of 17 categories.Geant4 consists of 17 categories.

Independently developed and Independently developed and

maintained by WG(s) responsible to maintained by WG(s) responsible to

each category.each category.

Interfaces between categories (e.g. Interfaces between categories (e.g.

top level design) are maintained by top level design) are maintained by

the global architecture WG.the global architecture WG.

Geant4 KernelGeant4 Kernel

Handles run, event, track, step, hit, Handles run, event, track, step, hit,

trajectory.trajectory.

Provides frameworks of geometrical Provides frameworks of geometrical

representation and physics representation and physics

processes.processes.

Geant4

ReadoutVisuali zation

Persis tency

Run

Event

Inter faces

Tracking

Digits + Hits

Processes

Track

Geometry Particle

Graphic _reps

Material

Intercoms

Global

Page 36: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 3838

Geant4 as a state machineGeant4 as a state machine Geant4 has six application states.Geant4 has six application states.

G4State_PreInitG4State_PreInit Material, Geometry, Particle Material, Geometry, Particle

and/or Physics Process need to be and/or Physics Process need to be initialized/definedinitialized/defined

G4State_IdleG4State_Idle Ready to start a runReady to start a run

G4State_GeomClosedG4State_GeomClosed Geometry is optimized and ready Geometry is optimized and ready

to process an eventto process an event G4State_EventProcG4State_EventProc

An event is processingAn event is processing G4State_QuitG4State_Quit

(Normal) termination(Normal) termination G4State_AbortG4State_Abort

A fatal exception occurred and A fatal exception occurred and program is abortingprogram is aborting

PreInit

Idle

EventProc

GeomClosed

Quit

Abort

initialize

beamOnexit

Run

(event loop)

Page 37: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

User classesUser classes

Page 38: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 4040

To use Geant4, you have to…To use Geant4, you have to… Geant4 is a toolkit. You have to build an application.Geant4 is a toolkit. You have to build an application. To make an application, you have toTo make an application, you have to

Define your geometrical setupDefine your geometrical setup Material, volumeMaterial, volume

Define physics to get involvedDefine physics to get involved Particles, physics processes/models Particles, physics processes/models Production thresholdsProduction thresholds

Define how an event startsDefine how an event starts Primary track generationPrimary track generation

Extract information useful to youExtract information useful to you You may also want toYou may also want to

Visualize geometry, trajectories and physics outputVisualize geometry, trajectories and physics output Utilize (Graphical) User InterfaceUtilize (Graphical) User Interface Define your own UI commandsDefine your own UI commands etc.etc.

Page 39: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 4141

User classesUser classes main()main()

Geant4 does not provide Geant4 does not provide main().main(). Initialization classesInitialization classes

Use G4RunManager::Use G4RunManager::SetUserInitializationSetUserInitialization() to define.() to define. Invoked at the initializationInvoked at the initialization

G4VUserDetectorConstructionG4VUserDetectorConstruction G4VUserPhysicsListG4VUserPhysicsList

Action classesAction classes Use G4RunManager::Use G4RunManager::SetUserActionSetUserAction() to define.() to define. Invoked during an event loopInvoked during an event loop

G4VUserPrimaryGeneratorActionG4VUserPrimaryGeneratorAction G4UserRunActionG4UserRunAction G4UserEventActionG4UserEventAction G4UserStackingActionG4UserStackingAction G4UserTrackingActionG4UserTrackingAction G4UserSteppingActionG4UserSteppingAction

Note : classes written in Note : classes written in yellowyellow are are mandatory.mandatory.

Page 40: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 4242

The main programThe main program Geant4 does not provide the Geant4 does not provide the mainmain().().

In your In your main(),main(), you have to you have to

Construct G4RunManager (or your derived class)Construct G4RunManager (or your derived class)

Set user mandatory classes to RunManagerSet user mandatory classes to RunManager

G4VUserDetectorConstructionG4VUserDetectorConstruction

G4VUserPhysicsListG4VUserPhysicsList

G4VUserPrimaryGeneratorActionG4VUserPrimaryGeneratorAction

You can define VisManager, (G)UI session, optional user action You can define VisManager, (G)UI session, optional user action

classes, and/or your persistency manager in your classes, and/or your persistency manager in your main()main()..

Page 41: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 4343

Describe your detectorDescribe your detector Derive your own concrete class from Derive your own concrete class from

G4VUserDetectorConstructionG4VUserDetectorConstruction abstract base class. abstract base class.

In the virtual method In the virtual method Construct()Construct(),,

Instantiate all necessary materialsInstantiate all necessary materials

Instantiate volumes of your detector geometryInstantiate volumes of your detector geometry

Instantiate your sensitive detector classes and set them to Instantiate your sensitive detector classes and set them to

the corresponding logical volumesthe corresponding logical volumes

Optionally you can define Optionally you can define

Regions for any part of your detectorRegions for any part of your detector

Visualization attributes (color, visibility, etc.) of your Visualization attributes (color, visibility, etc.) of your

detector elementsdetector elements

Page 42: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 4444

Select physics processesSelect physics processes Geant4 does not have any default particles or processes.Geant4 does not have any default particles or processes.

Even for the particle transportation, you have to define it Even for the particle transportation, you have to define it

explicitly.explicitly.

Derive your own concrete class from Derive your own concrete class from G4VUserPhysicsListG4VUserPhysicsList

abstract base class.abstract base class.

Define all necessary particlesDefine all necessary particles

Define all necessary processes and assign them to proper Define all necessary processes and assign them to proper

particlesparticles

Define cut-off ranges applied to the world (and each Define cut-off ranges applied to the world (and each

region)region)

Geant4 provides lots of utility classes/methods and examples.Geant4 provides lots of utility classes/methods and examples.

"Educated guess" physics lists for defining hadronic "Educated guess" physics lists for defining hadronic

processes for various use-cases.processes for various use-cases.

Page 43: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 4545

Generate primary eventGenerate primary event Derive your concrete class from Derive your concrete class from G4VUserPrimaryGeneratorActionG4VUserPrimaryGeneratorAction

abstract base class.abstract base class.

Pass a G4Event object to one or more primary generator concrete Pass a G4Event object to one or more primary generator concrete

class objects which generate primary vertices and primary particles.class objects which generate primary vertices and primary particles.

Geant4 provides several generators in addition to the Geant4 provides several generators in addition to the

G4VPrimaryParticlegenerator base class.G4VPrimaryParticlegenerator base class.

G4ParticleGunG4ParticleGun

G4HEPEvtInterface, G4HepMCInterfaceG4HEPEvtInterface, G4HepMCInterface

Interface to /hepevt/ common block or HepMC classInterface to /hepevt/ common block or HepMC class

G4GeneralParticleSourceG4GeneralParticleSource

Define radioactivityDefine radioactivity

Page 44: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 4646

Optional user action classesOptional user action classes All user action classes, methods of which are invoked during “Beam All user action classes, methods of which are invoked during “Beam

On”, must be constructed in the user’s On”, must be constructed in the user’s mainmain() and must be set to the () and must be set to the RunManager.RunManager.

G4UserRunActionG4UserRunAction G4Run* GenerateRun()G4Run* GenerateRun()

Instantiate user-customized run objectInstantiate user-customized run object void BeginOfRunAction(const G4Run*)void BeginOfRunAction(const G4Run*)

Define histogramsDefine histograms void EndOfRunAction(const G4Run*)void EndOfRunAction(const G4Run*)

Analyze the runAnalyze the run Store histogramsStore histograms

G4UserEventActionG4UserEventAction void BeginOfEventAction(const G4Event*)void BeginOfEventAction(const G4Event*)

Event selectionEvent selection void EndOfEventAction(const G4Event*)void EndOfEventAction(const G4Event*)

Output event informationOutput event information

Page 45: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 4747

Optional user action classesOptional user action classes G4UserStackingActionG4UserStackingAction

void PrepareNewEvent()void PrepareNewEvent()

Reset priority controlReset priority control

G4ClassificationOfNewTrack ClassifyNewTrack(const G4ClassificationOfNewTrack ClassifyNewTrack(const

G4Track*)G4Track*)

Invoked every time a new track is pushed Invoked every time a new track is pushed

Classify a new track -- priority controlClassify a new track -- priority control

Urgent, Waiting, PostponeToNextEvent, KillUrgent, Waiting, PostponeToNextEvent, Kill

void NewStage()void NewStage()

Invoked when the Urgent stack becomes emptyInvoked when the Urgent stack becomes empty

Change the classification criteria Change the classification criteria

Event filtering (Event abortion)Event filtering (Event abortion)

Page 46: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 4848

Optional user action classesOptional user action classes G4UserTrackingActionG4UserTrackingAction

void PreUserTrackingAction(const G4Track*)void PreUserTrackingAction(const G4Track*)

Decide trajectory should be stored or notDecide trajectory should be stored or not

Create user-defined trajectoryCreate user-defined trajectory

void PostUserTrackingAction(const G4Track*)void PostUserTrackingAction(const G4Track*)

Delete unnecessary trajectoryDelete unnecessary trajectory

G4UserSteppingActionG4UserSteppingAction

void UserSteppingAction(const G4Step*)void UserSteppingAction(const G4Step*)

Kill / suspend / postpone the trackKill / suspend / postpone the track

Draw the step (for a track not to be stored as a trajectory)Draw the step (for a track not to be stored as a trajectory)

Page 47: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 4949

Let me remind you…Let me remind you… Define material and geometryDefine material and geometry

G4VUserDetectorConstructionG4VUserDetectorConstruction

Material and Geometry lecturesMaterial and Geometry lectures

Select appropriate particles and processes and define production Select appropriate particles and processes and define production

threshold(s)threshold(s)

G4VUserPhysicsListG4VUserPhysicsList

Physics lecturesPhysics lectures

Define the way of primary particle generationDefine the way of primary particle generation

G4VUserPrimaryGeneratorActionG4VUserPrimaryGeneratorAction

Primary particle lecturePrimary particle lecture

Define the way to extract useful information from Geant4Define the way to extract useful information from Geant4

G4UserSteppingAction, G4UserTrackingAction, etc.G4UserSteppingAction, G4UserTrackingAction, etc.

G4VUserDetectorConstruction, G4UserEventAction, G4Run, G4VUserDetectorConstruction, G4UserEventAction, G4Run,

G4UserRunActionG4UserRunAction

G4SensitiveDetector, G4VHit, G4VHitsCollectionG4SensitiveDetector, G4VHit, G4VHitsCollection

Scoring lecturesScoring lectures

Page 48: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 5656

December 2004

Page 49: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 5959December 2004

Page 50: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 6060

Chandra X-ray observatory, Chandra X-ray observatory, with similar orbit, experienced with similar orbit, experienced unexpected degradation of unexpected degradation of CCDs CCDs

Possible effects on XMM?Possible effects on XMM?BaffleBaffle

ss

X-ray X-ray detectorsdetectors

(CCDs)(CCDs)

MirrorMirrorss

Telescope Telescope tubetube

X-ray Multi-Mirror mission X-ray Multi-Mirror mission (XMM)(XMM) Launch December Launch December

19991999 Perigee 7000 kmPerigee 7000 km apogee 114000 kmapogee 114000 km Flight through the Flight through the

radiation belts radiation belts

Page 51: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 6161

astrophysicsastrophysics--ray burstsray bursts

AGILE GLAST

Typical telescope: Tracker Calorimeter Anticoincidence

conversion electron interactions multiple scattering-ray production charged particle tracking

GLAST

GLAST

Page 52: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 6565

Screen shots of gMocrenScreen shots of gMocren

Page 53: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 6767

Page 54: Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial Course @ LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1

Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN)Kernel I - M.Asai (SLAC) and J. Apostolakis (CERN) 6868