Changeset 3601 for trunk/MagicSoft/Mars/mbadpixels
- Timestamp:
- 03/29/04 18:55:40 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mbadpixels
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCam.cc
r3482 r3601 342 342 break; 343 343 case 7: 344 val = !(*this)[idx].IsCalibration FitOK();344 val = !(*this)[idx].IsCalibrationResultOK(); 345 345 return val; 346 346 break; 347 347 case 8: 348 val = (*this)[idx].Is CalibrationOscillating();348 val = (*this)[idx].IsUncalibrated(MBadPixelsPix::kHiGainNotFitted); 349 349 return val; 350 350 break; 351 351 case 9: 352 val = !(*this)[idx].IsCalibrationResultOK();352 val = (*this)[idx].IsUncalibrated(MBadPixelsPix::kLoGainNotFitted); 353 353 return val; 354 354 break; 355 355 case 10: 356 val = (*this)[idx].IsHiGainSaturation();356 val = (*this)[idx].IsUncalibrated(MBadPixelsPix::kHiGainOscillating); 357 357 return val; 358 358 break; 359 359 case 11: 360 val = (*this)[idx].Is LoGainSaturation();360 val = (*this)[idx].IsUncalibrated(MBadPixelsPix::kLoGainSaturation ); 361 361 return val; 362 362 break; 363 363 case 12: 364 val = (*this)[idx].Is NotCalibrated();364 val = (*this)[idx].IsUncalibrated(MBadPixelsPix::kChargeIsPedestal ); 365 365 return val; 366 366 break; 367 367 case 13: 368 val = (*this)[idx].Is MeanTimeInLastBin();368 val = (*this)[idx].IsUncalibrated(MBadPixelsPix::kChargeErrNotValid); 369 369 return val; 370 370 break; 371 371 case 14: 372 val = (*this)[idx].Is MeanTimeInFirstBin();372 val = (*this)[idx].IsUncalibrated(MBadPixelsPix::kChargeRelErrNotValid); 373 373 return val; 374 374 break; 375 375 case 15: 376 val = (*this)[idx].Is LoGainOscillating();376 val = (*this)[idx].IsUncalibrated(MBadPixelsPix::kChargeSigmaNotValid ); 377 377 return val; 378 378 break; 379 379 case 16: 380 val = (*this)[idx].Is HiGainOscillating();380 val = (*this)[idx].IsUncalibrated(MBadPixelsPix::kMeanTimeInFirstBin ); 381 381 return val; 382 382 break; 383 383 case 17: 384 val = (*this)[idx].Is ConvHiLoNotValid();384 val = (*this)[idx].IsUncalibrated(MBadPixelsPix::kMeanTimeInLast2Bins ); 385 385 return val; 386 386 break; 387 387 case 18: 388 val = (*this)[idx].IsChargeSigmaNotValid(); 389 return val; 390 break; 391 case 19: 392 val = (*this)[idx].IsChargeRelErrNotValid(); 393 return val; 394 break; 395 case 20: 396 val = (*this)[idx].IsChargeErrNotValid(); 397 return val; 398 case 21: 399 val = (*this)[idx].IsChargeIsPedestal(); 400 return val; 401 case 22: 402 val = (*this)[idx].IsLoGainNotFitted(); 403 return val; 404 break; 405 case 23: 406 val = (*this)[idx].IsHiGainNotFitted(); 388 val = (*this)[idx].IsUncalibrated(MBadPixelsPix::kDeviatingNumPhes ); 407 389 return val; 408 390 break; -
trunk/MagicSoft/Mars/mbadpixels/MBadPixelsPix.cc
r3559 r3601 23 23 ! 24 24 \* ======================================================================== */ 25 26 25 ///////////////////////////////////////////////////////////////////////////// 27 26 // 28 27 // MBadPixelsPix 28 // 29 // The bits of an integer array fInfo are used to declare and inform about 30 // possible defects in a pixel. Default and absence of defects create an array 31 // of zeros. 32 // 33 // The first index (fInfo[0]) holds general information which is coded as follows: 34 // * BIT(1): Unsuitable Run: The pixel is not suited for analysis for the entire run 35 // * BIT(2): Unsuitable Evt: The pixel is not suited for analysis for the current event 36 // * BIT(3): Unreliable Run: The pixel can in principle be used for analysis, although 37 // previous analysis steps have yielded certain inconsistencies 38 // 39 // These bits can be called with the enum MBadPixelsPix::UnsuitableTupe_t in combination 40 // with the function IsUnsuitable(MBadPixelsPix::UnsuitableTupe_t), e.g. 41 // MBadPixelsPix::IsUnsuitalbe(MBadPixelsPix::kUnsuitableRun) asks if the first bit is set. 42 // 43 // The second index (fInfo[1]) hold information acquired during the calibration. The bits 44 // are coded in the following form: 45 // BIT(1 ): kHiGainNotCalibrated : Any High Gain signal is not calibrated and cannot be used 46 // BIT(2 ): kLoGainNotCalibrated : Any Low Gain signal is not calibrated and cannot be used 47 // BIT(3 ): kHiGainNotFitted : Any High Gain signal is calibrated without a Gauss Fit to the signal distribution 48 // BIT(4 ): kLoGainNotFitted : Any Low Gain signal is calibrated without a Gauss Fit to the signal distribution 49 // BIT(5 ): kHiGainOscillating : The High Gain signals fourier transform showed abnormal behavior 50 // BIT(6 ): kLoGainOscillating : The Low Gain signals fourier transform showed abnormal behavior 51 // BIT(7 ): kLoGainSaturation : The Low Gain signals were saturated during calibration 52 // BIT(8 ): kChargeIsPedestal : The calibration signal contained only pedestals - presumably dead pixel 53 // BIT(10): kChargeRelErrNotValid: The relative error of the derived charge was too large or too small 54 // BIT(11): kChargeSigmaNotValid : The sigma of the pedestal distribution smaller than the pedestal RMS - presumably a pixel with a star in its FOV only during the pedestal taking 55 // BIT(12): kMeanTimeInFirstBin : The signal has its mean maximum in the first used FADC slice - signal extractor bad 56 // BIT(13): kMeanTimeInLast2Bins : The signal has its mean maximum in the last two used FADC slice - signal extractor bad 57 // BIT(14): kDeviatingNumPhes : The calculated number of photo-electrons deviates too much from the mean - inconsitency 58 // 59 // These bits can be called with the enum MBadPixelsPix::UncalibratedType_t in combination 60 // with the function IsUncalibrated(MBadPixelsPix::UncalibratedTupe_t), e.g. 61 // MBadPixelsPix::IsUncalibrated(MBadPixelsPix::kHiGainNotCalibrated) asks if the Hi Gain signal 62 // could be calibrated. 63 // 64 // Two additional functions yield specific calibration information: 65 // * IsCalibrationSignalOK() asks if the extracted calibration signal showed any inconsistency 66 // * IsCalibrationResultOK() asks if the applied calibration can be used at all. 29 67 // 30 68 ///////////////////////////////////////////////////////////////////////////// -
trunk/MagicSoft/Mars/mbadpixels/MBadPixelsPix.h
r3559 r3601 27 27 28 28 // All types are initialized to normal behaviour 29 enum CalibrationType_t {30 kHiGain Saturation= BIT(1),31 kLoGain Saturation = BIT(2),29 enum UncalibratedType_t { 30 kHiGainNotCalibrated = BIT(1), 31 kLoGainNotCalibrated = BIT(2), 32 32 kHiGainNotFitted = BIT(3), 33 33 kLoGainNotFitted = BIT(4), 34 k ChargeIsPedestal= BIT(5),35 k ChargeErrNotValid= BIT(6),36 k ChargeRelErrNotValid= BIT(7),37 kCharge SigmaNotValid= BIT(8),38 kC onvHiLoNotValid = BIT(9),39 k HiGainOscillating= BIT(10),40 k LoGainOscillating= BIT(11),34 kHiGainOscillating = BIT(5), 35 kLoGainOscillating = BIT(6), 36 kLoGainSaturation = BIT(7), 37 kChargeIsPedestal = BIT(8), 38 kChargeErrNotValid = BIT(9), 39 kChargeRelErrNotValid = BIT(10), 40 kChargeSigmaNotValid = BIT(11), 41 41 kMeanTimeInFirstBin = BIT(12), 42 kMeanTimeInLastBin = BIT(13), 43 kDeviatingNumPhes = BIT(14), 44 kNotCalibrated = BIT(15) 42 kMeanTimeInLast2Bins = BIT(13), 43 kDeviatingNumPhes = BIT(14) 45 44 }; 46 45 … … 53 52 54 53 // Setter 55 void SetUnsuitable(UnsuitableType_t typ) { fInfo[0] |= typ; } 56 57 // Calibration 58 void SetHiGainSaturation () { fInfo[1] |= kHiGainSaturation; } 59 void SetLoGainSaturation () { fInfo[1] |= kLoGainSaturation; } 60 void SetNotCalibrated () { fInfo[1] |= kNotCalibrated; } 61 void SetMeanTimeInLastBin () { fInfo[1] |= kMeanTimeInLastBin; } 62 void SetMeanTimeInFirstBin () { fInfo[1] |= kMeanTimeInFirstBin; } 63 void SetLoGainOscillating () { fInfo[1] |= kLoGainOscillating; } 64 void SetHiGainOscillating () { fInfo[1] |= kHiGainOscillating; } 65 void SetConvHiLoNotValid () { fInfo[1] |= kConvHiLoNotValid; } 66 void SetChargeSigmaNotValid () { fInfo[1] |= kChargeSigmaNotValid; } 67 void SetChargeRelErrNotValid () { fInfo[1] |= kChargeRelErrNotValid; } 68 void SetChargeErrNotValid () { fInfo[1] |= kChargeErrNotValid; } 69 void SetChargeIsPedestal () { fInfo[1] |= kChargeIsPedestal; } 70 void SetLoGainNotFitted () { fInfo[1] |= kLoGainNotFitted; } 71 void SetHiGainNotFitted () { fInfo[1] |= kHiGainNotFitted; } 72 void SetDeviatingNumPhes () { fInfo[1] |= kDeviatingNumPhes; } 54 void SetUnsuitable ( UnsuitableType_t typ ) { fInfo[0] |= typ; } 55 void SetUncalibrated( UncalibratedType_t typ ) { fInfo[1] |= typ; } 73 56 74 57 // Getter 75 Bool_t IsUnsuitable(UnsuitableType_t typ) const { return fInfo[0]&typ; } 58 Bool_t IsUnsuitable ( UnsuitableType_t typ ) const { return fInfo[0]&typ; } 59 Bool_t IsUncalibrated( UncalibratedType_t typ ) const { return fInfo[1]&typ; } 76 60 77 61 Bool_t IsOK() const { return fInfo[0]==0; } 78 62 Bool_t IsBad() const { return fInfo[0]!=0; } 79 63 80 Bool_t IsHiGainSaturation () const { return fInfo[1] & kHiGainSaturation ; } 81 Bool_t IsLoGainSaturation () const { return fInfo[1] & kLoGainSaturation ; } 82 Bool_t IsNotCalibrated () const { return fInfo[1] & kNotCalibrated; } 83 Bool_t IsMeanTimeInLastBin () const { return fInfo[1] & kMeanTimeInLastBin; } 84 Bool_t IsMeanTimeInFirstBin () const { return fInfo[1] & kMeanTimeInFirstBin; } 85 Bool_t IsLoGainOscillating () const { return fInfo[1] & kLoGainOscillating; } 86 Bool_t IsHiGainOscillating () const { return fInfo[1] & kHiGainOscillating; } 87 Bool_t IsConvHiLoNotValid () const { return fInfo[1] & kConvHiLoNotValid; } 88 Bool_t IsChargeSigmaNotValid () const { return fInfo[1] & kChargeSigmaNotValid; } 89 Bool_t IsChargeRelErrNotValid () const { return fInfo[1] & kChargeRelErrNotValid; } 90 Bool_t IsChargeErrNotValid () const { return fInfo[1] & kChargeErrNotValid; } 91 Bool_t IsChargeIsPedestal () const { return fInfo[1] & kChargeIsPedestal; } 92 Bool_t IsLoGainNotFitted () const { return fInfo[1] & kLoGainNotFitted; } 93 Bool_t IsHiGainNotFitted () const { return fInfo[1] & kHiGainNotFitted; } 94 Bool_t IsDeviatingNumPhes () const { return fInfo[1] & kDeviatingNumPhes; } 64 Bool_t IsLoGainBad() const { return IsUnsuitable (kUnsuitableRun ) 65 || IsUncalibrated(kLoGainSaturation ) 66 || IsUncalibrated(kLoGainNotCalibrated) 67 || IsUncalibrated(kLoGainOscillating ) ; } 68 Bool_t IsHiGainBad() const { return IsUnsuitable (kUnsuitableRun ) 69 || IsUncalibrated(kHiGainNotCalibrated) 70 || IsUncalibrated(kHiGainOscillating ) ; } 95 71 96 97 Bool_t IsLoGainBad() const { return IsLoGainSaturation() || IsConvHiLoNotValid() || IsLoGainOscillating() ;} 98 Bool_t IsHiGainBad() const { return (IsHiGainSaturation() && IsConvHiLoNotValid()) || IsHiGainOscillating(); } 72 Bool_t IsCalibrationSignalOK() const { return !( IsUncalibrated(kChargeIsPedestal ) 73 || IsUncalibrated(kChargeErrNotValid ) 74 || IsUncalibrated(kChargeRelErrNotValid) 75 || IsUncalibrated(kChargeSigmaNotValid ) 76 || IsUncalibrated(kMeanTimeInFirstBin ) 77 || IsUncalibrated(kMeanTimeInLast2Bins ) ); } 99 78 100 Bool_t IsCalibrationSignalOK() const { return !( IsChargeIsPedestal() 101 || IsChargeErrNotValid() 102 || IsChargeRelErrNotValid() 103 || IsChargeSigmaNotValid() 104 || IsMeanTimeInFirstBin() 105 || IsMeanTimeInLastBin() ); } 106 Bool_t IsCalibrationFitOK() const { return !( (!IsHiGainSaturation() && IsHiGainNotFitted()) 107 || ( IsHiGainSaturation() && IsLoGainNotFitted()) ); } 108 Bool_t IsCalibrationOscillating() const { return ( !IsHiGainSaturation() && IsHiGainOscillating()) 109 || ( IsHiGainSaturation() && IsLoGainOscillating()) ; } 110 Bool_t IsCalibrationResultOK() const { return !IsUnsuitable(kUnsuitableRun) && 111 IsCalibrationSignalOK() 112 && !IsCalibrationOscillating() 113 && ( (!IsHiGainSaturation() && !IsHiGainBad()) 114 || (IsHiGainSaturation() && !IsLoGainBad()) ) ;} 79 Bool_t IsCalibrationResultOK() const { return !IsUnsuitable(kUnsuitableRun) 80 && IsCalibrationSignalOK() 81 && !IsHiGainBad() 82 && !IsLoGainBad() ; } 115 83 116 84 void Merge(const MBadPixelsPix &pix);
Note:
See TracChangeset
for help on using the changeset viewer.