- Timestamp:
- 03/29/04 18:55:40 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3600 r3601 29 29 * mbadpixels/MBadPixelsPix.cc 30 30 - put some documentation in the header 31 32 * mcalib/MHCalibrationChargeCam.cc 33 - adopt to new style in MBadPixelsPix.h 31 34 32 35 -
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); -
trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeCam.cc
r3560 r3601 113 113 fLoGainArray->SetOwner(); 114 114 115 fAverageHiGainInnerPix = new MHCalibrationChargeHiGainPix("AverageHiGainInnerPix","Average HiGain FADC sums of inner pixels"); 116 fAverageLoGainInnerPix = new MHCalibrationChargeLoGainPix("AverageLoGainInnerPix","Average LoGain FADC sums of inner pixels"); 117 fAverageHiGainOuterPix = new MHCalibrationChargeHiGainPix("AverageHiGainOuterPix","Average HiGain FADC sums of outer pixels"); 118 fAverageLoGainOuterPix = new MHCalibrationChargeLoGainPix("AverageLoGainOuterPix","Average LoGain FADC sums of outer pixels"); 119 120 /* 121 fAverageHiGainInnerPix->GetHGausHist()->SetName("HCalibrationChargeAverageInnerHiGainPix"); 122 fAverageHiGainOuterPix->GetHGausHist()->SetName("HCalibrationChargeAverageOuterHiGainPix"); 123 fAverageLoGainInnerPix->GetHGausHist()->SetName("HCalibrationChargeAverageInnerLoGainPix"); 124 fAverageLoGainOuterPix->GetHGausHist()->SetName("HCalibrationChargeAverageOuterLoGainPix"); 125 */ 115 fAverageHiGainInnerPix = new MHCalibrationChargeHiGainPix("AverageHiGainInnerPix", 116 "Average HiGain FADC sums of inner pixels"); 117 fAverageLoGainInnerPix = new MHCalibrationChargeLoGainPix("AverageLoGainInnerPix", 118 "Average LoGain FADC sums of inner pixels"); 119 fAverageHiGainOuterPix = new MHCalibrationChargeHiGainPix("AverageHiGainOuterPix", 120 "Average HiGain FADC sums of outer pixels"); 121 fAverageLoGainOuterPix = new MHCalibrationChargeLoGainPix("AverageLoGainOuterPix", 122 "Average LoGain FADC sums of outer pixels"); 123 126 124 fAverageHiGainInnerPix->GetHGausHist()->SetTitle("Summed FADC slices average Inner pixels HiGain"); 127 125 fAverageLoGainInnerPix->GetHGausHist()->SetTitle("Summed FADC slices average Inner pixels LoGain"); … … 348 346 if ((*fBadPixels)[i].IsBad()) 349 347 { 350 fNumExcluded++; 351 (*this)[i].SetExcluded(); 348 *fLog << warn << "Excluded pixel: " << i << " from calibration " << endl; 349 fNumExcluded++; 350 (*this)[i].SetExcluded(); 352 351 } 353 352 (*this)[i].Init(); … … 576 575 if (hist.IsEmpty()) 577 576 { 577 *fLog << warn << "Empty Hi Gain histogram in pixel: " << pix.GetPixId() << endl; 578 578 bad.SetUnsuitable(MBadPixelsPix::kUnsuitableRun); 579 579 return; … … 583 583 { 584 584 pix.SetHiGainSaturation(); 585 bad.SetHiGainSaturation();586 585 return; 587 586 } … … 597 596 { 598 597 hist.BypassFit(); 599 bad.SetHiGainNotFitted(); 600 bad.SetUnsuitable(MBadPixelsPix::kUnreliableRun); 598 *fLog << warn << "Hi Gain could not be fitted in pixel: " << pix.GetPixId() << endl; 599 bad.SetUncalibrated( MBadPixelsPix::kHiGainNotFitted ); 600 bad.SetUnsuitable( MBadPixelsPix::kUnreliableRun ); 601 601 } 602 602 … … 627 627 if (!hist.IsFourierSpectrumOK()) 628 628 { 629 bad.SetHiGainOscillating(); 630 bad.SetUnsuitable(MBadPixelsPix::kUnreliableRun); 629 *fLog << warn << "Oscillating Hi Gain in pixel: " << pix.GetPixId() << endl; 630 bad.SetUncalibrated( MBadPixelsPix::kHiGainOscillating ); 631 bad.SetUnsuitable( MBadPixelsPix::kUnreliableRun ); 631 632 } 632 633 } … … 648 649 { 649 650 pix.SetLoGainSaturation(); 650 bad.SetLoGainSaturation(); 651 bad.SetUnsuitable( MBadPixelsPix::kUnsuitableRun);651 bad.SetUncalibrated( MBadPixelsPix::kLoGainSaturation ); 652 bad.SetUnsuitable( MBadPixelsPix::kUnsuitableRun ); 652 653 return; 653 654 } … … 663 664 { 664 665 hist.BypassFit(); 665 bad.SetLoGainNotFitted();666 bad.SetUncalibrated( MBadPixelsPix::kLoGainNotFitted ); 666 667 if (pix.IsHiGainSaturation()) 667 668 bad.SetUnsuitable(MBadPixelsPix::kUnreliableRun); … … 697 698 if (!hist.IsFourierSpectrumOK()) 698 699 { 699 bad.Set LoGainOscillating();700 bad.SetUncalibrated( MBadPixelsPix::kLoGainOscillating ); 700 701 if (pix.IsHiGainSaturation()) 701 702 bad.SetUnsuitable(MBadPixelsPix::kUnreliableRun);
Note:
See TracChangeset
for help on using the changeset viewer.