Download presentation
Presentation is loading. Please wait.
1
S. Guatelli, M.G Pia, INFN Genova S. Guatelli ( CERN, INFN Genova ) CERN, 13 November 2002 Users Workshop Where to put analysis in Geant4 Applications With the help of Geant 4 examples! Useful links : http://geant4.web.cern.ch/geant4/G4UsersDocuments/ UsersGuides/UsersGuides/ForApplicationDeveloper/html/index.html http://www.ge.infn.it/geant4/
2
S. Guatelli, M.G Pia, INFN Genova I will show: 1. Which Geant4 User classes are suited for : Book histograms and ntuples Fill histograms and ntuples Store histograms and ntuple in a file 2. Examples and results of analysis in Geant 4 Applications
3
S. Guatelli, M.G Pia, INFN Genova Mandatory user classes Management of Physical Processes Management of Primary Particles Management of the Geometry The user must override their methods to build up a smulation!
4
S. Guatelli, M.G Pia, INFN Genova Optional User Action Run Action Track Stepping Action Event Action
5
S. Guatelli, M.G Pia, INFN Genova
6
Run Action A run is a collection of events that share a common beam and a detector the detector geometry the set up of sensitive detectors the physics processes Within a run, you should keep unchanged G4UserRunAction user action : class from which you can derive your own concrete class RunAction Method beginOfRunAction() invoked at the very end of the beamOn() endOfRunAction() invoked at the beginning of the beamOn() What you can do set a run identification number book histograms set run specific conditions of the sensitive detectors store/print histograms manipulate run summaries Method What you can do
7
S. Guatelli, M.G Pia, INFN Genova Event action Management of the events in terms of tracks of the particles hits collections particle tracking energy deposit EndOfEvent Action Method Visualisation of the tracks Eg. information about
8
S. Guatelli, M.G Pia, INFN Genova Stepping Action PERFORMANCE TIP ! Avoid stepping action if possible and use hits and tracking action. G4Step Delta of position / time between Pre and PostStepPoint Step length Total energy deposited during the step information of the final status of a particle after the completion of a step for example: transient information of the step Tracking Action for example: Position kinetic energy trackID number
9
S. Guatelli, M.G Pia, INFN Genova Brachytherapy example: analysis with AIDA
10
S. Guatelli, M.G Pia, INFN Genova How to build the analysis in a Geant4 Application 1.Management of ntuple and histograms 2.Create the file to store the data 3.Book histos and ntples From brachytherapy example
11
S. Guatelli, M.G Pia, INFN Genova 4. Fill histograms and ntuples 5. Method Finish() Close histo and ntuple Close the file How to build the analysis in a Geant4 Application From brachytherapy example
12
S. Guatelli, M.G Pia, INFN Genova At the beginning of the BeamOn() Run Action: Management of the Analysis At the end of the BeamOn() 1.open the file 2.create the ntuple and the histograms Book Finish 1.close the ntuples and histos 2.close the file From brachytherapy example
13
S. Guatelli, M.G Pia, INFN Genova Information about energy deposit 1.Gets the information about the energy deposit from the Hits Collection Example 1 In the Event Action From brachytherapy example
14
S. Guatelli, M.G Pia, INFN Genova Example 1 3. Gets information of: Energy deposit Spatial coordinates 4. A histogram and a ntuple are filled with energy deposit Now everything is ok ! From brachytherapy example
15
S. Guatelli, M.G Pia, INFN Genova Storage of the energy deposit in a ntuple you can select the energy deposit in planes and represent them in histograms Geometric set-up Brachytherapy example
16
S. Guatelli, M.G Pia, INFN Genova Example of a result Simulation of a radioactive source The energy deposit fills a 2Dhistogram …… Elaboration of the data stored 0.16 mGy =100% Isodose curves Geometric set-up From brachytherapy example
17
S. Guatelli, M.G Pia, INFN Genova Example 2 Histogram of the initial energy of primary particles The information is stored in 1D histo is stored in 1D histo Result From brachytherapy example In the Primary Action Primary particle energy Primary particle energy
18
S. Guatelli, M.G Pia, INFN Genova Example 3 range 1. Particle position when the kinetic energy is zero 3. The information is stored in 1D histo is stored in 1D histo 2. range e- range test S. Guatelli, V. Ivantchenko In the Stepping Action
19
S. Guatelli, M.G Pia, INFN Genova Result Example 3 e- range test S. Guatelli, V. Ivantchenko Range
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.