Warning, /geant4/examples/extended/electromagnetic/TestEm11/README is written in an unsupported language. File is not indexed.
0001 -------------------------------------------------------------------
0002
0003 =========================================================
0004 Geant4 - an Object-Oriented Toolkit for Simulation in HEP
0005 =========================================================
0006
0007 TestEm11
0008 --------
0009
0010 How to plot a depth dose profile in a rectangular box.
0011
0012
0013 1- GEOMETRY DEFINITION
0014
0015 The geometry consists of a stack of one or several blocks of homogenous
0016 material, called absorbers.
0017 Optionally, each absorber can be divided in thinner layers (replica)
0018
0019 A minimum of 5 parameters define the geometry :
0020 - the number of absorbers (NbOfAbsor)
0021 - the material of each absorber,
0022 - the thickness of each absorber,
0023 - the tranverse dimension of the stack (sizeYZ),
0024 - the number of divisions of each absorber (NbOfDivisions)
0025
0026 In addition a transverse uniform magnetic field can be applied.
0027 eg: /globalField/setValue 0 0 5 tesla
0028
0029 The default geometry is constructed in DetectorConstruction class,
0030 but all of the above parameters can be changed interactively via
0031 the commands defined in the DetectorMessenger class.
0032
0033 2- PHYSICS LIST
0034
0035 Physics Lists are based on modular design. Several modules are instantiated:
0036 1. Transportation
0037 2. EM physics
0038 3. Decays
0039 4. StepMax - for step limitation
0040
0041 The following options for EM physics using builders from physics_lists
0042 sub-package are available:
0043 - "emstandard_opt0" recommended standard EM physics for LHC
0044 - "emstandard_opt1" best CPU performance standard physics for LHC
0045 - "emstandard_opt2" similar fast simulation
0046 - "emstandard_opt3" best standard EM options - analog to "local" above
0047 - "emstandard_opt4" best current advanced EM options standard + lowenergy
0048 - "emstandardWVI" standard EM physics and WentzelVI multiple scattering
0049 - "emstandardSS" standard EM physics and single scattering model
0050 - "emstandardGS" standard EM physics and Goudsmit-Saunderson multiple scatt.
0051 - "emlivermore" low-energy EM physics using Livermore data
0052 - "empenelope" low-energy EM physics implementing Penelope models
0053 - "emlowenergy" low-energy EM physics implementing experimental
0054 low-energy models
0055 - "emstandardMP" standard EM physics where for e- a new model
0056 G4DiscreteScatteringModel is applied; for this model
0057 a data set G4GBFPDATA should be requested from EM group
0058
0059 A local builder, PhysListEmStandard "local" (similar to opt3) is also
0060 available.
0061
0062 Physics lists and options can be (re)set with UI commands
0063
0064 3- ACTION INITIALIZATION
0065
0066 A newly introduced class, ActionInitialization, instantiates and registers
0067 to Geant4 kernel all user action classes.
0068
0069 While in sequential mode the action classes are instantiated just once,
0070 via invoking the method:
0071 ActionInitialization::Build()
0072 in multi-threading mode the same method is invoked for each thread worker
0073 and so all user action classes are defined thread-local.
0074
0075 A run action class (if present) has to be instantiated both thread-local
0076 and global, which is why its instance has to be created also in the method
0077 ActionInitialization::BuildForMaster()
0078 which is invoked only in multi-threading mode.
0079
0080 4- AN EVENT : THE PRIMARY GENERATOR
0081
0082 The primary kinematic consists of a single particle starting at the
0083 left face of the box. The type of the particle and its energy are set
0084 in the PrimaryGeneratorAction class, and can be changed via the G4
0085 build-in commands of G4ParticleGun class (see the macros provided with
0086 this example).
0087
0088 In addition one can choose randomly the impact point of the incident
0089 particle. The corresponding interactive command is built in
0090 PrimaryGeneratorMessenger class.
0091
0092 A RUN is a set of events.
0093
0094 5- VISUALIZATION
0095
0096 The Visualization Manager is set in the main().
0097 The initialisation of the drawing is done via the commands
0098 /vis/... in the macro vis.mac. To get visualisation:
0099 > /control/execute vis.mac
0100
0101 The detector has a default view which is a longitudinal view of the box.
0102
0103 The tracks are drawn at the end of event, and erased at the end of run.
0104 Optionally one can choose to draw all particles, only the charged one,
0105 or none. This command is defined in EventActionMessenger class.
0106
0107 6- HOW TO START ?
0108
0109 - Execute TestEm11 in 'batch' mode from macro files
0110 % TestEm11 run01.mac
0111
0112 - Execute TestEm11 in 'interactive mode' with visualization
0113 % TestEm11
0114 ....
0115 Idle> type your commands
0116 ....
0117 Idle> exit
0118
0119 Macros provided in this example:
0120 - alpha.mac: alpha (400 MeV) on water
0121 - ionC12.mac: ion C12 (2.4 GeV) on water
0122 - multiLayers.mac: gamma (6 MeV) on multi layers
0123 - radioactive.mac: radioactive ion on multi layers
0124 - range.mac: compute csda range of primary particle
0125 - run01.mac: e- (500 keV) on silicon. Step max from histo 1
0126 - run02.mac: e- (500 keV) on silicon. Step max from geometry
0127 - sandia.mac: to compare with Sandia data
0128 - water.mac: e- (4 MeV) on water. No constraint on tracking step
0129
0130 Macros to be run interactively:
0131 - vis.mac: To activate visualization
0132
0133 7- TRACKING and STEP MAX
0134
0135 TestEm11 computes the distribution of energy deposited along the trajectory of
0136 the incident particle : the so-called longitudinal energy profile,
0137 or depth dose distribution.
0138 The energy deposited (edep) is randomly distribued along the step (see
0139 SteppingAction).
0140
0141 In order to control the accuracy of the deposition, the maximum step size
0142 of charged particles is computed automatically from the binning of
0143 histograms 1 and 8 (see RunAction).
0144
0145 As an example, this limitation is implemented as a 'full' process :
0146 see StepMax class and its Messenger. The 'StepMax process' is registered
0147 in the Physics List.
0148
0149 StepMax is evaluated at RunAction::BeginOfRun(),
0150 and passed to the StepMax process.
0151 A boolean UI command allows to deactivate this mechanism.
0152 Another UI command allows to define directly a stepMax value.
0153
0154 8- HISTOGRAMS
0155
0156 TestEm11 has several predefined 1D histograms :
0157
0158 1 : longitudinal energy profile (in MeV/mm and per event)
0159 2 : total energy deposited in all absorbers
0160 3 : total track length of the primary track
0161 4 : step size of the primary track
0162 5 : projected range of the primary track
0163 6 : total track length of charged secondary tracks
0164 7 : step size of charged secondary tracks
0165 8 : longitudinal energy profile (in MeV.cm2/g), as a function of x/r0
0166 where r0 is the range of the primary particle
0167 9 : total energy leakage
0168 10 : total energy : Edep + Eleak
0169 11 : energy deposited in absorber 1
0170 12 : energy deposited in absorber 2
0171 ...etc........
0172
0173 The histograms are managed by G4Analysis classes.
0174 The histos can be individually activated with the command :
0175 /analysis/h1/set id nbBins valMin valMax unit
0176 where unit is the desired unit for the histo (MeV or keV, deg or mrad, etc..)
0177
0178 One can control the name of the histograms file with the command:
0179 /analysis/setFileName name (default testem11)
0180
0181 It is possible to choose the format of the histogram file : root (default),
0182 hdf5, xml, csv, by changing the default file type in HistoManager.cc
0183
0184 It is also possible to print selected histograms on an ascii file:
0185 /analysis/h1/setAscii id
0186 All selected histos will be written on a file name.ascii (default testem11)