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 |
|
---|
39 | ClassImp(MCalibrationBlindPix);
|
---|
40 |
|
---|
41 | using namespace std;
|
---|
42 | // --------------------------------------------------------------------------
|
---|
43 | //
|
---|
44 | // Default Constructor.
|
---|
45 | //
|
---|
46 | MCalibrationBlindPix::MCalibrationBlindPix(const char *name, const char *title)
|
---|
47 | : fHist(NULL)
|
---|
48 | {
|
---|
49 |
|
---|
50 | fName = name ? name : "MCalibrationBlindPix";
|
---|
51 | fTitle = title ? title : "Container of the MHCalibrationBlindPixel and the fit results";
|
---|
52 |
|
---|
53 | fHist = new MHCalibrationBlindPixel();
|
---|
54 |
|
---|
55 | if (!fHist)
|
---|
56 | *fLog << err << dbginf << "Could not create MHCalibrationBlindPixel " << endl;
|
---|
57 |
|
---|
58 | fLambda = fMu0 = fMu1 = fSigma0 = fSigma1 = 0;
|
---|
59 | fErrLambda = fErrMu0 = fErrMu1 = fErrSigma0 = fErrSigma1 = 0;
|
---|
60 |
|
---|
61 | fTime = fErrTime = 0;
|
---|
62 | }
|
---|
63 |
|
---|
64 | MCalibrationBlindPix::~MCalibrationBlindPix()
|
---|
65 | {
|
---|
66 | delete fHist;
|
---|
67 | }
|
---|
68 |
|
---|
69 | // ------------------------------------------------------------------------
|
---|
70 | //
|
---|
71 | // Invalidate values
|
---|
72 | //
|
---|
73 | void MCalibrationBlindPix::Clear(Option_t *o)
|
---|
74 | {
|
---|
75 | fHist->Reset();
|
---|
76 | }
|
---|
77 |
|
---|
78 | Bool_t MCalibrationBlindPix::FitCharge()
|
---|
79 | {
|
---|
80 | if (!fHist->FitSinglePhe())
|
---|
81 | return kFALSE;
|
---|
82 |
|
---|
83 | fLambda = fHist->GetLambda();
|
---|
84 | fMu0 = fHist->GetMu0();
|
---|
85 | fMu1 = fHist->GetMu1();
|
---|
86 | fSigma0 = fHist->GetSigma0();
|
---|
87 | fSigma1 = fHist->GetSigma1();
|
---|
88 |
|
---|
89 | fErrLambda = fHist->GetLambdaErr();
|
---|
90 | fErrMu0 = fHist->GetMu0Err();
|
---|
91 | fErrMu1 = fHist->GetMu1Err();
|
---|
92 | fErrSigma0 = fHist->GetSigma0Err();
|
---|
93 | fErrSigma1 = fHist->GetSigma1Err();
|
---|
94 |
|
---|
95 | return kTRUE;
|
---|
96 | }
|
---|
97 |
|
---|
98 |
|
---|
99 |
|
---|
100 | Bool_t MCalibrationBlindPix::FitTime()
|
---|
101 | {
|
---|
102 |
|
---|
103 | if(!fHist->FitTime())
|
---|
104 | return kFALSE;
|
---|
105 |
|
---|
106 | fTime = fHist->GetMeanTime();
|
---|
107 | fErrTime = fHist->GetMeanTimeErr();
|
---|
108 |
|
---|
109 | return kTRUE;
|
---|
110 |
|
---|
111 | }
|
---|