source: trunk/MagicSoft/Mars/mgeom/MGeomCamCT1.cc@ 2384

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