Warning, /geant4/examples/extended/electromagnetic/TestEm1/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 TestEm1
0008 -------
0009 How to count processes.
0010 How to activate/inactivate processes.
0011 How to survey the tracking, in particular the range of charged particles.
0012 How to define a maximum step size.
0013
0014 1 - GEOMETRY DEFINITION
0015
0016 It is a simple box which represents a 'semi infinite' homogeneous medium.
0017
0018 Two parameters define the geometry :
0019 - the material of the box,
0020 - the full size of the box.
0021
0022 In addition a transverse uniform magnetic field can be applied.
0023 e.g. /globalField/setValue 0 0 5 tesla
0024
0025 The default geometry is constructed in DetectorConstruction class, but all of
0026 the above parameters can be changed interactively via the commands defined in
0027 the DetectorMessenger class.
0028
0029 2 - PHYSICS LIST
0030
0031 Physics lists are based on modular design. Several modules are instantiated:
0032 1. Transportation
0033 2. EM physics
0034 3. Decays
0035 4. StepMax - for step limitation
0036
0037 EM physics builders can be local (eg. in this example) or from G4 kernel
0038 physics_lists subdirectory.
0039
0040 Local physics builder:
0041 - "local" standard EM physics with current 'best' options setting.
0042 these options are explicited in PhysListEmStandard
0043
0044 From geant4/source/physics_lists/builders:
0045 - "emstandard_opt0" recommended standard EM physics for LHC
0046 - "emstandard_opt1" best CPU performance standard physics for LHC
0047 - "emstandard_opt2" similar fast simulation
0048 - "emstandard_opt3" best standard EM options - analog to "local" above
0049 - "emstandard_opt4" best current advanced EM options standard + lowenergy
0050 - "emstandardSS" standard EM physics and single scattering model
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
0056 Physics lists and options can be (re)set with UI commands
0057
0058 A few commands have been added to PhysicsList, in order to set the production
0059 threshold for secondaries for gamma and e-/e+.
0060
0061 3 - AN EVENT : THE PRIMARY GENERATOR
0062
0063 The primary kinematic consists of a single particle starting at the left face
0064 of the box. The type of the particle and its energy are set in the
0065 PrimaryGeneratorAction class, and can be changed via the G4 build-in commands
0066 of G4ParticleGun class (see the macros provided with this example).
0067
0068 In addition one can choose randomly the impact point of the incident particle.
0069 The corresponding interactive command is built in PrimaryGeneratorMessenger.
0070
0071 4 - VISUALIZATION
0072
0073 The Visualization Manager is set in the main () (see TestEm1.cc).
0074 The initialisation of the drawing is done via the commands /vis/... in the
0075 macro vis.mac. To get visualisation:
0076 > /control/execute vis.mac
0077
0078 The detector has a default view which is a longitudinal view of the box.
0079
0080 The tracks are drawn at the end of event, and erased at the end of run.
0081
0082 5 - PHYSICS SURVEY
0083
0084 The particle's type and the physics processes which will be available in this
0085 example are set in PhysicsList class.
0086
0087 A set of macros defining various run conditions are provided. The processes
0088 are actived/inactivated together with differents cuts, in order to survey the
0089 processes one by one.
0090
0091 The number of produced secondaries are counted, the number of steps, and the
0092 number of process calls responsible of the step.
0093
0094 6 - HOW TO START ?
0095
0096 - execute TestEm1 in 'batch' mode from macro files
0097 % TestEm1 runs.mac
0098
0099 - execute TestEm1 in 'interactive mode' with visualization
0100 % TestEm1
0101 ....
0102 Idle> type your commands
0103 ....
0104 Idle> exit
0105
0106 Macros provided in this example:
0107 - brems.mac: Bremsstrahlung only
0108 - erange.mac: compute the csda range of primary particle
0109 - geantino.mac: geantino as primary particle
0110 - ionis.mac: Ionisation only
0111 - photoelec.mac: 100 keV photon photoelectric effect
0112 - radioactive.mac: use radioactive ion as primary particle
0113 - range.mac: compute the csda range of the primary particle
0114 with or without fluctuations
0115 - erange.mac, pRange.mac, alphaRange.mac, ionRange.mac: variants of range.mac
0116 to play with StepFunction()
0117 - runs.mac: electron 100 MeV; all processes
0118
0119 Macros to be run interactively:
0120 - annihil.mac: To visualise 100 MeV e+ annihilation
0121 - decayinfly.mac: To visualise decay in fly of N16
0122 - etaDecay.mac: to visualise decay of eta particle
0123 - gammaconversion.mac: To visualise gamma conversion and e+ annihilation
0124 - photon.mac: To visualiza p300 keV photon beam
0125 - stepMax.mac: to test command /testem/stepMax
0126 - vis.mac: To activate visualization
0127
0128 7 - TRACKING : StepMax
0129
0130 In order to control the accuracy of the deposition, the user can limit
0131 'by hand' the maximum step size of charged particles.
0132 As an example, this limitation is implemented as a 'full' process :
0133 see StepMax class and its Messenger. The 'StepMax process' is registered
0134 in the Physics List.
0135
0136 8 - HISTOGRAMS
0137
0138 Testem1 produces several histo which are saved as testem1.root by default.
0139 Content of these histo:
0140 1 : track length of primary particle
0141 2 : number of steps primary particle
0142 3 : step size of primary particle
0143 4 : total energy deposit
0144 5 : energy of charged secondaries at creation
0145 6 : energy of neutral secondaries at creation
0146
0147 The histograms are managed by G4AnalysisManager class and its Messenger.
0148 The histos can be individually activated with the command :
0149 /analysis/h1/set id nbBins valMin valMax unit
0150 where unit is the desired unit for the histo (MeV or keV, deg or mrad, etc..)
0151
0152 One can control the name of the histograms file with the command:
0153 /analysis/setFileName name (default testem1)
0154
0155 It is possible to choose the format of the histogram file : root (default),
0156 hdf5, xml, csv, by changing the default file type in HistoManager.cc
0157
0158 It is also possible to print selected histograms on an ascii file:
0159 /analysis/h1/setAscii id
0160 All selected histos will be written on a file name.ascii (default testem1)