source: trunk/MagicSoft/Mars/mgui/MCamGeom.cc@ 607

Last change on this file since 607 was 589, checked in by harald, 24 years ago
Added some file for the Display and for the Geometry description.
File size: 19.5 KB
Line 
1#include "MCamGeom.h"
2
3#include <math.h>
4#include <TClonesArray.h>
5#include "TCanvas.h"
6
7#include "MHexagon.h"
8
9ClassImp(MPixGeom)
10ClassImp(MCamGeom)
11
12MPixGeom::MPixGeom(Float_t x, Float_t y, Float_t r )
13{
14 // default constructor
15 fX = x ;
16 fY = y ;
17 fR = r ;
18}
19
20
21void MPixGeom::Print()
22{
23 // information about a pixel
24 cout << "MPixGeom: x= " << fX
25 << " y= " << fY
26 << " r= " << fR
27 << endl ;
28}
29
30// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
31// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
32// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
33
34
35MCamGeom::MCamGeom (Int_t type )
36{
37 // default constructor
38
39 if ( type == 1 ) {
40 // set up the Geometry of CT1
41
42 fNbPixels = 127 ;
43 fPixels = new TObjArray ( fNbPixels ) ;
44
45 CreateCT1() ;
46 }
47 else {
48 // set up the standard Geometry MAGIC
49 fNbPixels = 577 ;
50 fPixels = new TObjArray ( fNbPixels ) ;
51
52 CreateMagic() ;
53 }
54}
55
56void MCamGeom::Draw( Option_t * )
57{
58 TCanvas *can = new TCanvas("can", "Camera Geometry", 4 ) ;
59
60 // set the range of the canvas
61 if ( fNbPixels == 127 ) // case of CT1
62 can->Range(-175, -175, 175, 175 ) ;
63 else
64 can->Range(-600, -600, 600, 600 ) ;
65
66 // draw all pixels
67
68 for ( Int_t i=0; i < fNbPixels ; i++ ) {
69 MHexagon *el = new MHexagon ( GetX(i) , GetY(i) , GetR(i) ) ;
70 el->Draw() ;
71 }
72
73}
74
75void MCamGeom::Print()
76{
77 // Print Information about the Geometry of the camera
78 cout << "++++++++++++++++++++++++++++++++++++++++" << endl ;
79 cout << " Number of Pixels: " << fNbPixels << endl ;
80
81 for ( Int_t i=0; i<fNbPixels; i++ ) {
82 cout << " Pixel: " << i << " " ;
83 ((MPixGeom *)fPixels->At(i))->Print() ;
84 }
85}
86
87Int_t MCamGeom::GetNbPixels ()
88{
89 // return the Number of pixels in the MCamGeom class
90 return fNbPixels ;
91
92}
93Float_t MCamGeom::GetX(Int_t iPix)
94{
95 // return the X coordinate of Pixel iPix
96
97 return ( ((MPixGeom*) fPixels->At(iPix))->GetX() ) ;
98}
99
100Float_t MCamGeom::GetY(Int_t iPix)
101{
102 // return the Y coordinate of Pixel iPix
103 return ( ((MPixGeom*) fPixels->At(iPix))->GetY() ) ;
104}
105
106Float_t MCamGeom::GetR(Int_t iPix)
107{
108 // return the radius r of Pixel iPix
109 return ( ((MPixGeom*) fPixels->At(iPix))->GetR() ) ;
110}
111
112
113void MCamGeom::CreateMagic()
114{
115 // fill the geometry class with the coordinates of the MAGIC camera
116 cout << " Create Magic geometry " << endl ;
117
118 // here define the hardwire things of the magic telescope
119 //
120 Float_t xtemp[577] = {
121 0.000, 30.000, 15.000, -15.000, -30.000, -15.000, 15.000, 60.000,
122 45.000, 30.000, 0.000, -30.000, -45.000, -60.000, -45.000, -30.000,
123 0.000, 30.000, 45.000, 90.000, 75.000, 60.000, 45.000, 15.000,
124 -15.000, -45.000, -60.000, -75.000, -90.000, -75.000, -60.000, -45.000,
125 -15.000, 15.000, 45.000, 60.000, 75.000, 120.000, 105.000, 90.000,
126 75.000, 60.000, 30.000, 0.000, -30.000, -60.000, -75.000, -90.000,
127 -105.000, -120.000, -105.000, -90.000, -75.000, -60.000, -30.000, 0.000,
128 30.000, 60.000, 75.000, 90.000, 105.000, 150.000, 135.000, 120.000,
129 105.000, 90.000, 75.000, 45.000, 15.000, -15.000, -45.000, -75.000,
130 -90.000, -105.000, -120.000, -135.000, -150.000, -135.000, -120.000, -105.000,
131 -90.000, -75.000, -45.000, -15.000, 15.000, 45.000, 75.000, 90.000,
132 105.000, 120.000, 135.000, 180.000, 165.000, 150.000, 135.000, 120.000,
133 105.000, 90.000, 60.000, 30.000, 0.000, -30.000, -60.000, -90.000,
134 -105.000, -120.000, -135.000, -150.000, -165.000, -180.000, -165.000, -150.000,
135 -135.000, -120.000, -105.000, -90.000, -60.000, -30.000, 0.000, 30.000,
136 60.000, 90.000, 105.000, 120.000, 135.000, 150.000, 165.000, 210.000,
137 195.000, 180.000, 165.000, 150.000, 135.000, 120.000, 105.000, 75.000,
138 45.000, 15.000, -15.000, -45.000, -75.000, -105.000, -120.000, -135.000,
139 -150.000, -165.000, -180.000, -195.000, -210.000, -195.000, -180.000, -165.000,
140 -150.000, -135.000, -120.000, -105.000, -75.000, -45.000, -15.000, 15.000,
141 45.000, 75.000, 105.000, 120.000, 135.000, 150.000, 165.000, 180.000,
142 195.000, 240.000, 225.000, 210.000, 195.000, 180.000, 165.000, 150.000,
143 135.000, 120.000, 90.000, 60.000, 30.000, 0.000, -30.000, -60.000,
144 -90.000, -120.000, -135.000, -150.000, -165.000, -180.000, -195.000, -210.000,
145 -225.000, -240.000, -225.000, -210.000, -195.000, -180.000, -165.000, -150.000,
146 -135.000, -120.000, -90.000, -60.000, -30.000, 0.000, 30.000, 60.000,
147 90.000, 120.000, 135.000, 150.000, 165.000, 180.000, 195.000, 210.000,
148 225.000, 270.000, 255.000, 240.000, 225.000, 210.000, 195.000, 180.000,
149 165.000, 150.000, 135.000, 105.000, 75.000, 45.000, 15.000, -15.000,
150 -45.000, -75.000, -105.000, -135.000, -150.000, -165.000, -180.000, -195.000,
151 -210.000, -225.000, -240.000, -255.000, -270.000, -255.000, -240.000, -225.000,
152 -210.000, -195.000, -180.000, -165.000, -150.000, -135.000, -105.000, -75.000,
153 -45.000, -15.000, 15.000, 45.000, 75.000, 105.000, 135.000, 150.000,
154 165.000, 180.000, 195.000, 210.000, 225.000, 240.000, 255.000, 300.000,
155 285.000, 270.000, 255.000, 240.000, 225.000, 210.000, 195.000, 180.000,
156 165.000, 150.000, 120.000, 90.000, 60.000, 30.000, 0.000, -30.000,
157 -60.000, -90.000, -120.000, -150.000, -165.000, -180.000, -195.000, -210.000,
158 -225.000, -240.000, -255.000, -270.000, -285.000, -300.000, -285.000, -270.000,
159 -255.000, -240.000, -225.000, -210.000, -195.000, -180.000, -165.000, -150.000,
160 -120.000, -90.000, -60.000, -30.000, 0.000, 30.000, 60.000, 90.000,
161 120.000, 150.000, 165.000, 180.000, 195.000, 210.000, 225.000, 240.000,
162 255.000, 270.000, 285.000, 330.000, 315.000, 300.000, 285.000, 270.000,
163 255.000, 240.000, 225.000, 210.000, 195.000, 180.000, 165.000, 135.000,
164 105.000, 75.000, 45.000, 15.000, -15.000, -45.000, -75.000, -105.000,
165 -135.000, -165.000, -180.000, -195.000, -210.000, -225.000, -240.000, -255.000,
166 -270.000, -285.000, -300.000, -315.000, -330.000, -315.000, -300.000, -285.000,
167 -270.000, -255.000, -240.000, -225.000, -210.000, -195.000, -180.000, -165.000,
168 -135.000, -105.000, -75.000, -45.000, -15.000, 15.000, 45.000, 75.000,
169 105.000, 135.000, 165.000, 180.000, 195.000, 210.000, 225.000, 240.000,
170 255.000, 270.000, 285.000, 300.000, 315.000, 360.000, 330.000, 300.000,
171 270.000, 240.000, 210.000, 150.000, 90.000, 30.000, -30.000, -90.000,
172 -150.000, -210.000, -240.000, -270.000, -300.000, -330.000, -360.000, -360.000,
173 -330.000, -300.000, -270.000, -240.000, -210.000, -150.000, -90.000, -30.000,
174 30.000, 90.000, 150.000, 210.000, 240.000, 270.000, 300.000, 330.000,
175 360.000, 420.000, 390.000, 360.000, 330.000, 300.000, 270.000, 240.000,
176 180.000, 120.000, 60.000, 0.000, -60.000, -120.000, -180.000, -240.000,
177 -270.000, -300.000, -330.000, -360.000, -390.000, -420.000, -420.000, -390.000,
178 -360.000, -330.000, -300.000, -270.000, -240.000, -180.000, -120.000, -60.000,
179 0.000, 60.000, 120.000, 180.000, 240.000, 270.000, 300.000, 330.000,
180 360.000, 390.000, 420.000, 480.000, 450.000, 420.000, 390.000, 360.000,
181 330.000, 300.000, 270.000, 210.000, 150.000, 90.000, 30.000, -30.000,
182 -90.000, -150.000, -210.000, -270.000, -300.000, -330.000, -360.000, -390.000,
183 -420.000, -450.000, -480.000, -480.000, -450.000, -420.000, -390.000, -360.000,
184 -330.000, -300.000, -270.000, -210.000, -150.000, -90.000, -30.000, 30.000,
185 90.000, 150.000, 210.000, 270.000, 300.000, 330.000, 360.000, 390.000,
186 420.000, 450.000, 480.000, 540.000, 510.000, 480.000, 450.000, 420.000,
187 390.000, 360.000, 330.000, 300.000, 240.000, 180.000, 120.000, 60.000,
188 0.000, -60.000, -120.000, -180.000, -240.000, -300.000, -330.000, -360.000,
189 -390.000, -420.000, -450.000, -480.000, -510.000, -540.000, -540.000, -510.000,
190 -480.000, -450.000, -420.000, -390.000, -360.000, -330.000, -300.000, -240.000,
191 -180.000, -120.000, -60.000, 0.000, 60.000, 120.000, 180.000, 240.000,
192 300.000, 330.000, 360.000, 390.000, 420.000, 450.000, 480.000, 510.000,
193 540.000
194 } ;
195
196 Float_t ytemp[577] = {
197 0.000, 0.000, 25.981, 25.981, 0.000, -25.981, -25.981, 0.000,
198 25.981, 51.961, 51.961, 51.961, 25.981, 0.000, -25.981, -51.961,
199 -51.961, -51.961, -25.981, 0.000, 25.981, 51.961, 77.942, 77.942,
200 77.942, 77.942, 51.961, 25.981, 0.000, -25.981, -51.961, -77.942,
201 -77.942, -77.942, -77.942, -51.961, -25.981, 0.000, 25.981, 51.961,
202 77.942, 103.923, 103.923, 103.923, 103.923, 103.923, 77.942, 51.961,
203 25.981, 0.000, -25.981, -51.961, -77.942, -103.923, -103.923, -103.923,
204 -103.923, -103.923, -77.942, -51.961, -25.981, 0.000, 25.981, 51.961,
205 77.942, 103.923, 129.904, 129.904, 129.904, 129.904, 129.904, 129.904,
206 103.923, 77.942, 51.961, 25.981, 0.000, -25.981, -51.961, -77.942,
207 -103.923, -129.904, -129.904, -129.904, -129.904, -129.904, -129.904, -103.923,
208 -77.942, -51.961, -25.981, 0.000, 25.981, 51.961, 77.942, 103.923,
209 129.904, 155.885, 155.885, 155.885, 155.885, 155.885, 155.885, 155.885,
210 129.904, 103.923, 77.942, 51.961, 25.981, 0.000, -25.981, -51.961,
211 -77.942, -103.923, -129.904, -155.885, -155.885, -155.885, -155.885, -155.885,
212 -155.885, -155.885, -129.904, -103.923, -77.942, -51.961, -25.981, 0.000,
213 25.981, 51.961, 77.942, 103.923, 129.904, 155.885, 181.865, 181.865,
214 181.865, 181.865, 181.865, 181.865, 181.865, 181.865, 155.885, 129.904,
215 103.923, 77.942, 51.961, 25.981, 0.000, -25.981, -51.961, -77.942,
216 -103.923, -129.904, -155.885, -181.865, -181.865, -181.865, -181.865, -181.865,
217 -181.865, -181.865, -181.865, -155.885, -129.904, -103.923, -77.942, -51.961,
218 -25.981, 0.000, 25.981, 51.961, 77.942, 103.923, 129.904, 155.885,
219 181.865, 207.846, 207.846, 207.846, 207.846, 207.846, 207.846, 207.846,
220 207.846, 207.846, 181.865, 155.885, 129.904, 103.923, 77.942, 51.961,
221 25.981, 0.000, -25.981, -51.961, -77.942, -103.923, -129.904, -155.885,
222 -181.865, -207.846, -207.846, -207.846, -207.846, -207.846, -207.846, -207.846,
223 -207.846, -207.846, -181.865, -155.885, -129.904, -103.923, -77.942, -51.961,
224 -25.981, 0.000, 25.981, 51.961, 77.942, 103.923, 129.904, 155.885,
225 181.865, 207.846, 233.827, 233.827, 233.827, 233.827, 233.827, 233.827,
226 233.827, 233.827, 233.827, 233.827, 207.846, 181.865, 155.885, 129.904,
227 103.923, 77.942, 51.961, 25.981, 0.000, -25.981, -51.961, -77.942,
228 -103.923, -129.904, -155.885, -181.865, -207.846, -233.827, -233.827, -233.827,
229 -233.827, -233.827, -233.827, -233.827, -233.827, -233.827, -233.827, -207.846,
230 -181.865, -155.885, -129.904, -103.923, -77.942, -51.961, -25.981, 0.000,
231 25.981, 51.961, 77.942, 103.923, 129.904, 155.885, 181.865, 207.846,
232 233.827, 259.808, 259.808, 259.808, 259.808, 259.808, 259.808, 259.808,
233 259.808, 259.808, 259.808, 259.808, 233.827, 207.846, 181.865, 155.885,
234 129.904, 103.923, 77.942, 51.961, 25.981, 0.000, -25.981, -51.961,
235 -77.942, -103.923, -129.904, -155.885, -181.865, -207.846, -233.827, -259.808,
236 -259.808, -259.808, -259.808, -259.808, -259.808, -259.808, -259.808, -259.808,
237 -259.808, -259.808, -233.827, -207.846, -181.865, -155.885, -129.904, -103.923,
238 -77.942, -51.961, -25.981, 0.000, 25.981, 51.961, 77.942, 103.923,
239 129.904, 155.885, 181.865, 207.846, 233.827, 259.808, 285.788, 285.788,
240 285.788, 285.788, 285.788, 285.788, 285.788, 285.788, 285.788, 285.788,
241 285.788, 285.788, 259.808, 233.827, 207.846, 181.865, 155.885, 129.904,
242 103.923, 77.942, 51.961, 25.981, 0.000, -25.981, -51.961, -77.942,
243 -103.923, -129.904, -155.885, -181.865, -207.846, -233.827, -259.808, -285.788,
244 -285.788, -285.788, -285.788, -285.788, -285.788, -285.788, -285.788, -285.788,
245 -285.788, -285.788, -285.788, -259.808, -233.827, -207.846, -181.865, -155.885,
246 -129.904, -103.923, -77.942, -51.961, -25.981, 34.641, 86.603, 138.564,
247 190.526, 242.487, 294.449, 329.090, 329.090, 329.090, 329.090, 329.090,
248 329.090, 294.449, 242.487, 190.526, 138.564, 86.603, 34.641, -34.641,
249 -86.603, -138.564, -190.526, -242.487, -294.449, -329.090, -329.090, -329.090,
250 -329.090, -329.090, -329.090, -294.449, -242.487, -190.526, -138.564, -86.603,
251 -34.641, 34.641, 86.603, 138.564, 190.526, 242.487, 294.449, 346.410,
252 381.051, 381.051, 381.051, 381.051, 381.051, 381.051, 381.051, 346.410,
253 294.449, 242.487, 190.526, 138.564, 86.603, 34.641, -34.641, -86.603,
254 -138.564, -190.526, -242.487, -294.449, -346.410, -381.051, -381.051, -381.051,
255 -381.051, -381.051, -381.051, -381.051, -346.410, -294.449, -242.487, -190.526,
256 -138.564, -86.603, -34.641, 34.641, 86.603, 138.564, 190.526, 242.487,
257 294.449, 346.410, 398.372, 433.013, 433.013, 433.013, 433.013, 433.013,
258 433.013, 433.013, 433.013, 398.372, 346.410, 294.449, 242.487, 190.526,
259 138.564, 86.603, 34.641, -34.641, -86.603, -138.564, -190.526, -242.487,
260 -294.449, -346.410, -398.372, -433.013, -433.013, -433.013, -433.013, -433.013,
261 -433.013, -433.013, -433.013, -398.372, -346.410, -294.449, -242.487, -190.526,
262 -138.564, -86.603, -34.641, 34.641, 86.603, 138.564, 190.526, 242.487,
263 294.449, 346.410, 398.372, 450.333, 484.974, 484.974, 484.974, 484.974,
264 484.974, 484.974, 484.974, 484.974, 484.974, 450.333, 398.372, 346.410,
265 294.449, 242.487, 190.526, 138.564, 86.603, 34.641, -34.641, -86.603,
266 -138.564, -190.526, -242.487, -294.449, -346.410, -398.372, -450.333, -484.974,
267 -484.974, -484.974, -484.974, -484.974, -484.974, -484.974, -484.974, -484.974,
268 -450.333, -398.372, -346.410, -294.449, -242.487, -190.526, -138.564, -86.603,
269 -34.641
270 } ;
271
272 Float_t rtemp[577] = {
273 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
274 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
275 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
276 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
277 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
278 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
279 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
280 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
281 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
282 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
283 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
284 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
285 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
286 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
287 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
288 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
289 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
290 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
291 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
292 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
293 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
294 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
295 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
296 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
297 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
298 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
299 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
300 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
301 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
302 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
303 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
304 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
305 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
306 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
307 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
308 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
309 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
310 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
311 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
312 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
313 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
314 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
315 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
316 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
317 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
318 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
319 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
320 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
321 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
322 30.00,30.00,30.00,30.00,30.00,60.00,60.00,60.00,
323 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
324 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
325 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
326 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
327 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
328 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
329 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
330 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
331 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
332 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
333 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
334 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
335 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
336 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
337 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
338 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
339 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
340 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
341 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
342 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
343 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
344 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
345 60.00 } ;
346
347 // fill the pixels list with this data
348
349 for ( Int_t i = 0 ; i< fNbPixels ; i++ ) {
350 fPixels->Add( new MPixGeom(xtemp[i], ytemp[i], rtemp[i]) ) ;
351 }
352}
353
354void MCamGeom::CreateCT1()
355{
356 // fill the geometry class with the coordinates of the CT1 camera
357 cout << " Create CT1 geometry " << endl ;
358 // use a function from Martin Kestel
359
360 float fpixdiameter = 21. ; // units are cm
361 int ring_counter=1, ipix;
362 int num_pix_this_ring;
363 int new_ring_start, end_this_ring;
364 int end_last_ring = 1;
365 float fang, ffrac_ang, frad;
366 float pi=4.*atan(1.);
367
368 // add the first pixel to the list
369
370 fPixels->Add( new MPixGeom( 0. ,0., fpixdiameter ) ) ;
371 for (ring_counter=1;ring_counter<7;ring_counter++) {
372 /* calc. numofpix in ring number i first */
373 num_pix_this_ring = ring_counter*6;
374
375 /* get then the start-of-ring pixel number */
376 new_ring_start = end_last_ring;
377
378 /* .... this means the ring ends with pixnum ... */
379 end_this_ring = end_last_ring + num_pix_this_ring;
380
381 /* calc. coords for this ring counting from the
382 starting number to the ending number */
383 for (ipix = 0;
384 ipix < num_pix_this_ring;
385 ipix++) {
386 fang = 60./(float)ring_counter * (float)ipix;
387 ffrac_ang = fang - 60.*((int)(floor(fang/60.)));
388 fang *= pi/180.;
389 ffrac_ang *= pi/180.;
390 frad = (float)ring_counter * fpixdiameter ;
391 frad *= sqrt(3.)/(2.*sin(2./3.*pi-ffrac_ang));
392
393 // fill the ObjArray with the pixels data ;
394
395 fPixels->Add( new MPixGeom( frad * cos(fang) ,frad * sin(fang) , fpixdiameter ) ) ;
396 }
397
398 /* set the end-of-ring number correctly */
399 end_last_ring = end_this_ring ;
400 }
401
402}
403
Note: See TracBrowser for help on using the repository browser.