Makoto Asai (SLAC) Geant4 Users CERN Nov. 15 th, 2002 Customizing Run Management.

Slides:



Advertisements
Similar presentations
Geant4 v9.2p02 Speed up Makoto Asai (SLAC) Geant4 Tutorial Course.
Advertisements

First Step on User Commands Makoto Asai (SLAC) Geant4 Users CERN Nov. 11th, 2002.
Contents o Introduction o Characteristics of Constructor. o Types of constructor. - Default Constructor - Parameterized Constructor - Copy Constructor.
IEEE Nuclear Science Symposium and Medical Imaging Conference Short Course The Geant4 Simulation Toolkit Sunanda Banerjee (Saha Inst. Nucl. Phys., Kolkata,
Geant4 v9.2p02 User Interface II Makoto Asai (SLAC) Geant4 Tutorial Course.
Geant4 v9.2p02 Particle Gun Makoto Asai (SLAC) Geant4 Tutorial Course.
Geant4 v9.2p02 Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course.
Improvement of G4Exception (and an announcement on G4ApplicationState) Makoto Asai (SLAC) on behalf of Architecture team.
Primary particle generation Makoto Asai (SLAC) Geant4 Users CERN Nov. 12 th, 2002.
Makoto Asai (SLAC) Geant4 Users SLAC Feb. 18 th, 2002 Getting Started.
Makoto Asai (SLAC) Geant4 Users CERN Nov. 12 th, 2002 Detector Sensitivity.
Geant4 v9.4 Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course.
Makoto Asai (SLAC) Geant4 Users CERN Nov. 11 th, 2002 Getting Started.
Makoto Asai (SLAC) Geant4 Users SLAC Feb. 18 th, 2002 Getting Started.
Highlights of latest developments ESA/ESTEC Makoto Asai (SLAC)
Geant4 v9.3p01 Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course.
Makoto Asai (SLAC) Geant4 Users SLAC Feb. 20th, 2002 Stack management, Digitization and Pile-up.
Makoto Asai (SLAC) Geant4 Tutorial Course
Geant4 v9.3 Scoring II Makoto Asai (SLAC) Geant4 Tutorial Course.
Primary particle generation Makoto Asai (SLAC) Geant4 Users SLAC Feb. 18 th, 2002.
Makoto Asai (SLAC) Geant4 Users CERN Nov. 13th, 2002 Stack management, Digitization and Pile-up.
Some tips for geometries of medical applications Makoto Asai (SLAC)
Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course Geant4 v8.2p01.
A introduction Luciano Pandola INFN-LNGS Partially based on a presentation by G.A.P. Cirrone (INFN-LNS) and M.G. Pia (INFN-Ge) Queen’s University, Belfast.
parameterisation The aim of the exercise is again to build a lead-scintillator calorimeter, this time though the calorimeter will be a trapezoid.
17-19 Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan 2007 Geant4 Collaboration.
Physics I: Physics Lists Geant4 Tutorial at Jefferson Lab 10 July 2012 Dennis Wright (SLAC) Geant4 9.6 beta.
1 Primary particles Geant4 User's Tutorial CERN, February 2010 Talk from previous tutorial by Giovanni Santin Ecole Geant4, Annecy 2008.
Geant4 Training 2003 Basic structure of the Geant4 Simulation Toolkit The full set of lecture notes of this Geant4 Course is available.
Introduction to Geant4 Makoto Asai (SLAC) Geant4 Tutorial CERN May 25-27, 2005 May 2005, Geant4 v7.0p01.
Basic Structure of the Geant4 Simulation Toolkit
Primary particle Giovanni Santin ESA / ESTEC and RheaTech Ltd On behalf of the Geant4 collaboration Ecole Geant4 Annecy, and Nov 2008 With.
UI command Makoto Asai (SLAC) Geant4 Tutorial CERN May 25-27, 2005 May 2005, Geant4 v7.0p01.
Geant4 internal Classes and Objects Gunter Folger / CERN Geant4 course, Annecy 2008 User Action & Information Classes.
User Application Toolkit + User application toolkit Geant4 is a toolkit –i.e. you cannot “run” it out of the box –You must write.
User Application Luciano Pandola INFN-LNGS Partially based on a presentation by Maria Grazia Pia (INFN-Ge)
Geant4 internal Classes and Objects Geant4 Users’ Tutorial February 2010 Gunter Folger / CERN User Action & Information Classes.
Geant4 versus External Frameworks Approaches, Requirements and Constraints ATLAS, LHCb, CMS, Alice M. Stavrianakou CERN/CMC Geant4  -review
Maria Grazia Pia INFN Genova Salamanca, July 2002
Run and Event G4Run and G4RunManager In Geant4, the Run is the largest unit of simulation and it consist of a series of events Within a Run, the detector.
Architecture team and Inter-category design/interface Makoto Asai (SLAC) 10/Oct/2002 Geant4 delta-review.
17-19 Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan 2007 Geant4 Collaboration.
Makoto Asai (SLAC) Getting Started MGP: added class diagram of basic user application.
Geant4 release 5.1 summary Gabriele Cosmo EP/SFT.
Constructors and Destructors
Interaction with the Geant4 kernel
J. Apostolakis, M. Asai, G. Cosmo, A. Howard
Interaction with the Geant4 kernel
Geant4 Geometry Objects Persistency using ROOT
Basics of a user application
Makoto Asai (SLAC) Geant4 Tutorial Course
Makoto Asai (SLAC) Geant4 Tutorial Course
Primary Particle Generation
Makoto Asai (SLAC) Geant4 Users CERN Nov. 11th, 2002
G.A.P.Cirrone, S.E.Mazzaglia - INFN/LNS, Italy
Primary Particle Generation
Makoto Asai (SLAC) Geant4 Tutorial Course
Constructors and Destructors
The n-3He Simulation Using Geant4
User Application
The n-3He Simulation Using Geant4
User Application
Mantis a framework and toolkit for Geant4 simulation in CMS
User Application
The full set of lecture notes of this Geant4 Course is available at
Customizing Run Management
The full set of lecture notes of this Geant4 Course is available at
Primary particle Makoto Asai (SLAC Computing Services)
The full set of lecture notes of this Geant4 Course is available at
Makoto Asai (SLAC) Geant4 Users CERN Nov. 13th, 2002
Presentation transcript:

Makoto Asai (SLAC) Geant4 Users CERN Nov. 15 th, 2002 Customizing Run Management

Customizing Run Management - M.Asai (SLAC) - Geant4 Users CERN (Nov/15/2002) 2 G4RunManager Basic flow of Geant4 kernel Structure of G4RunManager Contents

Customizing Run Management - M.Asai (SLAC) - Geant4 Users CERN (Nov/15/2002) 3 G4RunManager G4RunManager is the only manager class in Geant4 kernel from which the user is allowed / expected to inherit and create his / her own customized manager. For large HEP experiments, it is rather mandatory to make their own customized managers. For connecting to their specific frameworks For their persistency solutions Etc. G4RunManager is well structured and almost all of its methods are virtual. Thus the user can easily overwrite some of its methods for customization while keep utilizing other methods given in the base class.

Customizing Run Management - M.Asai (SLAC) - Geant4 Users CERN (Nov/15/2002) 4 How Geant4 runs w.r.t. run management Instantiation Instantiation / initialization of manager classes Initialization Construction of material and geometry Construction of particles, physics processes Calculation of cross-section tables “ Beam-On ” = “ Run ” Close geometry --> Optimize geometry Event Loop Termination Deletion of manager classes

Customizing Run Management - M.Asai (SLAC) - Geant4 Users CERN (Nov/15/2002) 5 Initialization

6 Beam on (event loop) loop

Customizing Run Management - M.Asai (SLAC) - Geant4 Users CERN (Nov/15/2002) 7 User classes Initialization classes - Invoked at the initialization G4VUserDetectorConstruction G4VUserPhysicsList Action classes - Invoked during the event loop G4VUserPrimaryGeneratorAction G4UserRunAction G4UserEventAction G4UserStackingAction G4UserTrackingAction G4UserSteppingAction Classes with yellow underlines are “ mandatory ” user classes. Classes written in red are used exclusively by G4RunManager.

Customizing Run Management - M.Asai (SLAC) - Geant4 Users CERN (Nov/15/2002) 8 G4ApplicationState Geant4 is a state machine. It has seven states, PreInit, Init, Idle, GeomClosed, EventProc, Quit and Abort. All state changes except Abort are triggered by G4RunManager. Abort state is triggered by G4Exception. Note that the state of Geant4 is always EventProc while an event is processing. Other five states ( PreInit, Init, Idle, GeomClosed and Quit ) are for the sake of proper handling of run management.

Customizing Run Management - M.Asai (SLAC) - Geant4 Users CERN (Nov/15/2002) 9 Constructor / destructor of G4RunManager G4RunManager::G4RunManager() Instantiation and initialization of kernel manager classes virtual G4RunManager::~G4RunManager() Deletion of kernel manager classes Orders of instantiation and deletion of kernel manager classes are important to avoid conflicts. By deriving G4RunManager, these constructor and destructor are used to ensure the correct ordering.

Customizing Run Management - M.Asai (SLAC) - Geant4 Users CERN (Nov/15/2002) 10 Methods in G4RunManager for initialization virtual void Initialize(); This method invokes all the necessary initialization procedures. This method invokes three granular methods, InitializeGeometry(), InitializePhysics() and InitializeCutOff(). After some event loops, the user can invoke this method once again. It is rather mandatory if the user changes geometry, physics process, and/or cut off value(s). If the user forget the second invocation, G4RunManager will automatically invoke this method at the moment of next BeamOn.

Customizing Run Management - M.Asai (SLAC) - Geant4 Users CERN (Nov/15/2002) 11 Methods in G4RunManager for initialization virtual void InitializeGeometry(); This method invokes user’s concrete G4VUserDetectorConstruction::Construct(). Then the world volume is set to G4Navigator through G4RunManager::DefineWorldVolume() method. Note that all materials must be constructed before start calculating cross-section tables.

Customizing Run Management - M.Asai (SLAC) - Geant4 Users CERN (Nov/15/2002) 12 Methods in G4RunManager for initialization virtual void InitializePhysics(); This method invokes user’s G4VUserPhysicsList::Construct(). Note that all particles must be defined and all processes must be properly assigned to them before start calculating cross-section tables. virtual void InitializeCutOff(); This method invokes user’s G4VUserPhysicsList::SetCut() to calculate cross-section tables.

Customizing Run Management - M.Asai (SLAC) - Geant4 Users CERN (Nov/15/2002) 13 Methods in G4RunManager for event loop virtual void BeamOn(); This method starts an event loop. The condition of Geant4 is examined before starting the event loop. This method invokes four granular methods, ConfirmBeamOnCondition(), RunInitialization(), DoEventLoop() and RunTermination(). According to the second and third arguments of BeamOn method, a macro file will be read at the end of each event.

Customizing Run Management - M.Asai (SLAC) - Geant4 Users CERN (Nov/15/2002) 14 Methods in G4RunManager for event loop virtual G4bool ConfirmBeamOnCondition(); Confirms initialization, re-initialization if needed virtual void RunInitialization(); Closes geometry virtual void DoEventLoop(); Manages an event loop Invokes two granular methods, GenerateEvent() and AnalyzeEvent() for each event virtual void RunTermination(); Opens geometry

Customizing Run Management - M.Asai (SLAC) - Geant4 Users CERN (Nov/15/2002) 15 Methods in G4RunManager for one event virtual G4Event* GenerateEvent(); Instantiates G4Event object Invokes user’s G4VUserPrimaryGeneratorAction virtual void AnalyzeEvent(); Basically does nothing as default Invokes G4VPersistencyManager if the user defines a concrete class Allows access to more than one events for, for example, event pile-up.

Customizing Run Management - M.Asai (SLAC) - Geant4 Users CERN (Nov/15/2002) 16 Future plans We believe G4RunManager is well modularized for most of the cases. So that the user can easily derive his/her own concrete (customized) RunManager by just overwriting some of its virtual methods. G4RunManager contains both some mandatory procedures to use Geant4 kernel and also some utility functionalities to make the user easy to use Geant4. We understand there exists a requirement from CMS to split mandatory procedures from utilities.

Customizing Run Management - M.Asai (SLAC) - Geant4 Users CERN (Nov/15/2002) 17 Future plans To meet this requirement from CMS, we are studying to split G4RunManager into three classes. G4RunManager Keeps all methods in its header file so that ordinary users do not need to change anything Is to be re-implemented to use following two classes G4RunManagerCore Has all mandatory procedures to use Geant4 kernel G4RunManagerUtilities Has most of utility functionalities which the current G4RunManager has, and which are still useful to experienced users