Changeset 3198 for trunk/MagicSoft/Mars
- Timestamp:
- 02/16/04 15:32:07 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mcalib
- Files:
-
- 5 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) -
trunk/MagicSoft/Mars/mcalib/MExtractBlindPixel.h
r3196 r3198 29 29 static const Byte_t fgLast; 30 30 31 MPedestalCam *fPedestals; // Pedestals of all pixels in the camera32 31 MExtractedSignalBlindPixel *fBlindPixel; // Extracted signal of the Blind Pixel 33 32 … … 43 42 UInt_t fBlindPixelIdx; 44 43 45 Float_t fPedestal;46 Float_t fPedRms;47 48 void FindSignal(Byte_t *ptr, Int_t size, UInt_t &sum, UInt_t &sum2, UInt_t &sat, UInt_t &max) const;49 50 44 Int_t PreProcess(MParList *pList); 51 45 Int_t Process(); -
trunk/MagicSoft/Mars/mcalib/MExtractedSignalBlindPixel.cc
r3196 r3198 40 40 using namespace std; 41 41 42 static const Float_t gkSignalInitializer = 99999.9;42 static const UInt_t gkSignalInitializer = 99999; 43 43 44 44 // ------------------------------------------------------------------------ … … 66 66 void MExtractedSignalBlindPixel::Clear(Option_t *o) 67 67 { 68 fExtractedSignal = gkSignalInitializer; 69 fExtractedSignal Err= gkSignalInitializer;68 69 fExtractedSignal = gkSignalInitializer; 70 70 71 71 fNumSaturated = 0; … … 79 79 80 80 81 void MExtractedSignalBlindPixel::SetExtractedSignal(const Float_t sig, const Float_t sigerr)82 {83 fExtractedSignal = sig;84 fExtractedSignalErr = sigerr;85 }86 87 88 81 Bool_t MExtractedSignalBlindPixel::IsValid() const 89 82 { 90 return fExtractedSignal >= 0. || fExtractedSignalErr >= 0.; 91 } 92 93 void MExtractedSignalBlindPixel::SetSaturation(const Byte_t numsat) 94 { 95 fNumSaturated = numsat; 83 return fExtractedSignal >= 0 && fExtractedSignal < gkSignalInitializer; 96 84 } 97 85 … … 99 87 { 100 88 *fLog << " Signal: " << fExtractedSignal 101 << " +- " << fExtractedSignalErr102 89 << " Nr. Saturation: " << fNumSaturated 103 90 << endl; -
trunk/MagicSoft/Mars/mcalib/MExtractedSignalBlindPixel.h
r3196 r3198 10 10 private: 11 11 12 Float_t fExtractedSignal; // mean value of the extracted signal 13 Float_t fExtractedSignalErr; // error of the mean value of the extracted signal 12 UInt_t fExtractedSignal; // mean value of the extracted signal 14 13 15 14 Byte_t fFirst; … … 18 17 19 18 public: 20 MExtractedSignalBlindPixel(const char* name=NULL, const char* title=NULL);21 19 22 void Clear(Option_t *o=""); 23 void Print(Option_t *o="") const; 20 MExtractedSignalBlindPixel(const char* name=NULL, const char* title=NULL); 24 21 25 // Setter 26 void SetExtractedSignal(const Float_t sig, const Float_t sigerr); 27 void SetSaturation( const Byte_t numsat); 28 void SetUsedFADCSlices( const Byte_t first, const Byte_t num); 22 void Clear(Option_t *o=""); 23 void Print(Option_t *o="") const; 24 25 // Setter 26 void SetExtractedSignal(const UInt_t sig) { fExtractedSignal = sig; } 27 void SetNumSaturated( const Byte_t numsat) { fNumSaturated = numsat; } 28 void SetUsedFADCSlices( const Byte_t first, const Byte_t num); 29 29 30 30 // Getter 31 Float_t GetExtractedSignal() const { return fExtractedSignal; } 32 Float_t GetExtractedSignalErr() const { return fExtractedSignalErr; } 31 UInt_t GetExtractedSignal() const { return fExtractedSignal; } 33 32 34 35 36 33 Byte_t GetNumFADCSamples() const { return fNumFADCSamples; } 34 35 Bool_t IsValid() const; 37 36 38 37 ClassDef(MExtractedSignalBlindPixel, 0) // Storage Container for Extracted Signal of the blind pixel 39 38 }; 40 39 -
trunk/MagicSoft/Mars/mcalib/MHGausEvents.cc
r3170 r3198 212 212 if (fHGausHist.Fill(f) == -1) 213 213 return kFALSE; 214 215 214 215 return kTRUE; 216 216 } 217 217
Note:
See TracChangeset
for help on using the changeset viewer.