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

Last change on this file since 3058 was 3030, checked in by gaug, 21 years ago
*** empty log message ***
File size: 4.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): 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::FillRChargevsTime(const Float_t rq, const Int_t t)
104{
105 return fHist->FillBlindPixelChargevsN(rq,t);
106}
107
108Bool_t MCalibrationBlindPix::FitCharge()
109{
110
111 if (!fHist->FitSinglePhe())
112 return kFALSE;
113
114 fLambda = TMath::IsNaN(fHist->GetLambda()) ? -1. : fHist->GetLambda();
115 fMu0 = TMath::IsNaN(fHist->GetMu0()) ? -1. : fHist->GetMu0();
116 fMu1 = TMath::IsNaN(fHist->GetMu1()) ? -1. : fHist->GetMu1();
117 fSigma0 = TMath::IsNaN(fHist->GetSigma0()) ? -1. : fHist->GetSigma0();
118 fSigma1 = TMath::IsNaN(fHist->GetSigma1()) ? -1. : fHist->GetSigma1();
119
120 fErrLambda = TMath::IsNaN(fHist->GetLambdaErr()) ? -1. : fHist->GetLambdaErr();
121 fErrMu0 = TMath::IsNaN(fHist->GetMu0Err()) ? -1. : fHist->GetMu0Err();
122 fErrMu1 = TMath::IsNaN(fHist->GetMu1Err()) ? -1. : fHist->GetMu1Err();
123 fErrSigma0 = TMath::IsNaN(fHist->GetSigma0Err()) ? -1. : fHist->GetSigma0Err();
124 fErrSigma1 = TMath::IsNaN(fHist->GetSigma1Err()) ? -1. : fHist->GetSigma1Err();
125
126 return kTRUE;
127}
128
129
130
131Bool_t MCalibrationBlindPix::FitTime()
132{
133
134 if(!fHist->FitTime())
135 return kFALSE;
136
137 fTime = fHist->GetMeanTime();
138 fErrTime = fHist->GetMeanTimeErr();
139
140 return kTRUE;
141
142}
Note: See TracBrowser for help on using the repository browser.