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 | // MCalibrationPINDiode //
|
---|
28 | // //
|
---|
29 | // This is the storage container to hold informations about the pedestal //
|
---|
30 | // (offset) value of one Pixel (PMT). //
|
---|
31 | // //
|
---|
32 | /////////////////////////////////////////////////////////////////////////////
|
---|
33 | #include "MCalibrationPINDiode.h"
|
---|
34 |
|
---|
35 | #include "MLog.h"
|
---|
36 |
|
---|
37 | ClassImp(MCalibrationPINDiode);
|
---|
38 |
|
---|
39 | using namespace std;
|
---|
40 | // --------------------------------------------------------------------------
|
---|
41 | //
|
---|
42 | // Default Constructor.
|
---|
43 | //
|
---|
44 | MCalibrationPINDiode::MCalibrationPINDiode(const char *name, const char *title)
|
---|
45 | : fHist(NULL),
|
---|
46 | fCharge(-1.),
|
---|
47 | fErrCharge(-1.),
|
---|
48 | fPed(-1.),
|
---|
49 | fPedRms(-1.),
|
---|
50 | fSigmaCharge(-1.),
|
---|
51 | fErrSigmaCharge(-1.),
|
---|
52 | fTime(-1.),
|
---|
53 | fErrTime(-1.)
|
---|
54 | {
|
---|
55 |
|
---|
56 | fName = name ? name : "MCalibrationPINDiode";
|
---|
57 | fTitle = title ? title : "Container of the MHCalibrationPINDiode and the fit results";
|
---|
58 |
|
---|
59 | fHist = new MHCalibrationPINDiode();
|
---|
60 |
|
---|
61 | if (!fHist)
|
---|
62 | *fLog << warn << dbginf << " Could not create MHCalibrationPINDiode " << endl;
|
---|
63 |
|
---|
64 | }
|
---|
65 |
|
---|
66 | MCalibrationPINDiode::~MCalibrationPINDiode()
|
---|
67 | {
|
---|
68 | delete fHist;
|
---|
69 | }
|
---|
70 |
|
---|
71 | // ------------------------------------------------------------------------
|
---|
72 | //
|
---|
73 | // Invalidate values
|
---|
74 | //
|
---|
75 | void MCalibrationPINDiode::Clear(Option_t *o)
|
---|
76 | {
|
---|
77 | fHist->Reset();
|
---|
78 | }
|
---|
79 |
|
---|
80 | Bool_t MCalibrationPINDiode::FitCharge()
|
---|
81 | {
|
---|
82 | if(!fHist->FitChargeHiGain())
|
---|
83 | return kFALSE;
|
---|
84 |
|
---|
85 | fCharge = fHist->GetChargeMean();
|
---|
86 | fErrCharge = fHist->GetChargeMeanErr();
|
---|
87 | fSigmaCharge = fHist->GetChargeSigma();
|
---|
88 | fErrSigmaCharge = fHist->GetChargeSigmaErr();
|
---|
89 |
|
---|
90 | return kTRUE;
|
---|
91 |
|
---|
92 | }
|
---|
93 |
|
---|
94 | Bool_t MCalibrationPINDiode::FitTime()
|
---|
95 | {
|
---|
96 |
|
---|
97 | if(!fHist->FitTimeHiGain())
|
---|
98 | return kFALSE;
|
---|
99 |
|
---|
100 | fTime = fHist->GetTime();
|
---|
101 | fErrTime = fHist->GetErrTime();
|
---|
102 |
|
---|
103 | return kTRUE;
|
---|
104 |
|
---|
105 | }
|
---|