Geant4 Cross Reference |
1 ------------------------------------------------------------------- 2 3 ========================================================= 4 Geant4 - an Object-Oriented Toolkit for Simulation in HEP 5 ========================================================= 6 7 TestEm2 8 ------- 9 10 How to do shower profiles in an homogenous medium, with virtual 11 voxelisation. 12 13 1- GEOMETRY DEFINITION 14 15 The geometry consists of a cylinder of homogenous material. 16 17 The default geometry is constructed in DetectorConstruction class, 18 but all of the above parameters can be modified interactively via 19 the commands defined in the DetectorMessenger class. 20 21 Material can be choosen: Air Water lAr Al Fe BGO PbWO4 Pb. 22 eg: /testem/det/setMat PbWO4 23 24 The cylinder is virtually sliced longitudinally (slice) and radially 25 (ring). The size of the slices and rings are expressed in radiation 26 length units and can be changed. 27 eg: /testem/det/setLbin 20 1. ---> 20 slices of 1. radl 28 /testem/det/setRbin 5 0.25 ---> 5 rings of 0.25 radl 29 /testem/det/update ---> rebuild the geometry 30 31 (MaxBin = 500 in both directions) 32 33 An uniform magnetic field along the cylinder axis can be set. 34 eg: /globalField/setValue 0 0 5 tesla 35 36 2- PHYSICS LISTS 37 38 Physics lists are based on modular design. Several modules are instantiated: 39 1. Transportation 40 2. EM physics 41 3. Decays 42 4. StepMax - for step limitation 43 44 EM physics builders can be local (eg. in this example) or from G4 kernel 45 physics_lists subdirectory. 46 47 Local physics builders: 48 - "local" standard EM physics with current 'best' options setting. 49 these options are explicited in PhysListEmStandard 50 51 From geant4/source/physics_lists/builders: 52 - "emstandard_opt0" recommended standard EM physics for LHC 53 - "emstandard_opt1" best CPU performance standard physics for LHC 54 - "emstandard_opt2" similar fast simulation 55 - "emstandard_opt3" best standard EM options - analog to "local" above 56 - "emstandard_opt4" best current advanced EM options standard + lowenergy 57 - "emstandardWVI" standard EM physics and WentzelVI multiple scattering 58 - "emstandardSS" standard EM physics and single scattering model 59 - "emlivermore" low-energy EM physics using Livermore data 60 - "empenelope" low-energy EM physics implementing Penelope models 61 - "emlowenergy" low-energy EM physics implementing experimental 62 low-energy models 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 which hits the 69 cylinder perpendicular to the input face. The type of the particle 70 and its energy are set in the PrimaryGeneratorAction class, and can 71 changed via the G4 build-in commands of G4ParticleGun class (see 72 the macros provided with this example). 73 74 A RUN is a set of events. 75 76 4- VISUALIZATION 77 78 The Visualization Manager is set in the main() (see TestEm2.cc). 79 The initialisation of the drawing is done via the commands 80 /vis/.. in the macro vis.mac. In interactive session: 81 PreInit or Idle > /control/execute vis.mac 82 83 The detector has a default view which is a longitudinal view of the 84 cylinder. 85 86 The tracks are drawn at the end of event, and erased at the end of run. 87 Optionally one can choose to draw all particles, only the charged one, 88 or none. This command is defined in EventActionMessenger class. 89 90 5- PHYSICS DEMO 91 92 The particle's type and the physics processes which will be available 93 in this example are set in PhysicsList class. 94 95 In addition a build-in interactive command (/process/inactivate procname) 96 allows to activate/inactivate the processes one by one. 97 98 The threshold for producing secondaries can be changed. 99 eg: /testem/phys/setCuts 100 microm 100 /run/initialize 101 102 The shower profiles are histogramed, if histograming is activated. 103 They can be also printed with the command /testem/run/verbose 1 104 105 6- HOW TO START ? 106 107 - Execute TestEm2 in 'batch' mode from macro files 108 % TestEm2 run01.mac 109 110 - Execute TestEm2 in 'batch' mode using multi-threading 111 % TestEm2 run01.mac 4 112 here 4 is number of threads, it should be user defined, 113 optimal value depends on hardware 114 115 - Execute TestEm2 in 'interactive mode' with visualization 116 % TestEm2 117 .... 118 Idle> type your commands 119 .... 120 Idle> exit 121 122 123 Macros provided in this example: 124 - egs4.mac: 125 Fe; L = 20 radl; R = 5 radl; electron 30 GeV 126 (EGS4 simulation: Particle Data Group - Phys.Rev.D 50-3 - August94) 127 - run01.mac: PbWO4; L = 20 radl; R = 5 radl; electron 5 GeV 128 - run02.mac: Al; L = 13.5 radl; R = 1.35 radl; electron 1 GeV 129 (Electron-induced cascade showers: J&H Crannel - Phys. Rev. 184-2 - August69) 130 - run03.mac: H2O; L = 9.97 radl; R = 0.665 radl; electron 1 GeV 131 (Electron-induced cascade showers: J&H Crannel - Phys. Rev. 184-2 - August69) 132 - test.mac: PbWO4; L = 20 radl; R = 5 radl; electron 5 GeV 133 - stepMax.mac: chargedgeantino in PbWO4; To illustrate step max mechanism; 134 - vis.mac: to activate visualization 135 136 7- HISTOGRAMS 137 138 TestEm2 produces several histograms: 139 140 Content of these histo: 141 142 1 : energy deposit per event 143 2 : charged track length per event 144 3 : neutral track length per event 145 146 4 : longitudinal energy profile 147 5 : rms of longitudinal energy profile 148 6 : cumulated longitudinal energy profile 149 7 : rms of cumulated longitudinal energy profile 150 151 8 : radial energy profile 152 9 : rms of radial energy profile 153 10 : cumulated radial energy profile 154 11 : rms of cumulated radial energy profile 155 156 To define the output file name with histograms, use the UI command : 157 158 "/analysis/setFileName name" 159 160 The format of the histogram file can be : root (default), 161 xml, csv, by selecting g4nnn.hh in RunAction.hh 162