Where to put analysis in Geant 4 Applications



















- Slides: 19
Where to put analysis in Geant 4 Applications With the help of Geant 4 examples! Useful links: http: //geant 4. web. cern. ch/geant 4/G 4 Users. Documents/ Users. Guides/For. Application. Developer/html/index. html http: //www. ge. infn. it/geant 4/ S. Guatelli, M. G Pia, INFN Genova S. Guatelli ( CERN, INFN Genova ) CERN, 13 November 2002 Users Workshop
I will show: 1. Which Geant 4 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 S. Guatelli, M. G Pia, INFN Genova
Mandatory user classes q Management of Physical Processes q Management of Primary Particles q Management of the Geometry The user must override their methods to build up a smulation! S. Guatelli, M. G Pia, INFN Genova
Optional User Action Run Action Event Action Stepping Action Track S. Guatelli, M. G Pia, INFN Genova
S. Guatelli, M. G Pia, INFN Genova
A run is a collection of events that share Run Action a common beam and a detector G 4 User. Run. Action user action : class from which you can derive your own concrete class Run. Action §the detector geometry Within a run, you should keep unchanged §the set up of sensitive detectors §the physics processes Method What you can do • set a run identification number begin. Of. Run. Action() • book histograms invoked at the beginning of the beam. On() Method • set run specific conditions of the sensitive detectors What you can do end. Of. Run. Action() S. Guatelli, Genova invoked at the M. G very. Pia, end. INFN of the beam. On() • store/print histograms • manipulate run summaries
Event action Method End. Of. Event Action Management of the events in terms of tracks of the particles Eg. information about §hits collections §particle tracking §energy deposit Visualisation of the tracks S. Guatelli, M. G Pia, INFN Genova
Stepping Action transient information of the step q G 4 Step Delta of position / time between Pre and Post. Step. Point for example: q Step length q Total energy deposited during the step Tracking Action information of the final status of a particle after the completion of a step q Position for example: q kinetic energy q track. ID number PERFORMANCE TIP ! Avoid stepping action if possible and use hits and tracking action. S. Guatelli, M. G Pia, INFN Genova
Brachytherapy example: analysis with AIDA S. Guatelli, M. G Pia, INFN Genova
How to build the analysis in a Geant 4 Application From brachytherapy example S. Guatelli, M. G Pia, INFN Genova 1. Management of ntuple and histograms 2. Create the file to store the data 3. Book histos and ntples
How to build the analysis in a Geant 4 Application 4. Fill histograms and ntuples 5. Method Finish() ü Close histo and ntuple From brachytherapy example S. Guatelli, M. G Pia, INFN Genova ü Close the file
Run Action: Management of the Analysis q Book q Finish From brachytherapy example At the beginning of the Beam. On() At the end of the Beam. On() S. Guatelli, M. G Pia, INFN Genova 1. open the file 2. create the ntuple and the histograms 1. close the ntuples and histos 2. close the file
Information about energy deposit Example 1 From brachytherapy example 1. In the Event Action S. Guatelli, M. G Pia, INFN Genova Gets the information about the energy deposit from the Hits Collection
Example 1 From brachytherapy example 3. Gets information of: üEnergy deposit üSpatial coordinates 4. A histogram and a ntuple are filled with energy deposit Now everything is ok ! 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 S. Guatelli, M. G Pia, INFN Genova Brachytherapy example
Geometric set -up Example of a result Simulation of a radioactive source From brachytherapy example The energy deposit fills a 2 Dhistogram … … Elaboration of the data stored 0. 16 m. Gy =100% Isodose curves S. Guatelli, M. G Pia, INFN Genova
Example 2 From brachytherapy example Histogram of the initial energy of primary particles Primary particle energy The information is stored in 1 D histo In the Primary Action S. Guatelli, M. G Pia, INFN Genova Result
Example 3 e- range test S. Guatelli, V. Ivantchenko range 1. Particle position when the kinetic energy is zero 2. range 3. The information is stored in 1 D histo S. Guatelli, M. G Pia, INFN Genova In the Stepping Action
Range Example 3 e- range test S. Guatelli, V. Ivantchenko Result S. Guatelli, M. G Pia, INFN Genova