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 | // MCalibrationRelTimePix //
|
---|
26 | // //
|
---|
27 | // Storage container to hold informations about the calibrated arrival time//
|
---|
28 | // value of one Pixel (PMT). //
|
---|
29 | // //
|
---|
30 | /////////////////////////////////////////////////////////////////////////////
|
---|
31 | #include "MCalibrationRelTimePix.h"
|
---|
32 |
|
---|
33 | ClassImp(MCalibrationRelTimePix);
|
---|
34 |
|
---|
35 | using namespace std;
|
---|
36 | // --------------------------------------------------------------------------
|
---|
37 | //
|
---|
38 | // Default Constructor:
|
---|
39 | //
|
---|
40 | MCalibrationRelTimePix::MCalibrationRelTimePix(const char *name, const char *title)
|
---|
41 | {
|
---|
42 |
|
---|
43 | fName = name ? name : "MCalibrationRelTimePix";
|
---|
44 | fTitle = title ? title : "Container of the fit results of MHCalibrationRelTimePixs ";
|
---|
45 |
|
---|
46 | Clear();
|
---|
47 |
|
---|
48 | }
|
---|
49 |
|
---|
50 | // ------------------------------------------------------------------------
|
---|
51 | //
|
---|
52 | // Invalidate values
|
---|
53 | //
|
---|
54 | void MCalibrationRelTimePix::Clear(Option_t *o)
|
---|
55 | {
|
---|
56 |
|
---|
57 | SetExcluded ( kFALSE );
|
---|
58 | SetValid ( kFALSE );
|
---|
59 |
|
---|
60 | fMeanConversion = -1.;
|
---|
61 | fConversionVar = -1.;
|
---|
62 | fSigmaConversion = -1.;
|
---|
63 |
|
---|
64 | MCalibrationPix::Clear();
|
---|
65 | }
|
---|
66 |
|
---|
67 |
|
---|
68 | // --------------------------------------------------------------------------
|
---|
69 | //
|
---|
70 | // Set the conversion factors from outside (only for MC)
|
---|
71 | //
|
---|
72 | void MCalibrationRelTimePix::SetConversion(Float_t c, Float_t err, Float_t sig)
|
---|
73 | {
|
---|
74 | fMeanConversion = c;
|
---|
75 | fConversionVar = err*err;
|
---|
76 | fSigmaConversion = sig;
|
---|
77 | }
|
---|
78 |
|
---|
79 |
|
---|
80 | // --------------------------------------------------------------------------
|
---|
81 | //
|
---|
82 | // Set the Excluded Bit from outside
|
---|
83 | //
|
---|
84 | void MCalibrationRelTimePix::SetExcluded(Bool_t b )
|
---|
85 | {
|
---|
86 | b ? SETBIT(fFlags, kExcluded) : CLRBIT(fFlags, kExcluded);
|
---|
87 | }
|
---|
88 |
|
---|
89 |
|
---|
90 | // --------------------------------------------------------------------------
|
---|
91 | //
|
---|
92 | // Set the Excluded Bit from outside
|
---|
93 | //
|
---|
94 | void MCalibrationRelTimePix::SetValid(const Bool_t b )
|
---|
95 | {
|
---|
96 | b ? SETBIT(fFlags, kValid) : CLRBIT(fFlags, kValid);
|
---|
97 | }
|
---|
98 |
|
---|
99 |
|
---|
100 | Float_t MCalibrationRelTimePix::GetConversionErr() const
|
---|
101 | {
|
---|
102 | if (fConversionVar < 0.)
|
---|
103 | return -1.;
|
---|
104 | return TMath::Sqrt(fConversionVar);
|
---|
105 | }
|
---|
106 |
|
---|
107 |
|
---|
108 | Bool_t MCalibrationRelTimePix::IsExcluded() const
|
---|
109 | {
|
---|
110 | return TESTBIT(fFlags,kExcluded);
|
---|
111 | }
|
---|
112 |
|
---|
113 | Bool_t MCalibrationRelTimePix::IsValid() const
|
---|
114 | {
|
---|
115 | return TESTBIT(fFlags, kValid);
|
---|
116 | }
|
---|