source: trunk/MagicSoft/Mars/macros/testMTrans.C@ 4693

Last change on this file since 4693 was 4675, checked in by wittek, 20 years ago
*** empty log message ***
File size: 16.3 KB
Line 
1
2/////////////////////////////////////////////////////////////////////////////
3// //
4// Description: Macro to test the class MTransCelLocCam
5//
6// Author: Wolfgang Wittek (wittek@mppmu.mpg.de)
7// Date: 08/2004
8// //
9/////////////////////////////////////////////////////////////////////////////
10
11void testMTrans()
12{
13 gLog->SetNoColors();
14
15
16 MGeomCamMagic geom;
17 MObservatory obs;
18
19 MTransCelLocCam trans(geom, obs);
20
21 trans.SetGridParameters(0.50, 0.1);
22
23
24 trans.PlotGridAtTheta0Phi0("Plot_2a", 0.001,135.0);
25 trans.PlotGridAtTheta0Phi0("Plot_2b", 30.00,135.0);
26 trans.PlotGridAtTheta0Phi0("Plot_2c", 60.00,135.0);
27 trans.PlotGridAtTheta0Phi0("Plot_2d", 90.00,135.0);
28
29 trans.PlotGridAtTheta0Phi0("Plot1a", 0.001, 0.0);
30 trans.PlotGridAtTheta0Phi0("Plot1b", 30.00, 0.0);
31 trans.PlotGridAtTheta0Phi0("Plot1c", 60.00, 0.0);
32 trans.PlotGridAtTheta0Phi0("Plot1d", 90.00, 0.0);
33
34 trans.PlotGridAtTheta0Phi0("Plot2a", 0.001, 90.0);
35 trans.PlotGridAtTheta0Phi0("Plot2b", 30.00, 90.0);
36 trans.PlotGridAtTheta0Phi0("Plot2c", 60.00, 90.0);
37 trans.PlotGridAtTheta0Phi0("Plot2d", 90.00, 90.0);
38
39
40 trans.PlotGridAtTheta0Phi0("Plot3a", 0.001, 180.0);
41 trans.PlotGridAtTheta0Phi0("Plot3b", 30.00, 180.0);
42 trans.PlotGridAtTheta0Phi0("Plot3c", 60.00, 180.0);
43 trans.PlotGridAtTheta0Phi0("Plot3d", 90.00, 180.0);
44
45 trans.PlotGridAtTheta0Phi0("Plot4a", 0.001, 270.0);
46 trans.PlotGridAtTheta0Phi0("Plot4b", 30.00, 270.0);
47 trans.PlotGridAtTheta0Phi0("Plot4c", 60.00, 270.0);
48 trans.PlotGridAtTheta0Phi0("Plot4d", 90.00, 270.0);
49
50 trans.PlotGridAtDec0H0 ("Plot5a", 89.999, -12.0);
51 trans.PlotGridAtDec0H0 ("Plot5b", 60.000, -12.0);
52 trans.PlotGridAtDec0H0 ("Plot5c", 30.000, -12.0);
53 trans.PlotGridAtDec0H0 ("Plot5d", 0.000, -12.0);
54 trans.PlotGridAtDec0H0 ("Plot5e",-30.000, -12.0);
55
56 trans.PlotGridAtDec0H0 ("Plot6a", 89.999, -6.0);
57 trans.PlotGridAtDec0H0 ("Plot6b", 60.000, -6.0);
58 trans.PlotGridAtDec0H0 ("Plot6c", 30.000, -6.0);
59 trans.PlotGridAtDec0H0 ("Plot6d", 0.000, -6.0);
60 trans.PlotGridAtDec0H0 ("Plot6e",-30.000, -6.0);
61
62 trans.PlotGridAtDec0H0 ("Plot7a", 89.999, 0.0);
63 trans.PlotGridAtDec0H0 ("Plot7b", 60.000, 0.0);
64 trans.PlotGridAtDec0H0 ("Plot7c", 30.000, 0.0);
65 trans.PlotGridAtDec0H0 ("Plot7d", 0.000, 0.0);
66 trans.PlotGridAtDec0H0 ("Plot7e",-30.000, 0.0);
67
68 trans.PlotGridAtDec0H0 ("Plot8a", 89.999, 6.0);
69 trans.PlotGridAtDec0H0 ("Plot8b", 60.000, 6.0);
70 trans.PlotGridAtDec0H0 ("Plot8c", 30.000, 6.0);
71 trans.PlotGridAtDec0H0 ("Plot8d", 0.000, 6.0);
72 trans.PlotGridAtDec0H0 ("Plot8e",-30.000, 6.0);
73
74 //===================================================
75 // special tests
76
77 gLog << "==============================================================="
78 << endl;
79
80 Double_t th1 = 10.0;
81 Double_t ph1 = 200.0;
82 Double_t X1 = 0.0;
83 Double_t Y1 = 0.0;
84 Double_t X2 = 100.0;
85 Double_t Y2 = 50.0;
86 Double_t th2;
87 Double_t ph2;
88
89 trans.LocCamCamToLoc(th1, ph1, X1, Y1, X2, Y2, th2, ph2);
90 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
91 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
92 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
93
94 trans.Loc0CamToLoc(th1, ph1, X2, Y2, th2, ph2);
95 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
96 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
97 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
98
99 trans.Loc0LocToCam(th1, ph1, th2, ph2, X2, Y2);
100 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
101 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
102 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
103
104 trans.LocCamToLoc0(th2, ph2, X2, Y2, th1, ph1);
105 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
106 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
107 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
108
109 trans.LocCamLocToCam(th1, ph1, X1, Y1, th2, ph2, X2, Y2);
110 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
111 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
112 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
113
114 trans.Loc0LocToCam(th1, ph1, th2, ph2, X2, Y2);
115 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
116 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
117 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
118 gLog << "==============================================================="
119 << endl;
120
121 //---------------------
122
123 gLog << "==============================================================="
124 << endl;
125
126 th1 = th2;
127 ph1 = ph2;
128 X1 = 100.0;
129 Y1 = 50.0;
130 X2 = 0.0;
131 Y2 = 0.0;
132
133 trans.LocCamCamToLoc(th1, ph1, X1, Y1, X2, Y2, th2, ph2);
134 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
135 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
136 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
137
138 trans.LocCamToLoc0(th1, ph1, X1, Y1, th2, ph2);
139 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
140 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
141 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
142
143 trans.Loc0CamToLoc(th2, ph2, X1, Y1, th1, ph1);
144 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
145 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
146 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
147
148 trans.Loc0LocToCam(th2, ph2, th1, ph1, X1, Y1);
149 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
150 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
151 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
152
153 trans.LocCamLocToCam(th1, ph1, X1, Y1, th2, ph2, X2, Y2);
154 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
155 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
156 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
157
158 gLog << "==============================================================="
159 << endl;
160
161 gLog << "==============================================================="
162 << endl;
163
164 Double_t de1 = 10.0;
165 Double_t ho1 = 200.0;
166 Double_t XX1 = 0.0;
167 Double_t YY1 = 0.0;
168 Double_t XX2 = 100.0;
169 Double_t YY2 = 50.0;
170 Double_t de2;
171 Double_t ho2;
172
173 trans.CelCamCamToCel(de1, ho1, XX1, YY1, XX2, YY2, de2, ho2);
174 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
175 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
176 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
177
178 trans.Cel0CamToCel(de1, ho1, XX2, YY2, de2, ho2);
179 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
180 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
181 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
182
183 trans.CelCamCelToCam(de1, ho1, XX1, YY1, de2, ho2, XX2, YY2);
184 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
185 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
186 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
187
188 trans.Cel0CelToCam(de1, ho1, de2, ho2, XX2, YY2);
189 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
190 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
191 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
192
193
194 gLog << "==============================================================="
195 << endl;
196
197 gLog << "==============================================================="
198 << endl;
199
200 de1 = de2;
201 ho1 = ho2;
202 XX1 = 100.0;
203 YY1 = 50.0;
204 XX2 = 0.0;
205 YY2 = 0.0;
206
207 trans.CelCamCamToCel(de1, ho1, XX1, YY1, XX2, YY2, de2, ho2);
208 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
209 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
210 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
211
212 trans.CelCamToCel0(de1, ho1, XX1, YY1, de2, ho2);
213 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
214 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
215 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
216
217 trans.CelCamCelToCam(de1, ho1, XX1, YY1, de2, ho2, XX2, YY2);
218 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
219 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
220 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
221
222 gLog << "==============================================================="
223 << endl;
224
225 //---------------------
226
227 gLog << "==============================================================="
228 << endl;
229
230 th1 = 70.0;
231 ph1 = 200.0;
232 X1 = 100.0;
233 Y1 = 50.0;
234 X2 = 120.0;
235 Y2 = -30.0;
236
237 Double_t th0;
238 Double_t ph0;
239
240 trans.LocCamCamToLoc(th1, ph1, X1, Y1, X2, Y2, th2, ph2);
241 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
242 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
243 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
244
245 trans.LocCamCamToLoc(th2, ph2, X2, Y2, X1, Y1, th1, ph1);
246 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
247 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
248 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
249
250 trans.LocCamToLoc0(th1, ph1, X1, Y1, th0, ph0);
251 gLog << "th0, ph0 = " << th0 << ", " << ph0 << endl;
252
253 trans.Loc0CamToLoc(th0, ph0, X1, Y1, th1, ph1);
254 gLog << "th1, ph1 = " << th1 << ", " << ph1 << endl;
255
256 trans.Loc0CamToLoc(th0, ph0, X2, Y2, th2, ph2);
257 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
258 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
259 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
260
261 trans.LocCamToLoc0(th2, ph2, X2, Y2, th0, ph0);
262 gLog << "th0, ph0 = " << th0 << ", " << ph0 << endl;
263 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
264 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
265 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
266
267 trans.LocCamLocToCam(th1, ph1, X1, Y1, th2, ph2, X2, Y2);
268 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
269 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
270 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
271
272 trans.LocCamLocToCam(th2, ph2, X2, Y2, th1, ph1, X1, Y1);
273 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
274 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
275 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
276
277 trans.LocCamToLoc0(th1, ph1, X1, Y1, th0, ph0);
278 gLog << "th0, ph0 = " << th0 << ", " << ph0 << endl;
279
280 trans.Loc0LocToCam(th0, ph0, th2, ph2, X2, Y2);
281
282 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
283 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
284 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
285
286 gLog << "==============================================================="
287 << endl;
288
289 gLog << "==============================================================="
290 << endl;
291
292 th1 = th2;
293 ph1 = ph2;
294 X1 = 120.0;
295 Y1 = -30.0;
296 X2 = 100.0;
297 Y2 = 50.0;
298
299 Double_t th0;
300 Double_t ph0;
301
302 trans.LocCamCamToLoc(th1, ph1, X1, Y1, X2, Y2, th2, ph2);
303 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
304 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
305 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
306
307 trans.LocCamToLoc0(th1, ph1, X1, Y1, th0, ph0);
308 gLog << "th0, ph0 = " << th0 << ", " << ph0 << endl;
309
310 trans.Loc0CamToLoc(th0, ph0, X2, Y2, th2, ph2);
311
312 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
313 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
314 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
315
316 trans.LocCamLocToCam(th1, ph1, X1, Y1, th2, ph2, X2, Y2);
317 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
318 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
319 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
320
321 trans.LocCamToLoc0(th1, ph1, X1, Y1, th0, ph0);
322 gLog << "th0, ph0 = " << th0 << ", " << ph0 << endl;
323
324 trans.Loc0LocToCam(th0, ph0, th2, ph2, X2, Y2);
325
326 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
327 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
328 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
329
330 gLog << "==============================================================="
331 << endl;
332
333 gLog << "==============================================================="
334 << endl;
335
336 Double_t de1 = 10.0;
337 Double_t ho1 = 3.0;
338 Double_t XX1 = -30.0;
339 Double_t YY1 = 200.0;
340 Double_t XX2 = 100.0;
341 Double_t YY2 = 50.0;
342 Double_t de2;
343 Double_t ho2;
344
345 trans.CelCamCamToCel(de1, ho1, XX1, YY1, XX2, YY2, de2, ho2);
346 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
347 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
348 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
349
350 Double_t de0;
351 Double_t ho0;
352 trans.CelCamToCel0(de1, ho1, XX1, YY1, de0, ho0);
353 gLog << "de0, ho0 = " << de0 << ", " << ho0 << endl;
354
355 trans.Cel0CamToCel(de0, ho0, XX2, YY2, de2, ho2);
356 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
357 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
358 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
359
360 trans.CelCamCelToCam(de1, ho1, XX1, YY1, de2, ho2, XX2, YY2);
361 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
362 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
363 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
364
365 trans.CelCamToCel0(de1, ho1, XX1, YY1, de0, ho0);
366 gLog << "de0, ho0 = " << de0 << ", " << ho0 << endl;
367
368 trans.Cel0CelToCam(de0, ho0, de2, ho2, XX2, YY2);
369 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
370 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
371 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
372
373
374 gLog << "==============================================================="
375 << endl;
376
377 gLog << "==============================================================="
378 << endl;
379
380 de1 = de2;
381 ho1 = ho2;
382 XX1 = 100.0;
383 YY1 = 50.0;
384 XX2 = -30.0;
385 YY2 = 200.0;
386
387 trans.CelCamCamToCel(de1, ho1, XX1, YY1, XX2, YY2, de2, ho2);
388 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
389 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
390 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
391
392 Double_t de0;
393 Double_t ho0;
394 trans.CelCamToCel0(de1, ho1, XX1, YY1, de0, ho0);
395 gLog << "de0, ho0 = " << de0 << ", " << ho0 << endl;
396
397 trans.Cel0CamToCel(de0, ho0, XX2, YY2, de2, ho2);
398 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
399 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
400 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
401
402 trans.CelCamCelToCam(de1, ho1, XX1, YY1, de2, ho2, XX2, YY2);
403 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
404 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
405 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
406
407 trans.CelCamToCel0(de1, ho1, XX1, YY1, de0, ho0);
408 gLog << "de0, ho0 = " << de0 << ", " << ho0 << endl;
409
410 trans.Cel0CelToCam(de0, ho0, de2, ho2, XX2, YY2);
411 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
412 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
413 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
414
415
416 gLog << "==============================================================="
417 << endl;
418
419}
420//=========================================================================
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
Note: See TracBrowser for help on using the repository browser.