Introduction to Geant 4 Makoto Asai SLAC Computing

  • Slides: 68
Download presentation
Introduction to Geant 4 Makoto Asai (SLAC Computing Services) Geant 4 Tutorial Course @

Introduction to Geant 4 Makoto Asai (SLAC Computing Services) Geant 4 Tutorial Course @ DESY September 30 th, 2003 Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY

Contents 4 General introduction and brief history 4 Highlights of user applications 4 Geant

Contents 4 General introduction and brief history 4 Highlights of user applications 4 Geant 4 kernel 4 4 Basic concepts and kernel structure 4 User classes Geant 4 user support processes Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 2

General introduction and brief history Introduction to Geant 4 - M. Asai (SLAC) -

General introduction and brief history Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY

What is Geant 4? 4 Geant 4 is the successor of GEANT 3, the

What is Geant 4? 4 Geant 4 is the successor of GEANT 3, the world-standard toolkit for HEP detector simulation. 4 Geant 4 is one of the first successful attempt to re-design a major package of HEP software for the next generation of experiments using an Object-Oriented environment. 4 A variety of requirements also came from heavy ion physics, CP violation physics, cosmic ray physics, astrophysics, space science and medical applications. 4 In order to meet such requirements, a large degree of functionality and flexibility are provided. 4 G 4 is not only for HEP but goes well beyond that. Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 4

Flexibility of Geant 4 4 In order to meet wide variety of requirements from

Flexibility of Geant 4 4 In order to meet wide variety of requirements from various application fields, a large degree of functionality and flexibility are provided. 4 Geant 4 has many types of geometrical descriptions to describe most complicated and realistic geometries 4 4 CSG, BREP, Boolean 4 STEP compliant 4 XML interface Everything is open to the user 4 Choice of physics processes/models 4 Choice of GUI/Visualization/persistency/histogramming technologies Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 5

Physics in Geant 4 4 4 It is rather unrealistic to develop a uniform

Physics in Geant 4 4 4 It is rather unrealistic to develop a uniform physics model to cover wide variety of particles and/or wide energy range. Much wider coverage of physics comes from mixture of theory-driven, parameterized, and empirical formulae. Thanks to polymorphism mechanism, both cross-sections and models (final state generation) can be combined in arbitrary manners into one particular process. 4 Standard EM processes 4 Low energy EM processes 4 Hadronic processes 4 Photon/lepton-hadron processes 4 Optical photon processes 4 Decay processes 4 Shower parameterization 4 Event biasing technique Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 6

Physics in Geant 4 4 Each cross-section table or physics model (final state generation)

Physics in Geant 4 4 Each cross-section table or physics model (final state generation) has its own applicable energy range. Combining more than one tables / models, one physics process can have enough coverage of energy range for wide variety of simulation applications. 4 Geant 4 provides sets of alternative physics models so that the user can freely choose appropriate models according to the type of his/her application. 4 Several individual universities / physicists groups are contributing their physics models to Geant 4. Given the modular structure of Geant 4, developers of each physics model are well recognized and credited. Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 7

Geant 4 – Its history and future 4 Dec ’ 94 - Project start

Geant 4 – Its history and future 4 Dec ’ 94 - Project start 4 Apr ’ 97 - First alpha release 4 Jul ’ 98 - First beta release 4 Dec ’ 98 - Geant 4 0. 0 release 4 Jul ’ 99 - Geant 4 0. 1 release 4 … 4 Jun ’ 03 - Geant 4 5. 2 release 4 Dec ’ 03 - Geant 4 6. 0 release (planned) 4 We currently provide two to three public releases and beta releases bimonthly in between public releases every year. Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 8

HARP Geant 4 Collaboration Univ. Barcelona Lebedev Helsinki Inst. Ph. PPARC Collaborators also from

HARP Geant 4 Collaboration Univ. Barcelona Lebedev Helsinki Inst. Ph. PPARC Collaborators also from nonmember institutions, including Budker Inst. of Physics IHEP Protvino MEPHI Moscow Pittsburg University Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 9

Highlights of Users Applications Introduction to Geant 4 - M. Asai (SLAC) - Sept.

Highlights of Users Applications Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY

Geant 4 in HEP 4 ATLAS (CERN-LHC) 4 22 x 44 m 3 4

Geant 4 in HEP 4 ATLAS (CERN-LHC) 4 22 x 44 m 3 4 15, 000 ton     4 4 million channels 4 40 MHz readout Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 11

Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY

Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 12

Geant 4 for beam transportation Introduction to Geant 4 - M. Asai (SLAC) -

Geant 4 for beam transportation Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 13

Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY

Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 14

Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY

Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 15

Geant 4 in space science Cosmic rays, jovian electrons ESA Space Environment & Effects

Geant 4 in space science Cosmic rays, jovian electrons ESA Space Environment & Effects Analysis Section X-Ray Surveys of Asteroids and Moons Solar X-rays, e, p Geant 3. 21 G 4 “standard” Courtesy SOHO EIT Induced X-ray line emission: indicator of target composition (~100 mm surface layer) Geant 4 low-E C, N, O line emissions included Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 16

ESA Space Environment & Effects Analysis Section DESIRE (Dose Estimation by Simulation of the

ESA Space Environment & Effects Analysis Section DESIRE (Dose Estimation by Simulation of the ISS · · · Radiation Environment) KTH Stockholm, ESTEC, EAC, NASA Johnson Prediction of the ambient energetic particle environment (SPENVIS & additional models) Construction of COLUMBUS geometry in Geant 4 Radiation transport, including secondary particle production, through the geometry Calculation of astronaut radiation doses Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 17

Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY

Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 18

Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY

Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 19

For next generation linear collider experiment of N. Graf (SLAC) Introduction to Geant 4

For next generation linear collider experiment of N. Graf (SLAC) Introduction to Geant 4 - M. Asai (SLAC)Courtesy - Sept. 30, 2003 @ DESY 20

Courtesy of N. Graf (SLAC) Introduction to Geant 4 - M. Asai (SLAC) -

Courtesy of N. Graf (SLAC) Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 21

Courtesy of N. Graf (SLAC) Introduction to Geant 4 - M. Asai (SLAC) -

Courtesy of N. Graf (SLAC) Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 22

Courtesy of N. Graf (SLAC) Introduction to Geant 4 - M. Asai (SLAC) -

Courtesy of N. Graf (SLAC) Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 23

Basic concepts and kernel structure Introduction to Geant 4 - M. Asai (SLAC) -

Basic concepts and kernel structure Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY

Geant 4 kernel 4 Geant 4 consists of 17 categories. 4 Geant 4 Independently

Geant 4 kernel 4 Geant 4 consists of 17 categories. 4 Geant 4 Independently developed and maintained by WG(s) responsible to Visuali zation each category. 4 Run Persis tency Interfaces between categories (e. g. top level design) are maintained by Inter faces Readout Event Tracking the global architecture WG. 4 Digits + Hits Geant 4 Kernel 4 Handles run, event, track, step, hit, trajectory. 4 Processes Track Geometry Particle Graphic _reps Material Provides frameworks for geometrical representation and physics processes. Intercoms Global Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 25

Run in Geant 4 4 4 As an analogy of the real experiment, a

Run in Geant 4 4 4 As an analogy of the real experiment, a run of Geant 4 starts with “Beam On”. Within a run, the user cannot change 4 detector geometry 4 settings of physics processes ---> detector is inaccessible during a run 4 4 4 Conceptually, a run is a collection of events which share the same detector conditions. At the beginning of a run, geometry is optimized for navigation and cross-section tables are calculated according to materials appear in the geometry and the cut-off values defined. G 4 Run. Manager class manages processing a run, a run is represented by G 4 Run class or a user-defined class derived from G 4 Run. Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 26

Event in Geant 4 4 At beginning of processing, an event contains primary particles.

Event in Geant 4 4 At beginning of processing, an event contains primary particles. These primaries are pushed into a stack. 4 When the stack becomes empty, processing of an event is over. 4 G 4 Event. Manager class manages processing an event. 4 G 4 Event class represents an event. It has following objects at the end of its processing. 4 List of primary vertexes and particles (as input) 4 Hits collections 4 Trajectory collection (optional) 4 Digits collections (optional) Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 27

Track in Geant 4 4 Track is a snapshot of a particle. 4 4

Track in Geant 4 4 Track is a snapshot of a particle. 4 4 Step is a “delta” information to a track. 4 4 4 it goes out of the world volume 4 it disappears (e. g. decay) 4 it goes down to zero kinetic energy and no “At. Rest” additional process is required the user decides to kill it No track object persists at the end of event. 4 4 Track is not a collection of steps. Track is deleted when 4 4 It has only position and physical quantities of current instance. For the record of track, use trajectory class objects. G 4 Tracking. Manager manages processing a track, a track is represented by G 4 Track class. Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 28

Step in Geant 4 4 4 Step has two points and also “delta” information

Step in Geant 4 4 4 Step has two points and also “delta” information of a particle (energy loss on the step, time-of-flight spent by the step, etc. ). Each point knows the volume (and material). In case a step is limited by a volume boundary, the end point physically stands on the boundary, and it logically belongs to the next volume. 4 4 Because one step knows materials of two volumes, boundary processes such as transition radiation or refraction could be simulated. G 4 Stepping. Manager class manages processing a step, a step is represented by G 4 Step class. Boundary Step Begin of step point End of step point Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 29

Particle in Geant 4 4 4 A particle in Geant 4 is represented in

Particle in Geant 4 4 4 A particle in Geant 4 is represented in three layers of classes. G 4 Track 4 Position, geometrical information, etc. 4 This is a class representing a particle to be tracked. G 4 Dynamic. Particle 4 "Dynamic" physical properties of a particle, such as momentum, energy, spin, etc. 4 Each G 4 Track object has its own and unique G 4 Dynamic. Particle object. 4 This is a class representing an individual particle (which is not necessarily to be tracked). G 4 Particle. Definition 4 "Static" properties of a particle, such as charge, mass, life time, decay channels, etc. 4 G 4 Process. Manager which describes processes involving to the particle 4 All G 4 Dynamic. Particle objects of same kind of particle share the same G 4 Particle. Definition. Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 30

Tracking and processes 4 Geant 4 tracking is general. 4 4 It is independent

Tracking and processes 4 Geant 4 tracking is general. 4 4 It is independent to 4 the particle type 4 the physics processes involving to a particle It gives the chance to all processes 4 To contribute to determining the step length 4 To contribute any possible changes in physical quantities of the track 4 To generate secondary particles 4 To suggest changes in the state of the track 4 e. g. to suspend, postpone or kill it. Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 31

Processes in Geant 4 4 In Geant 4, particle transportation is a process as

Processes in Geant 4 4 In Geant 4, particle transportation is a process as well, by which a particle interacts with geometrical volume boundaries and field of any kind. 4 Because of this, shower parameterization process can take over from the ordinary transportation without modifying the transportation process. 4 Each particle has its own list of applicable processes. At each step, all processes listed are invoked to get proposed physical interaction lengths. 4 The process which requires the shortest interaction length (in spacetime) limits the step. 4 All processes are derived from G 4 VProcess abstract base class. Each particle has its individual G 4 Process. Manager class object which holds a vector of assigned processes. Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 32

Process and step 4 4 Each process has one or combination of the following

Process and step 4 4 Each process has one or combination of the following natures. 4 At. Rest 4 e. g. muon decay at rest 4 Along. Step 4 e. g. Celenkov process 4 Post. Step 4 e. g. decay on the fly Each process involving to a step replies a concrete object of G 4 Particle. Change which affects on a step/track. Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 33

4 4 4 Volume Three conceptual layers 4 G 4 VSolid -- shape, size

4 4 4 Volume Three conceptual layers 4 G 4 VSolid -- shape, size 4 G 4 Logical. Volume -- daughter physical volumes, 4 material, sensitivity, user limits, etc. G 4 VPhysical. Volume -- position, rotation Hierarchal three layers of geometry description allows maximum reuse of information to minimize the use of memory space. Detector sensitivity should be described by the user in his/her concrete implementation of G 4 VSensitive. Detector and set to G 4 Logical. Volume. G 4 VSolid G 4 Box G 4 Tubs G 4 Logical. Volume G 4 Material G 4 Vis. Attributes G 4 VSensitive. Detector G 4 VPhysical. Volume G 4 PVPlacement G 4 PVParameterised Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 34

How Geant 4 runs (one step) Stepping Manager Physics Process Particle Change Step Track

How Geant 4 runs (one step) Stepping Manager Physics Process Particle Change Step Track Logical Volume Sensitive Detector Get. Physical. Interaction. Length Select. Shortest Do. It Fill Update Is. Sensitive Generate. Hits Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 35

Cuts in Geant 4 4 4 A Cut in Geant 4 is a production

Cuts in Geant 4 4 4 A Cut in Geant 4 is a production threshold. 4 Only for physics processes that have infrared divergence 4 Not tracking cut, which does not exist in Geant 4 Energy threshold must be determined at which discrete energy loss is replaced by continuous loss 4 Old way: 4 Track primary particle until cut-off energy is reached, calculate continuous loss and dump it at that point, stop tracking primary 4 Create secondaries only above cut-off energy, or add to continuous loss of primary for less energetic secondaries 4 Geant 4 way: 4 Specify range (which is converted to energy for each material) at which continuous loss begins, track primary down to zero range 4 Create secondaries only above specified range, or add to continuous loss of primary for secondaries of less energetic and not reaching to the volume boundary Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 36

Energy cut vs. range cut 4 4 4 500 Me. V/c proton in liq.

Energy cut vs. range cut 4 4 4 500 Me. V/c proton in liq. Ar (4 mm) / Pb (4 mm) sampling calorimeter Geant 3 (energy cut) 4 Ecut = 450 ke. V Geant 4 (range cut) 4 Rcut = 1. 5 mm 4 Corresponds to Ecut in liq. Ar = 450 ke. V, Ecut in Pb = 2 Me. V liq. Ar Pb Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 37

Range cut vs. geometrical safety 4 4 Even though a secondary is less energetic

Range cut vs. geometrical safety 4 4 Even though a secondary is less energetic than the defined range cut, it can penetrate to the next volume (and actual range can be longer than the range cut) if it is born close to the geometrical boundary. Range cut is applied only if the range of the particle is shorter than the geometrical safety. 4 4 Pb CO 2 Such particle cannot penetrate. Geometrical safety is the isotropic shortest distance to the geometrical boundary. Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 38

Field integration 4 4 In order to propagate a particle inside a field (e.

Field integration 4 4 In order to propagate a particle inside a field (e. g. magnetic, electric or both), we solve the equation of motion of the particle in the field. We use a Runge-Kutta method for the integration of the ordinary differential equations of motion. 4 Several Runge-Kutta ‘steppers’ are available. In specific cases other solvers can also be used: 4 In a uniform field, using the analytical solution. 4 In a nearly uniform field (Bgs. Transportation/future) 4 In a smooth but varying field, with new RK+helix. Using the method to calculate the track's motion in a field, Geant 4 breaks up this curved path into linear chord segments. 4 We determine the chord segments so that they closely approximate the curved path. ‘Tracking’ Step Chords Real Trajectory Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 39

Tracking in field 4 4 4 We use the chords to interrogate the G

Tracking in field 4 4 4 We use the chords to interrogate the G 4 Navigator, to see whether the track has crossed a volume boundary. User can set the accuracy of the volume intersection, 4 By setting a parameter called the “miss distance” 4 It is a measure of the error in whether the approximate track intersects a volume. One physics/tracking step can create several chords. 4 In some cases, one step consists of several helix turns. ‘Tracking’ Step Real Trajectory Chords "miss distance" Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 40

Stack 4 Track is a class object, thus it is easy to treat suspending

Stack 4 Track is a class object, thus it is easy to treat suspending or postponing tracks. For example, 4 4 4 Suspend tracks at the entrance of calorimeter, i. e. simulate all tracks in tracking region before generating showers. Suspend a “looper” track after certain time and postpone it to next event. Prioritized tracking without performance cost Stacks are managed by G 4 Stack. Manager with user's G 4 User. Stacking. Action. Well-thought prioritization/abortion of tracks/events makes entire simulation process much more efficient. Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 41

Geant 4 as a state machine 4 Geant 4 has six application states. 4

Geant 4 as a state machine 4 Geant 4 has six application states. 4 G 4 State_Pre. Init 4 Material, Geometry, Particle and/or Physics Process need to be initialized/defined 4 G 4 State_Idle 4 Ready to start a run 4 G 4 State_Geom. Closed 4 Geometry is optimized and ready to process an event 4 G 4 State_Event. Proc 4 An event is processing 4 G 4 State_Quit 4 (Normal) termination 4 G 4 State_Abort 4 A fatal exception occurred and program is aborting Pre. Init initialize Idle beam. On exit Geom. Closed Quit Event. Proc Abort Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 42

Unit system 4 4 Internal unit system used in Geant 4 is completely hidden

Unit system 4 4 Internal unit system used in Geant 4 is completely hidden not only from user’s code but also from Geant 4 source code implementation. Each hard-coded number must be multiplied by its proper unit. radius = 10. 0 * cm; kinetic. E = 1. 0 * Ge. V; 4 To get a number, it must be divided by a proper unit. G 4 cout << e. Dep / Me. V << “ [Me. V]” << G 4 endl; 4 4 Most of commonly used units are provided and user can add his/her own units. By this unit system, source code becomes more readable and importing / exporting physical quantities becomes straightforward. 4 For particular application, user can change the internal unit to suitable alternative unit without affecting to the result. Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 43

G 4 cout, G 4 cerr 4 G 4 cout and G 4 cerr

G 4 cout, G 4 cerr 4 G 4 cout and G 4 cerr are ostream objects defined by Geant 4. 4 4 G 4 endl is also provided. Some GUIs are buffering output streams so that they display print-outs on another window or provide storing / editing functionality. 4 4 The user should not use std: : cout, etc. The user should not use std: : cin for input. Use user-defined commands provided by intercoms category in Geant 4. Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 44

User classes Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003

User classes Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY

User classes 4 4 4 Initialization classes 4 Invoked at the initialization 4 G

User classes 4 4 4 Initialization classes 4 Invoked at the initialization 4 G 4 VUser. Detector. Construction 4 G 4 VUser. Physics. List Action classes 4 Invoked during an event loop 4 G 4 VUser. Primary. Generator. Action 4 G 4 User. Run. Action 4 G 4 User. Event. Action 4 G 4 User. Stacking. Action 4 G 4 User. Tracking. Action 4 G 4 User. Stepping. Action main() 4 Geant 4 does not provide main(). Note : classes written in yellow are mandatory. Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 46

Describe your detector 4 4 Derive your own concrete class from G 4 VUser.

Describe your detector 4 4 Derive your own concrete class from G 4 VUser. Detector. Construction abstract base class. In the virtual method Construct(), 4 Instantiate all necessary materials 4 Instantiate volumes of your detector geometry 4 4 Instantiate your sensitive detector classes and set them to the corresponding logical volumes Optionally you can define 4 4 Regions for any part of your detector Visualization attributes (color, visibility, etc. ) of your detector elements Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 47

Select physics processes 4 4 4 Geant 4 does not have any default particles

Select physics processes 4 4 4 Geant 4 does not have any default particles or processes. 4 Even for the particle transportation, you have to define it explicitly. Derive your own concrete class from G 4 VUser. Physics. List abstract base class. 4 Define all necessary particles 4 Define all necessary processes and assign them to proper particles 4 Define cut-off ranges applied to the world (and each region) Geant 4 provides lots of utility classes/methods and examples. 4 "Educated guess" physics lists for defining hadronic processes for various use-cases. Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 48

Generate primary event 4 4 4 Derive your concrete class from G 4 VUser.

Generate primary event 4 4 4 Derive your concrete class from G 4 VUser. Primary. Generator. Action abstract base class. Pass a G 4 Event object to one or more primary generator concrete class objects which generate primary vertices and primary particles. Geant 4 provides several generators in addition to the G 4 VPrimary. Particlegenerator base class. 4 G 4 Particle. Gun 4 G 4 HEPEvt. Interface, G 4 Hep. MCInterface 4 to /hepevt/ common block or Hep. MC class G 4 General. Particle. Source 4 Define radioactivity Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 49

Optional user action classes 4 4 4 All user action classes, methods of which

Optional user action classes 4 4 4 All user action classes, methods of which are invoked during “Beam On”, must be constructed in the user’s main() and must be set to the Run. Manager. G 4 User. Run. Action 4 G 4 Run* Generate. Run() 4 Instantiate user-customized run object 4 void Begin. Of. Run. Action(const G 4 Run*) 4 Define histograms 4 void End. Of. Run. Action(const G 4 Run*) 4 Store histograms G 4 User. Event. Action 4 void Begin. Of. Event. Action(const G 4 Event*) 4 Event selection 4 Define histograms 4 void End. Of. Event. Action(const G 4 Event*) 4 Analyze the event Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 50

Optional user action classes 4 G 4 User. Stacking. Action 4 void Prepare. New.

Optional user action classes 4 G 4 User. Stacking. Action 4 void Prepare. New. Event() 4 Reset 4 priority control G 4 Classification. Of. New. Track Classify. New. Track(const G 4 Track*) 4 Invoked 4 Classify every time a new track is pushed a new track -- priority control 4 Urgent, 4 Waiting, Postpone. To. Next. Event, Kill void New. Stage() 4 Invoked 4 Change 4 Event when the Urgent stack becomes empty the classification criteria filtering (Event abortion) Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 51

Optional user action classes 4 G 4 User. Tracking. Action 4 4 4 void

Optional user action classes 4 G 4 User. Tracking. Action 4 4 4 void Pre. User. Tracking. Action(const G 4 Track*) 4 Decide trajectory should be stored or not 4 Create user-defined trajectory void Post. User. Tracking. Action(const G 4 Track*) G 4 User. Stepping. Action 4 void User. Stepping. Action(const G 4 Step*) 4 Kill / suspend / postpone the track 4 Draw the step (for a track not to be stored as a trajectory) Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 52

The main program 4 Geant 4 does not provide the main(). 4 In your

The main program 4 Geant 4 does not provide the main(). 4 In your main(), you have to 4 Construct G 4 Run. Manager (or your derived class) 4 Set user mandatory classes to Run. Manager 4 G 4 VUser. Detector. Construction 4 G 4 VUser. Physics. List 4 G 4 VUser. Primary. Generator. Action 4 You can define Vis. Manager, (G)UI session, optional user action classes, and/or your persistency manager in your main(). Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 53

Select (G)UI 4 4 In your main(), according to your computer environments, construct a

Select (G)UI 4 4 In your main(), according to your computer environments, construct a G 4 UIsession concrete class provided by Geant 4 and invoke its session. Start() method. Geant 4 provides 4 G 4 UIterminal -- C- and TC-shell like character terminal 4 G 4 GAG -- Tcl/Tk or Java PVM based GUI 4 G 4 Wo -- Opacs 4 G 4 JAG -- Interface to JAS (Java Analysis Studio) 4 G 4 UIBatch -- Batch job with macro file Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 54

Visualization 4 4 Derive your own concrete class from G 4 VVis. Manager according

Visualization 4 4 Derive your own concrete class from G 4 VVis. Manager according to your computer environments. Geant 4 provides interfaces to graphics drivers 4 DAWN -- Fukui renderer 4 WIRED 4 Ray. Tracer -- Ray tracing by Geant 4 tracking 4 OPACS 4 Open. GL 4 Open. Inventor 4 VRML Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 55

Environment variables 4 You need to set following environment variables to compile, link and

Environment variables 4 You need to set following environment variables to compile, link and execute Geant 4 -based simulation. 4 Mandatory variables 4 G 4 SYSTEM – OS (e. g. Linux-g++) 4 G 4 INSTALL – base directory of Geant 4 4 G 4 WORKDIR – your temporary work space 4 CLHEP_BASE_DIR 4 – base directory of CLHEP Variables for physics processes in case corresponding processes are used 4 G 4 LEVELGAMMADATA 4 G 4 LEDATA - photon evaporation - cross-sections for Low-E EM module 4 G 4 RADIOACTIVEDATA - radioactive decay 4 Neutron. HPCross. Sections 4 - neutron cross-section Additional variables for GUI/Vis/Analysis Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 56

(Graphical) User Interfaces 4 4 Geant 4 kernel is independent to any specific GUI

(Graphical) User Interfaces 4 4 Geant 4 kernel is independent to any specific GUI technology. Geant 4 provides several alternative (G)UIs or interfaces to external GUI packages. The user can choose one or more of them according to computer environment / need. 4 4 4 Character terminal (csh and tcsh(bash)-like terminal) Xm, Xaw, Win 32, variations of the upper terminals by using a Motif, Athena or Windows widget to retrieve commands GAG, a fully Graphical User Interface and its extension Gain. Server of the client/server type OPACS, an OPACS/Wo widget manager implementation in conjunction with the OPACS visualization system. JAG, an interface to JAS (Java Analysis Studio) User can connect his/her own GUI to Geant 4 Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 57

Visualization 4 4 4 Geant 4 kernel is independent to any specific visualization technology.

Visualization 4 4 4 Geant 4 kernel is independent to any specific visualization technology. Geant 4 provides several alternative visualization drivers or interfaces to external visualization drivers. The user can choose one or more of them according to computer environment / need. 4 Open. GL viewers 4 Fukui. Renderer (DAWN) 4 VRML builder 4 WIRED 4 Wo, Xo (OPACS) 4 Open. Inventor. X (OIX) 4 Ray. Tracer 4 User can connect his/her own visualization driver to Geant 4 Some example figures are given with introduction of users applications in this presentation Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 58

User Support Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003

User Support Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY

User Support 4 Geant 4 Collaboration offers extensive user supports. 4 Users workshops 4

User Support 4 Geant 4 Collaboration offers extensive user supports. 4 Users workshops 4 Tutorial courses 4 Hyper. News and mailing list 4 Bug reporting system 4 Requirements tracking system 4 Daily “private” communications 4 New implementation - Technical Forum Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 60

Geant 4 users workshop 4 Users workshops were held or are going to be

Geant 4 users workshop 4 Users workshops were held or are going to be held hosted by several institutes for various user communities. 4 KEK - Dec. 2000, Jul. 2001, Mar. 2002, Jul. 2002, Mar. 2003, Jul. 2003 4 SLAC - Feb. 2002 4 Spain (supported by INFN) - Jul. 2002 4 CERN - Nov. 2002 4 ESA - Jan. 2003, Jan. 2004 (planned) 4 dedicated 4 4 to space-related users Helsinki - Oct. 2003 Local workshops of one or two days were held or are planned at several places. Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 61

Geant 4 tutorials / lectures 4 4 In addition to the users workshops, many

Geant 4 tutorials / lectures 4 4 In addition to the users workshops, many tutorial courses and lectures with some discussion time slots were held for various user communities. 4 CERN School of Computing 4 Italian National School for HEP/Nuclear Physicists 4 MC 2000 4 MCNEG workshop 4 KEK, SLAC, DESY, FNAL, INFN, Frascati, Karolinska, Gran. Sasso, etc. 4 ATLAS, CMS, LHCb 4 Tutorials/lectures at universities 4 U. K. - Imperial 4 Italy - Genoa, Bologna, Udine, Roma, Trieste Near future tutorial courses 4 DESY (Sept. 30 - Oct. 02, 2003) 4 IEEE NSS/MIC @ Portland, Oregon (Oct. 19, 2003) 4 FNAL (Oct. 27 - Oct. 29, 2003) Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 62

Hyper. News 4 Hyper. News system was set up in April 2001 Introduction to

Hyper. News 4 Hyper. News system was set up in April 2001 Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 63

Hyper. News 4 4 19 categories Not only “userdeveloper”, but also “user-user” information exchanges

Hyper. News 4 4 19 categories Not only “userdeveloper”, but also “user-user” information exchanges are quite intensive. Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 64

Hyper. News is quite active Introduction to Geant 4 - M. Asai (SLAC) -

Hyper. News is quite active Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 65

Some postings are novice… Introduction to Geant 4 - M. Asai (SLAC) - Sept.

Some postings are novice… Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 66

Some are excellent users contribution Introduction to Geant 4 - M. Asai (SLAC) -

Some are excellent users contribution Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 67

Technical Forum 4 4 In the Technical Forum, the Geant 4 Collaboration, its user

Technical Forum 4 4 In the Technical Forum, the Geant 4 Collaboration, its user community and resource providers discuss: 4 major user and developer requirements, user and developer priorities, software implementation issues, prioritized plans, physics validation issues, user support issues The Technical Forum is open to all interested parties 4 To be held at least 4 times per year (in at least two locales) The purpose of the forum is to: 4 Achieve, as much as possible, a mutual understanding of the needs and plans of users and developers. 4 Provide the Geant 4 Collaboration with the clearest possible understanding of the needs of its users. 4 Promote the exchange of information about physics validation performed by Geant 4 Collaborators and Geant 4 users. 4 Promote the exchange of information about user support provided by Geant 4 Collaborators and Geant 4 user communities. First Technical Forum meeting at TRIUMF during this collaboration meeting, followed by one at CERN in October. Introduction to Geant 4 - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 68