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

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