1 | $Id: README,v 1.2 2007/11/13 16:43:59 maire Exp $ |
---|
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) |
---|
68 | /testem/histo/setFileType name (default hbook) |
---|
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 |
---|
115 | available (see http://aida.freehep.org). |
---|
116 | |
---|
117 | 8a - PI |
---|
118 | |
---|
119 | A package including AIDA and extended interfaces also using Python is PI, |
---|
120 | available from: http://cern.ch/pi |
---|
121 | |
---|
122 | Once installed PI or PI-Lite in a specified local area $MYPY, it is required |
---|
123 | to add the installation path to $PATH, i.e. for example, for release 1.2.1 of |
---|
124 | PI: |
---|
125 | setenv PATH ${PATH}:$MYPI/1.2.1/app/releases/PI/PI_1_2_1/rh73_gcc32/bin |
---|
126 | |
---|
127 | CERN users can use the PATH to the LCG area on AFS. |
---|
128 | Before running the example the command should be issued: |
---|
129 | eval `aida-config --runtime csh` |
---|
130 | |
---|
131 | 8b - OpenScientist |
---|
132 | |
---|
133 | OpenScientist is available at http://OpenScientist.lal.in2p3.fr. |
---|
134 | |
---|
135 | You have to "setup" the OpenScientist AIDA implementation before compiling |
---|
136 | (then with G4ANALYSIS_USE set) and running your Geant4 application. |
---|
137 | |
---|
138 | On UNIX you setup, with a csh flavoured shell : |
---|
139 | csh> source <<OpenScientist install path>/aida-setup.csh |
---|
140 | or with a sh flavoured shell : |
---|
141 | sh> . <<OpenScientist install path>/aida-setup.sh |
---|
142 | On Windows : |
---|
143 | DOS> call <<OpenScientist install path>/aida-setup.bat |
---|
144 | |
---|
145 | You can use various file formats for writing (AIDA-XML, hbook, root). |
---|
146 | These formats are readable by the Lab onx interactive program |
---|
147 | or the OpenPAW application. See the web pages. |
---|
148 | |
---|
149 | |
---|
150 | With OpenPAW, on a run.hbook file, one can view the histograms |
---|
151 | with something like : |
---|
152 | OS> opaw |
---|
153 | opaw> h/file 1 run.hbook ( or opaw> h/file 1 run.aida or run.root) |
---|
154 | opaw> zone 2 2 |
---|
155 | opaw> h/plot 1 |
---|
156 | opaw> h/plot 2 |
---|