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

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