Back to home page

EIC code displayed by LXR

 
 

    


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

0001 \page ExampleTestEm18 Example TestEm18
0002 
0003  This example allows to study the various contributions of the energy lost 
0004  by a charged particle in a single layer of an homogeneous material.
0005  See any textbook of interactions of charged particles with matter, in particular :
0006  - 1- geant4.web.cern.ch --> UserSupport --> Physics Reference Manual
0007  - 2- lappweb.in2p3.fr/~maire/tutorials/index.html
0008         
0009 ## GEOMETRY DEFINITION
0010  
0011  It is a simple cubic box of homogeneous material.
0012  Two parameters define the geometry :
0013      - the material of the box,
0014      - the thickness of the box.
0015  
0016  The default geometry (1 cm of water) is constructed in DetectorConstruction,
0017  but the above parameters can be changed interactively via the commands
0018  defined in DetectorMessenger.
0019         
0020 ## PHYSICS
0021  
0022  The physics list, PhysicsList, contains the 'standard' electromagnetic processes.
0023  However the MultipleScattering is not registered, in order to focuse on
0024  fluctuations of to energy loss alone.
0025                  
0026 ## BEAM
0027  
0028  The primary kinematic is a single particle starting at the edge
0029  of the box. The type of the particle and its energy are set in 
0030  PrimaryGeneratorAction (e- 10 MeV), and can be changed via the G4 
0031  build-in commands of G4ParticleGun class.
0032         
0033 ## RUN
0034 
0035  During the tracking of the incident particle, by default, the secondary 
0036  particles are immediately killed, after that their energy has been registered
0037  (see SteppingAction and StackingAction).
0038  Therefore, we study here the various components of the total energy lost
0039  by the incident particle, not the energy deposited in a layer of finite
0040  thickness.
0041  With the option /testEm/trackSecondaries one can compute and plot the energy
0042  deposited in the layer. See edep.mac
0043 
0044  At EndOfRun, the above results are compared with 'reference' values,
0045  i.e. the input data read from EnergyLoss and Range tables.
0046  See reference 2 : Energy-Range relation, slide 4.
0047 
0048 ## HISTOGRAMS
0049          
0050  The test contains 13 built-in 1D histograms, which are managed by
0051  G4AnalysisManager and its messenger.
0052 
0053  -  1:  step size of primary track
0054  -  2:  energy locally deposited along primary track
0055  -  3:  energy transfered to secondaries by ionisation
0056  -  4:  energy transfered to secondaries by Bremsstrahlung
0057  -  5:  energy transfered to secondaries by (e+,e-) production
0058  -  6:  total energy transfered to secondaries
0059  -  7:  total energy lost by primary track
0060  -  8:  total energy lost by primary track from energy balance
0061  -  9:  energy continuously deposited along secondary tracks
0062  - 10:  total energy deposited
0063  - 11:  energy spectrum of gamma
0064  - 12:  energy spectrum of e-
0065  - 13:  energy spectrum of e+
0066 
0067  The histograms are defined in HistoManager.
0068      
0069  The histos can be activated individually with the command :
0070 ```
0071 /analysis/h1/set id nbBins valMin valMax unit
0072 ```
0073  where 'unit' is the desired unit for the histo (MeV or KeV, cm or mm, etc..)
0074                                                                   
0075  One can control the name of the histograms file with the command:
0076 ```
0077 /analysis/setFileName  name  (default testem18)
0078 ```
0079  
0080  It is possible to choose the format of the histogram file : root (default),
0081  xml, csv, by changing the default file type in HistoManager.cc     
0082  For convenience, few simple Root macros are provided : plotHisto.C pixe.C
0083     
0084  It is also possible to print selected histograms on an ascii file:
0085 ```
0086 /analysis/h1/sweAscii id
0087 ```
0088  All selected histos will be written on a file name.ascii  (default testem18)
0089                                         
0090 ## VISUALIZATION
0091  
0092  The Visualization Manager is set in the main().
0093  The initialisation of the drawing is done via the commands
0094  /vis/... in the macro vis.mac. To get visualisation:
0095 ```
0096 > /control/execute vis.mac
0097 ```
0098         
0099  The detector has a default view which is a longitudinal view of the box.
0100  The tracks are drawn at the end of event, and erased at the end of run.
0101         
0102 ## HOW TO START ?
0103  
0104  - Execute TestEm18 in 'batch' mode from macro files :
0105 ```
0106 % ./TestEm18   electron.mac
0107 ```
0108                 
0109  - Execute TestEm18 in 'interactive mode' with visualization :
0110 ```
0111 % ./TestEm18
0112 Idle> control/execute vis.mac
0113 ....
0114 Idle> type your commands
0115 ....
0116 Idle> exit
0117 ```
0118         
0119  Macros provided in this example:
0120   - csda.mac: test independance of user step max
0121   - edep.mac: track secondary particles and plot energy deposited
0122   - electron.mac: e- (10 MeV) on 1 cm of water
0123   - ion.mac: ion C12 (4 GeV) on 1 cm of water
0124   - muon.mac: mu+ (1 TeV) on 1 m of water 
0125   - pixe.mac: proton (20 MeV) on 50 um of gold. Plot gamma pixe
0126   - proton.mac: proton (1 GeV) on 10 cm of water
0127   - plotHisto.C, pixe.C: Root macros
0128   
0129   Macros to be run interactively:
0130   - vis.mac: To activate visualization