Changeset 2943 for trunk/MagicSoft/Mars/mcalib
- Timestamp:
- 01/28/04 14:43:56 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mcalib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrationCalc.cc
r2931 r2943 120 120 MCalibrationCalc::MCalibrationCalc(const char *name, const char *title) 121 121 : fPedestals(NULL), fCalibrations(NULL), fSignals(NULL), 122 fRawEvt(NULL), fRunHeader(NULL), fArrivalTime(NULL), fEvtTime(NULL), 123 fEvents(0), fCosmics(0), 124 fNumHiGainSamples(0), fNumLoGainSamples(0), fConversionHiLo(0.), 125 fNumExcludedPixels(0), 126 fColor(kEBlue) 122 fRawEvt(NULL), fRunHeader(NULL), fArrivalTime(NULL), fEvtTime(NULL) 127 123 { 128 124 … … 135 131 AddToBranchList("MRawEvtData.fLoGainFadcSamples"); 136 132 133 Clear(); 134 } 135 136 void MCalibrationCalc::Clear(const Option_t *o) 137 { 138 137 139 SETBIT(fFlags, kUseTimes); 138 140 SETBIT(fFlags, kUseBlindPixelFit); 139 SETBIT(fFlags, kUsePinDiodeFit);140 141 SETBIT(fFlags, kUseCosmicsRejection); 141 142 SETBIT(fFlags, kUseQualityChecks); 142 143 143 } 144 // As long as we don't have the PIN Diode: 145 CLRBIT(fFlags, kUsePinDiodeFit); 146 147 fEvents = 0; 148 fCosmics = 0; 149 fNumHiGainSamples = 0; 150 fNumLoGainSamples = 0; 151 fConversionHiLo = 0; 152 fNumExcludedPixels = 0; 153 154 fColor = kECT1; 155 } 156 144 157 145 158 MCalibrationBlindPix *MCalibrationCalc::GetBlindPixel() const … … 269 282 UInt_t npixels = cam->GetNumPixels(); 270 283 271 fCalibrations->InitSize(npixels);272 273 284 for (UInt_t i=0; i<npixels; i++) 274 285 { … … 570 581 if (!blindpixel.FitCharge()) 571 582 { 572 *fLog << err << dbginf<< "Could not fit the blind pixel! " << endl;573 blindpixel.DrawClone();574 return kFALSE;583 *fLog << warn << "Could not fit the blind pixel! " << endl; 584 *fLog << warn << "Setting bit kBlindPixelMethodValid to FALSE in MCalibrationCam" << endl; 585 fCalibrations->SetBlindPixelMethodValid(kFALSE); 575 586 } 576 587 588 fCalibrations->SetBlindPixelMethodValid(kTRUE); 577 589 blindpixel.DrawClone(); 578 590 } … … 622 634 } 623 635 624 if (TESTBIT(fFlags,kUseBlindPixelFit) )636 if (TESTBIT(fFlags,kUseBlindPixelFit) && fCalibrations->IsBlindPixelMethodValid()) 625 637 { 626 638 … … 631 643 *fLog << err 632 644 << "You can try to calibrate using the MCalibrationCalc::SkipBlindPixelFit()" << endl; 633 return kFALSE;645 fCalibrations->SetBlindPixelMethodValid(kFALSE); 634 646 } 635 647 } 636 648 else 637 *fLog << inf << GetDescriptor() << ": Skipping Blind Pixel Fit " << endl; 649 *fLog << inf << GetDescriptor() << ": Skipping Blind Pixel Calibration! " << endl; 650 651 652 if (TESTBIT(fFlags,kUsePinDiodeFit) && fCalibrations->IsPINDiodeMethodValid()) 653 { 654 655 if (!fCalibrations->CalcNumPhotInsidePlexiglass()) 656 { 657 *fLog << err 658 << "Could not calculate the number of photons from the blind pixel " << endl; 659 *fLog << err 660 << "You can try to calibrate using the MCalibrationCalc::SkipPINDiodeFit()" << endl; 661 fCalibrations->SetPINDiodeMethodValid(kFALSE); 662 } 663 } 664 else 665 *fLog << inf << GetDescriptor() << ": Skipping PIN Diode Calibration! " << endl; 638 666 639 667 fCalibrations->SetReadyToSave(); -
trunk/MagicSoft/Mars/mcalib/MCalibrationCalc.h
r2904 r2943 62 62 TString fExcludedPixelsFile; 63 63 UInt_t fNumExcludedPixels; 64 64 65 enum { kUseTimes, kUseBlindPixelFit, kUsePinDiodeFit, 66 kUseCosmicsRejection, kUseQualityChecks }; 67 65 68 public: 66 69 … … 80 83 MCalibrationCalc(const char *name=NULL, const char *title=NULL); 81 84 82 private: 83 84 enum { kUseTimes, kUseBlindPixelFit, kUsePinDiodeFit, 85 kUseCosmicsRejection, kUseQualityChecks }; 86 87 public: 88 85 void Clear(const Option_t *o=""); 86 89 87 // Skipping parts of the work 90 88 void SkipTime(Bool_t b=kTRUE) … … 98 96 void SkipQualityChecks(Bool_t b=kTRUE) 99 97 {b ? CLRBIT(fFlags, kUseQualityChecks) : SETBIT(fFlags, kUseQualityChecks);} 98 100 99 101 100 // Setters -
trunk/MagicSoft/Mars/mcalib/MCalibrationCam.cc
r2939 r2943 192 192 return; 193 193 } 194 195 void MCalibrationCam::SetBlindPixelMethodValid(const Bool_t b) 196 { 197 198 if (b) 199 SETBIT(fFlags, kBlindPixelMethodValid); 200 else 201 CLRBIT(fFlags, kBlindPixelMethodValid); 202 203 } 204 205 void MCalibrationCam::SetPINDiodeMethodValid(const Bool_t b) 206 { 207 208 if (b) 209 SETBIT(fFlags, kPINDiodeMethodValid); 210 else 211 CLRBIT(fFlags, kPINDiodeMethodValid); 212 213 214 } 215 216 Bool_t MCalibrationCam::IsBlindPixelMethodValid() const 217 { 218 return TESTBIT(fFlags,kBlindPixelMethodValid); 219 } 220 221 Bool_t MCalibrationCam::IsPINDiodeMethodValid() const 222 { 223 return TESTBIT(fFlags,kPINDiodeMethodValid); 224 } 225 194 226 195 227 // -------------------------------------------------------------------------- -
trunk/MagicSoft/Mars/mcalib/MCalibrationCam.h
r2931 r2943 39 39 UInt_t fNumExcludedPixels; 40 40 41 Byte_t fFlags; 42 43 enum { kBlindPixelMethodValid, kPINDiodeMethodValid }; 44 41 45 public: 42 46 … … 58 62 void SetColor(const CalibrationColor_t color) { fColor = color; } 59 63 void SetNumPixelsExcluded(const UInt_t n) { fNumExcludedPixels = n; } 60 64 void SetBlindPixelMethodValid(const Bool_t b = kTRUE); 65 void SetPINDiodeMethodValid(const Bool_t b = kTRUE); 66 61 67 // Getters 62 68 Int_t GetSize() const; … … 75 81 Bool_t IsPixelUsed(Int_t idx) const; 76 82 Bool_t IsPixelFitted(Int_t idx) const; 83 84 Bool_t IsBlindPixelMethodValid() const; 85 Bool_t IsPINDiodeMethodValid() const; 77 86 78 87 // Others
Note:
See TracChangeset
for help on using the changeset viewer.