source: trunk/MagicSoft/Mars/manalysis/MCalibrationBlindPix.cc@ 2699

Last change on this file since 2699 was 2699, checked in by gaug, 21 years ago
*** empty log message ***
File size: 3.4 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 : fHist(NULL),
48 fLambda(-1.),
49 fMu0 (-1.),
50 fMu1 (-1.),
51 fSigma0(-1.),
52 fSigma1(-1.),
53 fErrLambda(-1.),
54 fErrMu0 (-1.),
55 fErrMu1 (-1.),
56 fErrSigma0(-1.),
57 fErrSigma1(-1.),
58 fTime (-1.),
59 fErrTime (-1.)
60{
61
62 fName = name ? name : "MCalibrationBlindPix";
63 fTitle = title ? title : "Container of the MHCalibrationBlindPixel and the fit results";
64
65 fHist = new MHCalibrationBlindPixel();
66
67 if (!fHist)
68 *fLog << err << dbginf << "Could not create MHCalibrationBlindPixel " << endl;
69
70 fLambda = fMu0 = fMu1 = fSigma0 = fSigma1 = 0;
71 fErrLambda = fErrMu0 = fErrMu1 = fErrSigma0 = fErrSigma1 = 0;
72
73 fTime = fErrTime = 0;
74}
75
76MCalibrationBlindPix::~MCalibrationBlindPix()
77{
78 delete fHist;
79}
80
81// ------------------------------------------------------------------------
82//
83// Invalidate values
84//
85void MCalibrationBlindPix::Clear(Option_t *o)
86{
87 fHist->Reset();
88}
89
90Bool_t MCalibrationBlindPix::FitCharge()
91{
92
93 if (!fHist->FitSinglePhe())
94 return kFALSE;
95
96 fLambda = fHist->GetLambda();
97 fMu0 = fHist->GetMu0();
98 fMu1 = fHist->GetMu1();
99 fSigma0 = fHist->GetSigma0();
100 fSigma1 = fHist->GetSigma1();
101
102 fErrLambda = fHist->GetLambdaErr();
103 fErrMu0 = fHist->GetMu0Err();
104 fErrMu1 = fHist->GetMu1Err();
105 fErrSigma0 = fHist->GetSigma0Err();
106 fErrSigma1 = fHist->GetSigma1Err();
107
108 return kTRUE;
109}
110
111
112
113Bool_t MCalibrationBlindPix::FitTime()
114{
115
116 if(!fHist->FitTime())
117 return kFALSE;
118
119 fTime = fHist->GetMeanTime();
120 fErrTime = fHist->GetMeanTimeErr();
121
122 return kTRUE;
123
124}
Note: See TracBrowser for help on using the repository browser.