source: trunk/MagicSoft/Mars/mjobs/MJCalibration.cc@ 4298

Last change on this file since 4298 was 4285, checked in by gaug, 21 years ago
*** empty log message ***
File size: 40.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): Thomas Bretz, 1/2004 <mailto:tbretz@astro.uni-wuerzburg.de>
19! Markus Gaug, 02/2004 <mailto:markus@ifae.es>
20!
21! Copyright: MAGIC Software Development, 2000-2004
22!
23!
24\* ======================================================================== */
25/////////////////////////////////////////////////////////////////////////////
26//
27// MJCalibration
28//
29// Do one calibration loop over serious of runs with the same pulser
30// colour and the same intensity. The following containers (rectangular) and
31// tasks (ellipses) are called to produce an MCalibrationChargeCam and to
32// update the MCalibrationQECam: (MCalibrate is not called from this class)
33//
34//Begin_Html
35/*
36<img src="images/CalibClasses.gif">
37*/
38//End_Html
39//
40// Different signal extractors can be set with the command SetExtractor()
41// Only extractors deriving from MExtractor can be set, default is MExtractSlidingWindow
42//
43// Different arrival time extractors can be set with the command SetTimeExtractor()
44// Only extractors deriving from MExtractTime can be set, default is MExtractTimeSpline
45//
46// At the end of the eventloop, plots and results are displayed, depending on
47// the flags set (see DisplayResult())
48//
49// If the flag SetFullDisplay() is set, all MHCameras will be displayed.
50// if the flag SetDataCheckDisplay() is set, only the most important ones are displayed
51// Otherwise, (default: SetNormalDisplay()), a good selection of plots is given
52//
53// If the flag SetDataCheck() is set, the calibration is used as in the data check at
54// La Palma, which mean especially running on raw data files.
55//
56// The absolute light calibration devices Blind Pixel and PIN Diode can be switched on
57// and off with the commands:
58//
59// - SetUseBlindPixel(Bool_t )
60// - SetUsePINDiode(Bool_t )
61//
62// See also: MHCalibrationChargePix, MHCalibrationChargeCam, MHGausEvents
63// MHCalibrationChargeBlindPix, MHCalibrationChargePINDiode
64// MCalibrationChargePix, MCalibrationChargeCam, MCalibrationChargeCalc
65// MCalibrationChargeBlindPix, MCalibrationChargePINDiode,
66// MCalibrationQECam, MBadPixelsPix, MBadPixelsCam
67//
68// If the flag RelTimeCalibration() is set, a calibration of the relative arrival
69// times is also performed. The following containers (rectangular) and
70// tasks (ellipses) are called to produce an MCalibrationRelTimeCam used by
71// MCalibrateTime to correct timing offset between pixels: (MCalibrateTime is not
72// called from this class)
73//
74//Begin_Html
75/*
76<img src="images/RelTimeClasses.gif">
77*/
78//End_Html
79//
80// Different arrival time extractors can be set directly with the command SetTimeExtractor(MExtractor *)
81//
82// See also: MHCalibrationRelTimePix, MHCalibrationRelTimeCam, MHGausEvents
83// MCalibrationRelTimePix, MCalibrationRelTimeCam
84// MBadPixelsPix, MBadPixelsCam
85//
86/////////////////////////////////////////////////////////////////////////////
87#include "MJCalibration.h"
88
89#include <TFile.h>
90#include <TStyle.h>
91#include <TCanvas.h>
92#include <TSystem.h>
93
94#include "MLog.h"
95#include "MLogManip.h"
96
97#include "MRunIter.h"
98#include "MParList.h"
99#include "MTaskList.h"
100#include "MEvtLoop.h"
101
102#include "MHCamera.h"
103#include "MGeomCam.h"
104
105#include "MPedestalCam.h"
106#include "MCalibrationCam.h"
107#include "MCalibrationQECam.h"
108#include "MCalibrationChargeCam.h"
109#include "MCalibrationChargePINDiode.h"
110#include "MCalibrationChargeBlindPix.h"
111#include "MCalibrationChargeCalc.h"
112
113#include "MHGausEvents.h"
114#include "MHCalibrationCam.h"
115#include "MHCalibrationChargeCam.h"
116#include "MHCalibrationChargeBlindPix.h"
117#include "MHCalibrationRelTimeCam.h"
118#include "MCalibrationRelTimeCam.h"
119#include "MCalibrationRelTimeCalc.h"
120
121#include "MReadMarsFile.h"
122#include "MRawFileRead.h"
123#include "MGeomApply.h"
124#include "MBadPixelsMerge.h"
125#include "MBadPixelsCam.h"
126#include "MExtractTime.h"
127#include "MExtractor.h"
128#include "MExtractPINDiode.h"
129#include "MExtractBlindPixel.h"
130#include "MExtractSlidingWindow.h"
131#include "MExtractTimeSpline.h"
132#include "MFCosmics.h"
133#include "MContinue.h"
134#include "MFillH.h"
135
136#include "MArrivalTimeCam.h"
137
138#include "MStatusDisplay.h"
139
140ClassImp(MJCalibration);
141
142using namespace std;
143
144const Int_t MJCalibration::gkIFAEBoxInaugurationRun = 20113;
145// --------------------------------------------------------------------------
146//
147// Default constructor.
148//
149// - Sets fRuns to 0, fExtractor to NULL, fTimeExtractor to NULL, fColor to kNONE,
150// fDisplay to kNormalDisplay, fRelTime to kFALSE, fDataCheck to kFALSE,
151// - SetUseBlindPixel()
152// - SetUsePINDiode()
153//
154MJCalibration::MJCalibration(const char *name, const char *title)
155 : fRuns(0), fExtractor(NULL), fTimeExtractor(NULL),
156 fColor(MCalibrationCam::kNONE), fDisplayType(kNormalDisplay),
157 fRelTimes(kFALSE), fDataCheck(kFALSE)
158{
159
160 fName = name ? name : "MJCalibration";
161 fTitle = title ? title : "Tool to create the calibration constants for one calibration run";
162
163 SetUseBlindPixel();
164 SetUsePINDiode();
165
166}
167
168
169// --------------------------------------------------------------------------
170//
171// Display the results in MStatusDisplay:
172//
173// - Add "Calibration" to the MStatusDisplay title
174// - Retrieve the MGeomCam from MParList
175// - Initialize the following MHCamera's:
176// 1) MCalibrationPix::GetMean()
177// 2) MCalibrationPix::Sigma()
178// 3) MCalibrationChargePix::GetRSigma()
179// 4) MCalibrationChargePix::GetRSigmaPerCharge()
180// 5) MCalibrationChargePix::GetPheFFactorMethod()
181// 6) MCalibrationChargePix::GetMeanConvFADC2Phe()
182// 7) MCalibrationChargePix::GetMeanFFactorFADC2Phot()
183// 8) MCalibrationQEPix::GetQECascadesFFactor()
184// 9) MCalibrationQEPix::GetQECascadesBlindPixel()
185// 10) MCalibrationQEPix::GetQECascadesPINDiode()
186// 11) MCalibrationQEPix::GetQECascadesCombined()
187// 12) MCalibrationQEPix::IsAverageQEFFactorAvailable()
188// 13) MCalibrationQEPix::IsAverageQEBlindPixelAvailable()
189// 14) MCalibrationQEPix::IsAverageQEPINDiodeAvailable()
190// 15) MCalibrationQEPix::IsAverageQECombinedAvailable()
191// 16) MCalibrationChargePix::IsHiGainSaturation()
192// 17) MCalibrationPix::GetHiLoMeansDivided()
193// 18) MCalibrationPix::GetHiLoSigmasDivided()
194// 19) MCalibrationChargePix::GetHiGainPickup()
195// 20) MCalibrationChargePix::GetLoGainPickup()
196// 21) MCalibrationChargePix::GetHiGainBlackout()
197// 22) MCalibrationChargePix::GetLoGainBlackout()
198// 23) MCalibrationPix::IsExcluded()
199// 24) MBadPixelsPix::IsUnsuitable(MBadPixelsPix::kUnsuitableRun)
200// 25) MBadPixelsPix::IsUnsuitable(MBadPixelsPix::kUnreliableRun)
201// 26) MBadPixelsPix::IsUncalibrated(MBadPixelsPix::kHiGainOscillating)
202// 27) MBadPixelsPix::IsUncalibrated(MBadPixelsPix::kLoGainOscillating)
203// 28) MCalibrationChargePix::GetAbsTimeMean()
204// 29) MCalibrationChargePix::GetAbsTimeRms()
205//
206// If the flag SetFullDisplay() is set, all MHCameras will be displayed.
207// if the flag SetDataCheckDisplay() is set, only the most important ones are displayed
208// and otherwise, (default: SetNormalDisplay()), a good selection of plots is given
209//
210void MJCalibration::DisplayResult(MParList &plist)
211{
212 if (!fDisplay)
213 return;
214
215 //
216 // Update display
217 //
218 TString title = fDisplay->GetTitle();
219 title += "-- Calibration ";
220 title += fRuns->GetRunsAsString();
221 title += " --";
222 fDisplay->SetTitle(title);
223
224 //
225 // Get container from list
226 //
227 MGeomCam &geomcam = *(MGeomCam*)plist.FindObject("MGeomCam");
228
229 // Create histograms to display
230 MHCamera disp1 (geomcam, Form("%s%s","Charge",(fRuns->GetRunsAsFileName()).Data()),
231 "Fitted Mean Charges");
232 MHCamera disp2 (geomcam, Form("%s%s","SigmaCharge",(fRuns->GetRunsAsFileName()).Data()),
233 "Sigma of Fitted Charges");
234 MHCamera disp3 (geomcam, Form("%s%s","RSigma",(fRuns->GetRunsAsFileName()).Data()),
235 "Reduced Sigmas");
236 MHCamera disp4 (geomcam, Form("%s%s","RSigmaPerCharge",(fRuns->GetRunsAsFileName()).Data()),
237 "Reduced Sigma per Charge");
238 MHCamera disp5 (geomcam, Form("%s%s","NumPhes",(fRuns->GetRunsAsFileName()).Data()),
239 "Nr. of Phe's (F-Factor Method)");
240 MHCamera disp6 (geomcam, Form("%s%s","ConvFADC2Phes",(fRuns->GetRunsAsFileName()).Data()),
241 "Conversion Factor (F-Factor Method)");
242 MHCamera disp7 (geomcam, Form("%s%s","TotalFFactor",(fRuns->GetRunsAsFileName()).Data()),
243 "Total F-Factor (F-Factor Method)");
244 MHCamera disp8 (geomcam, Form("%s%s","CascadesQEFFactor",(fRuns->GetRunsAsFileName()).Data()),
245 "Cascades QE (F-Factor Method)");
246 MHCamera disp9 (geomcam, Form("%s%s","CascadesQEBlindPix",(fRuns->GetRunsAsFileName()).Data()),
247 "Cascades QE (Blind Pixel Method)");
248 MHCamera disp10(geomcam, Form("%s%s","CascadesQEPINDiode",(fRuns->GetRunsAsFileName()).Data()),
249 "Cascades QE (PIN Diode Method)");
250 MHCamera disp11(geomcam, Form("%s%s","CascadesQECombined",(fRuns->GetRunsAsFileName()).Data()),
251 "Cascades QE (Combined Method)");
252 MHCamera disp12(geomcam, Form("%s%s","FFactorValid",(fRuns->GetRunsAsFileName()).Data()),
253 "Pixels with valid F-Factor calibration");
254 MHCamera disp13(geomcam, Form("%s%s","BlindPixelValid",(fRuns->GetRunsAsFileName()).Data()),
255 "Pixels with valid BlindPixel calibration");
256 MHCamera disp14(geomcam, Form("%s%s","PINdiodeValid",(fRuns->GetRunsAsFileName()).Data()),
257 "Pixels with valid PINDiode calibration");
258 MHCamera disp15(geomcam, Form("%s%s","CombinedValid",(fRuns->GetRunsAsFileName()).Data()),
259 "Pixels with valid Combined calibration");
260 MHCamera disp16(geomcam, Form("%s%s","Saturation",(fRuns->GetRunsAsFileName()).Data()),
261 "Pixels with saturated Hi Gain");
262 MHCamera disp17(geomcam, Form("%s%s","ConversionMeans",(fRuns->GetRunsAsFileName()).Data()),
263 "Conversion HiGain.vs.LoGain Means");
264 MHCamera disp18(geomcam, Form("%s%s","ConversionSigmas",(fRuns->GetRunsAsFileName()).Data()),
265 "Conversion HiGain.vs.LoGain Sigmas");
266 MHCamera disp19(geomcam, Form("%s%s","HiGainPickup",(fRuns->GetRunsAsFileName()).Data()),
267 "Number Pickup events Hi Gain");
268 MHCamera disp20(geomcam, Form("%s%s","LoGainPickup",(fRuns->GetRunsAsFileName()).Data()),
269 "Number Pickup events Lo Gain");
270 MHCamera disp21(geomcam, Form("%s%s","HiGainBlackout",(fRuns->GetRunsAsFileName()).Data()),
271 "Number Blackout events Hi Gain");
272 MHCamera disp22(geomcam, Form("%s%s","LoGainBlackout",(fRuns->GetRunsAsFileName()).Data()),
273 "Number Blackout events Lo Gain");
274 MHCamera disp23(geomcam, Form("%s%s","Excluded",(fRuns->GetRunsAsFileName()).Data()),
275 "Pixels previously excluded");
276 MHCamera disp24(geomcam, Form("%s%s","UnSuitable",(fRuns->GetRunsAsFileName()).Data()),
277 "Pixels not suited for further analysis");
278 MHCamera disp25(geomcam, Form("%s%s","UnReliable",(fRuns->GetRunsAsFileName()).Data()),
279 "Pixels not reliable for further analysis");
280 MHCamera disp26(geomcam, Form("%s%s","HiGainOscillating",(fRuns->GetRunsAsFileName()).Data()),
281 "Oscillating Pixels High Gain");
282 MHCamera disp27(geomcam, Form("%s%s","LoGainOscillating",(fRuns->GetRunsAsFileName()).Data()),
283 "Oscillating Pixels Low Gain");
284 MHCamera disp28(geomcam, Form("%s%s","AbsTimeMean",(fRuns->GetRunsAsFileName()).Data()),
285 "Abs. Arrival Times");
286 MHCamera disp29(geomcam, Form("%s%s","AbsTimeRms",(fRuns->GetRunsAsFileName()).Data()),
287 "RMS of Arrival Times");
288 MHCamera disp30(geomcam, Form("%s%s","MeanTime",(fRuns->GetRunsAsFileName()).Data()),
289 "Mean Rel. Arrival Times");
290 MHCamera disp31(geomcam, Form("%s%s","SigmaTime",(fRuns->GetRunsAsFileName()).Data()),
291 "Sigma Rel. Arrival Times");
292 MHCamera disp32(geomcam, Form("%s%s","TimeProb",(fRuns->GetRunsAsFileName()).Data()),
293 "Probability of Time Fit");
294 MHCamera disp33(geomcam, Form("%s%s","TimeNotFitValid",(fRuns->GetRunsAsFileName()).Data()),
295 "Pixels with not valid fit results");
296 MHCamera disp34(geomcam, Form("%s%s","TimeOscillating",(fRuns->GetRunsAsFileName()).Data()),
297 "Oscillating Pixels");
298
299 // Fitted charge means and sigmas
300 disp1.SetCamContent(fCalibrationCam, 0);
301 disp1.SetCamError( fCalibrationCam, 1);
302 disp2.SetCamContent(fCalibrationCam, 2);
303 disp2.SetCamError( fCalibrationCam, 3);
304
305 // Reduced Sigmas and reduced sigmas per charge
306 disp3.SetCamContent(fCalibrationCam, 5);
307 disp3.SetCamError( fCalibrationCam, 6);
308 disp4.SetCamContent(fCalibrationCam, 7);
309 disp4.SetCamError( fCalibrationCam, 8);
310
311 // F-Factor Method
312 disp5.SetCamContent(fCalibrationCam, 9);
313 disp5.SetCamError( fCalibrationCam, 10);
314 disp6.SetCamContent(fCalibrationCam, 11);
315 disp6.SetCamError( fCalibrationCam, 12);
316 disp7.SetCamContent(fCalibrationCam, 13);
317 disp7.SetCamError( fCalibrationCam, 14);
318
319 // Quantum Efficiencies
320 disp8.SetCamContent (fQECam, 0 );
321 disp8.SetCamError (fQECam, 1 );
322 disp9.SetCamContent (fQECam, 2 );
323 disp9.SetCamError (fQECam, 3 );
324 disp10.SetCamContent(fQECam, 4 );
325 disp10.SetCamError (fQECam, 5 );
326 disp11.SetCamContent(fQECam, 6 );
327 disp11.SetCamError (fQECam, 7 );
328
329 // Valid flags
330 disp12.SetCamContent(fQECam, 8 );
331 disp13.SetCamContent(fQECam, 9 );
332 disp14.SetCamContent(fQECam, 10);
333 disp15.SetCamContent(fQECam, 11);
334
335 // Conversion Hi-Lo
336 disp16.SetCamContent(fCalibrationCam, 25);
337 disp17.SetCamContent(fCalibrationCam, 16);
338 disp17.SetCamError (fCalibrationCam, 17);
339 disp18.SetCamContent(fCalibrationCam, 18);
340 disp18.SetCamError (fCalibrationCam, 19);
341
342 // Pickup and Blackout
343 disp19.SetCamContent(fCalibrationCam, 21);
344 disp20.SetCamContent(fCalibrationCam, 22);
345 disp21.SetCamContent(fCalibrationCam, 23);
346 disp22.SetCamContent(fCalibrationCam, 24);
347
348 // Pixels with defects
349 disp23.SetCamContent(fCalibrationCam, 20);
350 disp24.SetCamContent(fBadPixels, 1);
351 disp25.SetCamContent(fBadPixels, 3);
352
353 // Oscillations
354 disp26.SetCamContent(fBadPixels, 10);
355 disp27.SetCamContent(fBadPixels, 11);
356
357 // Arrival Times
358 disp28.SetCamContent(fCalibrationCam, 26);
359 disp28.SetCamError( fCalibrationCam, 27);
360 disp29.SetCamContent(fCalibrationCam, 27);
361
362 disp1.SetYTitle("Q [FADC counts]");
363 disp2.SetYTitle("\\sigma_{Q} [FADC counts]");
364
365 disp3.SetYTitle("\\sqrt{\\sigma^{2}_{Q} - RMS^{2}_{Ped}} [FADC Counts]");
366 disp4.SetYTitle("Red.Sigma/<Q> [1]");
367
368 disp5.SetYTitle("Nr. Phe's [1]");
369 disp6.SetYTitle("Conv.Factor [PhE/FADC counts]");
370 disp7.SetYTitle("Total F-Factor [1]");
371
372 disp8.SetYTitle("QE [1]");
373 disp9.SetYTitle("QE [1]");
374 disp10.SetYTitle("QE [1]");
375 disp11.SetYTitle("QE [1]");
376
377 disp12.SetYTitle("[1]");
378 disp13.SetYTitle("[1]");
379 disp14.SetYTitle("[1]");
380 disp15.SetYTitle("[1]");
381 disp16.SetYTitle("[1]");
382
383 disp17.SetYTitle("<Q>(High)/<Q>(Low) [1]");
384 disp18.SetYTitle("\\sigma_{Q}(High)/\\sigma_{Q}(Low) [1]");
385
386 disp19.SetYTitle("[1]");
387 disp20.SetYTitle("[1]");
388 disp21.SetYTitle("[1]");
389 disp22.SetYTitle("[1]");
390 disp23.SetYTitle("[1]");
391 disp24.SetYTitle("[1]");
392 disp25.SetYTitle("[1]");
393 disp26.SetYTitle("[1]");
394 disp27.SetYTitle("[1]");
395
396 disp28.SetYTitle("Mean Abs. Time [FADC slice]");
397 disp29.SetYTitle("RMS Abs. Time [FADC slices]");
398
399 if (fRelTimes)
400 {
401
402 disp30.SetCamContent(fRelTimeCam,0);
403 disp30.SetCamError( fRelTimeCam,1);
404 disp31.SetCamContent(fRelTimeCam,2);
405 disp31.SetCamError( fRelTimeCam,3);
406 disp32.SetCamContent(fRelTimeCam,4);
407 disp33.SetCamContent(fBadPixels,20);
408 disp34.SetCamContent(fBadPixels,21);
409
410 disp30.SetYTitle("Time Offset [FADC units]");
411 disp31.SetYTitle("Timing resolution [FADC units]");
412 disp32.SetYTitle("P_{Time} [1]");
413 disp33.SetYTitle("[1]");
414 disp34.SetYTitle("[1]");
415 }
416
417 if (fDisplayType == kDataCheckDisplay)
418 {
419 TCanvas &c1 = fDisplay->AddTab("Fit.Charge");
420 c1.Divide(3, 3);
421
422 disp1.CamDraw(c1, 1, 3, 2);
423 disp4.CamDraw(c1, 2, 3, 2);
424 disp28.CamDraw(c1, 3, 3, 2);
425
426 // F-Factor
427 TCanvas &c2 = fDisplay->AddTab("Phe's");
428 c2.Divide(3,4);
429
430 disp6.CamDraw(c2, 1, 3, 2, 1);
431 disp7.CamDraw(c2, 2, 3, 2, 1);
432 disp8.CamDraw(c2, 3, 3, 2, 1);
433
434 // QE's
435 TCanvas &c3 = fDisplay->AddTab("QE's");
436 c3.Divide(3,4);
437
438 disp8.CamDraw(c3, 1, 3, 2, 1);
439 disp9.CamDraw(c3, 2, 3, 2, 1);
440 disp10.CamDraw(c3, 3, 3, 2, 1);
441
442 // Defects
443 TCanvas &c4 = fDisplay->AddTab("Defect");
444 // c4.Divide(3,2);
445 c4.Divide(2,2);
446
447 // CamDraw(c4, 1, 3, disp23, 0);
448 // CamDraw(c4, 2, 3, disp24, 0);
449 // CamDraw(c4, 3, 3, disp25, 0);
450 disp24.CamDraw(c4, 1, 2, 0);
451 disp25.CamDraw(c4, 2, 2, 0);
452
453 if (fRelTimes)
454 {
455 // Rel. Times
456 TCanvas &c5 = fDisplay->AddTab("Rel. Times");
457 c5.Divide(2,4);
458
459 disp30.CamDraw(c5, 1, 2, 2);
460 disp31.CamDraw(c5, 2, 2, 2);
461 }
462
463
464 return;
465 }
466
467 if (fDisplayType == kNormalDisplay)
468 {
469
470 // Charges
471 TCanvas &c11 = fDisplay->AddTab("Fit.Charge");
472 c11.Divide(2, 4);
473
474 disp1.CamDraw(c11, 1, 2, 5, 1);
475 disp2.CamDraw(c11, 2, 2, 5, 1);
476
477 // Reduced Sigmas
478 TCanvas &c12 = fDisplay->AddTab("Red.Sigma");
479 c12.Divide(2,4);
480
481 disp3.CamDraw(c12, 1, 2, 5, 1);
482 disp4.CamDraw(c12, 2, 2, 5, 1);
483
484 // F-Factor
485 TCanvas &c13 = fDisplay->AddTab("Phe's");
486 c13.Divide(3,4);
487
488 disp5.CamDraw(c13, 1, 3, 5, 1);
489 disp6.CamDraw(c13, 2, 3, 5, 1);
490 disp7.CamDraw(c13, 3, 3, 5, 1);
491
492 // QE's
493 TCanvas &c14 = fDisplay->AddTab("QE's");
494 c14.Divide(4,4);
495
496 disp8.CamDraw(c14, 1, 4, 5, 1);
497 disp9.CamDraw(c14, 2, 4, 5, 1);
498 disp10.CamDraw(c14, 3, 4, 5, 1);
499 disp11.CamDraw(c14, 4, 4, 5, 1);
500
501 // Defects
502 TCanvas &c15 = fDisplay->AddTab("Defect");
503 // c15.Divide(5,2);
504 c15.Divide(4,2);
505
506 /*
507 disp23.CamDraw(c15, 1, 5, 0);
508 disp24.CamDraw(c15, 2, 5, 0);
509 disp25.CamDraw(c15, 3, 5, 0);
510 disp26.CamDraw(c15, 4, 5, 0);
511 disp27.CamDraw(c15, 5, 5, 0);
512 */
513 disp24.CamDraw(c15, 1, 4, 0);
514 disp25.CamDraw(c15, 2, 4, 0);
515 disp26.CamDraw(c15, 3, 4, 0);
516 disp27.CamDraw(c15, 4, 4, 0);
517
518 // Abs. Times
519 TCanvas &c16 = fDisplay->AddTab("Abs. Times");
520 c16.Divide(2,3);
521
522 disp28.CamDraw(c16, 1, 2, 5);
523 disp29.CamDraw(c16, 2, 2, 5);
524
525 if (fRelTimes)
526 {
527 // Rel. Times
528 TCanvas &c17 = fDisplay->AddTab("Rel. Times");
529 c17.Divide(2,4);
530
531 disp30.CamDraw(c17, 1, 2, 5, 1);
532 disp31.CamDraw(c17, 2, 2, 5, 1);
533 }
534
535 return;
536 }
537
538 if (fDisplayType == kFullDisplay)
539 {
540
541 MHCalibrationCam *cam = (MHCalibrationCam*)plist.FindObject("MHCalibrationChargeCam");
542
543 for (Int_t sector=1;sector<cam->GetAverageSectors();sector++)
544 {
545 cam->GetAverageHiGainSector(sector).DrawClone("all");
546 cam->GetAverageLoGainSector(sector).DrawClone("all");
547 }
548
549 // Charges
550 TCanvas &c21 = fDisplay->AddTab("Fit.Charge");
551 c21.Divide(2, 4);
552
553 disp1.CamDraw(c21, 1, 2, 2, 1);
554 disp2.CamDraw(c21, 2, 2, 2, 1);
555
556 // Reduced Sigmas
557 TCanvas &c23 = fDisplay->AddTab("Red.Sigma");
558 c23.Divide(2,4);
559
560 disp3.CamDraw(c23, 1, 2, 2, 1);
561 disp4.CamDraw(c23, 2, 2, 2, 1);
562
563 // F-Factor
564 TCanvas &c24 = fDisplay->AddTab("Phe's");
565 c24.Divide(3,5);
566
567 disp5.CamDraw(c24, 1, 3, 2, 1, 1);
568 disp6.CamDraw(c24, 2, 3, 2, 1, 1);
569 disp7.CamDraw(c24, 3, 3, 2, 1, 1);
570
571 // QE's
572 TCanvas &c25 = fDisplay->AddTab("QE's");
573 c25.Divide(4,5);
574
575 disp8.CamDraw(c25, 1, 4, 2, 1, 1);
576 disp9.CamDraw(c25, 2, 4, 2, 1, 1);
577 disp10.CamDraw(c25, 3, 4, 2, 1, 1);
578 disp11.CamDraw(c25, 4, 4, 2, 1, 1);
579
580 // Validity
581 TCanvas &c26 = fDisplay->AddTab("Valid");
582 c26.Divide(4,2);
583
584 disp12.CamDraw(c26, 1, 4, 0);
585 disp13.CamDraw(c26, 2, 4, 0);
586 disp14.CamDraw(c26, 3, 4, 0);
587 disp15.CamDraw(c26, 4, 4, 0);
588
589 // Other info
590 TCanvas &c27 = fDisplay->AddTab("HiLoGain");
591 c27.Divide(3,3);
592
593 disp16.CamDraw(c27, 1, 3, 0);
594 disp17.CamDraw(c27, 2, 3, 1);
595 disp18.CamDraw(c27, 3, 3, 1);
596
597 // Pickup
598 TCanvas &c28 = fDisplay->AddTab("Pickup");
599 c28.Divide(4,2);
600
601 disp19.CamDraw(c28, 1, 4, 0);
602 disp20.CamDraw(c28, 2, 4, 0);
603 disp21.CamDraw(c28, 3, 4, 0);
604 disp22.CamDraw(c28, 4, 4, 0);
605
606 // Defects
607 TCanvas &c29 = fDisplay->AddTab("Defect");
608 // c29.Divide(5,2);
609 c29.Divide(4,2);
610
611 disp24.CamDraw(c29, 1, 4, 0);
612 disp25.CamDraw(c29, 2, 4, 0);
613 disp26.CamDraw(c29, 3, 4, 0);
614 disp27.CamDraw(c29, 4, 4, 0);
615
616 // Abs. Times
617 TCanvas &c30 = fDisplay->AddTab("Abs. Times");
618 c30.Divide(2,3);
619
620 disp28.CamDraw(c30, 1, 2, 2);
621 disp29.CamDraw(c30, 2, 2, 1);
622
623 if (fRelTimes)
624 {
625 // Rel. Times
626 TCanvas &c31 = fDisplay->AddTab("Rel. Times");
627 c31.Divide(3,5);
628
629 disp30.CamDraw(c31, 1, 3, 2, 1, 1);
630 disp31.CamDraw(c31, 2, 3, 2, 1, 1);
631 disp32.CamDraw(c31, 3, 3, 4, 1, 1);
632
633 // Time Defects
634 TCanvas &c32 = fDisplay->AddTab("Time Def.");
635 c32.Divide(2,2);
636
637 disp33.CamDraw(c32, 1, 2, 0);
638 disp34.CamDraw(c32, 2, 2, 0);
639
640 MHCalibrationCam *cam = (MHCalibrationCam*)plist.FindObject("MHCalibrationRelTimeCam");
641
642 for (Int_t sector=1;sector<cam->GetAverageSectors();sector++)
643 {
644 cam->GetAverageHiGainSector(sector).DrawClone("fourierevents");
645 cam->GetAverageLoGainSector(sector).DrawClone("fourierevents");
646 }
647
648 }
649
650 return;
651 }
652}
653
654
655
656// --------------------------------------------------------------------------
657//
658// Find the colour of the pulsing LED:
659// - If the run number is smaller than gkIFAEBoxInaugurationRun, take MCalibrationCam::kCT1
660// - Otherwise find the colour out of the run name
661// - If no colour is found, return kFALSE
662//
663Bool_t MJCalibration::FindColor()
664{
665
666 const UInt_t nruns = fRuns->GetNumRuns();
667
668 if (nruns == 0)
669 return kFALSE;
670
671 TArrayI arr = fRuns->GetRuns();
672
673 if (arr[nruns-1] < gkIFAEBoxInaugurationRun)
674 {
675 *fLog << "Found colour kCT1 in runs: " << fRuns->GetRunsAsString() << endl;
676 fColor = MCalibrationCam::kCT1;
677 return kTRUE;
678 }
679
680 TString filenames;
681 ((MDirIter*)fRuns)->Reset();
682
683 while (!(filenames=((MDirIter*)fRuns)->Next()).IsNull())
684 {
685
686 filenames.ToLower();
687
688 //
689 // Here starts the list of runs where the shifters did not put
690 // a colour, but which have been found out by other means
691 //
692 if (filenames.Contains("_27474_"))
693 if (fColor == MCalibrationCam::kNONE)
694 {
695 *fLog << "Sorry, run 27474 was taken with CLOSED LIDS. It should not be used! "
696 << "Selected runs were: " << filenames << endl;
697 fColor = MCalibrationCam::kNONE;
698 return kFALSE;
699 }
700 else if (fColor != MCalibrationCam::kNONE)
701 {
702 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;
703 return kFALSE;
704 }
705
706 if (filenames.Contains("_26924_"))
707 if (fColor == MCalibrationCam::kNONE)
708 {
709 *fLog << "Found colour: kGREEN in " << filenames << endl;
710 fColor = MCalibrationCam::kGREEN;
711 }
712 else if (fColor != MCalibrationCam::kGREEN)
713 {
714 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;
715 return kFALSE;
716 }
717
718
719 if (filenames.Contains("_26568_"))
720 if (fColor == MCalibrationCam::kNONE)
721 {
722 *fLog << "Found colour: kGREEN in " << filenames << endl;
723 fColor = MCalibrationCam::kGREEN;
724 }
725 else if (fColor != MCalibrationCam::kGREEN)
726 {
727 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;
728 return kFALSE;
729 }
730
731 if (filenames.Contains("_26412_"))
732 if (fColor == MCalibrationCam::kNONE)
733 {
734 *fLog << "Found colour: kGREEN in " << filenames << endl;
735 fColor = MCalibrationCam::kGREEN;
736 }
737 else if (fColor != MCalibrationCam::kGREEN)
738 {
739 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;
740 return kFALSE;
741 }
742
743
744 if (filenames.Contains("_26409_"))
745 if (fColor == MCalibrationCam::kNONE)
746 {
747 *fLog << "Found colour: kGREEN in " << filenames << endl;
748 fColor = MCalibrationCam::kGREEN;
749 }
750 else if (fColor != MCalibrationCam::kGREEN)
751 {
752 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;
753 return kFALSE;
754 }
755
756 if (filenames.Contains("_26408_"))
757 if (fColor == MCalibrationCam::kNONE)
758 {
759 *fLog << "Found colour: kGREEN in " << filenames << endl;
760 fColor = MCalibrationCam::kGREEN;
761 }
762 else if (fColor != MCalibrationCam::kGREEN)
763 {
764 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;
765 return kFALSE;
766 }
767
768
769 if (filenames.Contains("_26402_"))
770 if (fColor == MCalibrationCam::kNONE)
771 {
772 *fLog << "Found colour: kBLUE in " << filenames << endl;
773 fColor = MCalibrationCam::kBLUE;
774 }
775 else if (fColor != MCalibrationCam::kBLUE)
776 {
777 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;
778 return kFALSE;
779 }
780
781 if (filenames.Contains("_20661_"))
782 if (fColor == MCalibrationCam::kNONE)
783 {
784 *fLog << "Found colour: kGREEN in " << filenames << endl;
785 fColor = MCalibrationCam::kGREEN;
786 }
787 else if (fColor != MCalibrationCam::kGREEN)
788 {
789 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;
790 return kFALSE;
791 }
792
793 if (filenames.Contains("_20660_"))
794 if (fColor == MCalibrationCam::kNONE)
795 {
796 *fLog << "Found colour: kGREEN in " << filenames << endl;
797 fColor = MCalibrationCam::kGREEN;
798 }
799 else if (fColor != MCalibrationCam::kGREEN)
800 {
801 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;
802 return kFALSE;
803 }
804
805 //
806 // Here start the runs where the shifter put
807 // the colour
808 //
809 if (filenames.Contains("green"))
810 if (fColor == MCalibrationCam::kNONE)
811 {
812 *fLog << "Found colour: kGREEN in " << filenames << endl;
813 fColor = MCalibrationCam::kGREEN;
814 }
815 else if (fColor != MCalibrationCam::kGREEN)
816 {
817 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;
818 return kFALSE;
819 }
820
821 if (filenames.Contains("blue"))
822 if (fColor == MCalibrationCam::kNONE)
823 {
824 *fLog << "Found colour: kBLUE in " << filenames << endl;
825 fColor = MCalibrationCam::kBLUE;
826 }
827 else if (fColor != MCalibrationCam::kBLUE)
828 {
829 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;
830 return kFALSE;
831 }
832
833 if (filenames.Contains("uv"))
834 if (fColor == MCalibrationCam::kNONE)
835 {
836 *fLog << "Found colour: kUV in " << filenames << endl;
837 fColor = MCalibrationCam::kUV;
838 }
839 else if (fColor != MCalibrationCam::kUV)
840 {
841 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;
842 return kFALSE;
843 }
844
845 if (filenames.Contains("ct1"))
846 if (fColor == MCalibrationCam::kNONE)
847 {
848 *fLog << "Found colour: kCT1 in " << filenames << endl;
849 fColor = MCalibrationCam::kCT1;
850 }
851 else if (fColor != MCalibrationCam::kCT1)
852 {
853 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;
854 return kFALSE;
855 }
856
857 }
858
859 if (fColor == MCalibrationCam::kNONE)
860 {
861 *fLog << "No colour found in filenames of runs: " << fRuns->GetRunsAsString()
862 << "... abort" << endl;
863 return kFALSE;
864 }
865
866 return kTRUE;
867}
868
869
870
871
872// --------------------------------------------------------------------------
873//
874// Retrieve the output file written by WriteResult()
875//
876const char* MJCalibration::GetOutputFile() const
877{
878
879 if (!fRuns)
880 return "";
881
882 return Form("%s/%s-F1.root", (const char*)fOutputPath, (const char*)fRuns->GetRunsAsFileName());
883}
884
885
886Bool_t MJCalibration::IsUseBlindPixel() const
887{
888 return TESTBIT(fDevices,kUseBlindPixel);
889}
890
891
892Bool_t MJCalibration::IsUsePINDiode() const
893{
894 return TESTBIT(fDevices,kUsePINDiode);
895}
896
897
898
899
900
901// --------------------------------------------------------------------------
902//
903// Call the ProcessFile(MPedestalCam)
904//
905Bool_t MJCalibration::Process(MPedestalCam &pedcam)
906{
907 if (!ReadCalibrationCam())
908 return ProcessFile(pedcam);
909
910 return kTRUE;
911}
912
913// --------------------------------------------------------------------------
914//
915// Execute the task list and the eventloop:
916//
917// - Check if there are fRuns, otherwise return
918// - Check the colour of the files in fRuns (FindColor()), otherwise return
919// - Check for consistency between run numbers and number of files
920// - Add fRuns to MReadMarsFile
921// - Put into MParList:
922// 1) MPedestalCam (pedcam)
923// 2) MCalibrationQECam (fQECam)
924// 3) MCalibrationChargeCam (fCalibrationCam)
925// 4) MCalibrationRelTimeCam (fRelTimeCam) (only if flag fRelTimes is chosen)
926// 5) MBadPixelsCam (fBadPixels)
927// 6) MCalibrationChargePINDiode
928// 7) MCalibrationChargeBlindPix
929// - Put into the MTaskList:
930// 1) MReadMarsFile
931// 2) MBadPixelsMerge
932// 3) MGeomApply
933// 4) MExtractor
934// 5) MExtractPINDiode
935// 6) MExtractBlindPixel
936// 7) MExtractTime (only if flag fRelTimes is chosen)
937// 8) MContinue(MFCosmics)
938// 9) MFillH("MHCalibrationChargePINDiode", "MExtractedSignalPINDiode")
939// 10) MFillH("MHCalibrationChargeBlindPix", "MExtractedSignalBlindPixel")
940// 11) MFillH("MHCalibrationChargeCam", "MExtractedSignalCam")
941// 12) MFillH("MHCalibrationChargeCam", "MExtractedSignalCam")
942// 13) MCalibrationChargeCalc
943// 14) MFillH("MHCalibrationRelTimeCam", "MArrivalTimeCam") (only if flag fRelTimes is chosen)
944// 15) MCalibrationRelTimeCalc
945// - Execute MEvtLoop
946// - DisplayResult()
947// - WriteResult()
948//
949Bool_t MJCalibration::ProcessFile(MPedestalCam &pedcam)
950{
951 if (!fRuns)
952 {
953 *fLog << err << "No Runs choosen... abort." << endl;
954 return kFALSE;
955 }
956
957 if (fRuns->GetNumRuns() != fRuns->GetNumEntries())
958 {
959 *fLog << err << "Number of files found doesn't match number of runs... abort."
960 << fRuns->GetNumRuns() << " vs. " << fRuns->GetNumEntries() << endl;
961 return kFALSE;
962 }
963
964 *fLog << inf;
965 fLog->Separator(GetDescriptor());
966
967 if (!FindColor())
968 return kFALSE;
969
970 *fLog << "Calculate MCalibrationCam from Runs " << fRuns->GetRunsAsString() << endl;
971 *fLog << endl;
972
973 // Setup Tasklist
974 MParList plist;
975 MTaskList tlist;
976 plist.AddToList(&tlist);
977
978 MReadMarsFile read("Events");
979 MRawFileRead rawread(NULL);
980
981 if (fDataCheck)
982 {
983 rawread.AddFiles(*fRuns);
984 tlist.AddToList(&rawread);
985 }
986 else
987 {
988 read.DisableAutoScheme();
989 static_cast<MRead&>(read).AddFiles(*fRuns);
990 tlist.AddToList(&read);
991 }
992
993 plist.AddToList(&pedcam);
994 plist.AddToList(&fBadPixels);
995 plist.AddToList(&fQECam);
996 plist.AddToList(&fCalibrationCam);
997 plist.AddToList(&fCalibrationBlindPix);
998 plist.AddToList(&fCalibrationPINDiode);
999 plist.AddToList(&fRelTimeCam);
1000
1001 MGeomApply apply;
1002 // MBadPixelsMerge merge(&fBadPixels);
1003 MExtractPINDiode pinext;
1004 MExtractBlindPixel blindext;
1005 MExtractSlidingWindow extract2;
1006 MExtractTimeSpline timespline;
1007 MCalibrationChargeCalc calcalc;
1008 calcalc.SetOutputPath(fOutputPath);
1009 calcalc.SetOutputFile(Form("%s-ChargeCalibStat.txt",(const char*)fRuns->GetRunsAsFileName()));
1010
1011 MCalibrationRelTimeCalc timecalc;
1012 timecalc.SetOutputPath(fOutputPath);
1013 timecalc.SetOutputFile(Form("%s-TimeCalibStat.txt",(const char*)fRuns->GetRunsAsFileName()));
1014
1015 //
1016 // As long as there are no DM's, have to colour by hand
1017 //
1018 calcalc.SetPulserColor(fColor);
1019
1020 MFillH fillpin("MHCalibrationChargePINDiode", "MExtractedSignalPINDiode");
1021 MFillH fillbnd("MHCalibrationChargeBlindPix", "MExtractedSignalBlindPixel");
1022 MFillH fillcam("MHCalibrationChargeCam", "MExtractedSignalCam");
1023 MFillH filltme("MHCalibrationRelTimeCam", "MArrivalTimeCam");
1024 fillpin.SetNameTab("PINDiode");
1025 fillbnd.SetNameTab("BlindPix");
1026 fillcam.SetNameTab("Charge");
1027 filltme.SetNameTab("RelTimes");
1028
1029 if (fDisplayType == kFullDisplay)
1030 {
1031 fillcam.SetDrawOption("all");
1032 filltme.SetDrawOption("all");
1033 }
1034
1035
1036 //
1037 // Apply a filter against cosmics
1038 // (will have to be needed in the future
1039 // when the calibration hardware-trigger is working)
1040 //
1041 MFCosmics cosmics;
1042 MContinue cont(&cosmics);
1043
1044 // tlist.AddToList(&merge);
1045 tlist.AddToList(&apply);
1046
1047 if (fExtractor)
1048 tlist.AddToList(fExtractor);
1049 else
1050 {
1051 *fLog << warn << GetDescriptor()
1052 << ": No extractor has been chosen, take default MExtractSlidingWindow " << endl;
1053 tlist.AddToList(&extract2);
1054 }
1055
1056
1057 tlist.AddToList(&pinext);
1058 tlist.AddToList(&blindext);
1059
1060 if (fRelTimes)
1061 {
1062 if (fTimeExtractor)
1063 tlist.AddToList(fTimeExtractor);
1064 else
1065 {
1066 *fLog << warn << GetDescriptor()
1067 << ": No extractor has been chosen, take default MTimeExtractSpline " << endl;
1068 tlist.AddToList(&timespline);
1069 }
1070 }
1071
1072 if (fColor == MCalibrationCam::kCT1)
1073 tlist.AddToList(&cont);
1074
1075 tlist.AddToList(&fillcam);
1076
1077 if (IsUsePINDiode())
1078 tlist.AddToList(&fillpin);
1079 if (IsUseBlindPixel())
1080 tlist.AddToList(&fillbnd);
1081
1082 tlist.AddToList(&calcalc);
1083
1084 if (fRelTimes)
1085 {
1086 tlist.AddToList(&filltme);
1087 tlist.AddToList(&timecalc);
1088 }
1089
1090
1091 // Create and setup the eventloop
1092 MEvtLoop evtloop(fName);
1093 evtloop.SetParList(&plist);
1094 evtloop.SetDisplay(fDisplay);
1095 evtloop.SetLogStream(fLog);
1096
1097 // Execute first analysis
1098 if (!evtloop.Eventloop())
1099 {
1100 *fLog << err << GetDescriptor() << ": Failed." << endl;
1101 return kFALSE;
1102 }
1103
1104 tlist.PrintStatistics();
1105
1106 DisplayResult(plist);
1107
1108 if (!WriteResult())
1109 return kFALSE;
1110
1111 *fLog << inf << GetDescriptor() << ": Done." << endl;
1112
1113 return kTRUE;
1114}
1115
1116// --------------------------------------------------------------------------
1117//
1118// Read the following containers from GetOutputFile()
1119// - MCalibrationChargeCam
1120// - MCalibrationQECam
1121// - MBadPixelsCam
1122//
1123Bool_t MJCalibration::ReadCalibrationCam()
1124{
1125
1126 const TString fname = GetOutputFile();
1127
1128 if (gSystem->AccessPathName(fname, kFileExists))
1129 {
1130 *fLog << err << "Input file " << fname << " doesn't exist." << endl;
1131 return kFALSE;
1132 }
1133
1134 *fLog << inf << "Reading from file: " << fname << endl;
1135
1136 TFile file(fname, "READ");
1137 if (fCalibrationCam.Read()<=0)
1138 {
1139 *fLog << err << "Unable to read MCalibrationChargeCam from " << fname << endl;
1140 return kFALSE;
1141 }
1142
1143 if (fQECam.Read()<=0)
1144 {
1145 *fLog << err << "Unable to read MCalibrationQECam from " << fname << endl;
1146 return kFALSE;
1147 }
1148
1149
1150 if (fRelTimes)
1151 if (fRelTimeCam.Read()<=0)
1152 {
1153 *fLog << err << "Unable to read MCalibrationRelTimeCam from " << fname << endl;
1154 return kFALSE;
1155 }
1156
1157 if (file.FindKey("MBadPixelsCam"))
1158 {
1159 MBadPixelsCam bad;
1160 if (bad.Read()<=0)
1161 {
1162 *fLog << err << "Unable to read MBadPixelsCam from " << fname << endl;
1163 return kFALSE;
1164 }
1165 fBadPixels.Merge(bad);
1166 }
1167
1168 if (fDisplay /*&& !fDisplay->GetCanvas("Pedestals")*/) // FIXME!
1169 fDisplay->Read();
1170
1171 return kTRUE;
1172}
1173
1174
1175// --------------------------------------------------------------------------
1176//
1177// Set the path for output files, written by WriteResult()
1178//
1179void MJCalibration::SetOutputPath(const char *path)
1180{
1181 fOutputPath = path;
1182 if (fOutputPath.EndsWith("/"))
1183 fOutputPath = fOutputPath(0, fOutputPath.Length()-1);
1184}
1185
1186// --------------------------------------------------------------------------
1187//
1188// Set the useage of the Blind Pixel device
1189//
1190void MJCalibration::SetUseBlindPixel(const Bool_t b)
1191{
1192 b ? SETBIT(fDevices,kUseBlindPixel) : CLRBIT(fDevices,kUseBlindPixel);
1193}
1194
1195// --------------------------------------------------------------------------
1196//
1197// Set the useage of the PIN Diode device
1198//
1199void MJCalibration::SetUsePINDiode(const Bool_t b)
1200{
1201 b ? SETBIT(fDevices,kUsePINDiode) : CLRBIT(fDevices,kUsePINDiode);
1202}
1203
1204// --------------------------------------------------------------------------
1205//
1206// Write the result into the output file GetOutputFile(), if fOutputPath exists.
1207//
1208// The following containers are written:
1209// - MStatusDisplay
1210// - MCalibrationChargeCam
1211// - MCalibrationChargeBlindPix
1212// - MCalibrationQECam
1213// - MBadPixelsCam
1214//
1215Bool_t MJCalibration::WriteResult()
1216{
1217 if (fOutputPath.IsNull())
1218 return kTRUE;
1219
1220 const TString oname(GetOutputFile());
1221
1222 *fLog << inf << "Writing to file: " << oname << endl;
1223
1224 TFile file(oname, "UPDATE");
1225
1226 if (fDisplay && fDisplay->Write()<=0)
1227 {
1228 *fLog << err << "Unable to write MStatusDisplay to " << oname << endl;
1229 return kFALSE;
1230 }
1231
1232 if (fCalibrationCam.Write()<=0)
1233 {
1234 *fLog << err << "Unable to write MCalibrationChargeCam to " << oname << endl;
1235 return kFALSE;
1236 }
1237
1238 if (fCalibrationBlindPix.Write()<=0)
1239 {
1240 *fLog << err << "Unable to write MCalibrationChargeBlindPix to " << oname << endl;
1241 return kFALSE;
1242 }
1243
1244 if (fCalibrationPINDiode.Write()<=0)
1245 {
1246 *fLog << err << "Unable to write MCalibrationChargePINDiode to " << oname << endl;
1247 return kFALSE;
1248 }
1249
1250 if (fQECam.Write()<=0)
1251 {
1252 *fLog << err << "Unable to write MCalibrationQECam to " << oname << endl;
1253 return kFALSE;
1254 }
1255
1256 if (fRelTimes)
1257 if (fRelTimeCam.Write()<=0)
1258 {
1259 *fLog << err << "Unable to write MCalibrationQECam to " << oname << endl;
1260 return kFALSE;
1261 }
1262
1263 if (fBadPixels.Write()<=0)
1264 {
1265 *fLog << err << "Unable to write MBadPixelsCam to " << oname << endl;
1266 return kFALSE;
1267 }
1268
1269 return kTRUE;
1270
1271}
1272
Note: See TracBrowser for help on using the repository browser.