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 | !
|
---|
20 | ! Copyright: MAGIC Software Development, 2000-2004
|
---|
21 | !
|
---|
22 | !
|
---|
23 | \* ======================================================================== */
|
---|
24 |
|
---|
25 | /////////////////////////////////////////////////////////////////////////////
|
---|
26 | //
|
---|
27 | // MBadPixelsPix
|
---|
28 | //
|
---|
29 | /////////////////////////////////////////////////////////////////////////////
|
---|
30 | #include "MBadPixelsPix.h"
|
---|
31 |
|
---|
32 | #include "MLog.h"
|
---|
33 | #include "MLogManip.h"
|
---|
34 |
|
---|
35 | ClassImp(MBadPixelsPix);
|
---|
36 |
|
---|
37 | using namespace std;
|
---|
38 |
|
---|
39 | const Int_t MBadPixelsPix::fgRunMask =
|
---|
40 | MBadPixelsPix::kUnsuitableRun |
|
---|
41 | MBadPixelsPix::kUnreliableRun;
|
---|
42 |
|
---|
43 | // ------------------------------------------------------------------------
|
---|
44 | //
|
---|
45 | // Initialize Pixel to be Ok.
|
---|
46 | //
|
---|
47 | MBadPixelsPix::MBadPixelsPix(const char* name, const char* title)
|
---|
48 | : fInfo(5)
|
---|
49 | {
|
---|
50 | fName = name ? name : "MBadPixelsPix";
|
---|
51 | fTitle = title ? title : "Container storeing bad pixel information for a single pixel";
|
---|
52 |
|
---|
53 | fInfo[1] = 0;
|
---|
54 | }
|
---|
55 |
|
---|
56 | // ------------------------------------------------------------------------
|
---|
57 | //
|
---|
58 | // Invalidate all bits which are not run-wise. This will be called for
|
---|
59 | // all entries in the parameter list, just before each time the task-list
|
---|
60 | // is executed.
|
---|
61 | //
|
---|
62 | void MBadPixelsPix::Reset()
|
---|
63 | {
|
---|
64 | fInfo[0] &= fgRunMask;
|
---|
65 | }
|
---|
66 |
|
---|
67 | // ------------------------------------------------------------------------
|
---|
68 | //
|
---|
69 | // Invalidate values (set=0 which mean Pixel OK)
|
---|
70 | //
|
---|
71 | void MBadPixelsPix::Clear(Option_t *o)
|
---|
72 | {
|
---|
73 | fInfo.Reset(0);
|
---|
74 | }
|
---|
75 |
|
---|
76 | // ------------------------------------------------------------------------
|
---|
77 | //
|
---|
78 | // Merge (bitwise or) the information in pix into this pixel.
|
---|
79 | //
|
---|
80 | void MBadPixelsPix::Merge(const MBadPixelsPix &pix)
|
---|
81 | {
|
---|
82 | const Int_t n = pix.fInfo.GetSize();
|
---|
83 | if (n>fInfo.GetSize())
|
---|
84 | fInfo.Set(n);
|
---|
85 |
|
---|
86 | for (int i=0; i<n; i++)
|
---|
87 | fInfo[i] |= pix.fInfo[i];
|
---|
88 | }
|
---|
89 |
|
---|
90 |
|
---|
91 | /****************************************************************************
|
---|
92 | This is a collection of possible defects for later use
|
---|
93 | ****************************************************************************/
|
---|
94 |
|
---|
95 | /*
|
---|
96 | 1 PMT defective.
|
---|
97 | 2 Preamplifier defective.
|
---|
98 | 3 Optical link defective.
|
---|
99 | 4 HV cannot be set.
|
---|
100 | 7 HV unstable.
|
---|
101 | 5 HV readout defective.
|
---|
102 | 8 DC unstable.
|
---|
103 | 6 DC readout defective.
|
---|
104 | 9 Discriminator threshold cannot be set.
|
---|
105 | 10 Trigger delay cannot be set.
|
---|
106 | 11 Discriminator gives no output.
|
---|
107 | <-? 12 Pixel out of L1T.
|
---|
108 | 13 FADC defective.
|
---|
109 | 14 FADC board digital information defective.
|
---|
110 | */
|
---|
111 |
|
---|
112 | /*
|
---|
113 | 1 Pixel shows no signal
|
---|
114 | */
|
---|
115 |
|
---|
116 | /*
|
---|
117 | MCalibrationCalc - valid for the result of a calibration run:
|
---|
118 |
|
---|
119 | 3 Hi-Gain saturated, no LoGain available
|
---|
120 |
|
---|
121 | 4 Conversion Factor HiGain - LoGain not valid
|
---|
122 |
|
---|
123 | 5 Cannot be calibrated at all
|
---|
124 | 6 Cannot be fitted - calibrated using Histogram Mean and RMS
|
---|
125 |
|
---|
126 | */
|
---|
127 |
|
---|
128 | /*
|
---|
129 |
|
---|
130 | 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...
|
---|
131 | Preamplifier defective.
|
---|
132 | Optical link defective.
|
---|
133 | HV cannot be set.
|
---|
134 | HV readout defective.
|
---|
135 | DC readout defective.
|
---|
136 | Discriminator threshold cannot be set.
|
---|
137 | Trigger delay cannot be set.
|
---|
138 | Discriminator gives no output.
|
---|
139 | FADC defective.
|
---|
140 | FADC board digital information defective.
|
---|
141 | Pixel out of L1T. (this is an important information, but not necessarily a defect, is it?)
|
---|
142 |
|
---|
143 | In addition here are some cases which I think can be detected by software:
|
---|
144 | - no signal
|
---|
145 | - wrong signal
|
---|
146 | - hv problem
|
---|
147 | - dc problem
|
---|
148 | - Conversion Factor HiGain - LoGain not valid (what does this mean?)
|
---|
149 | - No calibration possible
|
---|
150 | - No fit possible - calibrated using Histogram Mean and RMS
|
---|
151 | - Mean Charge smaller than PedRMS
|
---|
152 | - Sigma Charge smaller than PedRMS
|
---|
153 | - Calib.methods inconsistency (there are in pricipal 6 combinations... do we need 6 bits?)
|
---|
154 | - Gains oscillate (what does it mean?)
|
---|
155 | - Sigma Arrival Time bigger than FADC window (from calib)
|
---|
156 | - Mean Arrival Time at edge of FADC window (from calib)
|
---|
157 | */
|
---|