Warning, /geant4/examples/extended/hadronic/Hadr07/README.md is written in an unsupported language. File is not indexed.
0001 \page ExampleHadr07 Example Hadr07
0002
0003 Survey energy deposition and particle's flux from an hadronic cascade.
0004 Use PhysicsConstructor objects rather than predefined G4 PhysicsLists.
0005 How to plot a depth dose profile in a rectangular box.
0006
0007 ## MATERIALS AND GEOMETRY DEFINITION
0008
0009 The geometry consists of a stack of one or several blocks of homogenous
0010 material, called absorbers.
0011
0012 A minimum of 4 parameters define the geometry :
0013 - the number of absorbers (NbOfAbsor)
0014 - the material of each absorber,
0015 - the thickness of each absorber,
0016 - the tranverse dimension of the stack (sizeYZ)
0017
0018 In addition a transverse uniform magnetic field can be applied.
0019 eg: /globalField/setValue 0 0 5 tesla
0020
0021 The absorber is surrounded by a World volume (vacuum)
0022
0023 A function, and its associated UI command, allows to build a material
0024 directly from a single isotope.
0025
0026 The default geometry is built in DetectorConstruction, but the above parameters
0027 can be changed interactively via commands defined in DetectorMessenger.
0028
0029 To be identified by the ThermalScattering module, the elements composing a
0030 material must have a specific name (see G4ParticleHPThermalScatteringNames.cc)
0031 Examples of such materials are build in Hadr06/src/DetectorConstruction.
0032
0033 ## PHYSICS LIST
0034
0035 "Full" set of physics processes are registered, but via PhysicsConstructor
0036 objects rather than complete pre-defined G4 physics lists. This alternative
0037 way gives more freedom to register physics.
0038
0039 Physics constructors are either constructors provided in Geant4 (with G4 prefix)
0040 or 'local'. They include : HadronElastic, HadronInelastic, IonsInelastic, GammaNuclear,
0041 RadioactiveDecay and Electomagnetic.
0042 (see geant4/source/physics_lists/constructors)
0043
0044 HadronElasticPhysicsHP include a model for thermalized neutrons, under the control of a command
0045 defined in NeutronHPMesseger.
0046
0047 GammmaNuclearPhysics is a subset of G4BertiniElectroNuclearBuilder.
0048
0049 ElectromagneticPhysics is a simplified version of G4EmStandardPhysics.
0050
0051 Several hadronic physics options are controlled by environment variables.
0052 To select them, see Hadr07.cc
0053
0054 ## AN EVENT : THE PRIMARY GENERATOR
0055
0056 The primary kinematic consists of a single particle starting at the
0057 left face of the box. The type of the particle and its energy are set
0058 in the PrimaryGeneratorAction class, and can be changed via the G4
0059 build-in commands of G4ParticleGun class (see the macros provided with
0060 this example).
0061
0062 In addition one can choose randomly the impact point of the incident
0063 particle. The corresponding interactive command is built in
0064 PrimaryGeneratorMessenger class.
0065
0066 A RUN is a set of events.
0067
0068 ## PHYSICS
0069
0070 The program computes the energy deposited in each absorber,
0071 and the flux of particles emerging in the world.
0072 Processes invoked and particles generated are listed.
0073
0074 ## HISTOGRAMS
0075
0076 The test has several built-in 1D histograms, which are managed by
0077 G4AnalysisManager and its Messenger. The histos can be individually
0078 activated with the command :
0079 ```
0080 /analysis/h1/set id nbBins valMin valMax unit
0081 ```
0082 where unit is the desired unit for the histo (MeV or keV, etc..)
0083 (see the macros xxxx.mac).
0084
0085 1 "total energy deposited in absorber 1"
0086 2 "total energy deposited in absorber 2"
0087 ...
0088 9 "total energy deposited in absorber 9"
0089 10 "Edep (MeV/mm) profile along absorbers"
0090 11 "total Energy deposited in all absorbers"
0091 12 "total Energy leakage"
0092 13 "total Energy released"
0093
0094 One can control the name of the histograms file with the command:
0095 ```
0096 /analysis/setFileName name (default Hadr07)
0097 ```
0098
0099 It is possible to choose the format of the histogram file : root (default),
0100 xml, csv, by using namespace in HistoManager.hh
0101
0102 It is also possible to print selected histograms on an ascii file:
0103 ```
0104 /analysis/h1/setAscii id
0105 ```
0106 All selected histos will be written on a file name.ascii (default Hadr07)
0107
0108 ## TRACKING and STEP MAX
0109
0110 Hadr07 computes the distribution of energy deposited along the trajectory of
0111 the incident particle : the so-called longitudinal energy profile,
0112 or depth dose distribution (histogram 10).
0113 The energy deposited (edep) is randomly distribued along the step (see
0114 SteppingAction).
0115
0116 In order to control the accuracy of the deposition, the maximum step size
0117 of charged particles is computed automatically from the binning of
0118 histogram 10.
0119
0120 As an example, this limitation is implemented as a 'full' process :
0121 see StepMax class and its Messenger. The 'StepMax process' is registered
0122 in the Physics List, via a physicsConstructor object (a builder).
0123
0124 StepMax is evaluated in the StepMax process.
0125 A boolean UI command allows to deactivate this mechanism.
0126 Another UI command allows to define directly a stepMax value.
0127
0128 ## VISUALIZATION
0129
0130 The Visualization Manager is set in the main().
0131 The initialisation of the drawing is done via the commands
0132 /vis/... in the macro vis.mac. To get visualisation:
0133 ```
0134 > /control/execute vis.mac
0135 ```
0136
0137 The tracks are drawn at the end of event, and erased at the end of run.
0138 gamma green
0139 neutron yellow
0140 negative particles (e-, ...) red
0141 positive particles (e+, ions, ...) blue
0142
0143 ## HOW TO START ?
0144
0145 Execute Hadr07 in 'batch' mode from macro files :
0146 ```
0147 % ./Hadr07 neutron.mac
0148 ```
0149
0150 Execute Hadr07 in 'interactive mode' with visualization :
0151 ```
0152 % ./Hadr07
0153 Idle> control/execute vis.mac
0154 ....
0155 Idle> type your commands
0156 ....
0157 Idle> exit
0158 ```
0159
0160 Macros provided in this example:
0161 - hadr07.in: macro used in Geant4 testing to produce hadr07.out
0162 - neutron.mac: neutron (14.1 MeV) in 30 cm of Li7
0163 - multiLayers.mac : example of multilayers : Air, Water, G4Bone
0164 - Na22.mac: multilayers. Radioactive source
0165 - alpha.mac: alpha (400 MeV). Limit the step size from histo 10
0166 - ionC12.mac: C12 (2.4 GeV). Limit the step size from histo 10
0167 - water.mac: e- (4 MeV) in Water
0168
0169 Macros to be run interactively:
0170 - proton.mac: proton (1 GeV). Multilayers
0171 - vis.mac: To activate visualization