source: trunk/MagicSoft/Mars/mgui/MGeomCamCT1.cc@ 967

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