1 | $Id: README,v 1.33 2009/09/17 20:06:26 maire Exp $ |
---|
2 | ------------------------------------------------------------------- |
---|
3 | |
---|
4 | ========================================================= |
---|
5 | Geant4 - an Object-Oriented Toolkit for Simulation in HEP |
---|
6 | ========================================================= |
---|
7 | |
---|
8 | TestEm3 |
---|
9 | ------- |
---|
10 | |
---|
11 | How to collect energy deposition in a sampling calorimeter. |
---|
12 | How to survey energy flow. |
---|
13 | how to print stopping power. |
---|
14 | |
---|
15 | 1- GEOMETRY DEFINITION |
---|
16 | |
---|
17 | The calorimeter is a box made of a given number of layers. |
---|
18 | A layer consists of a sequence of various absorbers (maximum MaxAbsor=9). |
---|
19 | The layer is replicated. |
---|
20 | |
---|
21 | Parameters defining the calorimeter : |
---|
22 | - the number of layers, |
---|
23 | - the number of absorbers within a layer, |
---|
24 | - the material of the absorbers, |
---|
25 | - the thickness of the absorbers, |
---|
26 | - the transverse size of the calorimeter (the input face is a square). |
---|
27 | |
---|
28 | In addition a transverse uniform magnetic field can be applied. |
---|
29 | |
---|
30 | The default geometry is constructed in DetectorConstruction class, but all |
---|
31 | of the above parameters can be modified interactively via the commands |
---|
32 | defined in the DetectorMessenger class. |
---|
33 | |
---|
34 | |
---|
35 | |<----layer 0---------->|<----layer 1---------->|<----layer 2---------->| |
---|
36 | | | | | |
---|
37 | ========================================================================== |
---|
38 | || | || | || | || |
---|
39 | || | || | || | || |
---|
40 | || abs 1 | abs 2 || abs 1 | abs 2 || abs 1 | abs 2 || |
---|
41 | || | || | || | || |
---|
42 | || | || | || | || |
---|
43 | beam || | || | || | || |
---|
44 | ======> || | || | || | || |
---|
45 | || | || | || | || |
---|
46 | || | || | || | || |
---|
47 | || | || | || | || |
---|
48 | || | || | || | || |
---|
49 | || cell 1 | cell 2|| cell 3 | cell 4|| cell 5 | cell 6|| |
---|
50 | ========================================================================== |
---|
51 | ^ ^ ^ ^ ^ ^ ^ |
---|
52 | pln1 pln2 pln3 pln4 pln5 pln6 pln7 |
---|
53 | |
---|
54 | NB. The number of absorbers and the number of layers can be set to 1. |
---|
55 | In this case we have a unique homogeneous block of matter, which looks like |
---|
56 | a bubble chamber rather than a calorimeter ... |
---|
57 | (see the macro of commands: newgeom.mac) |
---|
58 | |
---|
59 | 2- PHYSICS LISTS |
---|
60 | |
---|
61 | Physics lists can be local (eg. in this example) or from G4 kernel |
---|
62 | physics_lists subdirectory. |
---|
63 | |
---|
64 | Local physics lists: |
---|
65 | - "local" standard EM physics with current 'best' options setting. |
---|
66 | these options are explicited in PhysListEmStandard |
---|
67 | |
---|
68 | From geant4/source/physics_lists/builders: |
---|
69 | - "emstandard_opt0" recommended standard EM physics for LHC |
---|
70 | - "emstandard_opt1" best CPU performance standard physics for LHC |
---|
71 | - "emstandard_opt2" |
---|
72 | - "emstandard_opt3" best current advanced EM options. |
---|
73 | analog to "local" above |
---|
74 | - "emlivermore" low-energy EM physics using Livermore data |
---|
75 | - "empenelope" low-energy EM physics implementing Penelope models |
---|
76 | |
---|
77 | Physics lists and options can be (re)set with UI commands |
---|
78 | |
---|
79 | Please, notice that options set through G4EmProcessOPtions are global, eg |
---|
80 | for all particle types. In G4 builders, it is shown how to set options per |
---|
81 | particle type. |
---|
82 | |
---|
83 | 3- AN EVENT : THE PRIMARY GENERATOR |
---|
84 | |
---|
85 | The primary kinematic consists of a single particle which hits the calorimeter |
---|
86 | perpendicular to the input face. The type of the particle and its energy are |
---|
87 | set in the PrimaryGeneratorAction class, and can be changed via the |
---|
88 | G4 build-in commands of ParticleGun class (see the macros provided with this |
---|
89 | example). |
---|
90 | |
---|
91 | In addition one can choose randomly the impact point of the incident particle. |
---|
92 | The corresponding interactive command is built in PrimaryGeneratorMessenger. |
---|
93 | |
---|
94 | A RUN is a set of events. |
---|
95 | |
---|
96 | TestEm3 computes the energy deposited per absorber and the energy flow through |
---|
97 | the calorimeter |
---|
98 | |
---|
99 | 4- VISUALIZATION |
---|
100 | |
---|
101 | The Visualization Manager is set in the main(). |
---|
102 | The initialisation of the drawing is done via the commands : |
---|
103 | /vis/... in the macro vis.mac. In interactive session: |
---|
104 | PreInit or Idle > /control/execute vis.mac |
---|
105 | |
---|
106 | The default view is a longitudinal view of the calorimeter. |
---|
107 | |
---|
108 | The tracks are drawn at the end of event, and erased at the end of run. |
---|
109 | Optionaly one can choose to draw all particles, only the charged one, or none. |
---|
110 | This command is defined in EventActionMessenger class. |
---|
111 | |
---|
112 | 5- PHYSICS DEMO |
---|
113 | |
---|
114 | The particle's type and the physic processes which will be available |
---|
115 | in this example are set in PhysicsList class. |
---|
116 | |
---|
117 | In addition a build-in interactive command (/process/inactivate processName) |
---|
118 | allows to activate/inactivate the processes one by one. |
---|
119 | Then one can well visualize the processes one by one, especially |
---|
120 | in the bubble chamber setup with a transverse magnetic field. |
---|
121 | |
---|
122 | As a homework try to visualize a gamma conversion alone, |
---|
123 | or the effect of the multiple scattering. |
---|
124 | |
---|
125 | Notice that one can control the maximum step size in each absorber, via the |
---|
126 | StepMax process and the command /testem/stepMax/absorber |
---|
127 | (see StepMax and PhysicsList classes) |
---|
128 | |
---|
129 | 6- HOW TO START ? |
---|
130 | |
---|
131 | - compile and link to generate an executable |
---|
132 | % cd TestEm3 |
---|
133 | % gmake |
---|
134 | |
---|
135 | - execute TestEm3 in 'batch' mode from macro files |
---|
136 | % TestEm3 run01.mac |
---|
137 | |
---|
138 | - execute TestEm3 in 'interactive mode' with visualization |
---|
139 | % TestEm3 |
---|
140 | .... |
---|
141 | Idle> type your commands. For instance: |
---|
142 | Idle> /control/execute run01.mac |
---|
143 | .... |
---|
144 | Idle> exit |
---|
145 | |
---|
146 | 7- HISTOGRAMS |
---|
147 | |
---|
148 | Testem3 can produce histograms : |
---|
149 | histo 1 : energy deposit in absorber 1 |
---|
150 | histo 2 : energy deposit in absorber 2 |
---|
151 | ...etc........... |
---|
152 | |
---|
153 | One can control the binning of the histo with the command: |
---|
154 | /testem/histo/setHisto idAbsor nbin Emin Emax unit |
---|
155 | ...etc........... |
---|
156 | where unit is the desired energy unit for that histo (see TestEm3.in). |
---|
157 | |
---|
158 | histo 11 : longitudinal profile of energy deposit in absorber 1 (MeV/event) |
---|
159 | histo 12 : longitudinal profile of energy deposit in absorber 2 (MeV/event) |
---|
160 | ...etc........... |
---|
161 | |
---|
162 | histo 21 : energy flow (MeV/event) |
---|
163 | histo 22 : lateral energy leak (MeV/event) |
---|
164 | |
---|
165 | One can control the name of the histograms file with the commands: |
---|
166 | /testem/histo/setFileName name (default testem3) |
---|
167 | /testem/histo/setFileType type (choice: hbook, root(default), XML) |
---|
168 | |
---|
169 | NB. Numbering scheme for histograms: |
---|
170 | layer : from 1 to NbOfLayers (inclued) |
---|
171 | absorbers : from 1 to NbOfAbsor (inclued) |
---|
172 | planes : from 1 to NbOfLayers*NbOfAbsor + 1 (inclued) |
---|
173 | |
---|
174 | It is also possible to print selected histograms on an ascii file: |
---|
175 | /testem/histo/printHisto id |
---|
176 | All selected histos will be written on a file name.ascii (default testem3) |
---|
177 | |
---|
178 | Note that, by default, histograms are disabled. To activate them, uncomment |
---|
179 | the flag G4ANALYSIS_USE in GNUmakefile. |
---|
180 | |
---|
181 | Before compilation of the example it is optimal to clean up old files: |
---|
182 | gmake histclean |
---|
183 | gmake |
---|
184 | |
---|
185 | |
---|
186 | 8- USING HISTOGRAMS |
---|
187 | |
---|
188 | To use histograms, at least one of the AIDA implementations should be |
---|
189 | available. See InstallAida.txt |
---|
190 | |
---|