| [1337] | 1 | $Id: README,v 1.4 2008/09/26 20:26:01 maire Exp $
|
|---|
| [807] | 2 | -------------------------------------------------------------------
|
|---|
| 3 |
|
|---|
| 4 | =========================================================
|
|---|
| 5 | Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
|---|
| 6 | =========================================================
|
|---|
| 7 |
|
|---|
| 8 | TestEm18
|
|---|
| 9 | --------
|
|---|
| 10 | This example allows to study the energy lost by a charged particle in a
|
|---|
| 11 | single layer, due to ionization and bremsstrahlung. Results are compared to
|
|---|
| 12 | 'reference' values.
|
|---|
| 13 |
|
|---|
| 14 | 1- GEOMETRY DEFINITION
|
|---|
| 15 |
|
|---|
| 16 | It is a single box of homogeneous medium.
|
|---|
| 17 | Two parameters define the geometry :
|
|---|
| 18 | - the material of the box,
|
|---|
| 19 | - the (full) size of the box.
|
|---|
| 20 |
|
|---|
| 21 | The default geometry (1 cm of water) is constructed in DetectorConstruction,
|
|---|
| 22 | but the above parameters can be changed interactively via the commands
|
|---|
| 23 | defined in DetectorMessenger.
|
|---|
| 24 |
|
|---|
| 25 | 2- PHYSICS
|
|---|
| 26 |
|
|---|
| 27 | The physics list contains the 'standard' electromagnetic processes.
|
|---|
| 28 | However the MultipleScattering is not registered, in order to focuse on
|
|---|
| 29 | fluctuations due to energy loss alone.
|
|---|
| 30 |
|
|---|
| 31 | 3- BEAM
|
|---|
| 32 |
|
|---|
| 33 | The primary kinematic is a single particle starting at the edge
|
|---|
| 34 | of the box. The type of the particle and its energy are set in
|
|---|
| 35 | PrimaryGeneratorAction (e- 10 MeV), and can be changed via the G4
|
|---|
| 36 | build-in commands of ParticleGun class.
|
|---|
| 37 |
|
|---|
| 38 | 4- RUN
|
|---|
| 39 |
|
|---|
| 40 | During the tracking of the incident particle, the secondary particles
|
|---|
| 41 | are immediately killed, after that their energy has been registered
|
|---|
| 42 | (see StackingAction).
|
|---|
| 43 | Therefore, we study here the total energy lost by the incident particle,
|
|---|
| 44 | not the energy deposited in a layer of finite thickness.
|
|---|
| 45 |
|
|---|
| 46 | At EndOfRun, the above results are compared with 'reference' values,
|
|---|
| 47 | i.e. the values read from EnergyLoss tables.
|
|---|
| 48 |
|
|---|
| 49 | 5- HISTOGRAMS
|
|---|
| 50 |
|
|---|
| 51 | The test contains 6 built-in 1D histograms, which are managed by the
|
|---|
| 52 | HistoManager class and its Messenger.
|
|---|
| 53 |
|
|---|
| 54 | 1 continuous energy loss along primary track
|
|---|
| 55 | 2 energy from secondaries
|
|---|
| 56 | 3 total energy lost by primary track (1+2)
|
|---|
| 57 | 4 energy spectrum of e-+
|
|---|
| 58 | 5 energy spectrum of gamma
|
|---|
| 59 | 6 step size of primary track
|
|---|
| 60 |
|
|---|
| 61 | The histos can be activated individually with the command :
|
|---|
| 62 | /testem/histo/setHisto id nbBins valMin valMax unit
|
|---|
| 63 | where 'unit' is the desired unit for the histo (MeV or KeV, cm or mm, etc..)
|
|---|
| 64 |
|
|---|
| 65 | One can control the name and the type of the histograms file with
|
|---|
| 66 | the commands:
|
|---|
| 67 | /testem/histo/setFileName name (default testem18)
|
|---|
| [1337] | 68 | /testem/histo/setFileType name (default root)
|
|---|
| [807] | 69 |
|
|---|
| 70 | It is also possible to print selected histograms on an ascii file:
|
|---|
| 71 | /testem/histo/printHisto id
|
|---|
| 72 | All selected histos will be written on a file name.ascii (default testem18)
|
|---|
| 73 |
|
|---|
| 74 | Note that, by default, histograms are disabled. To activate them, uncomment
|
|---|
| 75 | the flag G4ANALYSIS_USE in GNUmakefile.
|
|---|
| 76 |
|
|---|
| 77 | 6- VISUALIZATION
|
|---|
| 78 |
|
|---|
| 79 | The Visualization Manager is set in the main().
|
|---|
| 80 | The initialisation of the drawing is done via the commands
|
|---|
| 81 | /vis/... in the macro vis.mac. To get visualisation:
|
|---|
| 82 | > /control/execute vis.mac
|
|---|
| 83 |
|
|---|
| 84 | The detector has a default view which is a longitudinal view of the box.
|
|---|
| 85 | The tracks are drawn at the end of event, and erased at the end of run.
|
|---|
| 86 |
|
|---|
| 87 | 7- HOW TO START ?
|
|---|
| 88 |
|
|---|
| 89 | compile and link to generate an executable
|
|---|
| 90 | % cd geant4/examples/extended/electromagnetic/TestEm18
|
|---|
| 91 | % gmake
|
|---|
| 92 |
|
|---|
| 93 | execute TestEm18 in 'batch' mode from macro files :
|
|---|
| 94 | % TestEm18 electron.mac.mac
|
|---|
| 95 |
|
|---|
| 96 | execute TestEm18 in 'interactive mode' with visualization :
|
|---|
| 97 | % TestEm18
|
|---|
| 98 | Idle> control/execute vis.mac
|
|---|
| 99 | ....
|
|---|
| 100 | Idle> type your commands
|
|---|
| 101 | ....
|
|---|
| 102 | Idle> exit
|
|---|
| 103 |
|
|---|
| 104 | 8- USING HISTOGRAMS
|
|---|
| 105 |
|
|---|
| 106 | By default the histograms are not activated. To activate histograms
|
|---|
| 107 | the environment variable G4ANALYSIS_USE should be defined. For instance
|
|---|
| 108 | uncomment the flag G4ANALYSIS_USE in GNUmakefile.
|
|---|
| 109 |
|
|---|
| 110 | Before compilation of the example it is optimal to clean up old files:
|
|---|
| 111 | gmake histclean
|
|---|
| 112 | gmake
|
|---|
| 113 |
|
|---|
| 114 | To use histograms, at least one of the AIDA implementations should be
|
|---|
| [1337] | 115 | available. See InstallAida.txt
|
|---|
| [807] | 116 |
|
|---|