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

Last change on this file since 4735 was 4735, checked in by wittek, 21 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 MStarCamTrans 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
43 /*
44
45 trans.PlotGridAtTheta0Phi0("Plot3c", 60.00, 180.0);
46 trans.PlotGridAtTheta0Phi0("Plot3d", 90.00, 180.0);
47
48 trans.PlotGridAtTheta0Phi0("Plot4a", 0.001, 270.0);
49 trans.PlotGridAtTheta0Phi0("Plot4b", 30.00, 270.0);
50 trans.PlotGridAtTheta0Phi0("Plot4c", 60.00, 270.0);
51 trans.PlotGridAtTheta0Phi0("Plot4d", 90.00, 270.0);
52
53 trans.PlotGridAtDec0H0 ("Plot5a", 89.999, -12.0);
54 trans.PlotGridAtDec0H0 ("Plot5b", 60.000, -12.0);
55 trans.PlotGridAtDec0H0 ("Plot5c", 30.000, -12.0);
56 trans.PlotGridAtDec0H0 ("Plot5d", 0.000, -12.0);
57 trans.PlotGridAtDec0H0 ("Plot5e",-30.000, -12.0);
58
59 trans.PlotGridAtDec0H0 ("Plot6a", 89.999, -6.0);
60 trans.PlotGridAtDec0H0 ("Plot6b", 60.000, -6.0);
61 trans.PlotGridAtDec0H0 ("Plot6c", 30.000, -6.0);
62 trans.PlotGridAtDec0H0 ("Plot6d", 0.000, -6.0);
63 trans.PlotGridAtDec0H0 ("Plot6e",-30.000, -6.0);
64
65 trans.PlotGridAtDec0H0 ("Plot7a", 89.999, 0.0);
66 trans.PlotGridAtDec0H0 ("Plot7b", 60.000, 0.0);
67 trans.PlotGridAtDec0H0 ("Plot7c", 30.000, 0.0);
68 trans.PlotGridAtDec0H0 ("Plot7d", 0.000, 0.0);
69 trans.PlotGridAtDec0H0 ("Plot7e",-30.000, 0.0);
70
71 trans.PlotGridAtDec0H0 ("Plot8a", 89.999, 6.0);
72 trans.PlotGridAtDec0H0 ("Plot8b", 60.000, 6.0);
73 trans.PlotGridAtDec0H0 ("Plot8c", 30.000, 6.0);
74 trans.PlotGridAtDec0H0 ("Plot8d", 0.000, 6.0);
75 trans.PlotGridAtDec0H0 ("Plot8e",-30.000, 6.0);
76 */
77
78 //===================================================
79 // special tests
80
81 gLog << "==============================================================="
82 << endl;
83
84 Double_t th1 = 10.0;
85 Double_t ph1 = 200.0;
86 Double_t X1 = 0.0;
87 Double_t Y1 = 0.0;
88 Double_t X2 = 100.0;
89 Double_t Y2 = 50.0;
90 Double_t th2;
91 Double_t ph2;
92
93 trans.LocCamCamToLoc(th1, ph1, X1, Y1, X2, Y2, th2, ph2);
94 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
95 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
96 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
97
98 trans.Loc0CamToLoc(th1, ph1, X2, Y2, th2, ph2);
99 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
100 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
101 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
102
103 trans.Loc0LocToCam(th1, ph1, th2, ph2, X2, Y2);
104 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
105 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
106 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
107
108 trans.LocCamToLoc0(th2, ph2, X2, Y2, th1, ph1);
109 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
110 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
111 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
112
113 trans.LocCamLocToCam(th1, ph1, X1, Y1, th2, ph2, X2, Y2);
114 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
115 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
116 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
117
118 trans.Loc0LocToCam(th1, ph1, th2, ph2, X2, Y2);
119 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
120 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
121 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
122 gLog << "==============================================================="
123 << endl;
124
125 //---------------------
126
127 gLog << "==============================================================="
128 << endl;
129
130 th1 = th2;
131 ph1 = ph2;
132 X1 = 100.0;
133 Y1 = 50.0;
134 X2 = 0.0;
135 Y2 = 0.0;
136
137 trans.LocCamCamToLoc(th1, ph1, X1, Y1, X2, Y2, th2, ph2);
138 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
139 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
140 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
141
142 trans.LocCamToLoc0(th1, ph1, X1, Y1, th2, ph2);
143 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
144 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
145 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
146
147 trans.Loc0CamToLoc(th2, ph2, X1, Y1, th1, ph1);
148 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
149 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
150 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
151
152 trans.Loc0LocToCam(th2, ph2, th1, ph1, X1, Y1);
153 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
154 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
155 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
156
157 trans.LocCamLocToCam(th1, ph1, X1, Y1, th2, ph2, X2, Y2);
158 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
159 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
160 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
161
162 gLog << "==============================================================="
163 << endl;
164
165 gLog << "==============================================================="
166 << endl;
167
168 Double_t de1 = 10.0;
169 Double_t ho1 = 200.0;
170 Double_t XX1 = 0.0;
171 Double_t YY1 = 0.0;
172 Double_t XX2 = 100.0;
173 Double_t YY2 = 50.0;
174 Double_t de2;
175 Double_t ho2;
176
177 trans.CelCamCamToCel(de1, ho1, XX1, YY1, XX2, YY2, de2, ho2);
178 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
179 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
180 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
181
182 trans.Cel0CamToCel(de1, ho1, XX2, YY2, de2, ho2);
183 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
184 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
185 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
186
187 trans.CelCamCelToCam(de1, ho1, XX1, YY1, de2, ho2, XX2, YY2);
188 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
189 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
190 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
191
192 trans.Cel0CelToCam(de1, ho1, de2, ho2, XX2, YY2);
193 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
194 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
195 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
196
197
198 gLog << "==============================================================="
199 << endl;
200
201 gLog << "==============================================================="
202 << endl;
203
204 de1 = de2;
205 ho1 = ho2;
206 XX1 = 100.0;
207 YY1 = 50.0;
208 XX2 = 0.0;
209 YY2 = 0.0;
210
211 trans.CelCamCamToCel(de1, ho1, XX1, YY1, XX2, YY2, de2, ho2);
212 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
213 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
214 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
215
216 trans.CelCamToCel0(de1, ho1, XX1, YY1, de2, ho2);
217 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
218 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
219 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
220
221 trans.CelCamCelToCam(de1, ho1, XX1, YY1, de2, ho2, XX2, YY2);
222 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
223 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
224 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
225
226 gLog << "==============================================================="
227 << endl;
228
229 //---------------------
230
231 gLog << "==============================================================="
232 << endl;
233
234 th1 = 70.0;
235 ph1 = 200.0;
236 X1 = 100.0;
237 Y1 = 50.0;
238 X2 = 120.0;
239 Y2 = -30.0;
240
241 Double_t th0;
242 Double_t ph0;
243
244 trans.LocCamCamToLoc(th1, ph1, X1, Y1, X2, Y2, th2, ph2);
245 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
246 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
247 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
248
249 trans.LocCamCamToLoc(th2, ph2, X2, Y2, X1, Y1, th1, ph1);
250 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
251 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
252 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
253
254 trans.LocCamToLoc0(th1, ph1, X1, Y1, th0, ph0);
255 gLog << "th0, ph0 = " << th0 << ", " << ph0 << endl;
256
257 trans.Loc0CamToLoc(th0, ph0, X1, Y1, th1, ph1);
258 gLog << "th1, ph1 = " << th1 << ", " << ph1 << endl;
259
260 trans.Loc0CamToLoc(th0, ph0, X2, Y2, th2, ph2);
261 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
262 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
263 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
264
265 trans.LocCamToLoc0(th2, ph2, X2, Y2, th0, ph0);
266 gLog << "th0, ph0 = " << th0 << ", " << ph0 << endl;
267 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
268 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
269 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
270
271 trans.LocCamLocToCam(th1, ph1, X1, Y1, th2, ph2, X2, Y2);
272 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
273 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
274 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
275
276 trans.LocCamLocToCam(th2, ph2, X2, Y2, th1, ph1, X1, Y1);
277 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
278 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
279 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
280
281 trans.LocCamToLoc0(th1, ph1, X1, Y1, th0, ph0);
282 gLog << "th0, ph0 = " << th0 << ", " << ph0 << endl;
283
284 trans.Loc0LocToCam(th0, ph0, th2, ph2, X2, Y2);
285
286 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
287 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
288 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
289
290 gLog << "==============================================================="
291 << endl;
292
293 gLog << "==============================================================="
294 << endl;
295
296 th1 = th2;
297 ph1 = ph2;
298 X1 = 120.0;
299 Y1 = -30.0;
300 X2 = 100.0;
301 Y2 = 50.0;
302
303 Double_t th0;
304 Double_t ph0;
305
306 trans.LocCamCamToLoc(th1, ph1, X1, Y1, X2, Y2, th2, ph2);
307 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
308 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
309 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
310
311 trans.LocCamToLoc0(th1, ph1, X1, Y1, th0, ph0);
312 gLog << "th0, ph0 = " << th0 << ", " << ph0 << endl;
313
314 trans.Loc0CamToLoc(th0, ph0, X2, Y2, th2, ph2);
315
316 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
317 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
318 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
319
320 trans.LocCamLocToCam(th1, ph1, X1, Y1, th2, ph2, X2, Y2);
321 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
322 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
323 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
324
325 trans.LocCamToLoc0(th1, ph1, X1, Y1, th0, ph0);
326 gLog << "th0, ph0 = " << th0 << ", " << ph0 << endl;
327
328 trans.Loc0LocToCam(th0, ph0, th2, ph2, X2, Y2);
329
330 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
331 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
332 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
333
334 gLog << "==============================================================="
335 << endl;
336
337 gLog << "==============================================================="
338 << endl;
339
340 Double_t de1 = 10.0;
341 Double_t ho1 = 3.0;
342 Double_t XX1 = -30.0;
343 Double_t YY1 = 200.0;
344 Double_t XX2 = 100.0;
345 Double_t YY2 = 50.0;
346 Double_t de2;
347 Double_t ho2;
348
349 trans.CelCamCamToCel(de1, ho1, XX1, YY1, XX2, YY2, de2, ho2);
350 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
351 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
352 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
353
354 Double_t de0;
355 Double_t ho0;
356 trans.CelCamToCel0(de1, ho1, XX1, YY1, de0, ho0);
357 gLog << "de0, ho0 = " << de0 << ", " << ho0 << endl;
358
359 trans.Cel0CamToCel(de0, ho0, XX2, YY2, de2, ho2);
360 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
361 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
362 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
363
364 trans.CelCamCelToCam(de1, ho1, XX1, YY1, de2, ho2, XX2, YY2);
365 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
366 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
367 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
368
369 trans.CelCamToCel0(de1, ho1, XX1, YY1, de0, ho0);
370 gLog << "de0, ho0 = " << de0 << ", " << ho0 << endl;
371
372 trans.Cel0CelToCam(de0, ho0, de2, ho2, XX2, YY2);
373 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
374 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
375 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
376
377
378 gLog << "==============================================================="
379 << endl;
380
381 gLog << "==============================================================="
382 << endl;
383
384 de1 = de2;
385 ho1 = ho2;
386 XX1 = 100.0;
387 YY1 = 50.0;
388 XX2 = -30.0;
389 YY2 = 200.0;
390
391 trans.CelCamCamToCel(de1, ho1, XX1, YY1, XX2, YY2, de2, ho2);
392 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
393 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
394 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
395
396 Double_t de0;
397 Double_t ho0;
398 trans.CelCamToCel0(de1, ho1, XX1, YY1, de0, ho0);
399 gLog << "de0, ho0 = " << de0 << ", " << ho0 << endl;
400
401 trans.Cel0CamToCel(de0, ho0, XX2, YY2, de2, ho2);
402 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
403 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
404 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
405
406 trans.CelCamCelToCam(de1, ho1, XX1, YY1, de2, ho2, XX2, YY2);
407 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
408 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
409 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
410
411 trans.CelCamToCel0(de1, ho1, XX1, YY1, de0, ho0);
412 gLog << "de0, ho0 = " << de0 << ", " << ho0 << endl;
413
414 trans.Cel0CelToCam(de0, ho0, de2, ho2, XX2, YY2);
415 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
416 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
417 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
418
419
420 gLog << "==============================================================="
421 << endl;
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
448
449
450
451
Note: See TracBrowser for help on using the repository browser.