Warning, /geant4/examples/extended/electromagnetic/TestEm12/README.md is written in an unsupported language. File is not indexed.
0001 \page ExampleTestEm12 Example TestEm12
0002
0003
0004 How to plot a depth dose profile in spherical geometry.
0005
0006
0007 ## GEOMETRY DEFINITION
0008
0009 The geometry consists of a single sphere of an homogenous material.
0010 Optionally, the sphere can be divided in thin shells.
0011
0012 3 parameters define the geometry :
0013 - the material of the sphere,
0014 - the radius of the sphere (absorRadius),
0015 - the number of shells (nbOfLayers)
0016
0017 In addition a transverse uniform magnetic field can be applied.
0018
0019 The default geometry is constructed in DetectorConstruction class,
0020 but all of the above parameters can be changed interactively via
0021 the commands defined in the DetectorMessenger class.
0022
0023 ## PHYSICS LIST
0024
0025 Physics Lists are based on modular design. Several modules are instantiated:
0026 1. Transportation
0027 2. EM physics
0028 3. Decays
0029 4. StepMax - for step limitation
0030
0031 The following options for EM physics using builders from physics_lists
0032 sub-package are available:
0033 - "emstandard_opt0" recommended standard EM physics for LHC
0034 - "emstandard_opt1" best CPU performance standard physics for LHC
0035 - "emstandard_opt2" similar fast simulation
0036 - "emstandard_opt3" best standard EM options - analog to "local" above
0037 - "emstandard_opt4" best current advanced EM options standard + lowenergy
0038 - "emstandardWVI" standard EM physics and WentzelVI multiple scattering
0039 - "emstandardSS" standard EM physics and single scattering model
0040 - "emstandardGS" standard EM physics and Goudsmit-Saunderson multiple scatt.
0041 - "emlivermore" low-energy EM physics using Livermore data
0042 - "empenelope" low-energy EM physics implementing Penelope models
0043 - "emlowenergy" low-energy EM physics implementing experimental
0044 low-energy models
0045 - "dna" process and models for Geant4-DNA
0046 - "dna_opt1" process and models for Geant4-DNA
0047 - "dna_opt2" process and models for Geant4-DNA
0048 - "dna_opt3" process and models for Geant4-DNA
0049 - "dna_opt4" process and models for Geant4-DNA
0050 - "dna_opt5" process and models for Geant4-DNA
0051 - "dna_opt6" process and models for Geant4-DNA
0052 - "dna_opt7" process and models for Geant4-DNA
0053
0054 A local builder, PhysListEmStandard "local" (similar to opt0) is also
0055 available.
0056
0057 Physics lists and options can be (re)set with UI commands
0058
0059 ## AN EVENT : THE PRIMARY GENERATOR
0060
0061 The primary kinematic consists of a single particle randomly shot at
0062 the centre of the sphere. The type of the particle and its energy are set
0063 in the PrimaryGeneratorAction class, and can be changed via the G4
0064 built-in commands of G4ParticleGun class (see the macros provided with
0065 this example).
0066
0067 In addition one can deactivate the randomness of the direction of the
0068 incident particle. The corresponding interactive command is built in
0069 PrimaryGeneratorMessenger class.
0070
0071 A RUN is a set of events.
0072
0073 ## VISUALIZATION
0074
0075 The Visualization Manager is set in the main().
0076 The initialisation of the drawing is done via the commands
0077 /vis/... in the macro vis.mac. To get visualisation:
0078 ```
0079 > /control/execute vis.mac
0080 ```
0081
0082 The detector has a default view which is a longitudinal view of the
0083 box.
0084
0085 The tracks are drawn at the end of event, and erased at the end of run.
0086 Optionally one can choose to draw all particles, only the charged ones,
0087 or none. This command is defined in EventActionMessenger class.
0088
0089 ## HOW TO START ?
0090
0091 - Execute TestEm12 in 'batch' mode from macro files
0092 ```
0093 % ./TestEm12 run01.mac
0094 ```
0095
0096 - Execute TestEm12 in 'interactive mode' with visualization
0097 ```
0098 % ./TestEm12
0099 ....
0100 Idle> type your commands
0101 ....
0102 Idle> exit
0103 ```
0104
0105 Macros provided in this example:
0106 - berger.mac: e- (100 keV) on water
0107 - dna.mac: e- (1 keV) on water. DNA physics list
0108 - run01.mac: e- (4 MeV) on water. Step max from histos 1 and 8
0109 - run02.mac: e- (4 MeV) on water. Step max from geometry
0110
0111 Macros to be run interactively:
0112 - vis.mac: To activate visualization
0113
0114 ## TRACKING and STEP MAX
0115
0116 TestDm12 computes the total energy deposited along the trajectory of
0117 the incident particle : the so-called longitudinal energy profile,
0118 or depth dose distribution.
0119 The energy deposited (edep) is randomly distributed along the step (see
0120 SteppingAction).
0121
0122 In order to control the accuracy of the deposition, the maximum step size
0123 of charged particles is computed automatically from the binning of
0124 histograms 1 and 8 (see RunAction).
0125
0126 As an example, this limitation is implemented as a 'full' process :
0127 see StepMax class and its messenger.
0128 The 'StepMax process' is registered in the Physics List.
0129
0130 StepMax is evaluated in RunAction::BeginOfRun() and passed
0131 to the StepMax process.
0132 A boolean UI command allows to deactivate this mechanism.
0133 Another UI command allows to define directly a stepMax value.
0134
0135 ## HISTOGRAMS
0136
0137 Testem12 has several predefined 1D histograms :
0138
0139 - 1 : energy profile dE/dr (in MeV/mm per event)
0140 - 2 : total energy deposited in the absorber
0141 - 3 : total track length of the primary track
0142 - 4 : step size of the primary track
0143 - 5 : projected range of the primary track
0144 - 6 : total track length of charged secondary tracks
0145 - 7 : step size of charged secondary tracks
0146 - 8 : normalized energy profile d(E/E0)/d(r/r0), where r0 is the range of
0147 the primary particle of energy E0
0148
0149 The histograms are managed by G4AnalysisManager class and its messenger.
0150 The histos can be individually activated with the command :
0151 ```
0152 /analysis/h1/set id nbBins valMin valMax unit
0153 ```
0154 where unit is the desired unit for the histo (MeV or keV, deg or mrad, etc..)
0155
0156 One can control the name of the histograms file with the command:
0157 ```
0158 /analysis/setFileName name (default testem12)
0159 ```
0160
0161 It is possible to choose the format of the histogram file : root (default),
0162 xml, csv, by changing the default file type in HistoManager.cc
0163
0164 It is also possible to print selected histograms on an ascii file:
0165 ```
0166 /analysis/h1/setAscii id
0167 ```
0168 All selected histos will be written on a file name.ascii (default testem12)
0169