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 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. 15 th, 2002 Customizing Run Management.
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.
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.
User Commands Makoto Asai (SLAC) Geant4 Users SLAC Feb. 19th, 2002.
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.
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.
NetSim ZigBee Simulation Code Walkthrough in 10 steps
parameterisation The aim of the exercise is again to build a lead-scintillator calorimeter, this time though the calorimeter will be a trapezoid.
Primary particle Geant4 tutorial Paris, 4-8 June 2007 Giovanni Santin ESA / ESTEC Rhea System SA With material from previous tutorials by Makoto Asai.
17-19 Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan 2007 Geant4 Collaboration.
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.
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.
Learners Support Publications Constructors and Destructors.
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
Detector sensitivity Makoto Asai (SLAC Computing Services)
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
Marc Verderi GEANT4 collaboration meeting 01/10/2002
User Application
The full set of lecture notes of this Geant4 Course is available at
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:

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

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

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 Workshop @ CERN (Nov/15/2002)

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 Workshop @ CERN (Nov/15/2002)

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’ classes. Classes written in red are used directly by G4RunManager. Customizing Run Management - M.Asai (SLAC) - Geant4 Users Workshop @ CERN (Nov/15/2002)

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 Workshop @ CERN (Nov/15/2002)

Constructor / destructor of G4RunManager G4RunManager::G4RunManager() Instantiation and initialization of kernel manager classes 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 Workshop @ CERN (Nov/15/2002)

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 invokation, G4RunManager will automatically invoke this method at the moment of next BeamOn. Customizing Run Management - M.Asai (SLAC) - Geant4 Users Workshop @ CERN (Nov/15/2002)

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 Workshop @ CERN (Nov/15/2002)

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 Workshop @ CERN (Nov/15/2002)

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 Workshop @ CERN (Nov/15/2002)

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 Workshop @ CERN (Nov/15/2002)

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 Workshop @ CERN (Nov/15/2002)

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 Workshop @ CERN (Nov/15/2002)

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 Customizing Run Management - M.Asai (SLAC) - Geant4 Users Workshop @ CERN (Nov/15/2002)