source: trunk/MagicSoft/Mars/mhcalib/MHCalibrationPulseTimeCam.cc@ 8802

Last change on this file since 8802 was 8582, checked in by tbretz, 17 years ago
*** empty log message ***
File size: 21.3 KB
Line 
1/* ======================================================================== *\
2! $Name: not supported by cvs2svn $:$Id: MHCalibrationPulseTimeCam.cc,v 1.41 2007-06-19 09:25:38 tbretz Exp $
3! --------------------------------------------------------------------------
4!
5! *
6! * This file is part of MARS, the MAGIC Analysis and Reconstruction
7! * Software. It is distributed to you in the hope that it can be a useful
8! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
9! * It is distributed WITHOUT ANY WARRANTY.
10! *
11! * Permission to use, copy, modify and distribute this software and its
12! * documentation for any purpose is hereby granted without fee,
13! * provided that the above copyright notice appear in all copies and
14! * that both that copyright notice and this permission notice appear
15! * in supporting documentation. It is provided "as is" without express
16! * or implied warranty.
17! *
18!
19!
20! Author(s): Markus Gaug 02/2004 <mailto:markus@ifae.es>
21! Author(s): Thomas Bretz <mailto:tbretz@astro.uni-wuerzburg.de>
22!
23! Copyright: MAGIC Software Development, 2000-2007
24!
25!
26\* ======================================================================== */
27/////////////////////////////////////////////////////////////////////////////
28//
29// MHCalibrationPulseTimeCam
30//
31// Fills the extracted signals of MExtractedSignalCam into the MHCalibrationPix-classes
32// MHCalibrationPulseTimeHiGainPix and MHCalibrationPulseTimeLoGainPix for every:
33//
34// - Pixel, stored in the TOrdCollection's MHCalibrationCam::fHiGainArray and
35// MHCalibrationCam::fLoGainArray
36//
37// - Average pixel per AREA index (e.g. inner and outer for the MAGIC camera),
38// stored in the TOrdCollection's MHCalibrationCam::fAverageHiGainAreas and
39// MHCalibrationCam::fAverageLoGainAreas
40//
41// - Average pixel per camera SECTOR (e.g. sectors 1-6 for the MAGIC camera),
42// stored in the TOrdCollection's MHCalibrationCam::fAverageHiGainSectors and
43// MHCalibrationCam::fAverageLoGainSectors
44//
45// Every signal is taken from MExtractedSignalCam and filled into a histogram and
46// an array, in order to perform a Fourier analysis (see MHGausEvents).
47// The signals are moreover averaged on an event-by-event basis and written into
48// the corresponding average pixels.
49//
50// Additionally, the (FADC slice) position of the maximum is stored in an Absolute
51// Arrival Time histogram. This histogram serves for a rough cross-check if the
52// signal does not lie at or outside the edges of the extraction window.
53//
54// The PulseTime histograms are fitted to a Gaussian, mean and sigma with its errors
55// and the fit probability are extracted. If none of these values are NaN's and
56// if the probability is bigger than MHGausEvents::fProbLimit (default: 0.5%),
57// the fit is declared valid.
58// Otherwise, the fit is repeated within ranges of the previous mean
59// +- MHCalibrationPix::fPickupLimit (default: 5) sigma (see MHCalibrationPix::RepeatFit())
60// In case this does not make the fit valid, the histogram means and RMS's are
61// taken directly (see MHCalibrationPix::BypassFit()) and the following flags are set:
62// - MBadPixelsPix::SetUncalibrated( MBadPixelsPix::kHiGainNotFitted ) or
63// - MBadPixelsPix::SetUncalibrated( MBadPixelsPix::kLoGainNotFitted ) and
64// - MBadPixelsPix::SetUnsuitable( MBadPixelsPix::kUnreliableRun )
65//
66// Outliers of more than MHCalibrationPix::fPickupLimit (default: 5) sigmas
67// from the mean are counted as Pickup events (stored in MHCalibrationPix::fPickup)
68//
69// Unless more than fNumHiGainSaturationLimit (default: 1%) of the overall FADC
70// slices show saturation, the following flag is set:
71// - MCalibrationPulseTimePix::SetHiGainSaturation();
72// In that case, the calibration constants are derived from the low-gain results.
73//
74// If more than fNumLoGainSaturationLimit (default: 1%) of the overall
75// low-gain FADC slices saturate, the following flags are set:
76// - MBadPixelsPix::SetUncalibrated( MBadPixelsPix::kLoGainSaturation ) and
77// - MBadPixelsPix::SetUnsuitable( MBadPixelsPix::kUnsuitableRun )
78//
79// The class also fills arrays with the signal vs. event number, creates a fourier
80// spectrum and investigates if the projected fourier components follow an exponential
81// distribution. In case that the probability of the exponential fit is less than
82// MHGausEvents::fProbLimit (default: 0.5%), the following flags are set:
83// - MBadPixelsPix::SetUncalibrated( MBadPixelsPix::kHiGainOscillating ) or
84// - MBadPixelsPix::SetUncalibrated( MBadPixelsPix::kLoGainOscillating ) and
85// - MBadPixelsPix::SetUnsuitable( MBadPixelsPix::kUnreliableRun )
86//
87// This same procedure is performed for the average pixels.
88//
89// The following results are written into MCalibrationPulseTimeCam:
90//
91// - MCalibrationPix::SetHiGainSaturation()
92// - MCalibrationPix::SetHiGainMean()
93// - MCalibrationPix::SetHiGainMeanErr()
94// - MCalibrationPix::SetHiGainSigma()
95// - MCalibrationPix::SetHiGainSigmaErr()
96// - MCalibrationPix::SetHiGainProb()
97// - MCalibrationPix::SetHiGainNumPickup()
98//
99// For all averaged areas, the fitted sigma is multiplied with the square root of
100// the number involved pixels in order to be able to compare it to the average of
101// sigmas in the camera.
102//
103//
104// ClassVersion 2:
105// ---------------
106// - Byte_t fSaturationLimit
107// - Byte_t fLowerSignalLimit
108// + UInt_t fSaturationLimit
109// + UInt_t fLowerSignalLimit
110//
111/////////////////////////////////////////////////////////////////////////////
112#include "MHCalibrationPulseTimeCam.h"
113
114#include <TEnv.h>
115#include <TLine.h>
116#include <TGraph.h>
117#include <TLegend.h>
118#include <TCanvas.h>
119#include <TOrdCollection.h>
120
121#include "MLog.h"
122#include "MLogManip.h"
123
124#include "MParList.h"
125
126#include "MArrayD.h"
127#include "MRawRunHeader.h"
128#include "MExtractedSignalCam.h"
129#include "MPedestalSubtractedEvt.h"
130
131#include "MCalibrationPix.h"
132#include "MHCalibrationPix.h"
133
134#include "MGeomCam.h"
135#include "MGeomPix.h"
136
137#include "MBadPixelsCam.h"
138
139ClassImp(MHCalibrationPulseTimeCam);
140
141using namespace std;
142
143const UInt_t MHCalibrationPulseTimeCam::fgSaturationLimit = 245;
144const UInt_t MHCalibrationPulseTimeCam::fgLowerSignalLimit = 85;
145const Int_t MHCalibrationPulseTimeCam::fgNumPixelsRequired = 2;
146const Int_t MHCalibrationPulseTimeCam::fgHiGainNbins = 20;
147const Axis_t MHCalibrationPulseTimeCam::fgHiGainFirst = -0.5;
148const Axis_t MHCalibrationPulseTimeCam::fgHiGainLast = 19.5;
149const Float_t MHCalibrationPulseTimeCam::fgProbLimit = 0.001;
150const TString MHCalibrationPulseTimeCam::gsHistName = "PulseTime";
151const TString MHCalibrationPulseTimeCam::gsHistTitle = "Extracted Times";
152const TString MHCalibrationPulseTimeCam::gsHistXTitle = "Time [FADC slices]";
153const TString MHCalibrationPulseTimeCam::gsHistYTitle = "Nr. events";
154const TString MHCalibrationPulseTimeCam::fgReferenceFile = "mjobs/signalref.rc";
155
156// --------------------------------------------------------------------------
157//
158// Default Constructor.
159//
160// Sets:
161// - all pointers to NULL
162//
163// - fNbins to fgHiGainNbins
164// - fFirst to fgHiGainFirst
165// - fLast to fgHiGainLast
166//
167// - fHistName to gsHistName
168// - fHistTitle to gsHistTitle
169// - fHistXTitle to gsHistXTitle
170// - fHistYTitle to gsHistYTitle
171//
172// - fSaturationLimit to fgSaturationLimit
173// - fLowerSignalLimit to fgLowerSignalLimit
174// - fNumPixelsRequired to fgNumPixelsRequired
175//
176MHCalibrationPulseTimeCam::MHCalibrationPulseTimeCam(const char *name, const char *title)
177 : fBadPixels(NULL)
178{
179
180 fName = name ? name : "MHCalibrationPulseTimeCam";
181 fTitle = title ? title : "Class to fill the extracted pulse times for cosmics ";
182
183 SetBinning(fgHiGainNbins, fgHiGainFirst, fgHiGainLast);
184
185 SetProbLimit(fgProbLimit);
186
187 SetHistName (gsHistName .Data());
188 SetHistTitle (gsHistTitle .Data());
189 SetHistXTitle(gsHistXTitle.Data());
190 SetHistYTitle(gsHistYTitle.Data());
191
192 SetReferenceFile();
193 SetLoGain(kFALSE);
194 SetOscillations(kFALSE);
195
196 SetSaturationLimit();
197 SetLowerSignalLimit();
198 SetNumPixelsRequired();
199
200 fInnerRefTime = 5.;
201 fOuterRefTime = 5.;
202}
203// --------------------------------------------------------------------------
204//
205// Creates new MHCalibrationPulseTimeCam only with the averaged areas:
206// the rest has to be retrieved directly, e.g. via:
207// MHCalibrationPulseTimeCam *cam = MParList::FindObject("MHCalibrationPulseTimeCam");
208// - cam->GetAverageSector(5).DrawClone();
209// - (*cam)[100].DrawClone()
210//
211TObject *MHCalibrationPulseTimeCam::Clone(const char *) const
212{
213
214 MHCalibrationPulseTimeCam *cam = new MHCalibrationPulseTimeCam();
215
216 //
217 // Copy the data members
218 //
219 cam->fColor = fColor;
220 cam->fRunNumbers = fRunNumbers;
221 cam->fPulserFrequency = fPulserFrequency;
222 cam->fFlags = fFlags;
223 cam->fNbins = fNbins;
224 cam->fFirst = fFirst;
225 cam->fLast = fLast;
226 cam->fReferenceFile = fReferenceFile;
227 cam->fInnerRefTime = fInnerRefTime;
228 cam->fOuterRefTime = fOuterRefTime;
229
230 if (!IsAverageing())
231 return cam;
232
233 const Int_t navhi = fAverageHiGainAreas->GetSize();
234
235 for (int i=0; i<navhi; i++)
236 cam->fAverageHiGainAreas->AddAt(GetAverageHiGainArea(i).Clone(),i);
237
238 return cam;
239}
240
241// --------------------------------------------------------------------------
242//
243// Gets the pointers to:
244// - MRawEvtData
245//
246Bool_t MHCalibrationPulseTimeCam::SetupHists(const MParList *pList)
247{
248
249 fBadPixels = (MBadPixelsCam*)pList->FindObject("MBadPixelsCam");
250 if (!fBadPixels)
251 {
252 *fLog << warn << GetDescriptor() << "MBadPixelsCam not found... " << endl;
253 }
254
255 return kTRUE;
256}
257
258// --------------------------------------------------------------------------
259//
260// Gets or creates the pointers to:
261// - MExtractedSignalCam
262// - MCalibrationPulseTimeCam
263// - MBadPixelsCam
264//
265// Initializes the number of used FADC slices from MExtractedSignalCam
266// into MCalibrationPulseTimeCam and test for changes in that variable
267//
268// Calls:
269// - InitHiGainArrays()
270//
271// Sets:
272// - fSumhiarea to nareas
273// - fSumloarea to nareas
274// - fSumhisector to nsectors
275// - fSumlosector to nsectors
276//
277Bool_t MHCalibrationPulseTimeCam::ReInitHists(MParList *pList)
278{
279
280 MExtractedSignalCam *signal =
281 (MExtractedSignalCam*)pList->FindObject(AddSerialNumber("MExtractedSignalCam"));
282 if (!signal)
283 {
284 *fLog << err << "MExtractedSignalCam not found... abort." << endl;
285 return kFALSE;
286 }
287
288 if (!InitCams(pList,"PulseTime"))
289 return kFALSE;
290
291 const Int_t npixels = fGeom->GetNumPixels();
292 const Int_t nsectors = fGeom->GetNumSectors();
293 const Int_t nareas = fGeom->GetNumAreas();
294
295 InitHiGainArrays(npixels,nareas,nsectors);
296
297 return kTRUE;
298}
299
300void MHCalibrationPulseTimeCam::InitHiGainArrays(const Int_t npixels, const Int_t nareas, const Int_t nsectors)
301{
302
303 const Int_t samples = fRunHeader->GetNumSamples();
304 SetBinning(samples, -0.5, samples-0.5);
305
306 if (fHiGainArray->GetSize()==0)
307 {
308 for (Int_t i=0; i<npixels; i++)
309 {
310 fHiGainArray->AddAt(new MHCalibrationPix(Form("%sHiGainPix%04d",fHistName.Data(),i),
311 Form("%s High Gain Pixel %4d",fHistTitle.Data(),i)),i);
312
313 MHCalibrationPix &pix = (*this)[i];
314 pix.SetBinning(fNbins, fFirst, fLast);
315
316 InitHists(pix, (*fBadPixels)[i], i);
317
318 if (fCam)
319 (*fCam)[i].SetPixId(i);
320 }
321 }
322
323 if (!IsAverageing())
324 return;
325
326 if (fAverageHiGainAreas->GetSize()==0)
327 {
328 for (Int_t j=0; j<nareas; j++)
329 {
330 fAverageHiGainAreas->AddAt(new MHCalibrationPix(Form("%sHiGainArea%d",fHistName.Data(),j),
331 Form("%s High Gain Area Idx %d",fHistTitle.Data(),j)),j);
332
333 MHCalibrationPix &pix = GetAverageHiGainArea(j);
334 pix.SetBinning(fNbins, fFirst, fLast);
335
336 InitHists(pix, fCam->GetAverageBadArea(j), j);
337 }
338 }
339
340 if (fAverageHiGainSectors->GetSize()==0)
341 {
342 for (Int_t j=0; j<nsectors; j++)
343 {
344 fAverageHiGainSectors->AddAt(new MHCalibrationPix(Form("%sHiGainSector%02d",fHistName.Data(),j),
345 Form("%s High Gain Sector %02d",fHistTitle.Data(),j)),j);
346 MHCalibrationPix &pix = GetAverageHiGainSector(j);
347 pix.SetBinning(fNbins, fFirst, fLast);
348
349 InitHists(pix, fCam->GetAverageBadSector(j), j);
350 }
351 }
352}
353
354// --------------------------------------------------------------------------
355//
356// Retrieves from MExtractedSignalCam:
357// - first used LoGain FADC slice
358//
359// Retrieves from MGeomCam:
360// - number of pixels
361// - number of pixel areas
362// - number of sectors
363//
364// For all TOrdCollection's (including the averaged ones), the following steps are performed:
365//
366// 1) Fill PulseTimes histograms (MHGausEvents::FillHistAndArray()) with:
367// - MExtractedSignalPix::GetExtractedSignalHiGain();
368// - MExtractedSignalPix::GetExtractedSignalLoGain();
369//
370Bool_t MHCalibrationPulseTimeCam::FillHists(const MParContainer *par, const Stat_t w)
371{
372 MPedestalSubtractedEvt *evt = (MPedestalSubtractedEvt*)par;
373 if (!evt)
374 {
375 *fLog << err << "No argument in MHCalibrationPulseTimeCam::Fill... abort." << endl;
376 return kFALSE;
377 }
378
379 const UInt_t nareas = fGeom->GetNumAreas();
380 const UInt_t nsectors = fGeom->GetNumSectors();
381
382 MArrayD sumarea(nareas);
383 MArrayD sumsector(nsectors);
384
385 fAverageAreaNum.Reset();
386 fAverageSectorNum.Reset();
387
388 const Int_t npix = evt->GetNumPixels();
389 for (int idx=0; idx<npix; idx++)
390 {
391 if (fBadPixels)
392 if ((*fBadPixels)[idx].IsUnsuitable())
393 continue;
394
395 // Check for saturation
396 if (evt->GetSaturation(idx, fSaturationLimit*fRunHeader->GetScale())>0)
397 continue;
398
399 // Get position of maximum (FIXME: Extraction range?)
400 Float_t max;
401 const Int_t pos = evt->GetMaxPos(idx, max);
402
403 // check if maximum is high enough
404 if (max<fLowerSignalLimit)
405 continue;
406
407 const Int_t maxpos = pos-1;
408
409 (*this)[idx].FillHist(maxpos);
410
411 const Int_t aidx = (*fGeom)[idx].GetAidx();
412 const Int_t sector = (*fGeom)[idx].GetSector();
413
414 sumarea[aidx] += maxpos;
415 sumsector[sector] += maxpos;
416
417 fAverageAreaNum[aidx]++;
418 fAverageSectorNum[sector]++;
419 }
420
421 for (UInt_t j=0; j<nareas; j++)
422 {
423 if (fAverageAreaNum[j] > fNumPixelsRequired)
424 {
425 sumarea[j] /= fAverageAreaNum[j];
426
427 if (IsOscillations())
428 GetAverageHiGainArea(j).FillHistAndArray(sumarea[j]);
429 else
430 GetAverageHiGainArea(j).FillHist(sumarea[j]);
431
432 }
433 }
434
435 for (UInt_t j=0; j<nsectors; j++)
436 {
437 if (fAverageSectorNum[j] > 0)
438 {
439 sumsector[j] /= fAverageSectorNum[j];
440
441 if (IsOscillations())
442 GetAverageHiGainSector(j).FillHistAndArray(sumsector[j]);
443 else
444 GetAverageHiGainSector(j).FillHist(sumsector[j]);
445 }
446 }
447
448 return kTRUE;
449}
450
451// --------------------------------------------------------------------------
452//
453// For all TOrdCollection's (including the averaged ones), the following steps are performed:
454//
455// 1) Returns if the pixel is excluded.
456// 2) Tests saturation. In case yes, set the flag: MCalibrationPix::SetHiGainSaturation()
457// or the flag: MBadPixelsPix::SetUncalibrated( MBadPixelsPix::kLoGainSaturated )
458// 3) Store the absolute arrival times in the MCalibrationPulseTimePix's. If flag
459// MCalibrationPix::IsHiGainSaturation() is set, the Low-Gain arrival times are stored,
460// otherwise the Hi-Gain ones.
461// 4) Calls to MHCalibrationCam::FitHiGainArrays() and MCalibrationCam::FitLoGainArrays()
462// with the flags:
463// - MBadPixelsPix::SetUncalibrated( MBadPixelsPix::kHiGainNotFitted )
464// - MBadPixelsPix::SetUncalibrated( MBadPixelsPix::kLoGainNotFitted )
465// - MBadPixelsPix::SetUncalibrated( MBadPixelsPix::kHiGainOscillating )
466// - MBadPixelsPix::SetUncalibrated( MBadPixelsPix::kLoGainOscillating )
467//
468Bool_t MHCalibrationPulseTimeCam::FinalizeHists()
469{
470
471 *fLog << endl;
472
473 //
474 // Perform the fitting for the High Gain (done in MHCalibrationCam)
475 //
476 for (Int_t i=0; i<fHiGainArray->GetSize(); i++)
477 {
478
479 MHCalibrationPix &hist = (*this)[i];
480 if (hist.IsExcluded())
481 continue;
482
483 CalcHists(hist, (*fCam)[i]);
484 }
485
486 if (!IsAverageing())
487 return kTRUE;
488
489 for (Int_t j=0; j<fAverageHiGainAreas->GetSize(); j++)
490 CalcHists(GetAverageHiGainArea(j), fCam->GetAverageArea(j));
491
492 for (Int_t j=0; j<fAverageHiGainSectors->GetSize(); j++)
493 CalcHists(GetAverageHiGainSector(j), fCam->GetAverageSector(j));
494
495 return kTRUE;
496}
497
498void MHCalibrationPulseTimeCam::CalcHists(MHCalibrationPix &hist, MCalibrationPix &pix) const
499{
500
501 if (hist.IsEmpty())
502 {
503 *fLog << warn << hist.GetName() << ": Histogram empty." << endl;
504 return;
505 }
506 if (hist.IsOnlyOverflow())
507 {
508 *fLog << warn << hist.GetName() << ": Histogram contains only overflows." << endl;
509 return;
510 }
511 if (hist.IsOnlyUnderflow())
512 {
513 *fLog << warn << hist.GetName() << ": Histogram contains only underflows." << endl;
514 return;
515 }
516
517 hist.BypassFit();
518
519 pix.SetHiGainMean ( hist.GetMean() );
520 pix.SetHiGainMeanVar ( hist.GetMeanErr() * hist.GetMeanErr() );
521 pix.SetHiGainRms ( hist.GetHistRms() );
522 pix.SetHiGainSigma ( hist.GetSigma() );
523 pix.SetHiGainSigmaVar ( hist.GetSigmaErr()* hist.GetSigmaErr() );
524
525 if (IsDebug())
526 {
527 *fLog << dbginf << GetDescriptor() << ": ID " << GetName()
528 << " "<<pix.GetPixId()
529 << " Mean: " << hist.GetMean ()
530 << " MeanErr: " << hist.GetMeanErr ()
531 << " MeanSigma: " << hist.GetSigma ()
532 << " MeanSigmaErr: " << hist.GetSigmaErr()
533 << " Prob: " << hist.GetProb ()
534 << endl;
535 }
536}
537
538
539// --------------------------------------------------------------------------
540//
541// Calls MHCalibrationPix::DrawClone() for pixel idx
542//
543void MHCalibrationPulseTimeCam::DrawPixelContent(Int_t idx) const
544{
545 (*this)[idx].DrawClone();
546}
547
548
549// -----------------------------------------------------------------------------
550//
551// Default draw:
552//
553// Displays the averaged areas, both High Gain and Low Gain
554//
555// Calls the Draw of the fAverageHiGainAreas and fAverageLoGainAreas objects with options
556//
557void MHCalibrationPulseTimeCam::Draw(const Option_t *opt)
558{
559
560 const Int_t nareas = fAverageHiGainAreas->GetSize();
561 if (nareas == 0)
562 return;
563
564 TString option(opt);
565 option.ToLower();
566
567 TVirtualPad *pad = gPad ? gPad : MH::MakeDefCanvas(this);
568 pad->SetBorderMode(0);
569 pad->Divide(1,nareas, 1e-10, 1e-10);
570
571 //
572 // Loop over inner and outer pixels
573 //
574 for (Int_t i=0; i<nareas;i++)
575 {
576 pad->cd(i+1);
577
578 MHCalibrationPix &hipix = GetAverageHiGainArea(i);
579 DrawDataCheckPixel(hipix,i ? fOuterRefTime : fInnerRefTime);
580 }
581}
582
583// -----------------------------------------------------------------------------
584//
585// Draw the average pixel for the datacheck:
586//
587// Displays the averaged areas, both High Gain and Low Gain
588//
589// Calls the Draw of the fAverageHiGainAreas and fAverageLoGainAreas objects with options
590//
591void MHCalibrationPulseTimeCam::DrawDataCheckPixel(MHCalibrationPix &pix, const Float_t refline)
592{
593 gPad->SetBorderMode(0);
594 gPad->SetTicks();
595
596 TH1F *hist = pix.GetHGausHist();
597
598 //
599 // set the labels bigger
600 //
601 TAxis *xaxe = hist->GetXaxis();
602 TAxis *yaxe = hist->GetYaxis();
603 xaxe->CenterTitle();
604 yaxe->CenterTitle();
605 xaxe->SetTitleSize(0.06);
606 yaxe->SetTitleSize(0.076);
607 xaxe->SetTitleOffset(0.6);
608 yaxe->SetTitleOffset(0.65);
609 xaxe->SetLabelSize(0.06);
610 yaxe->SetLabelSize(0.06);
611 xaxe->SetTitle(hist->GetXaxis()->GetTitle());
612 yaxe->SetTitle(hist->GetYaxis()->GetTitle());
613 xaxe->SetRange(hist->GetMaximumBin()-30, hist->GetMaximumBin()+30);
614
615 hist->Draw();
616
617 DisplayRefLines(hist, refline);
618}
619
620void MHCalibrationPulseTimeCam::DisplayRefLines(const TH1F *hist, const Float_t refline) const
621{
622 TLine *line = new TLine(refline, 0, refline, hist->GetMaximum());
623 line->SetLineColor(106);
624 line->SetLineStyle(2);
625 line->SetLineWidth(3);
626 line->SetBit(kCanDelete);
627 line->Draw();
628
629 TLegend *leg = new TLegend(0.8,0.35,0.99,0.65);
630 leg->AddEntry(line, "Reference", "l");
631 leg->SetBit(kCanDelete);
632 leg->Draw();
633}
634
635Int_t MHCalibrationPulseTimeCam::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
636{
637
638 Int_t rc = MHCalibrationCam::ReadEnv(env,prefix,print);
639 if (rc==kERROR)
640 return kERROR;
641
642 if (IsEnvDefined(env, prefix, "SaturationLimit", print))
643 {
644 SetSaturationLimit(GetEnvValue(env, prefix, "SaturationLimit", (Int_t)fSaturationLimit));
645 rc = kTRUE;
646 }
647
648 if (IsEnvDefined(env, prefix, "LowerSignalLimit", print))
649 {
650 SetLowerSignalLimit(GetEnvValue(env, prefix, "LowerSignalLimit", (Int_t)fLowerSignalLimit));
651 rc = kTRUE;
652 }
653
654 if (IsEnvDefined(env, prefix, "NumPixelsRequired", print))
655 {
656 SetNumPixelsRequired(GetEnvValue(env,prefix,"NumPixelsRequired",fNumPixelsRequired));
657 rc = kTRUE;
658 }
659
660 if (IsEnvDefined(env, prefix, "ReferenceFile", print))
661 {
662 SetReferenceFile(GetEnvValue(env,prefix,"ReferenceFile",fReferenceFile.Data()));
663 rc = kTRUE;
664 }
665
666 TEnv refenv(fReferenceFile);
667
668 fInnerRefTime = refenv.GetValue("InnerRefTime",fInnerRefTime);
669 fOuterRefTime = refenv.GetValue("OuterRefTime",fOuterRefTime);
670
671 return rc;
672}
Note: See TracBrowser for help on using the repository browser.