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

Last change on this file since 3063 was 3061, checked in by gaug, 21 years ago
*** empty log message ***
File size: 4.0 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::IsFitOK() const
89{
90 return fHist->IsFitOK();
91}
92
93Bool_t MCalibrationBlindPix::FillCharge(const Float_t q)
94{
95 return fHist->FillBlindPixelCharge(q);
96}
97
98Bool_t MCalibrationBlindPix::FillTime(const Float_t t)
99{
100 return fHist->FillBlindPixelTime(t);
101}
102
103Bool_t MCalibrationBlindPix::FitCharge()
104{
105
106 if (!fHist->FitSinglePhe())
107 return kFALSE;
108
109 fLambda = TMath::IsNaN(fHist->GetLambda()) ? -1. : fHist->GetLambda();
110 fMu0 = TMath::IsNaN(fHist->GetMu0()) ? -1. : fHist->GetMu0();
111 fMu1 = TMath::IsNaN(fHist->GetMu1()) ? -1. : fHist->GetMu1();
112 fSigma0 = TMath::IsNaN(fHist->GetSigma0()) ? -1. : fHist->GetSigma0();
113 fSigma1 = TMath::IsNaN(fHist->GetSigma1()) ? -1. : fHist->GetSigma1();
114
115 fErrLambda = TMath::IsNaN(fHist->GetLambdaErr()) ? -1. : fHist->GetLambdaErr();
116 fErrMu0 = TMath::IsNaN(fHist->GetMu0Err()) ? -1. : fHist->GetMu0Err();
117 fErrMu1 = TMath::IsNaN(fHist->GetMu1Err()) ? -1. : fHist->GetMu1Err();
118 fErrSigma0 = TMath::IsNaN(fHist->GetSigma0Err()) ? -1. : fHist->GetSigma0Err();
119 fErrSigma1 = TMath::IsNaN(fHist->GetSigma1Err()) ? -1. : fHist->GetSigma1Err();
120
121 return kTRUE;
122}
123
124
125
126Bool_t MCalibrationBlindPix::FitTime()
127{
128
129 if(!fHist->FitTime())
130 return kFALSE;
131
132 fTime = fHist->GetMeanTime();
133 fErrTime = fHist->GetMeanTimeErr();
134
135 return kTRUE;
136
137}
138
139void MCalibrationBlindPix::CheckOscillations()
140{
141 fHist->CheckOscillations();
142}
Note: See TracBrowser for help on using the repository browser.