Changeset 7094 for trunk/MagicSoft/Mars/mbadpixels
- Timestamp:
- 05/27/05 09:46:22 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mbadpixels
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCalc.cc
r7035 r7094 86 86 // 87 87 MBadPixelsCalc::MBadPixelsCalc(const char *name, const char *title) 88 : fPedestalLevel(3), fPedestalLevelVariance(5), fNamePedPhotCam("MPedPhotCam") 88 : fPedestalLevel(3), fPedestalLevelVariance(5), fNamePedPhotCam("MPedPhotCam"), 89 fCheckInProcess(kTRUE), fCheckInPostProcess(kFALSE) 89 90 { 90 91 fName = name ? name : gsDefName.Data(); … … 129 130 // -------------------------------------------------------------------------- 130 131 // 131 // Check the pedestal RMS of every pixel with respect to the mean pedestal RMS132 // of the camera (Sigmabar).133 //134 // The pixels can be set as blind if the pedestalRMS is too big or 0.135 //136 // If you don't want to use this option set the PedestalLevel<=0;137 //138 // MBadPixelsCalc calc;139 // calc.SetPedestalLevel(-1);140 /*141 void MBadPixelsCalc::CheckPedestalRMS() const142 {143 const Int_t entries = fPedPhotCam->GetSize();144 145 const Float_t meanPedRMS = fSigmabar->GetSigmabar();146 147 for (Int_t i=0; i<entries; i++)148 {149 //150 // get pixel as entry from list151 //152 const Double_t nratio = fGeomCam->GetPixRatio(i);153 const Double_t pixPedRms = (*fPedPhotCam)[i].GetRms();154 155 if (pixPedRms*nratio > fPedestalLevel * meanPedRMS || pixPedRms == 0)156 (*fBadPixels)[i].SetUnsuitable(MBadPixelsPix::kUnsuitableEvt);157 }158 }159 */160 161 // --------------------------------------------------------------------------162 //163 132 // Check the pedestal Rms of the pixels: compute with 2 iterations the mean 164 133 // for inner and outer pixels. Set as blind the pixels with too small or 165 134 // too high pedestal Rms with respect to the mean. 166 135 // 167 Bool_t MBadPixelsCalc::CheckPedestalRms() const 168 { 136 Bool_t MBadPixelsCalc::CheckPedestalRms(MBadPixelsPix::UnsuitableType_t type) const 137 { 138 if (fPedestalLevel<=0 && fPedestalLevelVariance<=0) 139 return kTRUE; 140 169 141 const Int_t entries = fPedPhotCam->GetSize(); 170 142 … … 266 238 continue; 267 239 268 (*fBadPixels)[i].SetUnsuitable(MBadPixelsPix::kUnsuitableEvt); 240 (*fBadPixels)[i].SetUnsuitable(type); 241 if (type==MBadPixelsPix::kUnsuitableRun) 242 (*fBadPixels)[i].SetUncalibrated(MBadPixelsPix::kDeadPedestalRms); 243 269 244 bads++; 270 245 } … … 281 256 } 282 257 283 284 258 // -------------------------------------------------------------------------- 285 259 // … … 287 261 Int_t MBadPixelsCalc::Process() 288 262 { 289 if (fPedestalLevel>0 || fPedestalLevelVariance>0) 290 CheckPedestalRms(); 291 292 return kTRUE; 263 return fCheckInProcess ? CheckPedestalRms(MBadPixelsPix::kUnsuitableEvt) : kTRUE; 264 } 265 266 // -------------------------------------------------------------------------- 267 // 268 // 269 Int_t MBadPixelsCalc::PostProcess() 270 { 271 return fCheckInPostProcess ? CheckPedestalRms(MBadPixelsPix::kUnsuitableRun) : kTRUE; 293 272 } 294 273 -
trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCalc.h
r5777 r7094 4 4 #ifndef MARS_MTask 5 5 #include "MTask.h" 6 #endif 7 #ifndef MARS_MBadPixelsPix 8 #include "MBadPixelsPix.h" 6 9 #endif 7 10 … … 21 24 22 25 TString fNamePedPhotCam; // name of the 'MPedPhotCam' container 23 24 // void CheckPedestalRMS() const;25 Bool_t CheckPedestalRms() const;26 26 27 Bool_t fCheckInProcess; 28 Bool_t fCheckInPostProcess; 29 30 // MBadPixelsCalc 31 Bool_t CheckPedestalRms(MBadPixelsPix::UnsuitableType_t t) const; 32 33 // MTask 27 34 Int_t PreProcess(MParList *pList); 28 35 Int_t Process(); 36 Int_t PostProcess(); 37 38 // MParContainer 29 39 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print); 30 40 … … 32 42 MBadPixelsCalc(const char *name=NULL, const char *title=NULL); 33 43 44 // Setter 34 45 void SetPedestalLevel(Float_t f) { fPedestalLevel=f; } 35 46 void SetPedestalLevelVariance(Float_t f) { fPedestalLevelVariance=f; } 36 47 void SetNamePedPhotCam(const char *name) { fNamePedPhotCam = name; } 48 49 void EnableCheckInProcess(Bool_t b=kTRUE) { fCheckInProcess = b; } 50 void EnableCheckInPostProcess(Bool_t b=kTRUE) { fCheckInPostProcess = b; } 37 51 38 52 ClassDef(MBadPixelsCalc, 1) // Task to find bad pixels (star, broken pixels, etc)
Note:
See TracChangeset
for help on using the changeset viewer.