source: trunk/MagicSoft/Mars/mcalib/MCalibrationBlindPix.cc@ 2996

Last change on this file since 2996 was 2996, checked in by gaug, 21 years ago
*** empty log message ***
File size: 3.7 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): Markus Gaug 11/2003 <mailto:markus@ifae.es>
19!
20! Copyright: MAGIC Software Development, 2000-2001
21!
22!
23\* ======================================================================== */
24
25/////////////////////////////////////////////////////////////////////////////
26// //
27// MCalibrationBlindPix //
28// //
29// This is the storage container to hold informations about the calibration//
30// blind pixel //
31// //
32/////////////////////////////////////////////////////////////////////////////
33#include "MCalibrationBlindPix.h"
34#include "MHCalibrationBlindPixel.h"
35
36#include "MLog.h"
37#include "MLogManip.h"
38
39ClassImp(MCalibrationBlindPix);
40
41using namespace std;
42// --------------------------------------------------------------------------
43//
44// Default Constructor.
45//
46MCalibrationBlindPix::MCalibrationBlindPix(const char *name, const char *title)
47{
48
49 fName = name ? name : "MCalibrationBlindPix";
50 fTitle = title ? title : "Container of the MHCalibrationBlindPixel and the fit results";
51
52 fHist = new MHCalibrationBlindPixel();
53
54 if (!fHist)
55 *fLog << warn << dbginf << " Could not create MHCalibrationBlindPixel " << endl;
56
57 Clear();
58}
59
60MCalibrationBlindPix::~MCalibrationBlindPix()
61{
62 delete fHist;
63}
64
65// ------------------------------------------------------------------------
66//
67// Invalidate values
68//
69void MCalibrationBlindPix::Clear(Option_t *o)
70{
71 fHist->Reset();
72
73 fLambda = -1.;
74 fMu0 = -1.;
75 fMu1 = -1.;
76 fSigma0 = -1.;
77 fSigma1 = -1.;
78 fErrLambda = -1.;
79 fErrMu0 = -1.;
80 fErrMu1 = -1.;
81 fErrSigma0 = -1.;
82 fErrSigma1 = -1.;
83 fTime = -1.;
84 fErrTime = -1;
85
86}
87
88Bool_t MCalibrationBlindPix::FitCharge()
89{
90
91 if (!fHist->FitSinglePhe())
92 return kFALSE;
93
94 fLambda = TMath::IsNaN(fHist->GetLambda()) ? -1. : fHist->GetLambda();
95 fMu0 = TMath::IsNaN(fHist->GetMu0()) ? -1. : fHist->GetMu0();
96 fMu1 = TMath::IsNaN(fHist->GetMu1()) ? -1. : fHist->GetMu1();
97 fSigma0 = TMath::IsNaN(fHist->GetSigma0()) ? -1. : fHist->GetSigma0();
98 fSigma1 = TMath::IsNaN(fHist->GetSigma1()) ? -1. : fHist->GetSigma1();
99
100 fErrLambda = TMath::IsNaN(fHist->GetLambdaErr()) ? -1. : fHist->GetLambdaErr();
101 fErrMu0 = TMath::IsNaN(fHist->GetMu0Err()) ? -1. : fHist->GetMu0Err();
102 fErrMu1 = TMath::IsNaN(fHist->GetMu1Err()) ? -1. : fHist->GetMu1Err();
103 fErrSigma0 = TMath::IsNaN(fHist->GetSigma0Err()) ? -1. : fHist->GetSigma0Err();
104 fErrSigma1 = TMath::IsNaN(fHist->GetSigma1Err()) ? -1. : fHist->GetSigma1Err();
105
106 return kTRUE;
107}
108
109
110
111Bool_t MCalibrationBlindPix::FitTime()
112{
113
114 if(!fHist->FitTime())
115 return kFALSE;
116
117 fTime = fHist->GetMeanTime();
118 fErrTime = fHist->GetMeanTimeErr();
119
120 return kTRUE;
121
122}
Note: See TracBrowser for help on using the repository browser.