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