Changeset 7126 for trunk/MagicSoft/Mars/mbadpixels
- Timestamp:
- 06/02/05 16:16:04 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mbadpixels
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCalc.cc
r7109 r7126 86 86 // 87 87 MBadPixelsCalc::MBadPixelsCalc(const char *name, const char *title) 88 : fPedestalLevel(3), fPedestalLevelVariance(5), fNamePedPhotCam("MPedPhotCam"), 88 : fPedestalLevel(3), fPedestalLevelVarianceLo(5), 89 fPedestalLevelVarianceHi(5), fNamePedPhotCam("MPedPhotCam"), 89 90 fCheckInProcess(kTRUE), fCheckInPostProcess(kFALSE) 90 91 { … … 120 121 121 122 *fLog << inf << "Name of MPedPhotCam to get pedestal rms from: " << fNamePedPhotCam << endl; 122 if (fPedestalLevel )123 if (fPedestalLevel>0) 123 124 *fLog << "Checking mean 'pedestal rms' against absolute value with level " << fPedestalLevel << endl; 124 if (fPedestalLevelVariance) 125 *fLog << "Checking mean 'pedestal rms' against its variance with level " << fPedestalLevelVariance << endl; 125 if (fPedestalLevelVarianceLo>0) 126 *fLog << "Checking mean 'pedestal rms' against its lower variance with level " << fPedestalLevelVarianceLo << endl; 127 if (fPedestalLevelVarianceHi>0) 128 *fLog << "Checking mean 'pedestal rms' against its upper variance with level " << fPedestalLevelVarianceHi << endl; 126 129 127 130 return kTRUE; … … 142 145 } 143 146 144 if (fPedestalLevel<=0 && fPedestalLevelVariance<=0) 147 const Bool_t checklo = fPedestalLevelVarianceLo>0; 148 const Bool_t checkhi = fPedestalLevelVarianceHi>0; 149 150 if (fPedestalLevel<=0 && !checklo && !checkhi) 145 151 return kTRUE; 146 152 … … 219 225 } 220 226 221 if ( fPedestalLevelVariance>0)227 if (checklo || checkhi) 222 228 { 223 229 varrms2[i] /= npix[i]; 224 230 varrms2[i] = TMath::Sqrt(varrms2[i]-meanrms2[i]*meanrms2[i]); 225 231 226 lolim2[i] = meanrms2[i]-fPedestalLevelVariance *varrms2[i];227 uplim2[i] = meanrms2[i]+fPedestalLevelVariance *varrms2[i];232 lolim2[i] = meanrms2[i]-fPedestalLevelVarianceLo*varrms2[i]; 233 uplim2[i] = meanrms2[i]+fPedestalLevelVarianceHi*varrms2[i]; 228 234 } 229 235 } … … 240 246 const Byte_t aidx = (*fGeomCam)[i].GetAidx(); 241 247 242 if ((fPedestalLevel<=0 || (rms>lolim1[aidx] && rms<=uplim1[aidx])) && 243 (fPedestalLevelVariance<=0 || (rms>lolim2[aidx] && rms<=uplim2[aidx]))) 248 if ((fPedestalLevel<=0 || (rms> lolim1[aidx] && rms<=uplim1[aidx])) && 249 (!checklo || rms> lolim2[aidx]) && 250 (!checkhi || rms<=uplim2[aidx]) 251 ) 244 252 continue; 245 253 … … 303 311 // Read the setup from a TEnv, eg: 304 312 // MBadPixelsCalc.PedestalLevel: 3.0 305 // MBadPixelsCalc.PedestalLevelVariance: 3.0 313 // 314 // MBadPixelsCalc.PedestalLevelVariance: 5.0 315 // overwrites 316 // MBadPixelsCalc.PedestalLevelVarianceLo: 5.0 317 // and 318 // MBadPixelsCalc.PedestalLevelVarianceHi: 5.0 306 319 // 307 320 Int_t MBadPixelsCalc::ReadEnv(const TEnv &env, TString prefix, Bool_t print) … … 313 326 SetPedestalLevel(GetEnvValue(env, prefix, "PedestalLevel", fPedestalLevel)); 314 327 } 328 if (IsEnvDefined(env, prefix, "PedestalLevelVarianceLo", print)) 329 { 330 rc = kTRUE; 331 SetPedestalLevelVarianceLo(GetEnvValue(env, prefix, "PedestalLevelVarianceLo", fPedestalLevelVarianceLo)); 332 } 333 if (IsEnvDefined(env, prefix, "PedestalLevelVarianceHi", print)) 334 { 335 rc = kTRUE; 336 SetPedestalLevelVarianceHi(GetEnvValue(env, prefix, "PedestalLevelVarianceHi", fPedestalLevelVarianceHi)); 337 } 315 338 316 339 if (IsEnvDefined(env, prefix, "PedestalLevelVariance", print)) 317 340 { 318 341 rc = kTRUE; 319 SetPedestalLevelVariance(GetEnvValue(env, prefix, "PedestalLevelVariance", fPedestalLevelVariance));342 SetPedestalLevelVariance(GetEnvValue(env, prefix, "PedestalLevelVariance", -1)); 320 343 } 321 344 return rc; -
trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCalc.h
r7109 r7126 22 22 23 23 Float_t fPedestalLevel; 24 Float_t fPedestalLevelVariance; 24 Float_t fPedestalLevelVarianceLo; 25 Float_t fPedestalLevelVarianceHi; 25 26 26 27 TString fNamePedPhotCam; // name of the 'MPedPhotCam' container … … 41 42 42 43 // Setter 43 void SetPedestalLevel(Float_t f) { fPedestalLevel=f; } 44 void SetPedestalLevelVariance(Float_t f) { fPedestalLevelVariance=f; } 45 void SetNamePedPhotCam(const char *name) { fNamePedPhotCam = name; } 44 void SetPedestalLevel(Float_t f=-1) { fPedestalLevel=f; } 45 void SetPedestalLevelVariance(Float_t f=-1) { fPedestalLevelVarianceLo=fPedestalLevelVarianceHi=f; } 46 void SetPedestalLevelVarianceLo(Float_t f=-1) { fPedestalLevelVarianceLo=f; } 47 void SetPedestalLevelVarianceHi(Float_t f=-1) { fPedestalLevelVarianceHi=f; } 46 48 47 void SetGeomCam(const MGeomCam *geom) { fGeomCam = geom; } 49 void SetNamePedPhotCam(const char *name) { fNamePedPhotCam = name; } 50 void SetGeomCam(const MGeomCam *geom) { fGeomCam = geom; } 48 51 49 52 void EnableCheckInProcess(Bool_t b=kTRUE) { fCheckInProcess = b; }
Note:
See TracChangeset
for help on using the changeset viewer.