Changeset 3434 for trunk/MagicSoft/Mars
- Timestamp:
- 03/07/04 20:09:31 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbadpixels/MBadPixelsPix.cc
r3433 r3434 38 38 39 39 const Char_t MBadPixelsPix::fgRunMask=MBadPixelsPix::kUnsuitableRun; 40 41 40 // ------------------------------------------------------------------------ 42 41 // … … 48 47 fName = name ? name : "MBadPixelsPix"; 49 48 fTitle = title ? title : "Container storeing bad pixel information for a single pixel"; 49 50 fInfo[1] = 0; 50 51 } 51 52 … … 59 60 { 60 61 fInfo[0] &= fgRunMask; 62 61 63 } 62 64 -
trunk/MagicSoft/Mars/mbadpixels/MBadPixelsPix.h
r3433 r3434 23 23 }; 24 24 25 // All types are initialized to normal behaviour 25 26 enum CalibrationType_t { 26 kHiGainSaturation = BIT(1),27 kLoGainSaturation = BIT(2),28 kHiGain Fitted = BIT(3),29 kLoGain Fitted = BIT(4),30 kC alcChargePedestal= BIT(5),31 kC alcChargeErrValid= BIT(6),32 kC alcChargeRelErrValid= BIT(7),33 kC alcChargeSigmaValid= BIT(8),34 kConv ersionHiLoValid= BIT(9),35 kHiGainOscillating = BIT(10),36 kLoGainOscillating = BIT(11),37 kMeanTimeInFirstBin = BIT(12),38 kMeanTimeInLastBin = BIT(13),39 kBlindPixelMethod Valid = BIT(14),40 kFFactorMethod Valid = BIT(15),41 kPINDiodeMethod Valid = BIT(16),42 kCombinedMethod Valid = BIT(17)27 kHiGainSaturation = BIT(1), 28 kLoGainSaturation = BIT(2), 29 kHiGainNotFitted = BIT(3), 30 kLoGainNotFitted = BIT(4), 31 kChargeIsPedestal = BIT(5), 32 kChargeErrNotValid = BIT(6), 33 kChargeRelErrNotValid = BIT(7), 34 kChargeSigmaNotValid = BIT(8), 35 kConvHiLoNotValid = BIT(9), 36 kHiGainOscillating = BIT(10), 37 kLoGainOscillating = BIT(11), 38 kMeanTimeInFirstBin = BIT(12), 39 kMeanTimeInLastBin = BIT(13), 40 kBlindPixelMethodNotValid = BIT(14), 41 kFFactorMethodNotValid = BIT(15), 42 kPINDiodeMethodNotValid = BIT(16), 43 kCombinedMethodNotValid = BIT(17) 43 44 }; 44 45 … … 61 62 62 63 // Calibration 63 void SetHiGainSaturation ( CalibrationType_t typ=kHiGainSaturation ) { fInfo[1] |= typ; } 64 void SetNoHiGainSaturation( CalibrationType_t typ=kHiGainSaturation ) { fInfo[1] &= ~typ; } 65 66 void SetLoGainSaturation ( CalibrationType_t typ=kLoGainSaturation ) { fInfo[1] |= typ; } 67 void SetNoLoGainSaturation( CalibrationType_t typ=kLoGainSaturation ) { fInfo[1] &= ~typ; } 68 69 void SetCombinedMethodValid ( CalibrationType_t typ=kCombinedMethodValid ) { fInfo[1] |= typ; } 70 void SetNoCombinedMethodValid( CalibrationType_t typ=kCombinedMethodValid ) { fInfo[1] &= ~typ; } 71 72 void SetPINDiodeMethodValid ( CalibrationType_t typ=kPINDiodeMethodValid ) { fInfo[1] |= typ; } 73 void SetNoPINDiodeMethodValid( CalibrationType_t typ=kPINDiodeMethodValid ) { fInfo[1] &= ~typ; } 74 75 void SetFFactorMethodValid ( CalibrationType_t typ=kFFactorMethodValid ) { fInfo[1] |= typ; } 76 void SetNoFFactorMethodValid( CalibrationType_t typ=kFFactorMethodValid ) { fInfo[1] &= ~typ; } 77 78 void SetBlindPixelMethodValid ( CalibrationType_t typ=kBlindPixelMethodValid ) { fInfo[1] |= typ; } 79 void SetNoBlindPixelMethodValid( CalibrationType_t typ=kBlindPixelMethodValid ) { fInfo[1] &= ~typ; } 80 81 void SetMeanTimeInLastBin ( CalibrationType_t typ=kMeanTimeInLastBin ) { fInfo[1] |= typ; } 82 void SetNoMeanTimeInLastBin( CalibrationType_t typ=kMeanTimeInLastBin ) { fInfo[1] &= ~typ; } 83 84 void SetMeanTimeInFirstBin ( CalibrationType_t typ=kMeanTimeInFirstBin ) { fInfo[1] |= typ; } 85 void SetNoMeanTimeInFirstBin( CalibrationType_t typ=kMeanTimeInFirstBin ) { fInfo[1] &= ~typ; } 86 87 void SetLoGainOscillating ( CalibrationType_t typ=kLoGainOscillating ) { fInfo[1] |= typ; } 88 void SetNoLoGainOscillating( CalibrationType_t typ=kLoGainOscillating ) { fInfo[1] &= ~typ; } 89 90 void SetHiGainOscillating ( CalibrationType_t typ=kHiGainOscillating ) { fInfo[1] |= typ; } 91 void SetNoHiGainOscillating( CalibrationType_t typ=kHiGainOscillating ) { fInfo[1] &= ~typ; } 92 93 void SetConversionHiLoValid ( CalibrationType_t typ=kConversionHiLoValid ) { fInfo[1] |= typ; } 94 void SetNoConversionHiLoValid( CalibrationType_t typ=kConversionHiLoValid ) { fInfo[1] &= ~typ; } 95 96 void SetCalcChargeSigmaValid ( CalibrationType_t typ=kCalcChargeSigmaValid ) { fInfo[1] |= typ; } 97 void SetNoCalcChargeSigmaValid( CalibrationType_t typ=kCalcChargeSigmaValid ) { fInfo[1] &= ~typ; } 98 99 void SetCalcChargeRelErrValid ( CalibrationType_t typ=kCalcChargeRelErrValid ) { fInfo[1] |= typ; } 100 void SetNoCalcChargeRelErrValid( CalibrationType_t typ=kCalcChargeRelErrValid ) { fInfo[1] &= ~typ; } 101 102 void SetCalcChargeErrValid ( CalibrationType_t typ=kCalcChargeErrValid ) { fInfo[1] |= typ; } 103 void SetNoCalcChargeErrValid( CalibrationType_t typ=kCalcChargeErrValid ) { fInfo[1] &= ~typ; } 104 105 void SetCalcChargePedestal ( CalibrationType_t typ=kCalcChargePedestal ) { fInfo[1] |= typ; } 106 void SetNoCalcChargePedestal( CalibrationType_t typ=kCalcChargePedestal ) { fInfo[1] &= ~typ; } 107 108 void SetLoGainFitted ( CalibrationType_t typ=kLoGainFitted ) { fInfo[1] |= typ; } 109 void SetNoLoGainFitted( CalibrationType_t typ=kLoGainFitted ) { fInfo[1] &= ~typ; } 110 111 void SetHiGainFitted ( CalibrationType_t typ=kHiGainFitted ) { fInfo[1] |= typ; } 112 void SetNoHiGainFitted( CalibrationType_t typ=kHiGainFitted ) { fInfo[1] &= ~typ; } 64 void SetHiGainSaturation ( CalibrationType_t typ=kHiGainSaturation ) 65 { fInfo[1] |= typ; } 66 void SetLoGainSaturation ( CalibrationType_t typ=kLoGainSaturation ) 67 { fInfo[1] |= typ; } 68 void SetCombinedMethodNotValid ( CalibrationType_t typ=kCombinedMethodNotValid ) 69 { fInfo[1] |= typ; } 70 void SetPINDiodeMethodNotValid ( CalibrationType_t typ=kPINDiodeMethodNotValid ) 71 { fInfo[1] |= typ; } 72 void SetFFactorMethodNotValid ( CalibrationType_t typ=kFFactorMethodNotValid ) 73 { fInfo[1] |= typ; } 74 void SetBlindPixelMethodNotValid ( CalibrationType_t typ=kBlindPixelMethodNotValid ) 75 { fInfo[1] |= typ; } 76 void SetMeanTimeInLastBin ( CalibrationType_t typ=kMeanTimeInLastBin ) 77 { fInfo[1] |= typ; } 78 void SetMeanTimeInFirstBin ( CalibrationType_t typ=kMeanTimeInFirstBin ) 79 { fInfo[1] |= typ; } 80 void SetLoGainOscillating ( CalibrationType_t typ=kLoGainOscillating ) 81 { fInfo[1] |= typ; } 82 void SetHiGainOscillating ( CalibrationType_t typ=kHiGainOscillating ) 83 { fInfo[1] |= typ; } 84 void SetConvHiLoNotValid ( CalibrationType_t typ=kConvHiLoNotValid ) 85 { fInfo[1] |= typ; } 86 void SetChargeSigmaNotValid ( CalibrationType_t typ=kChargeSigmaNotValid ) 87 { fInfo[1] |= typ; } 88 void SetChargeRelErrNotValid ( CalibrationType_t typ=kChargeRelErrNotValid ) 89 { fInfo[1] |= typ; } 90 void SetChargeErrNotValid ( CalibrationType_t typ=kChargeErrNotValid ) 91 { fInfo[1] |= typ; } 92 void SetChargeIsPedestal ( CalibrationType_t typ=kChargeIsPedestal ) 93 { fInfo[1] |= typ; } 94 void SetLoGainNotFitted ( CalibrationType_t typ=kLoGainNotFitted ) 95 { fInfo[1] |= typ; } 96 void SetHiGainNotFitted ( CalibrationType_t typ=kHiGainNotFitted ) 97 { fInfo[1] |= typ; } 113 98 114 99 // Getter … … 122 107 Bool_t IsBad() const { return fInfo[0]!=0; } 123 108 124 Bool_t IsLoGainBad() const { return (fInfo[1]&kLoGainSaturation 125 || !(fInfo[1]&kConversionHiLoValid) 126 || fInfo[1]&kLoGainOscillating ); } 127 Bool_t IsHiGainBad() const { return ( fInfo[1]&kHiGainSaturation 128 && !(fInfo[1]&kConversionHiLoValid) ) 129 || fInfo[1]&kHiGainOscillating ; } 130 Bool_t IsCalibrationSignalOK() const { return !( fInfo[1]&kCalcChargePedestal 131 || !(fInfo[1]&kCalcChargeErrValid) 132 || !(fInfo[1]&kCalcChargeRelErrValid) 133 || !(fInfo[1]&kCalcChargeSigmaValid) 134 || fInfo[1]&kMeanTimeInFirstBin 135 || fInfo[1]&kMeanTimeInLastBin ) ; } 136 Bool_t IsCalibrationFitOK() const { return ( fInfo[1]&kHiGainSaturation && kHiGainFitted ) 137 || ( fInfo[1]&kLoGainSaturation && kLoGainFitted ) ; } 138 Bool_t IsCalibrationOscillating() const { return ( fInfo[1]&kHiGainSaturation && kHiGainOscillating ) 139 || ( fInfo[1]&kLoGainSaturation && kLoGainOscillating ) ; } 140 Bool_t IsCalibrationResultOK() const { return ( IsCalibrationSignalOK() 141 && !(IsCalibrationOscillating()) 142 && IsCalibrationFitOK() 143 && (!fInfo[1]&kHiGainSaturation && !(IsHiGainBad()) 144 || fInfo[1]&kHiGainSaturation && !(IsLoGainBad())) );} 145 Bool_t IsCalibrationFFactorMethodOK() const { return ( IsCalibrationResultOK() 146 && (fInfo[1]&kFFactorMethodValid)) ; } 147 Bool_t IsCalibrationBlindPixelMethodOK() const { return ( IsCalibrationResultOK() 148 && (fInfo[1]&kBlindPixelMethodValid)) ; } 149 Bool_t IsCalibrationPINDiodeMethodOK() const { return ( IsCalibrationResultOK() 150 && (fInfo[1]&kPINDiodeMethodValid)) ; } 151 Bool_t IsCalibrationCombinedMethodOK() const { return ( IsCalibrationResultOK() 152 && (fInfo[1]&kCombinedMethodValid)) ; } 109 Bool_t IsHiGainSaturation () const 110 { return !(fInfo[1] | ~kHiGainSaturation == ~kHiGainSaturation ); } 111 Bool_t IsLoGainSaturation () const 112 { return !(fInfo[1] | ~kLoGainSaturation == ~kLoGainSaturation ); } 113 Bool_t IsCombinedMethodNotValid () const 114 { return !(fInfo[1] | ~kCombinedMethodNotValid == ~kCombinedMethodNotValid ); } 115 Bool_t IsPINDiodeMethodNotValid () const 116 { return !(fInfo[1] | ~kPINDiodeMethodNotValid == ~kPINDiodeMethodNotValid ); } 117 Bool_t IsFFactorMethodNotValid () const 118 { return !(fInfo[1] | ~kFFactorMethodNotValid == ~kFFactorMethodNotValid ); } 119 Bool_t IsBlindPixelMethodNotValid () const 120 { return !(fInfo[1] | ~kBlindPixelMethodNotValid == ~kBlindPixelMethodNotValid ); } 121 Bool_t IsMeanTimeInLastBin () const 122 { return !(fInfo[1] | ~kMeanTimeInLastBin == ~kMeanTimeInLastBin ); } 123 Bool_t IsMeanTimeInFirstBin () const 124 { return !(fInfo[1] | ~kMeanTimeInFirstBin == ~kMeanTimeInFirstBin ); } 125 Bool_t IsLoGainOscillating () const 126 { return !(fInfo[1] | ~kLoGainOscillating == ~kLoGainOscillating ); } 127 Bool_t IsHiGainOscillating () const 128 { return !(fInfo[1] | ~kHiGainOscillating == ~kHiGainOscillating ); } 129 Bool_t IsConvHiLoNotValid () const 130 { return !(fInfo[1] | ~kConvHiLoNotValid == ~kConvHiLoNotValid ); } 131 Bool_t IsChargeSigmaNotValid () const 132 { return !(fInfo[1] | ~kChargeSigmaNotValid == ~kChargeSigmaNotValid ); } 133 Bool_t IsChargeRelErrNotValid () const 134 { return !(fInfo[1] | ~kChargeRelErrNotValid == ~kChargeRelErrNotValid ); } 135 Bool_t IsChargeErrNotValid () const 136 { return !(fInfo[1] | ~kChargeErrNotValid == ~kChargeErrNotValid ); } 137 Bool_t IsChargeIsPedestal () const 138 { return !(fInfo[1] | ~kChargeIsPedestal == ~kChargeIsPedestal ); } 139 Bool_t IsLoGainNotFitted () const 140 { return !(fInfo[1] | ~kLoGainNotFitted == ~kLoGainNotFitted ); } 141 Bool_t IsHiGainNotFitted () const 142 { return !(fInfo[1] | ~kHiGainNotFitted == ~kHiGainNotFitted ); } 143 144 Bool_t IsLoGainBad() const { return IsLoGainSaturation() 145 || IsConvHiLoNotValid() 146 || IsLoGainOscillating() ;} 147 Bool_t IsHiGainBad() const { return ( IsHiGainSaturation() && IsConvHiLoNotValid() 148 || IsHiGainOscillating() ); } 149 Bool_t IsCalibrationSignalOK() const { return !( IsChargeIsPedestal() 150 || IsChargeErrNotValid() 151 || IsChargeRelErrNotValid() 152 || IsChargeSigmaNotValid() 153 || IsMeanTimeInFirstBin() 154 || IsMeanTimeInLastBin() ); } 155 Bool_t IsCalibrationFitOK() const { return !( (IsHiGainSaturation() && IsHiGainNotFitted()) 156 || ( IsLoGainSaturation() && IsLoGainNotFitted()) ); } 157 Bool_t IsCalibrationOscillating() const { return ( IsHiGainSaturation() && IsHiGainOscillating()) 158 || ( IsLoGainSaturation() && IsLoGainOscillating()) ; } 159 Bool_t IsCalibrationResultOK() const { return IsCalibrationSignalOK() 160 && !(IsCalibrationOscillating()) 161 && IsCalibrationFitOK() 162 && ( (!IsHiGainSaturation() && !IsHiGainBad()) 163 || (IsHiGainSaturation() && !IsLoGainBad()) ) ;} 164 Bool_t IsCalibrationFFactorMethodOK() const { return IsCalibrationResultOK() 165 && !IsFFactorMethodNotValid() ; } 166 Bool_t IsCalibrationBlindPixelMethodOK() const { return IsCalibrationResultOK() 167 && !IsBlindPixelMethodNotValid(); } 168 Bool_t IsCalibrationPINDiodeMethodOK() const { return IsCalibrationResultOK() 169 && !IsPINDiodeMethodNotValid() ; } 170 Bool_t IsCalibrationCombinedMethodOK() const { return IsCalibrationResultOK() 171 && !IsCombinedMethodNotValid(); } 153 172 154 173 void Merge(const MBadPixelsPix &pix); -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargePix.cc
r3427 r3434 507 507 { 508 508 509 if (!IsFitted())510 return kFALSE;511 512 509 if (GetMeanCharge() < fChargeLimit*GetPedRms()) 513 510 { … … 515 512 << fChargeLimit << " Pedestal RMS in Pixel " << fPixId << endl; 516 513 if (bad) 517 bad->SetC alcChargePedestal();514 bad->SetChargeIsPedestal(); 518 515 else 519 516 return kFALSE; 520 517 } 521 else522 if (bad)523 bad->SetNoCalcChargePedestal();524 525 518 526 519 if (GetMeanChargeErr() < fChargeErrLimit) … … 529 522 << fChargeErrLimit << " in Pixel " << fPixId << endl; 530 523 if (bad) 531 bad->Set NoCalcChargeErrValid();524 bad->SetChargeErrNotValid(); 532 525 else 533 526 return kFALSE; 534 527 } 535 else536 if (bad)537 bad->SetCalcChargeErrValid();538 528 539 529 if (GetMeanCharge() < fChargeRelErrLimit*GetMeanChargeErr()) … … 542 532 << fChargeRelErrLimit << "* its error in Pixel " << fPixId << endl; 543 533 if (bad) 544 bad->Set NoCalcChargeRelErrValid();534 bad->SetChargeRelErrNotValid(); 545 535 else 546 536 return kFALSE; 547 537 } 548 else549 if (bad)550 bad->SetCalcChargeRelErrValid();551 538 552 539 if (GetSigmaCharge() < GetPedRms()) … … 555 542 << fPixId << endl; 556 543 if (bad) 557 bad->SetNoCalcChargeSigmaValid(); 544 { 545 *fLog << err << "HERERERERE" << endl; 546 bad->SetChargeSigmaNotValid(); 547 } 558 548 else 559 549 return kFALSE; 560 550 } 561 else 562 if (bad)563 bad->SetCalcChargeSigmaValid();551 552 if (bad->IsChargeSigmaNotValid()) 553 *fLog << err << " HERE " << endl; 564 554 565 555 return kTRUE; … … 585 575 return kFALSE; 586 576 } 587 else588 bad->SetNoMeanTimeInFirstBin();589 577 590 578 if ( fAbsTimeMean > upperedge-1.) … … 596 584 return kFALSE; 597 585 } 598 else599 bad->SetNoMeanTimeInLastBin();600 586 601 587 return kTRUE; -
trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeCam.cc
r3433 r3434 549 549 FinalizeLoGainHists(*fAverageLoGainOuterPix,*fCam->GetAverageOuterPix(),*fCam->GetAverageOuterBadPix()); 550 550 551 fCam->GetAverageInnerPix()->SetSigmaCharge (fCam->GetAverageInnerPix()->GetSigmaCharge() *TMath::Sqrt((Float_t)fNumInnerPixels)); 552 fCam->GetAverageOuterPix()->SetSigmaCharge (fCam->GetAverageOuterPix()->GetSigmaCharge() *TMath::Sqrt((Float_t)fNumOuterPixels)); 553 fCam->GetAverageInnerPix()->SetSigmaChargeErr(fCam->GetAverageInnerPix()->GetSigmaChargeErr()*TMath::Sqrt((Float_t)fNumInnerPixels)); 554 fCam->GetAverageOuterPix()->SetSigmaChargeErr(fCam->GetAverageOuterPix()->GetSigmaChargeErr()*TMath::Sqrt((Float_t)fNumOuterPixels)); 551 fCam->GetAverageInnerPix()->SetSigmaCharge (fCam->GetAverageInnerPix()->GetSigmaCharge() 552 *TMath::Sqrt((Float_t)fNumInnerPixels)); 553 fCam->GetAverageOuterPix()->SetSigmaCharge (fCam->GetAverageOuterPix()->GetSigmaCharge() 554 *TMath::Sqrt((Float_t)fNumOuterPixels)); 555 fCam->GetAverageInnerPix()->SetSigmaChargeErr(fCam->GetAverageInnerPix()->GetSigmaChargeErr() 556 *TMath::Sqrt((Float_t)fNumInnerPixels)); 557 fCam->GetAverageOuterPix()->SetSigmaChargeErr(fCam->GetAverageOuterPix()->GetSigmaChargeErr() 558 *TMath::Sqrt((Float_t)fNumOuterPixels)); 555 559 556 560 return kTRUE; … … 575 579 // 2) Fit the Hi Gain histograms with a Gaussian 576 580 // 577 if (hist.FitGaus()) 578 bad.SetHiGainFitted(); 581 if (!hist.FitGaus()) 579 582 // 580 583 // 3) In case of failure set the bit Fitted to false and take histogram means and RMS 581 584 // 582 else if (hist.RepeatFit()) 583 bad.SetHiGainFitted(); 584 else 585 if (!hist.RepeatFit()) 585 586 { 586 587 hist.BypassFit(); 587 bad.Set NoHiGainFitted();588 bad.SetHiGainNotFitted(); 588 589 } 589 590 … … 635 636 // 2) Fit the Lo Gain histograms with a Gaussian 636 637 // 637 if (hist.FitGaus()) 638 bad.SetLoGainFitted(); 638 if (!hist.FitGaus()) 639 639 // 640 640 // 3) In case of failure set the bit kFitted to false and take histogram means and RMS 641 641 // 642 else if (hist.RepeatFit()) 643 bad.SetLoGainFitted(); 644 else 645 { 646 hist.BypassFit(); 647 bad.SetNoLoGainFitted(); 648 } 642 if (!hist.RepeatFit()) 643 { 644 hist.BypassFit(); 645 bad.SetLoGainNotFitted(); 646 } 649 647 650 648 //
Note:
See TracChangeset
for help on using the changeset viewer.