Geant4 Cross Reference |
1 1 2 ========================================= 2 ========================================================= 3 Geant4 - an Object-Oriented Toolkit for S 3 Geant4 - an Object-Oriented Toolkit for Simulation in HEP 4 ========================================= 4 ========================================================= 5 5 6 Hadr03 6 Hadr03 7 ------ 7 ------ 8 8 9 How to compute total cross section from the 9 How to compute total cross section from the direct evaluation of the 10 mean free path ( see below, item Physics). 10 mean free path ( see below, item Physics). 11 How to identify nuclear reactions. 11 How to identify nuclear reactions. 12 How to plot energy spectrum of secondary pa 12 How to plot energy spectrum of secondary particles. 13 13 14 1- GEOMETRY DEFINITION 14 1- GEOMETRY DEFINITION 15 15 16 It is a single box representing a 'semi inf 16 It is a single box representing a 'semi infinite' homogeneous medium. 17 Two parameters define the geometry : 17 Two parameters define the geometry : 18 - the material of the box, 18 - the material of the box, 19 - the (full) size of the box. 19 - the (full) size of the box. 20 20 21 The default geometry (10 m of molybdenum) i 21 The default geometry (10 m of molybdenum) is built in DetectorConstruction, 22 but the above parameters can be changed int 22 but the above parameters can be changed interactively via commands defined 23 in DetectorMessenger. 23 in DetectorMessenger. 24 24 25 2- PHYSICS LIST 25 2- PHYSICS LIST 26 26 27 The PhysicsList contains builders for hadro 27 The PhysicsList contains builders for hadronic interactions. 28 Predefined G4 PhysicsConstructors or 'local 28 Predefined G4 PhysicsConstructors or 'local' PhysicsConstructors can be used 29 (see geant4/source/physics_lists or example 29 (see geant4/source/physics_lists or example runAndEvent/RE04). 30 30 31 In order not to introduce 'artificial' cons 31 In order not to introduce 'artificial' constraints on the step size, 32 electromagnetic processes are not registere 32 electromagnetic processes are not registered: there is no continuous energy 33 loss. 33 loss. 34 34 35 Several hadronic physics options are contro 35 Several hadronic physics options are controlled by environment variables. 36 To select them, see Hadr03.cc. << 36 To trigger them, an envHadronic.csh has been added in this example. >> 37 One must select the options wished, and do >> 38 source envHadronic.csh (or sh) 37 39 38 3- AN EVENT : THE PRIMARY GENERATOR 40 3- AN EVENT : THE PRIMARY GENERATOR 39 41 40 The primary kinematic consists of a single 42 The primary kinematic consists of a single particle starting at the edge 41 of the box. The type of the particle and it 43 of the box. The type of the particle and its energy are set in 42 PrimaryGeneratorAction (neutron 1 MeV), and 44 PrimaryGeneratorAction (neutron 1 MeV), and can be changed via the G4 43 build-in commands of ParticleGun class (see 45 build-in commands of ParticleGun class (see the macros provided with 44 this example). 46 this example). 45 47 46 4- PHYSICS 48 4- PHYSICS 47 49 48 An event is killed at the first interaction << 50 An event is killed at the first interaction of the incident paticle. 49 The absorption length, also called mean fre 51 The absorption length, also called mean free path, is computed as 50 the mean value of the track length of the i 52 the mean value of the track length of the incident particle. 51 This is why the medium must be 'infinite' : 53 This is why the medium must be 'infinite' : to be sure that interaction 52 occurs at any events. 54 occurs at any events. 53 55 54 The result is compared with the 'input' val 56 The result is compared with the 'input' value, i.e. with the cross sections 55 given by G4HadronicProcessStore and used by 57 given by G4HadronicProcessStore and used by Geant4. 56 58 57 The list of nuclear reactions that occured 59 The list of nuclear reactions that occured is printed. 58 (the number of gamma of deexcitation is not 60 (the number of gamma of deexcitation is not printed). 59 61 60 Then, comes the total list of generated par 62 Then, comes the total list of generated particles and ions. 61 The energy spectrum of the scattered partic 63 The energy spectrum of the scattered particle (if any) and of the created 62 secondaries are plotted (see SteppingAction 64 secondaries are plotted (see SteppingAction). 63 65 64 Momentum conservation is checked as : 66 Momentum conservation is checked as : 65 momentum balance = modulus(P_out - P_in) 67 momentum balance = modulus(P_out - P_in) 66 68 67 A set of macros defining various run condit 69 A set of macros defining various run conditions are provided. 68 The processes can be actived/inactived in o 70 The processes can be actived/inactived in order to survey the processes 69 individually. 71 individually. 70 72 71 5- HISTOGRAMS 73 5- HISTOGRAMS 72 74 73 The test contains 12 built-in 1D histograms 75 The test contains 12 built-in 1D histograms, which are managed by 74 G4AnalysisManager and its Messenger. The hi 76 G4AnalysisManager and its Messenger. The histos can be individually 75 activated with the command : 77 activated with the command : 76 /analysis/h1/set id nbBins valMin valMax u 78 /analysis/h1/set id nbBins valMin valMax unit 77 where unit is the desired unit for the hist 79 where unit is the desired unit for the histo (MeV or keV, etc..) 78 (see the macros xxxx.mac). 80 (see the macros xxxx.mac). 79 81 80 1 "kinetic energy of scattered pri << 82 1 "kinetic energy of scattered primary particle" 81 2 "kinetic energy of gamma" 83 2 "kinetic energy of gamma" 82 3 "kinetic energy of e-" << 84 3 "kinetic energy of neutrons" 83 4 "kinetic energy of neutrons" << 85 4 "kinetic energy of protons" 84 5 "kinetic energy of protons" << 86 5 "kinetic energy of deuterons" 85 6 "kinetic energy of deuterons" << 87 6 "kinetic energy of alphas" 86 7 "kinetic energy of alphas" << 88 7 "kinetic energy of nuclei" 87 8 "kinetic energy of nuclei" << 89 8 "kinetic energy of mesons" 88 9 "kinetic energy of mesons" << 90 9 "kinetic energy of baryons" 89 10 "kinetic energy of baryons" << 91 10 "Q = Ekin out - Ekin in" 90 11 "Q = Ekin out - Ekin in" << 92 11 "Pbalance = mag(P_out - P_in)" 91 12 "Pbalance = mag(P_out - P_in)" << 93 12 "atomic mass of nuclei" 92 13 "atomic mass of nuclei" << 93 94 94 The histograms are managed by the HistoMana 95 The histograms are managed by the HistoManager class and its Messenger. 95 The histos can be individually activated wi 96 The histos can be individually activated with the command : 96 /analysis/h1/set id nbBins valMin valMax u 97 /analysis/h1/set id nbBins valMin valMax unit 97 where unit is the desired unit for the hist 98 where unit is the desired unit for the histo (MeV or keV, deg or mrad, etc..) 98 99 99 One can control the name of the histograms 100 One can control the name of the histograms file with the command: 100 /analysis/setFileName name (default Hadr0 101 /analysis/setFileName name (default Hadr03) 101 102 102 It is possible to choose the format of the 103 It is possible to choose the format of the histogram file : root (default), 103 xml, csv, by using namespace in HistoManage 104 xml, csv, by using namespace in HistoManager.hh 104 105 105 It is also possible to print selected histo 106 It is also possible to print selected histograms on an ascii file: 106 /analysis/h1/setAscii id 107 /analysis/h1/setAscii id 107 All selected histos will be written on a fi 108 All selected histos will be written on a file name.ascii (default Hadr03) 108 109 109 6- VISUALIZATION 110 6- VISUALIZATION 110 111 111 The Visualization Manager is set in the mai 112 The Visualization Manager is set in the main(). 112 The initialisation of the drawing is done v 113 The initialisation of the drawing is done via the commands 113 /vis/... in the macro vis.mac. To get visua 114 /vis/... in the macro vis.mac. To get visualisation: 114 > /control/execute vis.mac 115 > /control/execute vis.mac 115 116 116 The detector has a default view which is a 117 The detector has a default view which is a longitudinal view of the box. 117 The tracks are drawn at the end of event, a 118 The tracks are drawn at the end of event, and erased at the end of run. 118 119 119 7- HOW TO START ? 120 7- HOW TO START ? 120 121 121 Execute Hadr03 in 'batch' mode from macro f 122 Execute Hadr03 in 'batch' mode from macro files : 122 % Hadr03 inelastic.mac 123 % Hadr03 inelastic.mac 123 124 124 Execute Hadr03 in 'interactive mode' with v 125 Execute Hadr03 in 'interactive mode' with visualization : 125 % Hadr03 126 % Hadr03 126 Idle> control/execute vis.mac 127 Idle> control/execute vis.mac 127 .... 128 .... 128 Idle> type your commands 129 Idle> type your commands 129 .... 130 .... 130 Idle> exit 131 Idle> exit 131 << 132 Macros provided in this example: << 133 - hadr03.in: macro used in Geant4 testing << 134 - Au196.mac: neutron (1 MeV) on Au195 << 135 - elastic.mac: proton (10 MeV) on Mo100. Ela << 136 - fusion.mac: deuteron (400 keV) on tritium << 137 - gamma.mac: gamma (10 MeV) on Au196 << 138 - inelastic.mac: proton (10 MaV) on Mo98. In << 139 - ion.mac: Li7 (140 MeV) on Be9 << 140 - nCapture.mac: neutron (1 eV) on Boron. Cap << 141 - nFission.mac: neutron (1 eV) on U235. Fis << 142 - neutron.mac: neutron (1 MeV) on Boron << 143 << 144 Macros to be run interactively: << 145 - debug.mac: proton (10 MeV) on Boron << 146 - vis.mac: To activate visualization <<