Back to home page

EIC code displayed by LXR

 
 

    


Warning, /geant4/examples/extended/electromagnetic/TestEm11/README.md is written in an unsupported language. File is not indexed.

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