source: trunk/MagicSoft/Mars/manalysis/MPedestalWorkaround.cc@ 4972

Last change on this file since 4972 was 3140, checked in by wittek, 21 years ago
*** empty log message ***
File size: 19.1 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): Sabrina Stark 12/2003 <mailto:lstark@particle.phys.ethz.ch>
19! Wolfgang Wittek 12/2003 <mailto:wittek@mppmu.mpg.de>
20!
21! Copyright: MAGIC Software Development, 2000-2003
22!
23!
24\* ======================================================================== */
25
26/////////////////////////////////////////////////////////////////////////////
27// //
28// MPedestalWorkaround //
29// //
30// copies the pedestal value and the pedestal RMS //
31// from the container MPedPhotCam //
32// into the contaier MPedestalCam //
33// //
34// put the zenith angle into MMcEvt; //
35// the zenith angle is taken from the runbooks //
36// (1 fixed zenith angle for a given run) //
37// //
38// this workaround is necessary //
39// - as long as the analysis classes //
40// take the pedestals from MPedestalCam; in the long run they have to //
41// be taken from MPedPhotCam //
42// - and as long as the container for the zenith angle is not defined //
43// //
44/////////////////////////////////////////////////////////////////////////////
45#include "MPedestalWorkaround.h"
46
47#include <stdio.h>
48#include "MLog.h"
49#include "MLogManip.h"
50#include "MParList.h"
51#include "MGeomCam.h"
52
53#include "MPedPhotCam.h"
54#include "MPedPhotPix.h"
55#include "MMcEvt.hxx"
56#include "MRawRunHeader.h"
57
58using namespace std;
59
60ClassImp(MPedestalWorkaround);
61
62MPedestalWorkaround::MPedestalWorkaround(const char *name, const char *title)
63{
64 fName = name ? name : "MPedestalWorkaround";
65 fTitle = title ? title : "Storage of pedestal values and RMS in units of photons";
66
67}
68
69// ------------------------------------------------------------------------
70//
71
72Int_t MPedestalWorkaround::PreProcess(MParList *pList)
73{
74 /*
75 fPed = (MPedestalCam*)pList->FindObject("MPedestalCam");
76 if (!fPed)
77 {
78 *fLog << err << "MPedestalCam not found... aborting." << endl;
79 return kFALSE;
80 }
81 */
82
83 fPedPhot = (MPedPhotCam*)pList->FindObject("MPedPhotCam");
84 if (!fPedPhot)
85 {
86 *fLog << err << "MPedPhotCam not found... aborting." << endl;
87 return kFALSE;
88 }
89
90 fCam = (MGeomCam*)pList->FindObject("MGeomCam");
91 if (!fCam)
92 {
93 *fLog << err << "MGeomCam not found (no geometry information available)... aborting." << endl;
94 return kFALSE;
95 }
96
97 fRun = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
98 if (!fRun)
99 {
100 *fLog << err << "MRawRunHeader not found... aborting." << endl;
101 return kFALSE;
102 }
103
104 fMcEvt = (MMcEvt*)pList->FindCreateObj("MMcEvt");
105 if (!fMcEvt)
106 {
107 *fLog << err << "MMcEvt not found... aborting." << endl;
108 return kFALSE;
109 }
110
111 return kTRUE;
112}
113
114// ------------------------------------------------------------------------
115//
116Int_t MPedestalWorkaround::Process()
117{
118 //-------------------------------------------------------------------
119 // copy the pedestal and the pedestal RMS
120 // from MPedPhotCam into MPedestalCam
121
122 // set pedestalRMS = 0 if it is too high
123 UInt_t imaxnumpix = fCam->GetNumPixels();
124 for (UInt_t i=0; i<imaxnumpix; i++)
125 {
126 Double_t val = (*fPedPhot)[i].GetRms();
127 if (val < 0.0 || val > 10.0)
128 (*fPedPhot)[i].SetRms(0.0);
129 }
130
131
132 //-------------------------------------------------------------------
133 // put the zenith angle into MMcEvt
134
135 Double_t thetadeg;
136 Double_t thetarad;
137
138
139 /*
140 Int_t run = fRun->GetRunNumber();
141
142 if (run == 3127) thetadeg = 27.2; // Crab
143 else if (run == 3128) thetadeg = 25.6;
144 else if (run == 3129) thetadeg = 24.3;
145 else if (run == 3130) thetadeg = 23.9;
146
147
148 else if (run == 3132) thetadeg = 22.9;
149 else if (run == 3133) thetadeg = 22.8;
150 else if (run == 3134) thetadeg = 22.3;
151 else if (run == 3135) thetadeg = 21.9;
152 else if (run == 3136) thetadeg = 21.5;
153 else if (run == 3137) thetadeg = 21.1;
154 else if (run == 3138) thetadeg = 20.8;
155 else if (run == 3139) thetadeg = 20.4;
156
157 else if (run == 3140) thetadeg = 19.5;
158 else if (run == 3141) thetadeg = 19.4;
159 else if (run == 3142) thetadeg = 19.0;
160 else if (run == 3143) thetadeg = 18.6;
161 else if (run == 3144) thetadeg = 13.0;
162 else if (run == 3145) thetadeg = 12.4;
163 else if (run == 3146) thetadeg = 12.1;
164 else if (run == 3147) thetadeg = 11.7;
165 else if (run == 3148) thetadeg = 11.3;
166 else if (run == 3149) thetadeg = 11.9;
167
168 else if (run == 3150) thetadeg = 10.6;
169 else if (run == 3151) thetadeg = 10.3;
170 else if (run == 3152) thetadeg = 10.0;
171 else if (run == 3153) thetadeg = 9.6;
172 else if (run == 3154) thetadeg = 9.3;
173 else if (run == 3155) thetadeg = 9.0;
174 else if (run == 3156) thetadeg = 8.7;
175 else if (run == 3157) thetadeg = 8.4;
176 else if (run == 3158) thetadeg = 8.1;
177 else if (run == 3159) thetadeg = 7.9;
178
179 else if (run == 3160) thetadeg = 7.7;
180 else if (run == 3161) thetadeg = 7.3;
181 else if (run == 3162) thetadeg = 7.2;
182 else if (run == 3163) thetadeg = 7.0;
183 else if (run == 3164) thetadeg = 6.8;
184 else if (run == 3165) thetadeg = 6.7;
185 else if (run == 3166) thetadeg = 6.6;
186 else if (run == 3167) thetadeg = 6.5;
187 else if (run == 3168) thetadeg = 6.4;
188 else if (run == 3169) thetadeg = 6.4;
189
190 else if (run == 3170) thetadeg = 6.4;
191 else if (run == 3171) thetadeg = 6.4;
192 else if (run == 3172) thetadeg = 6.5;
193 else if (run == 3173) thetadeg = 6.6;
194 else if (run == 3174) thetadeg = 6.7;
195
196 else if (run == 3176) thetadeg = 7.1;
197 else if (run == 3177) thetadeg = 7.4;
198 else if (run == 3178) thetadeg = 7.6;
199 else if (run == 3179) thetadeg = 7.9;
200
201
202 else if (run == 3182) thetadeg = 8.4;
203 else if (run == 3183) thetadeg = 8.9;
204 else if (run == 3184) thetadeg = 9.2;
205 else if (run == 3185) thetadeg = 9.5;
206 else if (run == 3186) thetadeg = 9.8;
207 else if (run == 3187) thetadeg = 10.5;
208 else if (run == 3188) thetadeg = 10.9;
209 else if (run == 3189) thetadeg = 11.2;
210
211 else if (run == 3190) thetadeg = 11.6;
212 else if (run == 3191) thetadeg = 11.6;
213 else if (run == 3192) thetadeg = 12.4;
214 else if (run == 3193) thetadeg = 12.7;
215 else if (run == 3194) thetadeg = 13.1;
216 else if (run == 3195) thetadeg = 13.5;
217 else if (run == 3196) thetadeg = 13.9;
218 else if (run == 3197) thetadeg = 14.3;
219 else if (run == 3198) thetadeg = 14.7;
220 else if (run == 3199) thetadeg = 15.1;
221
222 else if (run == 3200) thetadeg = 15.6;
223 else if (run == 3201) thetadeg = 16.0;
224 else if (run == 3202) thetadeg = 16.5;
225 else if (run == 3203) thetadeg = 16.9;
226 else if (run == 3204) thetadeg = 17.3;
227 else if (run == 3205) thetadeg = 17.7;
228 else if (run == 3206) thetadeg = 18.2;
229 else if (run == 3207) thetadeg = 18.6;
230 else if (run == 3208) thetadeg = 19.0;
231 else if (run == 3209) thetadeg = 19.4;
232
233 else if (run == 3210) thetadeg = 19.9;
234 else if (run == 3211) thetadeg = 20.4;
235 else if (run == 3212) thetadeg = 20.8;
236 else if (run == 3213) thetadeg = 21.2;
237 else if (run == 3214) thetadeg = 21.7;
238 else if (run == 3215) thetadeg = 22.2;
239 else if (run == 3216) thetadeg = 25.6; // Off Crab1
240 else if (run == 3217) thetadeg = 25.0;
241 else if (run == 3218) thetadeg = 24.5;
242 else if (run == 3219) thetadeg = 24.0;
243
244 else if (run == 3220) thetadeg = 23.5;
245 else if (run == 3221) thetadeg = 22.5;
246 else if (run == 3222) thetadeg = 22.1;
247
248 else if (run == 3225) thetadeg = 15.1;
249 else if (run == 3226) thetadeg = 15.0;
250 else if (run == 3227) thetadeg = 14.5;
251 else if (run == 3228) thetadeg = 14.1;
252 else if (run == 3229) thetadeg = 13.8;
253
254 else if (run == 3230) thetadeg = 13.3;
255 else if (run == 3231) thetadeg = 13.0;
256 else if (run == 3232) thetadeg = 12.6;
257 else if (run == 3233) thetadeg = 12.3;
258 else if (run == 3234) thetadeg = 12.0;
259 else if (run == 3235) thetadeg = 11.6;
260 else if (run == 3236) thetadeg = 11.3;
261 else if (run == 3237) thetadeg = 11.0;
262 else if (run == 3238) thetadeg = 10.8;
263 else if (run == 3239) thetadeg = 10.4;
264
265 else if (run == 3240) thetadeg = 10.1;
266 else if (run == 3241) thetadeg = 9.9;
267 else if (run == 3242) thetadeg = 9.6;
268 else if (run == 3243) thetadeg = 9.4;
269 else if (run == 3244) thetadeg = 9.2;
270 else if (run == 3245) thetadeg = 9.0;
271 else if (run == 3246) thetadeg = 8.9;
272 else if (run == 3247) thetadeg = 8.8;
273 else if (run == 3248) thetadeg = 8.7;
274 else if (run == 3249) thetadeg = 8.6;
275
276 else if (run == 3250) thetadeg = 8.6;
277 else if (run == 3251) thetadeg = 8.6;
278 else if (run == 3252) thetadeg = 8.6;
279 else if (run == 3253) thetadeg = 8.7;
280 else if (run == 3254) thetadeg = 8.8;
281 else if (run == 3255) thetadeg = 8.9;
282 else if (run == 3256) thetadeg = 9.1;
283 else if (run == 3257) thetadeg = 9.3;
284 else if (run == 3258) thetadeg = 9.5;
285 else if (run == 3259) thetadeg = 9.7;
286 else if (run == 3260) thetadeg = 9.9;
287
288 else if (run == 3261) thetadeg = 10.2;
289 else if (run == 3262) thetadeg = 10.5;
290 else if (run == 3263) thetadeg = 10.8;
291 else if (run == 3264) thetadeg = 11.1;
292 else if (run == 3265) thetadeg = 11.4;
293 else if (run == 3266) thetadeg = 11.8;
294 else if (run == 3267) thetadeg = 12.1;
295 else if (run == 3268) thetadeg = 12.5;
296 else if (run == 3269) thetadeg = 12.8;
297
298 else if (run == 3270) thetadeg = 13.2;
299 else if (run == 3271) thetadeg = 13.5;
300 else if (run == 3272) thetadeg = 13.9;
301 else if (run == 3273) thetadeg = 14.0;
302 else if (run == 3274) thetadeg = 14.4;
303
304 else if (run == 3284) thetadeg = 7.0; // Crab
305 else if (run == 3285) thetadeg = 7.2;
306 else if (run == 3286) thetadeg = 7.4;
307 else if (run == 3287) thetadeg = 7.5;
308 else if (run == 3288) thetadeg = 8.4;
309 else if (run == 3289) thetadeg = 9.0;
310
311 else if (run == 3290) thetadeg = 9.4;
312 else if (run == 3291) thetadeg = 9.8;
313 else if (run == 3292) thetadeg = 10.2;
314 else if (run == 3293) thetadeg = 10.5;
315 else if (run == 3294) thetadeg = 10.9;
316 else if (run == 3295) thetadeg = 11.3;
317 else if (run == 3296) thetadeg = 11.8;
318 else if (run == 3297) thetadeg = 12.2;
319 else if (run == 3298) thetadeg = 12.6;
320 else if (run == 3299) thetadeg = 13.0;
321
322 else if (run == 3300) thetadeg = 13.5;
323 else if (run == 3301) thetadeg = 13.9;
324 else if (run == 3302) thetadeg = 14.3;
325 else if (run == 3303) thetadeg = 14.8;
326 else if (run == 3304) thetadeg = 15.2;
327 else if (run == 3305) thetadeg = 15.7;
328 else if (run == 3306) thetadeg = 16.2;
329 else if (run == 3307) thetadeg = 16.6;
330 else if (run == 3308) thetadeg = 17.1;
331 else if (run == 3309) thetadeg = 17.6;
332
333 else if (run == 3310) thetadeg = 17.9;
334 else if (run == 3311) thetadeg = 18.4;
335 else if (run == 3312) thetadeg = 18.9;
336 else if (run == 3313) thetadeg = 19.3;
337 else if (run == 3314) thetadeg = 19.8;
338 else if (run == 3315) thetadeg = 20.1;
339 else if (run == 3316) thetadeg = 20.7;
340 else if (run == 3317) thetadeg = 21.2;
341 else if (run == 3318) thetadeg = 21.7;
342 else if (run == 3319) thetadeg = 22.1;
343
344 else if (run == 3320) thetadeg = 22.5;
345 else if (run == 3321) thetadeg = 23.1;
346 else if (run == 3322) thetadeg = 23.6;
347 else if (run == 3323) thetadeg = 24.1;
348 else if (run == 3324) thetadeg = 24.6;
349 else if (run == 3325) thetadeg = 24.9;
350 else if (run == 3326) thetadeg = 25.5;
351 else if (run == 3327) thetadeg = 26.0;
352 else if (run == 3328) thetadeg = 26.0;
353 else if (run == 3329) thetadeg = 26.6;
354
355 else if (run == 3330) thetadeg = 26.6;
356 else if (run == 3331) thetadeg = 27.1;
357 else if (run == 3332) thetadeg = 27.7;
358 else if (run == 3333) thetadeg = 28.2;
359 else if (run == 3334) thetadeg = 28.5;
360
361 else if (run == 3340) thetadeg = 10.5;
362 else if (run == 3341) thetadeg = 10.3;
363 else if (run == 3342) thetadeg = 9.6;
364 else if (run == 3343) thetadeg = 9.2;
365 else if (run == 3344) thetadeg = 8.9;
366 else if (run == 3345) thetadeg = 8.6;
367 else if (run == 3346) thetadeg = 8.3;
368 else if (run == 3347) thetadeg = 8.0;
369 else if (run == 3348) thetadeg = 7.7;
370 else if (run == 3349) thetadeg = 7.5;
371
372 else if (run == 3350) thetadeg = 7.2;
373 else if (run == 3351) thetadeg = 7.0;
374 else if (run == 3352) thetadeg = 6.8;
375 else if (run == 3353) thetadeg = 6.7;
376 else if (run == 3354) thetadeg = 6.6;
377 else if (run == 3355) thetadeg = 6.5;
378 else if (run == 3356) thetadeg = 6.4;
379 else if (run == 3357) thetadeg = 6.4;
380 else if (run == 3358) thetadeg = 6.4;
381 else if (run == 3359) thetadeg = 6.5;
382
383 else if (run == 3360) thetadeg = 6.6;
384
385 else if (run == 3362) thetadeg = 6.7;
386 else if (run == 3363) thetadeg = 6.8;
387 else if (run == 3364) thetadeg = 7.0;
388 else if (run == 3365) thetadeg = 7.2;
389 else if (run == 3366) thetadeg = 7.5;
390 else if (run == 3367) thetadeg = 7.7;
391 else if (run == 3368) thetadeg = 8.0;
392 else if (run == 3369) thetadeg = 8.3;
393
394 else if (run == 3370) thetadeg = 8.6;
395 else if (run == 3371) thetadeg = 9.0;
396 else if (run == 3372) thetadeg = 9.3;
397 else if (run == 3373) thetadeg = 9.6;
398 else if (run == 3374) thetadeg = 10.0;
399 else if (run == 3375) thetadeg = 10.4;
400 else if (run == 3376) thetadeg = 10.7;
401 else if (run == 3377) thetadeg = 11.1;
402 else if (run == 3378) thetadeg = 11.5;
403 else if (run == 3379) thetadeg = 11.9;
404
405 else if (run == 3380) thetadeg = 12.3;
406 else if (run == 3381) thetadeg = 12.7;
407 else if (run == 3382) thetadeg = 13.1;
408 else if (run == 3383) thetadeg = 13.5;
409 else if (run == 3384) thetadeg = 13.9;
410 else if (run == 3385) thetadeg = 14.3;
411 else if (run == 3386) thetadeg = 14.7;
412 else if (run == 3387) thetadeg = 15.2;
413 else if (run == 3388) thetadeg = 15.6;
414 else if (run == 3389) thetadeg = 16.0;
415
416 else if (run == 3390) thetadeg = 16.4;
417 else if (run == 3391) thetadeg = 16.7;
418 else if (run == 3392) thetadeg = 17.9;
419 else if (run == 3393) thetadeg = 18.3;
420 else if (run == 3394) thetadeg = 18.7;
421 else if (run == 3395) thetadeg = 19.2;
422 else if (run == 3396) thetadeg = 19.6;
423 else if (run == 3397) thetadeg = 20.0;
424 else if (run == 3398) thetadeg = 20.5;
425 else if (run == 3399) thetadeg = 20.9;
426
427 else if (run == 3400) thetadeg = 21.4;
428 else if (run == 3401) thetadeg = 21.8;
429 else if (run == 3402) thetadeg = 22.1;
430 else if (run == 3403) thetadeg = 22.6;
431 else if (run == 3404) thetadeg = 23.1;
432 else if (run == 3405) thetadeg = 23.4;
433 else if (run == 3406) thetadeg = 23.9;
434 else if (run == 3407) thetadeg = 24.3;
435 else if (run == 3408) thetadeg = 24.7;
436 else if (run == 3409) thetadeg = 26.9;
437
438 else if (run == 3410) thetadeg = 27.3;
439 else if (run == 3411) thetadeg = 27.7;
440 else if (run == 3412) thetadeg = 28.2;
441 else if (run == 3413) thetadeg = 28.7;
442 else if (run == 3414) thetadeg = 29.1;
443 else if (run == 3415) thetadeg = 29.2;
444 else if (run == 3416) thetadeg = 30.0;
445 else if (run == 3417) thetadeg = 18.5; // Off Crab1
446 else if (run == 3418) thetadeg = 18.4;
447 else if (run == 3419) thetadeg = 17.5;
448
449 else if (run == 3420) thetadeg = 17.2;
450 else if (run == 3421) thetadeg = 16.8;
451 else if (run == 3422) thetadeg = 16.4;
452 else if (run == 3423) thetadeg = 16.0;
453 else if (run == 3424) thetadeg = 15.6;
454 else if (run == 3425) thetadeg = 15.3;
455 else if (run == 3426) thetadeg = 14.9;
456 else if (run == 3427) thetadeg = 14.5;
457 else if (run == 3428) thetadeg = 14.1;
458 else if (run == 3429) thetadeg = 13.7;
459
460 else if (run == 3430) thetadeg = 13.4;
461 else if (run == 3431) thetadeg = 13.0;
462 else if (run == 3432) thetadeg = 12.7;
463 else if (run == 3433) thetadeg = 12.3;
464 else if (run == 3434) thetadeg = 12.0;
465 else if (run == 3435) thetadeg = 12.0;
466 else if (run == 3436) thetadeg = 11.6;
467 else if (run == 3437) thetadeg = 11.3;
468 else if (run == 3438) thetadeg = 11.0;
469 else if (run == 3439) thetadeg = 10.7;
470
471 else if (run == 3440) thetadeg = 10.4;
472 else if (run == 3441) thetadeg = 10.1;
473 else if (run == 3442) thetadeg = 9.9;
474 else if (run == 3443) thetadeg = 9.8;
475 else if (run == 3444) thetadeg = 30.8; // Mkn 421
476 else if (run == 3445) thetadeg = 30.6;
477 else if (run == 3446) thetadeg = 29.7;
478 else if (run == 3447) thetadeg = 29.3;
479 else if (run == 3448) thetadeg = 28.9;
480 else if (run == 3449) thetadeg = 28.5;
481
482 else if (run == 3450) thetadeg = 28.1;
483 else if (run == 3451) thetadeg = 27.7;
484 else if (run == 3452) thetadeg = 27.3;
485 else if (run == 3453) thetadeg = 26.9;
486 else if (run == 3454) thetadeg = 26.5;
487 else if (run == 3455) thetadeg = 26.1;
488 else if (run == 3456) thetadeg = 25.7;
489 else if (run == 3457) thetadeg = 25.3;
490 else if (run == 3458) thetadeg = 24.9;
491 else if (run == 3459) thetadeg = 24.5;
492
493 else if (run == 3460) thetadeg = 24.1;
494
495 else if (run == 3463) thetadeg = 23.2;
496 else if (run == 3464) thetadeg = 22.8;
497 else if (run == 3465) thetadeg = 22.4;
498 else if (run == 3466) thetadeg = 22.0;
499 else if (run == 3467) thetadeg = 21.6;
500 else if (run == 3468) thetadeg = 21.2;
501 else if (run == 3469) thetadeg = 20.8;
502
503 else if (run == 3470) thetadeg = 20.4;
504 else if (run == 3471) thetadeg = 20.1;
505 else if (run == 3472) thetadeg = 19.7;
506 else if (run == 3473) thetadeg = 19.3;
507 else if (run == 3474) thetadeg = 18.9;
508 else if (run == 3475) thetadeg = 18.5;
509 else if (run == 3476) thetadeg = 18.2;
510 else if (run == 3477) thetadeg = 18.1;
511 else if (run == 3478) thetadeg = 17.7;
512
513
514 else if (run == 3480) thetadeg = 17.5;
515 else if (run == 3481) thetadeg = 17.1;
516 else if (run == 3482) thetadeg = 16.7;
517 else if (run == 3483) thetadeg = 16.3;
518 else if (run == 3484) thetadeg = 16.0;
519 else if (run == 3485) thetadeg = 15.6;
520 else if (run == 3486) thetadeg = 15.3;
521 else if (run == 3487) thetadeg = 15.0;
522 else if (run == 3488) thetadeg = 14.8;
523 else if (run == 3489) thetadeg = 14.8;
524
525 else
526 {
527 *fLog << warn << "MPedestalWorkaround : no zenith angle for run number = "
528 << run << endl;
529 thetadeg = 90.0;
530 }
531
532 thetarad = thetadeg / kRad2Deg;
533 */
534
535 thetadeg = 10.0;
536 thetarad = thetadeg / kRad2Deg;
537 fMcEvt->SetTelescopeTheta(thetarad);
538
539 return kTRUE;
540}
541
542Int_t MPedestalWorkaround::PostProcess()
543{
544 return kTRUE;
545}
546
547
548
549
550
551
552
Note: See TracBrowser for help on using the repository browser.