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): Thomas Bretz, 1/2004 <mailto:tbretz@astro.uni-wuerzburg.de>
|
---|
19 | ! Markus Gaug, 3/2004 <mailto:markus@ifae.es>
|
---|
20 | !
|
---|
21 | ! Copyright: MAGIC Software Development, 2000-2004
|
---|
22 | !
|
---|
23 | !
|
---|
24 | \* ======================================================================== */
|
---|
25 | /////////////////////////////////////////////////////////////////////////////
|
---|
26 | //
|
---|
27 | // MBadPixelsPix
|
---|
28 | //
|
---|
29 | // The bits of an integer array fInfo are used to declare and inform about
|
---|
30 | // possible defects in a pixel. Default and absence of defects create an array
|
---|
31 | // of zeros.
|
---|
32 | //
|
---|
33 | // The first index (fInfo[0]) holds general information which is coded as follows:
|
---|
34 | // * BIT(1): Unsuitable Run: The pixel is not suited for analysis for the entire run
|
---|
35 | // * BIT(2): Unsuitable Evt: The pixel is not suited for analysis for the current event
|
---|
36 | // * BIT(3): Unreliable Run: The pixel can in principle be used for analysis, although
|
---|
37 | // previous analysis steps have yielded certain inconsistencies
|
---|
38 | //
|
---|
39 | // These bits can be called with the enum MBadPixelsPix::UnsuitableTupe_t in combination
|
---|
40 | // with the function IsUnsuitable(MBadPixelsPix::UnsuitableTupe_t), e.g.
|
---|
41 | // MBadPixelsPix::IsUnsuitalbe(MBadPixelsPix::kUnsuitableRun) asks if the first bit is set.
|
---|
42 | //
|
---|
43 | // The second index (fInfo[1]) hold information acquired during the calibration. The bits
|
---|
44 | // are coded in the following form:
|
---|
45 | //
|
---|
46 | // * Set bits leading to an unreliable flag:
|
---|
47 | //
|
---|
48 | // BIT(1 ): kHiGainNotFitted : Any High Gain signal is calibrated without a Gauss Fit to the signal distribution
|
---|
49 | // BIT(2 ): kLoGainNotFitted : Any Low Gain signal is calibrated without a Gauss Fit to the signal distribution
|
---|
50 | // BIT(3 ): kRelTimeNotFitted : Any High Gain signal's arrival times are calibrated without a Gauss Fit
|
---|
51 | // BIT(4 ): kHiGainOscillating : The High Gain signals fourier transform showed abnormal behavior
|
---|
52 | // BIT(5 ): kLoGainOscillating : The Low Gain signals fourier transform showed abnormal behavior
|
---|
53 | // BIT(6 ): kRelTimeOscillating : The High Gain arrival times fourier transform showed abnormal behavior
|
---|
54 | // BIT(7 ): kLoGainSaturation : The Low Gain signals were saturated during calibration
|
---|
55 | //
|
---|
56 | // * Set bits leading to an unsuitable flag:
|
---|
57 | //
|
---|
58 | // BIT(8 ): kChargeIsPedestal : The calibration signal contained only pedestals - presumably dead pixel
|
---|
59 | // BIT(9 ): kChargeErrNotValid : The absolute error of the derived charge has given non-sense - presumably pedestal
|
---|
60 | // BIT(10): kChargeRelErrNotValid: The relative error of the derived charge was too large or too small
|
---|
61 | // BIT(11): kChargeSigmaNotValid : The sigma of the pedestal distribution smaller than the pedestal RMS - presumably a pixel with a star in its FOV only during the pedestal taking
|
---|
62 | // BIT(12): kMeanTimeInFirstBin : The signal has its mean maximum in the first used FADC slice - signal extractor bad
|
---|
63 | // BIT(13): kMeanTimeInLast2Bins : The signal has its mean maximum in the last two used FADC slice - signal extractor bad
|
---|
64 | // BIT(14): kDeviatingNumPhes : The calculated number of photo-electrons deviates too much from the mean - inconsistency
|
---|
65 | // BIT(15): kDeviatingNumPhots : The calculated number of calibrated photons deviates too much from the mean - inconsistency
|
---|
66 | // BIT(16): kDeviatingFFactor : The calculated overall F-Factor deviates too much from the mean - inconsistency
|
---|
67 | //
|
---|
68 | // * Set bits leading to not useable low-gain signal:
|
---|
69 | //
|
---|
70 | // BIT(17): kConversionHiLoNotValid: The calibrated Conversion between Hi-Gain and Low Gain gives absurd results
|
---|
71 | //
|
---|
72 | // These bits can be called with the enum MBadPixelsPix::UncalibratedType_t in combination
|
---|
73 | // with the function IsUncalibrated(MBadPixelsPix::UncalibratedTupe_t), e.g.
|
---|
74 | // MBadPixelsPix::IsUncalibrated(MBadPixelsPix::kHiGainNotCalibrated) asks if the Hi Gain signal
|
---|
75 | // could be calibrated.
|
---|
76 | //
|
---|
77 | // The third index (fInfo[2]) holds information about possible hardware mulfunctionning. The bits
|
---|
78 | // are coded in the following form:
|
---|
79 | // BIT(1 ): kHVNotNominal : The HV deviates more than 3% from the nominal value.
|
---|
80 | //
|
---|
81 | /////////////////////////////////////////////////////////////////////////////
|
---|
82 | #include "MBadPixelsPix.h"
|
---|
83 |
|
---|
84 | #include "MLog.h"
|
---|
85 | #include "MLogManip.h"
|
---|
86 |
|
---|
87 | ClassImp(MBadPixelsPix);
|
---|
88 |
|
---|
89 | using namespace std;
|
---|
90 |
|
---|
91 | const Int_t MBadPixelsPix::fgRunMask =
|
---|
92 | MBadPixelsPix::kUnsuitableRun |
|
---|
93 | MBadPixelsPix::kUnreliableRun;
|
---|
94 |
|
---|
95 | // ------------------------------------------------------------------------
|
---|
96 | //
|
---|
97 | // Initialize Pixel to be Ok.
|
---|
98 | //
|
---|
99 | MBadPixelsPix::MBadPixelsPix(const char* name, const char* title)
|
---|
100 | {
|
---|
101 | fName = name ? name : "MBadPixelsPix";
|
---|
102 | fTitle = title ? title : "Container storing bad pixel information for a single pixel";
|
---|
103 |
|
---|
104 | fInfo.Set(3);
|
---|
105 |
|
---|
106 | }
|
---|
107 |
|
---|
108 | // ------------------------------------------------------------------------
|
---|
109 | //
|
---|
110 | // Invalidate all bits which are not run-wise. This will be called for
|
---|
111 | // all entries in the parameter list, just before each time the task-list
|
---|
112 | // is executed.
|
---|
113 | //
|
---|
114 | void MBadPixelsPix::Reset()
|
---|
115 | {
|
---|
116 | fInfo[0] &= fgRunMask;
|
---|
117 | }
|
---|
118 |
|
---|
119 | // ------------------------------------------------------------------------
|
---|
120 | //
|
---|
121 | // Invalidate values (set=0 which mean Pixel OK)
|
---|
122 | //
|
---|
123 | void MBadPixelsPix::Clear(Option_t *o)
|
---|
124 | {
|
---|
125 | fInfo.Reset(0);
|
---|
126 | }
|
---|
127 |
|
---|
128 | // ------------------------------------------------------------------------
|
---|
129 | //
|
---|
130 | // Merge (bitwise or) the information in pix into this pixel.
|
---|
131 | //
|
---|
132 | void MBadPixelsPix::Merge(const MBadPixelsPix &pix)
|
---|
133 | {
|
---|
134 | const Int_t n = pix.fInfo.GetSize();
|
---|
135 | if (n>fInfo.GetSize())
|
---|
136 | fInfo.Set(n);
|
---|
137 |
|
---|
138 | for (int i=0; i<n; i++)
|
---|
139 | fInfo[i] |= pix.fInfo[i];
|
---|
140 | }
|
---|
141 |
|
---|
142 |
|
---|
143 | /****************************************************************************
|
---|
144 | This is a collection of possible defects for later use
|
---|
145 | ****************************************************************************/
|
---|
146 |
|
---|
147 | /*
|
---|
148 | 1 PMT defective.
|
---|
149 | 2 Preamplifier defective.
|
---|
150 | 3 Optical link defective.
|
---|
151 | 4 HV cannot be set.
|
---|
152 | 7 HV unstable.
|
---|
153 | 5 HV readout defective.
|
---|
154 | 8 DC unstable.
|
---|
155 | 6 DC readout defective.
|
---|
156 | 9 Discriminator threshold cannot be set.
|
---|
157 | 10 Trigger delay cannot be set.
|
---|
158 | 11 Discriminator gives no output.
|
---|
159 | <-? 12 Pixel out of L1T.
|
---|
160 | 13 FADC defective.
|
---|
161 | 14 FADC board digital information defective.
|
---|
162 | */
|
---|
163 |
|
---|
164 | /*
|
---|
165 | 1 Pixel shows no signal
|
---|
166 | */
|
---|
167 |
|
---|
168 | /*
|
---|
169 |
|
---|
170 | Hardware defects which cannot be detected automatically by software. This might be stored at least in the data-base. I think we should wait until we implement these things...
|
---|
171 | Preamplifier defective.
|
---|
172 | Optical link defective.
|
---|
173 | HV cannot be set.
|
---|
174 | HV readout defective.
|
---|
175 | DC readout defective.
|
---|
176 | Discriminator threshold cannot be set.
|
---|
177 | Trigger delay cannot be set.
|
---|
178 | Discriminator gives no output.
|
---|
179 | FADC defective.
|
---|
180 | FADC board digital information defective.
|
---|
181 | Pixel out of L1T. (this is an important information, but not necessarily a defect, is it?)
|
---|
182 |
|
---|
183 | */
|
---|