Geant4 Cross Reference |
1 ------------------------------------------------------------------- 2 3 ========================================================= 4 Geant4 - an Object-Oriented Toolkit for Simulation in HEP 5 ========================================================= 6 7 TestEm12 8 -------- 9 10 11 How to plot a depth dose profile in spherical geometry. 12 13 14 1- GEOMETRY DEFINITION 15 16 The geometry consists of a single sphere of an homogenous material. 17 Optionally, the sphere can be divided in thin shells. 18 19 3 parameters define the geometry : 20 - the material of the sphere, 21 - the radius of the sphere (absorRadius), 22 - the number of shells (nbOfLayers) 23 24 In addition a transverse uniform magnetic field can be applied. 25 26 The default geometry is constructed in DetectorConstruction class, 27 but all of the above parameters can be changed interactively via 28 the commands defined in the DetectorMessenger class. 29 30 2- PHYSICS LIST 31 32 Physics Lists are based on modular design. Several modules are instantiated: 33 1. Transportation 34 2. EM physics 35 3. Decays 36 4. StepMax - for step limitation 37 38 The following options for EM physics using builders from physics_lists 39 sub-package are available: 40 - "emstandard_opt0" recommended standard EM physics for LHC 41 - "emstandard_opt1" best CPU performance standard physics for LHC 42 - "emstandard_opt2" similar fast simulation 43 - "emstandard_opt3" best standard EM options - analog to "local" above 44 - "emstandard_opt4" best current advanced EM options standard + lowenergy 45 - "emstandardWVI" standard EM physics and WentzelVI multiple scattering 46 - "emstandardSS" standard EM physics and single scattering model 47 - "emstandardGS" standard EM physics and Goudsmit-Saunderson multiple scatt. 48 - "emlivermore" low-energy EM physics using Livermore data 49 - "empenelope" low-energy EM physics implementing Penelope models 50 - "emlowenergy" low-energy EM physics implementing experimental 51 low-energy models 52 - "dna" process and models for Geant4-DNA 53 - "dna_opt1" process and models for Geant4-DNA 54 - "dna_opt2" process and models for Geant4-DNA 55 - "dna_opt3" process and models for Geant4-DNA 56 - "dna_opt4" process and models for Geant4-DNA 57 - "dna_opt5" process and models for Geant4-DNA 58 - "dna_opt6" process and models for Geant4-DNA 59 - "dna_opt7" process and models for Geant4-DNA 60 61 A local builder, PhysListEmStandard "local" (similar to opt0) is also 62 available. 63 64 Physics lists and options can be (re)set with UI commands 65 66 3- AN EVENT : THE PRIMARY GENERATOR 67 68 The primary kinematic consists of a single particle randomly shot at 69 the centre of the sphere. The type of the particle and its energy are set 70 in the PrimaryGeneratorAction class, and can be changed via the G4 71 built-in commands of ParticleGun class (see the macros provided with 72 this example). 73 74 In addition one can deactivate the randomness of the direction of the 75 incident particle. The corresponding interactive command is built in 76 PrimaryGeneratorMessenger class. 77 78 A RUN is a set of events. 79 80 4- VISUALIZATION 81 82 The Visualization Manager is set in the main(). 83 The initialisation of the drawing is done via the commands 84 /vis/... in the macro vis.mac. To get visualisation: 85 > /control/execute vis.mac 86 87 The detector has a default view which is a longitudinal view of the 88 box. 89 90 The tracks are drawn at the end of event, and erased at the end of run. 91 Optionally one can choose to draw all particles, only the charged ones, 92 or none. This command is defined in EventActionMessenger class. 93 94 5- HOW TO START ? 95 96 - execute TestEm12 in 'batch' mode from macro files 97 % TestEm12 run01.mac 98 99 - execute TestEm12 in 'interactive mode' with visualization 100 % TestEm12 101 .... 102 Idle> type your commands 103 .... 104 Idle> exit 105 106 Macros provided in this example: 107 - berger.mac: e- (100 keV) on water 108 - dna.mac: e- (1 keV) on water. DNA physics list 109 - run01.mac: e- (4 MeV) on water. Step max from histos 1 and 8 110 - run02.mac: e- (4 MeV) on water. Step max from geometry 111 112 Macros to be run interactively: 113 - vis.mac: To activate visualization 114 115 6- TRACKING and STEP MAX 116 117 TestDm12 computes the total energy deposited along the trajectory of 118 the incident particle : the so-called longitudinal energy profile, 119 or depth dose distribution. 120 The energy deposited (edep) is randomly distributed along the step (see 121 SteppingAction). 122 123 In order to control the accuracy of the deposition, the maximum step size 124 of charged particles is computed automatically from the binning of 125 histograms 1 and 8 (see RunAction). 126 127 As an example, this limitation is implemented as a 'full' process : 128 see StepMax class and its Messenger. The 'StepMax process' is registered 129 in the Physics List. 130 131 StepMax is evaluated in RunAction::BeginOfRun() and passed 132 to the StepMax process. 133 A boolean UI command allows to deactivate this mechanism. 134 Another UI command allows to define directly a stepMax value. 135 136 7- HISTOGRAMS 137 138 Testem12 has several predefined 1D histograms : 139 140 1 : energy profile dE/dr (in MeV/mm per event) 141 2 : total energy deposited in the absorber 142 3 : total track length of the primary track 143 4 : step size of the primary track 144 5 : projected range of the primary track 145 6 : total track length of charged secondary tracks 146 7 : step size of charged secondary tracks 147 8 : normalized energy profile d(E/E0)/d(r/r0), where r0 is the range of 148 the primary particle of energy E0 149 150 The histograms are managed by G4AnalysisManager class and its Messenger. 151 The histos can be individually activated with the command : 152 /analysis/h1/set id nbBins valMin valMax unit 153 where unit is the desired unit for the histo (MeV or keV, deg or mrad, etc..) 154 155 One can control the name of the histograms file with the command: 156 /analysis/setFileName name (default testem12) 157 158 It is possible to choose the format of the histogram file : root (default), 159 xml, csv, by using namespace in HistoManager.hh 160 161 It is also possible to print selected histograms on an ascii file: 162 /analysis/h1/setAscii id 163 All selected histos will be written on a file name.ascii (default testem12)