1 | |
---|
2 | ========================================================= |
---|
3 | Geant4 - an Object-Oriented Toolkit for Simulation in HEP |
---|
4 | ========================================================= |
---|
5 | |
---|
6 | Extended Example for G4GeneralParticleSource (GPS) |
---|
7 | --------------------------------------- |
---|
8 | |
---|
9 | exGPS is created to demonstrate the usage of G4GeneralParticleSource for generating |
---|
10 | primary incident particle according to user defined distributions. These range from simple |
---|
11 | monocromatic point source to complicated mutiple sources with various biasing schemes. |
---|
12 | |
---|
13 | More detailed information on the usage of GPS are available on its home site: |
---|
14 | http://reat.space.qinetiq.com/gps |
---|
15 | |
---|
16 | ------------------------------------------------------------------------------------------- |
---|
17 | 1. GEOMETRY |
---|
18 | |
---|
19 | Simple geometry consists of a "Vacuum" world and, in it with two other components: |
---|
20 | |
---|
21 | - An alunimium box : 20 x 20 x 20 cm in size, cerntered at the origin. |
---|
22 | |
---|
23 | - A SiO2 sphere: 5 cm in radius and is placed in the centre of the aluminium box. |
---|
24 | |
---|
25 | 2. PHYSICS |
---|
26 | |
---|
27 | Tranportation process only for all particles. |
---|
28 | |
---|
29 | 3. EVENT: |
---|
30 | |
---|
31 | The event generator is the G4GeneralParticleSource (GPS). The instantiation of G4GeneralParticleSource |
---|
32 | is same as that for G4ParticleGun. See the exGPSPrimaryGeneratorAction.cc file for details . |
---|
33 | |
---|
34 | 5. VISUALIZATION: |
---|
35 | |
---|
36 | Visualisation of the geometry and the tracks is possible with many of the G4 visualisation packages. An |
---|
37 | example of displaying the geometry and tracks using VRML is given in the macro file display_vrml.mac. |
---|
38 | |
---|
39 | 6. ANALYSIS: |
---|
40 | |
---|
41 | This example implements an AIDA-compliant analysis manager which creates histograms and ntuples. |
---|
42 | If user has an AIDA-compliant tool such as AIDAJNI, ANAPHE, or PI installed on his/her system, |
---|
43 | the analysis part of this example can be activated by: |
---|
44 | |
---|
45 | setenv G4ANALYSIS_USE 1 |
---|
46 | |
---|
47 | This needs to be done before building the executable. |
---|
48 | |
---|
49 | At the end of an excution, an xml file "exgps.aida" is created by default which contains |
---|
50 | histograms and ntuples. User can change the name and type of this output file with the commands |
---|
51 | |
---|
52 | /analysis/filetype new-type |
---|
53 | /analysis/fileName new-filename |
---|
54 | |
---|
55 | e.g. |
---|
56 | |
---|
57 | /analysis/filetype hbook |
---|
58 | /analysis/filename exgps.hbook |
---|
59 | |
---|
60 | these change the output file type to "hbook" and name to "exgps.hbbok" |
---|
61 | |
---|
62 | The output file conatins 6 histograms and one ntuple: |
---|
63 | |
---|
64 | histogram 1: The energy spectrum of the primary particles. |
---|
65 | histogram 2: 2d histogram of primary particle incident position distribution in the X-Y plane. |
---|
66 | histogram 3: 2d histogram of primary particle incident position distribution in the X-Z plane. |
---|
67 | histogram 4: 2d histogram of primary particle incident position distribution in the Y-Z plane. |
---|
68 | histogram 5: 2d histogram of primary particle incident angle distribution in terms of Phi/Cos(Theta). |
---|
69 | histogram 6: 2d histogram of primary particle incident angle distribution in terms of Phi/Theta. |
---|
70 | |
---|
71 | The binnings of the histograms can be changed with the UI commands avialable under the |
---|
72 | /analysis directory. |
---|
73 | |
---|
74 | In the ntuple the following data are recorded for each incident particle: |
---|
75 | |
---|
76 | Particle Name |
---|
77 | Incident Position (x,y,z); |
---|
78 | Incident Angle (theta,phi); |
---|
79 | Particle weight; |
---|
80 | |
---|
81 | |
---|
82 | 7. GETTING STARTED: |
---|
83 | |
---|
84 | i) If you have an AIDA-compliant analysis package installed, then you should switch on the analysis |
---|
85 | part of the example by: |
---|
86 | |
---|
87 | setenv G4ANALYSIS_USE 1 |
---|
88 | |
---|
89 | otherwise make sure the G4ANALYSIS_USE is not defined: |
---|
90 | |
---|
91 | unsetenv G4ANALYSIS_USE |
---|
92 | |
---|
93 | ii) Build the exGPS executable: |
---|
94 | |
---|
95 | cd to exgps |
---|
96 | gmake clean |
---|
97 | gmake |
---|
98 | |
---|
99 | gmake will create tmp and bin directories in your $G4TMP and $G4BIN directories. |
---|
100 | The executable, named exGPS, will be created in the $G4BIN/$G4SYSTEM/ directory. |
---|
101 | |
---|
102 | iii) Run the executable: |
---|
103 | |
---|
104 | while in the exgps directory do |
---|
105 | |
---|
106 | $G4BIN/$G4SYSTEM/exGPS exrgps.in |
---|
107 | |
---|
108 | If G4ANALYSIS_USE is defined, one should see a display of the six histograms. If JAIDA is used, one has |
---|
109 | to close the plotter window in order to terminate the execution. After the termination one will find |
---|
110 | the "exgps.aida", as well as a vrml file "g4_00.wrl" in the directory. |
---|
111 | |
---|
112 | 8. FURTHER EXAMPLES of MACRO FILES: |
---|
113 | |
---|
114 | There are a number of g4mac files in the ./macros subdirectory, to show the various features of GPS. |
---|
115 | Most of them will lead to the creation of an aida file in the same name as the macro file. |
---|
116 | These aida files can be examed and analysed with an analysis tool such as JAS3. |
---|
117 | |
---|
118 | Please see the README file there for further information. |
---|
119 | |
---|
120 | |
---|
121 | |
---|
122 | |
---|
123 | |
---|
124 | |
---|