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 02/2004 <mailto:markus@ifae.es>
|
---|
19 | !
|
---|
20 | ! Copyright: MAGIC Software Development, 2000-2004
|
---|
21 | !
|
---|
22 | \* ======================================================================== */
|
---|
23 | /////////////////////////////////////////////////////////////////////////////
|
---|
24 | // //
|
---|
25 | // MCalibrationPix //
|
---|
26 | // //
|
---|
27 | // Base Storage container to for a calibration pixel //
|
---|
28 | // //
|
---|
29 | /////////////////////////////////////////////////////////////////////////////
|
---|
30 | #include "MCalibrationPix.h"
|
---|
31 |
|
---|
32 | ClassImp(MCalibrationPix);
|
---|
33 |
|
---|
34 | using namespace std;
|
---|
35 |
|
---|
36 | // --------------------------------------------------------------------------
|
---|
37 | //
|
---|
38 | // Default Constructor:
|
---|
39 | //
|
---|
40 | MCalibrationPix::MCalibrationPix(const char *name, const char *title)
|
---|
41 | : fPixId(-1),
|
---|
42 | fFlags(0)
|
---|
43 | {
|
---|
44 |
|
---|
45 | fName = name ? name : "MCalibrationPix";
|
---|
46 | fTitle = title ? title : "Container of the fit results of MHCalibrationPixs ";
|
---|
47 |
|
---|
48 | Clear();
|
---|
49 |
|
---|
50 | }
|
---|
51 |
|
---|
52 | // ------------------------------------------------------------------------
|
---|
53 | //
|
---|
54 | // Invalidate values
|
---|
55 | //
|
---|
56 | void MCalibrationPix::Clear(Option_t *o)
|
---|
57 | {
|
---|
58 |
|
---|
59 | fHiGainNumPickup = -1 ;
|
---|
60 | fHiGainMean = -1.;
|
---|
61 | fHiGainMeanVar = -1.;
|
---|
62 | fHiGainProb = -1.;
|
---|
63 | fHiGainSigma = -1.;
|
---|
64 | fHiGainSigmaVar = -1.;
|
---|
65 |
|
---|
66 | fLoGainNumPickup = -1 ;
|
---|
67 | fLoGainMean = -1.;
|
---|
68 | fLoGainMeanVar = -1.;
|
---|
69 | fLoGainProb = -1.;
|
---|
70 | fLoGainSigma = -1.;
|
---|
71 | fLoGainSigmaVar = -1.;
|
---|
72 |
|
---|
73 | SetHiGainSaturation ( kFALSE );
|
---|
74 | SetExcluded ( kFALSE );
|
---|
75 |
|
---|
76 | }
|
---|
77 |
|
---|
78 | // --------------------------------------------------------------------------
|
---|
79 | //
|
---|
80 | // Set the Hi Gain Saturation Bit from outside
|
---|
81 | //
|
---|
82 | void MCalibrationPix::SetHiGainSaturation(Bool_t b)
|
---|
83 | {
|
---|
84 | b ? SETBIT(fFlags, kHiGainSaturation) : CLRBIT(fFlags, kHiGainSaturation);
|
---|
85 | }
|
---|
86 |
|
---|
87 |
|
---|
88 | // --------------------------------------------------------------------------
|
---|
89 | //
|
---|
90 | // Set the Excluded Bit from outside
|
---|
91 | //
|
---|
92 | void MCalibrationPix::SetExcluded(Bool_t b )
|
---|
93 | {
|
---|
94 | b ? SETBIT(fFlags, kExcluded) : CLRBIT(fFlags, kExcluded);
|
---|
95 | }
|
---|
96 |
|
---|
97 |
|
---|
98 | Float_t MCalibrationPix::GetHiGainMeanErr() const
|
---|
99 | {
|
---|
100 | return TMath::Sqrt(fHiGainMeanVar);
|
---|
101 | }
|
---|
102 |
|
---|
103 |
|
---|
104 | Float_t MCalibrationPix::GetHiGainSigmaErr() const
|
---|
105 | {
|
---|
106 | return TMath::Sqrt(fHiGainSigmaVar);
|
---|
107 | }
|
---|
108 |
|
---|
109 | Float_t MCalibrationPix::GetLoGainMeanErr() const
|
---|
110 | {
|
---|
111 | return TMath::Sqrt(fLoGainMeanVar);
|
---|
112 | }
|
---|
113 |
|
---|
114 |
|
---|
115 | Float_t MCalibrationPix::GetLoGainSigmaErr() const
|
---|
116 | {
|
---|
117 | return TMath::Sqrt(fLoGainSigmaVar);
|
---|
118 | }
|
---|
119 |
|
---|
120 |
|
---|
121 | Bool_t MCalibrationPix::IsExcluded() const
|
---|
122 | {
|
---|
123 | return TESTBIT(fFlags,kExcluded);
|
---|
124 | }
|
---|
125 |
|
---|
126 | Bool_t MCalibrationPix::IsHiGainSaturation() const
|
---|
127 | {
|
---|
128 | return TESTBIT(fFlags,kHiGainSaturation);
|
---|
129 | }
|
---|
130 |
|
---|