Changeset 3198 for trunk/MagicSoft/Mars/mcalib/MExtractBlindPixel.cc
- Timestamp:
- 02/16/04 15:32:07 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MExtractBlindPixel.cc
r3196 r3198 40 40 #include "MRawEvtPixelIter.h" 41 41 42 #include "MPedestalCam.h"43 #include "MPedestalPix.h"44 45 42 #include "MExtractedSignalBlindPixel.h" 46 43 … … 86 83 // The PreProcess searches for the following input containers: 87 84 // - MRawEvtData 88 // - MPedestalCam89 85 // 90 86 // The following output containers are also searched and created if … … 109 105 fBlindPixel->SetUsedFADCSlices(fFirst, fLast); 110 106 111 fPedestals = (MPedestalCam*)pList->FindObject(AddSerialNumber("MPedestalCam"));112 113 if (!fPedestals)114 {115 *fLog << err << AddSerialNumber("MPedestalCam") << " not found... aborting" << endl;116 return kFALSE;117 }118 119 const MPedestalPix &ped = (*fPedestals)[fBlindPixelIdx];120 121 if (&ped)122 {123 fPedestal = ped.GetPedestal();124 fPedRms = ped.GetPedestalRms();125 }126 else127 {128 *fLog << err << " Cannot find MPedestalPix of the Blind Pixel (idx="129 << fBlindPixelIdx << ")" << endl;130 return kFALSE;131 }132 107 133 108 return kTRUE; … … 149 124 150 125 UInt_t sat = 0; 151 UInt_t max = 0;152 126 153 127 Byte_t *ptr = pixel.GetHiGainSamples(); 154 128 155 UInt_t sumhi = 0;156 UInt_t sumlo = 0;157 129 // 158 130 // We need a dedicated signal extractor for the blind pixel … … 179 151 { 180 152 sum += *ptr; 181 182 if (*ptr > max)183 max = *ptr;184 153 185 154 if (*ptr++ >= fSaturationLimit) … … 197 166 sum += *ptr; 198 167 199 if (*ptr > max)200 max = *ptr;201 202 168 if (*ptr++ >= fSaturationLimit) 203 169 sat++; … … 206 172 } 207 173 208 sumhi = sum; 209 210 ptr = pixel.GetLoGainSamples(); 211 212 start = ptr + fFirst - 1; 213 end = ptr + fLast - 1; 214 215 ptr = start; 216 217 sum = 0; 218 219 while (ptr<=end) 220 { 221 222 sum += *ptr; 223 224 if (*ptr > max) 225 max = *ptr; 226 227 if (*ptr++ >= fSaturationLimit) 228 sat++; 229 } 230 231 sumlo = sum; 232 233 fBlindPixel->SetExtractedSignal(sum - fPedestal*fNumSamples, fPedRms*fSqrtSamples); 234 fBlindPixel->SetSaturation(sat); 174 fBlindPixel->SetExtractedSignal(sum); 175 fBlindPixel->SetNumSaturated(sat); 235 176 236 177 if (sat)
Note:
See TracChangeset
for help on using the changeset viewer.