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 | : fRelTimeFlags(0)
|
---|
42 | {
|
---|
43 |
|
---|
44 | fName = name ? name : "MCalibrationRelTimePix";
|
---|
45 | fTitle = title ? title : "Container of the fit results of MHCalibrationRelTimePixs ";
|
---|
46 |
|
---|
47 | Clear();
|
---|
48 |
|
---|
49 | }
|
---|
50 |
|
---|
51 | // ------------------------------------------------------------------------
|
---|
52 | //
|
---|
53 | // Invalidate values
|
---|
54 | //
|
---|
55 | void MCalibrationRelTimePix::Clear(Option_t *o)
|
---|
56 | {
|
---|
57 |
|
---|
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::SetValid(const Bool_t b )
|
---|
85 | {
|
---|
86 | b ? SETBIT(fRelTimeFlags, kValid) : CLRBIT(fRelTimeFlags, kValid);
|
---|
87 | }
|
---|
88 |
|
---|
89 |
|
---|
90 | Float_t MCalibrationRelTimePix::GetConversionErr() const
|
---|
91 | {
|
---|
92 | if (fConversionVar < 0.)
|
---|
93 | return -1.;
|
---|
94 | return TMath::Sqrt(fConversionVar);
|
---|
95 | }
|
---|
96 |
|
---|
97 |
|
---|
98 | Bool_t MCalibrationRelTimePix::IsValid() const
|
---|
99 | {
|
---|
100 | return TESTBIT(fRelTimeFlags, kValid);
|
---|
101 | }
|
---|