| 1 | $Id: README,v 1.11 2009/09/22 15:18:20 maire Exp $
|
|---|
| 2 | -------------------------------------------------------------------
|
|---|
| 3 |
|
|---|
| 4 | =========================================================
|
|---|
| 5 | Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
|---|
| 6 | =========================================================
|
|---|
| 7 |
|
|---|
| 8 | TestEm12
|
|---|
| 9 | --------
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 | How to plot a depth dose profile in spherical geometry.
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 | 1- GEOMETRY DEFINITION
|
|---|
| 16 |
|
|---|
| 17 | The geometry consists of a single sphere of an homogenous material.
|
|---|
| 18 | Optionally, the sphere can be divided in thin shells.
|
|---|
| 19 |
|
|---|
| 20 | 3 parameters define the geometry :
|
|---|
| 21 | - the material of the sphere,
|
|---|
| 22 | - the radius of the sphere (absorRadius),
|
|---|
| 23 | - the number of shells (nbOfLayers)
|
|---|
| 24 |
|
|---|
| 25 | In addition a transverse uniform magnetic field can be applied.
|
|---|
| 26 |
|
|---|
| 27 | The default geometry is constructed in DetectorConstruction class,
|
|---|
| 28 | but all of the above parameters can be changed interactively via
|
|---|
| 29 | the commands defined in the DetectorMessenger class.
|
|---|
| 30 |
|
|---|
| 31 | 2- PHYSICS LIST
|
|---|
| 32 |
|
|---|
| 33 | Physics lists can be local (eg. in this example) or from G4 kernel
|
|---|
| 34 | physics_lists subdirectory.
|
|---|
| 35 |
|
|---|
| 36 | Local physics lists:
|
|---|
| 37 | - "local" standard EM physics with current 'best' options setting.
|
|---|
| 38 |
|
|---|
| 39 | From geant4/source/physics_lists/builders:
|
|---|
| 40 | - "emstandard_opt0" recommended standard EM physics for LHC
|
|---|
| 41 | - "emstandard_opt1" best CPU performance standard physics for LHC
|
|---|
| 42 | - "emstandard_opt2"
|
|---|
| 43 | - "emstandard_opt3" best current advanced EM options.
|
|---|
| 44 | analog to "local" above
|
|---|
| 45 | - "emlivermore" low-energy EM physics using Livermore data
|
|---|
| 46 | - "empenelope" low-energy EM physics implementing Penelope models
|
|---|
| 47 |
|
|---|
| 48 | Physics lists and options can be (re)set with UI commands
|
|---|
| 49 |
|
|---|
| 50 | Please, notice that options set through G4EmProcessOPtions are global, eg
|
|---|
| 51 | for all particle types. In G4 builders, it is shown how to set options per
|
|---|
| 52 | particle type.
|
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 | 3- AN EVENT : THE PRIMARY GENERATOR
|
|---|
| 56 |
|
|---|
| 57 | The primary kinematic consists of a single particle randomly shooted at
|
|---|
| 58 | the centre of the sphere. The type of the particle and its energy are set
|
|---|
| 59 | in the PrimaryGeneratorAction class, and can be changed via the G4
|
|---|
| 60 | build-in commands of ParticleGun class (see the macros provided with
|
|---|
| 61 | this example).
|
|---|
| 62 |
|
|---|
| 63 | In addition one can desactivate the randomness of the direction of the
|
|---|
| 64 | incident particle. The corresponding interactive command is built in
|
|---|
| 65 | PrimaryGeneratorMessenger class.
|
|---|
| 66 |
|
|---|
| 67 | A RUN is a set of events.
|
|---|
| 68 |
|
|---|
| 69 |
|
|---|
| 70 | 4- VISUALIZATION
|
|---|
| 71 |
|
|---|
| 72 | The Visualization Manager is set in the main().
|
|---|
| 73 | The initialisation of the drawing is done via the commands
|
|---|
| 74 | /vis/... in the macro vis.mac. To get visualisation:
|
|---|
| 75 | > /control/execute vis.mac
|
|---|
| 76 |
|
|---|
| 77 | The detector has a default view which is a longitudinal view of the
|
|---|
| 78 | box.
|
|---|
| 79 |
|
|---|
| 80 | The tracks are drawn at the end of event, and erased at the end of run.
|
|---|
| 81 | Optionaly one can choose to draw all particles, only the charged one,
|
|---|
| 82 | or none. This command is defined in EventActionMessenger class.
|
|---|
| 83 |
|
|---|
| 84 |
|
|---|
| 85 | 5- HOW TO START ?
|
|---|
| 86 |
|
|---|
| 87 | - compile and link to generate an executable
|
|---|
| 88 | % cd geant4/examples/extended/electromagnetic/TestEm1
|
|---|
| 89 | % gmake
|
|---|
| 90 |
|
|---|
| 91 | - execute TestEm12 in 'batch' mode from macro files
|
|---|
| 92 | % TestEm12 run01.mac
|
|---|
| 93 |
|
|---|
| 94 | - execute TestEm12 in 'interactive mode' with visualization
|
|---|
| 95 | % TestEm12
|
|---|
| 96 | ....
|
|---|
| 97 | Idle> type your commands
|
|---|
| 98 | ....
|
|---|
| 99 | Idle> exit
|
|---|
| 100 |
|
|---|
| 101 | 6- TRACKING and STEP MAX
|
|---|
| 102 |
|
|---|
| 103 | Testem12 computes the total energy deposited along the trajectory of
|
|---|
| 104 | the incident particle : the so-called longitudinal energy profile,
|
|---|
| 105 | or depth dose distribution.
|
|---|
| 106 | The energy deposited (edep) is randomly distribued along the step (see
|
|---|
| 107 | SteppingAction).
|
|---|
| 108 |
|
|---|
| 109 | In order to control the accuracy of the deposition, the maximum step size
|
|---|
| 110 | of charged particles is computed automatically from the binning of
|
|---|
| 111 | histograms 1 and 8 (see HistoManager).
|
|---|
| 112 |
|
|---|
| 113 | As an example, this limitation is implemented as a 'full' process :
|
|---|
| 114 | see StepMax class and its Messenger. The 'StepMax process' is registered
|
|---|
| 115 | in the Physics List.
|
|---|
| 116 |
|
|---|
| 117 | In RunAction::BeginOfRun() the stepMax value is passed from the
|
|---|
| 118 | HistoManager to the StepMax process.
|
|---|
| 119 | A boolean UI command allows to desactivate this mechanism.
|
|---|
| 120 |
|
|---|
| 121 | 7- HISTOGRAMS
|
|---|
| 122 |
|
|---|
| 123 | Testem12 has several predefined 1D histograms :
|
|---|
| 124 |
|
|---|
| 125 | 1 : energy profile dE/dr (in MeV/mm per event)
|
|---|
| 126 | 2 : total energy deposited in the absorber
|
|---|
| 127 | 3 : total track length of the primary track
|
|---|
| 128 | 4 : step size of the primary track
|
|---|
| 129 | 5 : projected range of the primary track
|
|---|
| 130 | 6 : total track length of charged secondary tracks
|
|---|
| 131 | 7 : step size of charged secondary tracks
|
|---|
| 132 | 8 : normalized energy profile d(E/E0)/d(r/r0), where r0 is the range of
|
|---|
| 133 | the primary particle of energy E0
|
|---|
| 134 |
|
|---|
| 135 | The histograms are managed by the HistoManager class and its Messenger.
|
|---|
| 136 | The histos can be individually activated with the command :
|
|---|
| 137 | /testem/histo/setHisto id nbBins valMin valMax unit
|
|---|
| 138 | where unit is the desired unit for the histo (MeV or keV, deg or mrad, etc..)
|
|---|
| 139 |
|
|---|
| 140 | One can control the name of the histograms file with the command:
|
|---|
| 141 | /testem/histo/setFileName name (default testem12)
|
|---|
| 142 |
|
|---|
| 143 | It is possible to choose the format of the histogram file (hbook, root, XML)
|
|---|
| 144 | with the command /testem/histo/setFileType (root by default)
|
|---|
| 145 |
|
|---|
| 146 | It is also possible to print selected histograms on an ascii file:
|
|---|
| 147 | /testem/histo/printHisto id
|
|---|
| 148 | All selected histos will be written on a file name.ascii (default testem12)
|
|---|
| 149 |
|
|---|
| 150 | Note that, by default, histograms are disabled. To activate them, uncomment
|
|---|
| 151 | the flag G4ANALYSIS_USE in GNUmakefile.
|
|---|
| 152 |
|
|---|
| 153 |
|
|---|
| 154 | 8- USING HISTOGRAMS
|
|---|
| 155 |
|
|---|
| 156 | To use histograms, at least one of the AIDA implementations should be
|
|---|
| 157 | available. See InstallAida.txt
|
|---|