Geant4 Cross Reference |
>> 1 $Id: README 106588 2017-10-13 13:44:45Z gcosmo $ 1 ---------------------------------------------- 2 ------------------------------------------------------------------- 2 3 3 ========================================= 4 ========================================================= 4 Geant4 - an Object-Oriented Toolkit for S 5 Geant4 - an Object-Oriented Toolkit for Simulation in HEP 5 ========================================= 6 ========================================================= 6 7 7 TestEm18 8 TestEm18 8 -------- 9 -------- 9 This example allows to study the various c 10 This example allows to study the various contributions of the energy lost 10 by a charged particle in a single layer of 11 by a charged particle in a single layer of an homogeneous material. 11 See any textbook of interactions of charge 12 See any textbook of interactions of charged particles with matter, in particular : 12 1- geant4.web.cern.ch --> UserSupport -- 13 1- geant4.web.cern.ch --> UserSupport --> Physics Reference Manual 13 2- lappweb.in2p3.fr/~maire/tutorials/ind 14 2- lappweb.in2p3.fr/~maire/tutorials/index.html 14 15 15 1- GEOMETRY DEFINITION 16 1- GEOMETRY DEFINITION 16 17 17 It is a simple cubic box of homogeneous ma 18 It is a simple cubic box of homogeneous material. 18 Two parameters define the geometry : 19 Two parameters define the geometry : 19 - the material of the box, 20 - the material of the box, 20 - the thickness of the box. 21 - the thickness of the box. 21 22 22 The default geometry (1 cm of water) is co 23 The default geometry (1 cm of water) is constructed in DetectorConstruction, 23 but the above parameters can be changed in 24 but the above parameters can be changed interactively via the commands 24 defined in DetectorMessenger. 25 defined in DetectorMessenger. 25 26 26 2- PHYSICS 27 2- PHYSICS 27 28 28 The physics list contains the 'standard' e 29 The physics list contains the 'standard' electromagnetic processes. 29 However the MultipleScattering is not regi 30 However the MultipleScattering is not registered, in order to focuse on 30 fluctuations of to energy loss alone. 31 fluctuations of to energy loss alone. 31 32 32 3- BEAM 33 3- BEAM 33 34 34 The primary kinematic is a single particle 35 The primary kinematic is a single particle starting at the edge 35 of the box. The type of the particle and i 36 of the box. The type of the particle and its energy are set in 36 PrimaryGeneratorAction (e- 10 MeV), and ca 37 PrimaryGeneratorAction (e- 10 MeV), and can be changed via the G4 37 build-in commands of ParticleGun class. 38 build-in commands of ParticleGun class. 38 39 39 4- RUN 40 4- RUN 40 41 41 During the tracking of the incident partic 42 During the tracking of the incident particle, by default, the secondary 42 particles are immediately killed, after th 43 particles are immediately killed, after that their energy has been registered 43 (see SteppingAction and StackingAction). 44 (see SteppingAction and StackingAction). 44 Therefore, we study here the various compo 45 Therefore, we study here the various components of the total energy lost 45 by the incident particle, not the energy d 46 by the incident particle, not the energy deposited in a layer of finite 46 thickness. 47 thickness. 47 With the option /testEm/trackSecondaries o 48 With the option /testEm/trackSecondaries one can compute and plot the energy 48 deposited in the layer. See edep.mac 49 deposited in the layer. See edep.mac 49 50 50 At EndOfRun, the above results are compare 51 At EndOfRun, the above results are compared with 'reference' values, 51 i.e. the input data read from EnergyLoss a 52 i.e. the input data read from EnergyLoss and Range tables. 52 See reference 2 : Energy-Range relation, s 53 See reference 2 : Energy-Range relation, slide 4. 53 54 54 5- HISTOGRAMS 55 5- HISTOGRAMS 55 56 56 The test contains 13 built-in 1D histogram 57 The test contains 13 built-in 1D histograms, which are managed by 57 G4AnalysisManager and its Messenger. 58 G4AnalysisManager and its Messenger. 58 59 59 1 step size of primary track 60 1 step size of primary track 60 2 energy continuously deposited al 61 2 energy continuously deposited along primary track 61 3 energy transfered to secondaries 62 3 energy transfered to secondaries by ionisation 62 4 energy transfered to secondaries 63 4 energy transfered to secondaries by Bremsstrahlung 63 5 energy transfered to secondaries 64 5 energy transfered to secondaries by (e+,e-) production 64 6 total energy transfered to secon 65 6 total energy transfered to secondaries 65 7 total energy lost by primary tra 66 7 total energy lost by primary track 66 8 total energy lost by primary tra 67 8 total energy lost by primary track from energy balance 67 9 energy continuously deposited al 68 9 energy continuously deposited along secondary tracks 68 10 total energy deposited 69 10 total energy deposited 69 11 energy spectrum of gamma 70 11 energy spectrum of gamma 70 12 energy spectrum of e- 71 12 energy spectrum of e- 71 13 energy spectrum of e+ 72 13 energy spectrum of e+ 72 73 73 The histograms are defined in HistoManager 74 The histograms are defined in HistoManager. 74 75 75 The histos can be activated individually w 76 The histos can be activated individually with the command : 76 /analysis/h1/set id nbBins valMin valMax u 77 /analysis/h1/set id nbBins valMin valMax unit 77 where 'unit' is the desired unit for the h 78 where 'unit' is the desired unit for the histo (MeV or KeV, cm or mm, etc..) 78 79 79 One can control the name of the histograms 80 One can control the name of the histograms file with the command: 80 /analysis/setFileName name (default test 81 /analysis/setFileName name (default testem18) 81 82 82 It is possible to choose the format of the 83 It is possible to choose the format of the histogram file : root (default), 83 xml, csv, by using namespace in HistoManag << 84 xml, csv, by using namespace in HistoManager.hh 84 For convenience, few simple Root macros ar << 85 85 It is also possible to print selected hist 86 It is also possible to print selected histograms on an ascii file: 86 /analysis/h1/setAscii id 87 /analysis/h1/setAscii id 87 All selected histos will be written on a f 88 All selected histos will be written on a file name.ascii (default testem18) 88 89 89 6- VISUALIZATION 90 6- VISUALIZATION 90 91 91 The Visualization Manager is set in the ma 92 The Visualization Manager is set in the main(). 92 The initialisation of the drawing is done 93 The initialisation of the drawing is done via the commands 93 /vis/... in the macro vis.mac. To get visu 94 /vis/... in the macro vis.mac. To get visualisation: 94 > /control/execute vis.mac 95 > /control/execute vis.mac 95 96 96 The detector has a default view which is a 97 The detector has a default view which is a longitudinal view of the box. 97 The tracks are drawn at the end of event, 98 The tracks are drawn at the end of event, and erased at the end of run. 98 99 99 7- HOW TO START ? 100 7- HOW TO START ? 100 101 101 execute TestEm18 in 'batch' mode from macr 102 execute TestEm18 in 'batch' mode from macro files : 102 % TestEm18 electron.mac 103 % TestEm18 electron.mac 103 104 104 execute TestEm18 in 'interactive mode' wit 105 execute TestEm18 in 'interactive mode' with visualization : 105 % TestEm18 106 % TestEm18 106 Idle> control/execute vis.mac 107 Idle> control/execute vis.mac 107 .... 108 .... 108 Idle> type your commands 109 Idle> type your commands 109 .... 110 .... 110 Idle> exit 111 Idle> exit 111 << 112 Macros provided in this example: << 113 - csda.mac: test independance of user step m << 114 - edep.mac: track secondary particles and pl << 115 - electron.mac: e- (10 MeV) on 1 cm of water << 116 - ion.mac: ion C12 (4 GeV) on 1 cm of water << 117 - muon.mac: mu+ (1 TeV) on 1 m of water << 118 - pixe.mac: proton (20 MeV) on 50 um of gold << 119 - proton.mac: proton (1 GeV) on 10 cm of wat << 120 - plotHisto.C, pixe.C: Root macros << 121 << 122 Macros to be run interactively: << 123 - vis.mac: To activate visualization <<