source: trunk/MagicSoft/Mars/mgeom/MGeomCamCT1Daniel.cc@ 2489

Last change on this file since 2489 was 2463, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 9.5 KB
Line 
1/* ======================================================================== *\
2!
3! *
4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
5! * Software. It is distributed to you in the hope that it can be a useful
6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
7! * It is distributed WITHOUT ANY WARRANTY.
8! *
9! * Permission to use, copy, modify and distribute this software and its
10! * documentation for any purpose is hereby granted without fee,
11! * provided that the above copyright notice appear in all copies and
12! * that both that copyright notice and this permission notice appear
13! * in supporting documentation. It is provided "as is" without express
14! * or implied warranty.
15! *
16!
17!
18! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
19! Author(s): Harald Kornmayer 1/2001
20! Author(s): Wolfgang Wittek 10/2003 <mailto:wittek@mppmu.mpg.de>
21!
22! Copyright: MAGIC Software Development, 2000-2003
23!
24!
25\* ======================================================================== */
26
27/////////////////////////////////////////////////////////////////////////////
28//
29// MGeomCamCT1Daniel
30//
31// This class stores the geometry information of the CT1 camera.
32// The next neighbor information comes from a table, the geometry layout
33// is calculated (for Algorithm see CreateCam
34//
35//
36// The only difference to MGeomCamCT1 is the second argument of MGeomCam
37// (which is the distance camera-reflector)
38// it is dist = 4.8129 m (instead of 4.88 m)
39//
40// together with the pixel diameter of d = 21 mm this gives
41// d/dist = 0.0043633 = 0.25 deg (instead of 0.0043033 = 0.2466 deg)
42//
43////////////////////////////////////////////////////////////////////////////
44#include "MGeomCamCT1Daniel.h"
45
46#include <math.h> // floor
47
48#include "MGeomPix.h"
49
50ClassImp(MGeomCamCT1Daniel);
51
52// --------------------------------------------------------------------------
53//
54// CT1 camera has 127 pixels. For geometry and Next Neighbor info see
55// CreateCam and CreateNN
56//
57MGeomCamCT1Daniel::MGeomCamCT1Daniel(const char *name)
58 : MGeomCam(127, 4.8129, name, "Geometry information of CT1 camera")
59{
60 CreateCam();
61 CreateNN();
62 CalcNumSectors();
63 CalcMaxRadius();
64 CalcPixRatio();
65}
66
67// --------------------------------------------------------------------------
68//
69// Create Next Neighbors: Fill the NN Info into the pixel objects.
70//
71void MGeomCamCT1Daniel::CreateNN()
72{
73 const Short_t nn[127][6] = { // Neighbors of #
74 { 1, 2, 3, 4, 5, 6}, // 0
75 { 0, 2, 6, 7, 8, 18},
76 { 0, 1, 3, 8, 9, 10},
77 { 0, 2, 4, 10, 11, 12},
78 { 0, 3, 5, 12, 13, 14},
79 { 0, 4, 6, 14, 15, 16},
80 { 0, 1, 5, 16, 17, 18},
81 { 1, 8, 18, 19, 20, 36},
82 { 1, 2, 7, 9, 20, 21},
83 { 2, 8, 10, 21, 22, 23},
84 { 2, 3, 9, 11, 23, 24}, // 10
85 { 3, 10, 12, 24, 25, 26},
86 { 3, 4, 11, 13, 26, 27},
87 { 4, 12, 14, 27, 28, 29},
88 { 4, 5, 13, 15, 29, 30},
89 { 5, 14, 16, 30, 31, 32},
90 { 5, 6, 15, 17, 32, 33},
91 { 6, 16, 18, 33, 34, 35},
92 { 1, 6, 7, 17, 35, 36},
93 { 7, 20, 36, 37, 38, 60},
94 { 7, 8, 19, 21, 38, 39}, // 20
95 { 8, 9, 20, 22, 39, 40},
96 { 9, 21, 23, 40, 41, 42},
97 { 9, 10, 22, 24, 42, 43},
98 { 10, 11, 23, 25, 43, 44},
99 { 11, 24, 26, 44, 45, 46},
100 { 11, 12, 25, 27, 46, 47},
101 { 12, 13, 26, 28, 47, 48},
102 { 13, 27, 29, 48, 49, 50},
103 { 13, 14, 28, 30, 50, 51},
104 { 14, 15, 29, 31, 51, 52}, // 30
105 { 15, 30, 32, 52, 53, 54},
106 { 15, 16, 31, 33, 54, 55},
107 { 16, 17, 32, 34, 55, 56},
108 { 17, 33, 35, 56, 57, 58},
109 { 17, 18, 34, 36, 58, 59},
110 { 7, 18, 19, 35, 59, 60},
111 { 19, 38, 60, 61, 62, 90},
112 { 19, 20, 37, 39, 62, 63},
113 { 20, 21, 38, 40, 63, 64},
114 { 21, 22, 39, 41, 64, 65}, // 40
115 { 22, 40, 42, 65, 66, 67},
116 { 22, 23, 41, 43, 67, 68},
117 { 23, 24, 42, 44, 68, 69},
118 { 24, 25, 43, 45, 69, 70},
119 { 25, 44, 46, 70, 71, 72},
120 { 25, 26, 45, 47, 72, 73},
121 { 26, 27, 46, 48, 73, 74},
122 { 27, 28, 47, 49, 74, 75},
123 { 28, 48, 50, 75, 76, 77},
124 { 28, 29, 49, 51, 77, 78}, // 50
125 { 29, 30, 50, 52, 78, 79},
126 { 30, 31, 51, 53, 79, 80},
127 { 31, 52, 54, 80, 81, 82},
128 { 31, 32, 53, 55, 82, 83},
129 { 32, 33, 54, 56, 83, 84},
130 { 33, 34, 55, 57, 84, 85},
131 { 34, 56, 58, 85, 86, 87},
132 { 34, 35, 57, 59, 87, 88},
133 { 35, 36, 58, 60, 88, 89},
134 { 19, 36, 37, 59, 89, 90}, // 60
135 { 37, 62, 90, 91, 92, 126},
136 { 37, 38, 61, 63, 92, 93},
137 { 38, 39, 62, 64, 93, 94},
138 { 39, 40, 63, 65, 94, 95},
139 { 40, 41, 64, 66, 95, 96},
140 { 41, 65, 67, 96, 97, 98},
141 { 41, 42, 66, 68, 98, 99},
142 { 42, 43, 67, 69, 99, 100},
143 { 43, 44, 68, 70, 100, 101},
144 { 44, 45, 69, 71, 101, 102}, // 70
145 { 45, 70, 72, 102, 103, 104},
146 { 45, 46, 71, 73, 104, 105},
147 { 46, 47, 72, 74, 105, 106},
148 { 47, 48, 73, 75, 106, 107},
149 { 48, 49, 74, 76, 107, 108},
150 { 49, 75, 77, 108, 109, 110},
151 { 49, 50, 76, 78, 110, 111},
152 { 50, 51, 77, 79, 111, 112},
153 { 51, 52, 78, 80, 112, 113},
154 { 52, 53, 79, 81, 113, 114}, // 80
155 { 53, 80, 82, 114, 115, 116},
156 { 53, 54, 81, 83, 116, 117},
157 { 54, 55, 82, 84, 117, 118},
158 { 55, 56, 83, 85, 118, 119},
159 { 56, 57, 84, 86, 119, 120},
160 { 57, 85, 87, 120, 121, 122},
161 { 57, 58, 86, 88, 122, 123},
162 { 58, 59, 87, 89, 123, 124},
163 { 59, 60, 88, 90, 124, 125},
164 { 37, 60, 61, 89, 125, 126}, // 90
165 { 61, 92, 126, -1, -1, -1},
166 { 61, 62, 91, 93, -1, -1},
167 { 62, 63, 92, 94, -1, -1},
168 { 63, 64, 93, 95, -1, -1},
169 { 64, 65, 94, 96, -1, -1},
170 { 65, 66, 95, 97, -1, -1},
171 { 66, 96, 98, -1, -1, -1},
172 { 66, 67, 97, 99, -1, -1},
173 { 67, 68, 98, 100, -1, -1},
174 { 68, 69, 99, 101, -1, -1}, // 100
175 { 69, 70, 100, 102, -1, -1},
176 { 70, 71, 101, 103, -1, -1},
177 { 71, 102, 104, -1, -1, -1},
178 { 71, 72, 103, 105, -1, -1},
179 { 72, 73, 104, 106, -1, -1},
180 { 73, 74, 105, 107, -1, -1},
181 { 74, 75, 106, 108, -1, -1},
182 { 75, 76, 107, 109, -1, -1},
183 { 76, 108, 110, -1, -1, -1},
184 { 76, 77, 109, 111, -1, -1}, // 110
185 { 77, 78, 110, 112, -1, -1},
186 { 78, 79, 111, 113, -1, -1},
187 { 79, 80, 112, 114, -1, -1},
188 { 80, 81, 113, 115, -1, -1},
189 { 81, 114, 116, -1, -1, -1},
190 { 81, 82, 115, 117, -1, -1},
191 { 82, 83, 116, 118, -1, -1},
192 { 83, 84, 117, 119, -1, -1},
193 { 84, 85, 118, 120, -1, -1},
194 { 85, 86, 119, 121, -1, -1}, // 120
195 { 86, 120, 122, -1, -1, -1},
196 { 86, 87, 121, 123, -1, -1},
197 { 87, 88, 122, 124, -1, -1},
198 { 88, 89, 123, 125, -1, -1},
199 { 89, 90, 124, 126, -1, -1},
200 { 61, 90, 91, 125, -1, -1} // 126
201 };
202
203 for (Int_t i=0; i<127; i++)
204 (*this)[i].SetNeighbors(nn[i][0], nn[i][1], nn[i][2],
205 nn[i][3], nn[i][4], nn[i][5]);
206
207 InitOuterRing();
208}
209
210// --------------------------------------------------------------------------
211//
212// Calculate the geometry information of CT1 and fill this information
213// into the pixel objects.
214//
215void MGeomCamCT1Daniel::CreateCam()
216{
217 //
218 // fill the geometry class with the coordinates of the CT1 camera
219 //
220 //*fLog << inf << " Create CT1 geometry " << endl;
221
222 //
223 // this algorithm is from Martin Kestel originally
224 // it was punt into a root/C++ context by Harald Kornmayer and Thomas Bretz
225
226 const Float_t diameter = 21; // units are mm
227 const Float_t kS32 = sqrt(3)/2;
228
229 //
230 // add the first pixel to the list
231 //
232 Int_t pixnum = 0;
233
234 (*this)[pixnum++].Set(0, 0, diameter);
235
236 for (Int_t ring=1; ring<7; ring++)
237 {
238 //
239 // calc. coords for this ring counting from the
240 // starting number to the ending number
241 //
242 for (int i=0; i<ring; i++)
243 (*this)[pixnum++].Set((ring-i*0.5)*diameter,
244 i*kS32*diameter,
245 diameter);
246
247 for (int i=0; i<ring; i++)
248 (*this)[pixnum++].Set((ring*0.5-i)*diameter,
249 ring*kS32 * diameter,
250 diameter);
251
252 for (int i=0; i<ring; i++)
253 (*this)[pixnum++].Set(-(ring+i)*0.5*diameter,
254 (ring-i)*kS32*diameter,
255 diameter);
256
257 for (int i=0; i<ring; i++)
258 (*this)[pixnum++].Set((0.5*i-ring)*diameter,
259 -i*kS32*diameter,
260 diameter);
261
262 for (int i=0; i<ring; i++)
263 (*this)[pixnum++].Set((i-ring*0.5)*diameter,
264 -ring*kS32 * diameter,
265 diameter);
266
267 for (int i=0; i<ring; i++)
268 (*this)[pixnum++].Set((ring+i)*0.5*diameter,
269 (-ring+i)*kS32*diameter,
270 diameter);
271 }
272}
273
Note: See TracBrowser for help on using the repository browser.