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