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 | /////////////////////////////////////////////////////////////////////////////
|
---|
26 | //
|
---|
27 | // MExtractedSignalBlindPixel
|
---|
28 | //
|
---|
29 | // This is the storage container to hold informations about the extracted signal
|
---|
30 | // (offset) value of the calibration Blind Pixel.
|
---|
31 | //
|
---|
32 | // There is place for various blind pixels set into the camera in July. Default
|
---|
33 | // is one blind pixel.
|
---|
34 | //
|
---|
35 | /////////////////////////////////////////////////////////////////////////////
|
---|
36 | #include "MExtractedSignalBlindPixel.h"
|
---|
37 |
|
---|
38 | #include "MLog.h"
|
---|
39 | #include "MLogManip.h"
|
---|
40 |
|
---|
41 | ClassImp(MExtractedSignalBlindPixel);
|
---|
42 |
|
---|
43 | using namespace std;
|
---|
44 |
|
---|
45 | static const Int_t gkSignalInitializer = 99999;
|
---|
46 |
|
---|
47 | // ------------------------------------------------------------------------
|
---|
48 | //
|
---|
49 | // MExtractedSignalBlindPixel holds the extracted signal
|
---|
50 | // of the FADC slices and its error.
|
---|
51 | //
|
---|
52 | // Additionally, the number of saturated Slices are stored.
|
---|
53 | //
|
---|
54 | // Default values for the extracted signals are: 99999.9
|
---|
55 | //
|
---|
56 | MExtractedSignalBlindPixel::MExtractedSignalBlindPixel(const char* name, const char* title)
|
---|
57 | {
|
---|
58 |
|
---|
59 | fName = name ? name : "MExtractedSignalBlindPixel";
|
---|
60 | fTitle = title ? title : "Container of the Extracted Signals";
|
---|
61 |
|
---|
62 | fBlindPixelIdx.Set(1);
|
---|
63 | fExtractedSignal.Set(1);
|
---|
64 | fNumSaturated.Set(1);
|
---|
65 |
|
---|
66 | fPed.Set(1);
|
---|
67 | fPedErr.Set(1);
|
---|
68 | fPedRms.Set(1);
|
---|
69 | fPedRmsErr.Set(1);
|
---|
70 |
|
---|
71 | Clear();
|
---|
72 | }
|
---|
73 |
|
---|
74 | // ------------------------------------------------------------------------
|
---|
75 | //
|
---|
76 | // Invalidate values
|
---|
77 | //
|
---|
78 | void MExtractedSignalBlindPixel::Clear(Option_t *o)
|
---|
79 | {
|
---|
80 |
|
---|
81 | for (Int_t i=0;i<fBlindPixelIdx.GetSize();i++)
|
---|
82 | {
|
---|
83 | fNumSaturated .AddAt(gkSignalInitializer,i);
|
---|
84 | fExtractedSignal.AddAt(gkSignalInitializer,i);
|
---|
85 | fPed .AddAt(gkSignalInitializer,i);
|
---|
86 | fPedErr .AddAt(gkSignalInitializer,i);
|
---|
87 | fPedRms .AddAt(gkSignalInitializer,i);
|
---|
88 | fPedRmsErr .AddAt(gkSignalInitializer,i);
|
---|
89 | }
|
---|
90 |
|
---|
91 | }
|
---|
92 |
|
---|
93 | void MExtractedSignalBlindPixel::SetUsedFADCSlices(const Byte_t first, const Byte_t num)
|
---|
94 | {
|
---|
95 | fFirst = first;
|
---|
96 | fNumFADCSamples = num;
|
---|
97 | }
|
---|
98 |
|
---|
99 |
|
---|
100 | Bool_t MExtractedSignalBlindPixel::IsValid( const Int_t i ) const
|
---|
101 | {
|
---|
102 | return fExtractedSignal.At(i) >= 0 && fExtractedSignal.At(i) < gkSignalInitializer;
|
---|
103 | }
|
---|
104 |
|
---|
105 | void MExtractedSignalBlindPixel::Print(Option_t *o) const
|
---|
106 | {
|
---|
107 |
|
---|
108 | for (Int_t i=0;i<fBlindPixelIdx.GetSize();i++)
|
---|
109 | {
|
---|
110 |
|
---|
111 | *fLog << "Blind Pixel ID: " << fBlindPixelIdx.At(i)
|
---|
112 | << ": Signal: " << fExtractedSignal.At(i)
|
---|
113 | << " Saturated Slices: " << fNumSaturated.At(i)
|
---|
114 | << endl;
|
---|
115 | }
|
---|
116 | }
|
---|