Makoto Asai (SLAC) Getting Started MGP: added class diagram of basic user application.

Slides:



Advertisements
Similar presentations
The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.
Advertisements

IEEE Nuclear Science Symposium and Medical Imaging Conference Short Course The Geant4 Simulation Toolkit Sunanda Banerjee (Saha Inst. Nucl. Phys., Kolkata,
山下智弘 JST CREST/ 神戸大学 Borrowing especially from presentations of M. Asai(SLAC) Geant4 Japan Oct, RCNS, based on Geant4 9.0.p01.
Geant4 v9.2p02 Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course.
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.
Primary particle generation Makoto Asai (SLAC) Geant4 Users SLAC Feb. 18 th, 2002.
Makoto Asai (SLAC) Geant4 Tutorial Course
Introduction and Getting Started ESA/ESTEC Makoto Asai (SLAC)
Makoto Asai (SLAC) Geant4 Users CERN Nov. 15 th, 2002 Customizing Run Management.
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.
Geant4 v9.3p01 Kernel I 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.
Software Installation, release 4.0 Geant4 Users’ Workshop Tutorial SLAC February 18-22, 2002 Takashi Sasaki, Gabriele Cosmo,
Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course Geant4 v8.2p01.
Software Installation The full set of lecture notes of this Geant4 Course is available at
Introduction to Geant4 Makoto Asai (SLAC) Geant4 Tutorial Course the 2nd Finnish Geant4 Workshop June , Helsinki Institute of Physics June 2005,
IEEE Nuclear Science Symposium and Medical Imaging Conference Short Course The Geant4 Simulation Toolkit Sunanda Banerjee (Saha Inst. Nucl. Phys., Kolkata,
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.
Introduction to Geant4 John Apostolakis (CERN) Geant4 Tutorial LAPP, Nov 2008 Original slides by Makoto Asai (SLAC) Geant4 ver 9.1.
15/Jul/054th Workshop on Geant4 Bio-medical Developments and Physics Validation 1 Python Interface for Geant4 Medical Applications K.Murakami (KEK) 15/Jul/05.
Primary particle Geant4 tutorial Paris, 4-8 June 2007 Giovanni Santin ESA / ESTEC Rhea System SA With material from previous tutorials by Makoto Asai.
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.
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.
Maria Grazia Pia INFN Genova Salamanca, July 2002
Basics of Primary Particle Generation and Tracking Makoto Asai (SLAC) Geant4 Tutorial CERN May 25-27, 2005 May 2005, Geant4 v7.0p01.
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.
Geant4 Training 2003 Primary Particle Generation The full set of lecture notes of this Geant4 Course is available at
Geant4 internal Classes and Objects Gunter Folger / CERN MC-PAD, DESY/Hamburg January 2010 User Action & Information Classes.
Introduction to Geant4 Makoto Asai (SLAC) Geant4 Tutorial Course the 2nd Finnish Geant4 Workshop June , Helsinki Institute of Physics June 2005,
Interaction with the Geant4 kernel
Pablo Cirrone INFN-LNS
Pablo Cirrone INFN-LNS
Makoto Asai (SLAC) Geant4 Tutorial Course
Interaction with the Geant4 kernel
Basics of a user application
Geant4:User Actions and Analysis
Introduction to Geant4 Makoto Asai (SLAC Computing Services)
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
Software Installation
Makoto Asai (SLAC) Geant4 Tutorial Course
The n-3He Simulation Using Geant4
User Application
The n-3He Simulation Using Geant4
User Application
User Application
The full set of lecture notes of this Geant4 Course is available at
Software Installation, release 4.0
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
Visualisation and (G)UI
Simulation in Experiments searching for rare events
Presentation transcript:

Makoto Asai (SLAC) Getting Started MGP: added class diagram of basic user application

User classes Initialization classes Invoked at the initialization G4VUserDetectorConstruction G4VUserPhysicsList Action classes Invoked during the event loop G4VUserPrimaryGeneratorAction G4UserRunAction G4UserEventAction G4UserStackingAction G4UserTrackingAction G4UserSteppingAction

Mandatory user classes Part 3 Mandatory user classes

The main program Geant4 does not provide the main(). In your main(), you have to Construct G4RunManager (or your derived class) Set user mandatory classes to RunManager G4VUserDetectorConstruction G4VUserPhysicsList G4VUserPrimaryGeneratorAction You can define VisManager, (G)UI session, optional user action classes, and/or your persistency manager in your main().

Describe your detector Derive your own concrete class from G4VUserDetectorConstruction abstract base class. In the virtual method Construct(), Construct all necessary materials Construct volumes of your detector geometry Construct your sensitive detector classes and set them to the detector volumes Optionally you can define visualization attributes of your detector elements.

Select physics processes Geant4 does not have any default particles or processes. Even for the particle transportation, you have to define it explicitly. Derive your own concrete class from G4VUserPhysicsList abstract base class. Define all necessary particles Define all necessary processes and assign them to proper particles Define cut-off ranges Geant4 provides lots of utility classes/methods.

Generate primary event Derive your concrete class from G4VUserPrimaryGeneratorAction abstract base class. Pass a G4Event object to one or more primary generator concrete class objects which generate primary vertices and primary particles. Geant4 provides three generators. G4ParticleGun G4HEPEvtInterface Interface to /hepevt/ common block via ascii file G4GeneralParticleSource PYTHIA interface will be available quite soon when C++ version of PYTHIA is ready. Interface to HepMC is planned. User can implement his/her own generator. Large experiments has their own event record structure.

Environment variables You need to set following environment variables to compile, link and run Geant4-based simulation. Mandatory variables G4SYSTEM – OS (e.g. Linux-g++) G4INSTALL – base directory of Geant4 G4WORKDIR – your temporary work space CLHEP_BASE_DIR – base directory of CLHEP Variable for physics processes G4LEVELGAMMADATA – directory of PhotonEvaporation data Additional variables for GUI/Vis/Analysis

Select (G)UI In your main(), taking into account your computer environments, construct a G4UIsession concrete class provided by Geant4 and invoke its sessionStart() method. Geant4 provides G4UIterminal -- Csh or Tcsh like character terminal G4GAG -- Tcl/Tk or Java PVM based GUI G4Wo -- Opacs G4UIBatch -- Batch job with macro file Others…

Visualization Derive your own concrete class from G4VVisManager according to your computer environments. Geant4 provides interfaces to graphics drivers DAWN -- Fukui renderer WIRED RayTracer -- Ray tracing by Geant4 tracking OPACS OpenGL OpenInventor VRML

Optional user classes Part 4 Optional user classes

Optional user action classes 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 RunManager. G4UserRunAction BeginOfRunAction(const G4Run*) Define histograms EndOfRunAction(const G4Run*) Store histograms

Optional user action classes G4UserEventAction BeginOfEventAction(const G4Event*) Event selection Define histograms EndOfEventAction(const G4Event*) Analyze the event

Optional user action classes G4UserStackingAction PrepareNewEvent() Reset priority control ClassifyNewTrack(const G4Track*) Invoked every time a new track is pushed Classify a new track -- priority control Urgent, Waiting, PostponeToNextEvent, Kill NewStage() Invoked when the Urgent stack becomes empty Change the classification criteria Event filtering (Event abortion)

Optional user action classes G4UserTrackingAction PreUserTrackingAction(const G4Track*) Decide trajectory should be stored or not Create user-defined trajectory PostUserTrackingAction(const G4Track*) G4UserSteppingAction UserSteppingAction(const G4Step*) Kill / suspend / postpone the track Draw the step (for a track not to be stored by a trajectory)