Changeset 3029
- Timestamp:
- 02/05/04 17:28:52 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3028 r3029 17 17 * mcalib/MCalibrationCam.cc 18 18 - include relative times to display with GetPixelContent 19 20 * mcalib/MCalibrationCalc.[h,cc] 21 - flag to skip Hi-Lo Calibration 22 - Hi-LO Graph not filled any more after overflow of ChargevsN 23 - fill the blind pixel differently from the rest of pixels 19 24 20 25 -
trunk/MagicSoft/Mars/mcalib/MCalibrationBlindPix.h
r2931 r3029 54 54 MHCalibrationBlindPixel *GetHist() { return fHist; } 55 55 56 Bool_t IsFitOK() const { return fHist->IsFitOK(); }56 Bool_t IsFitOK() const; 57 57 58 58 // Fill histos 59 Bool_t FillCharge( Float_t q) const { return fHist->FillBlindPixelCharge(q); }60 Bool_t FillTime( Float_t t) const { return fHist->FillBlindPixelTime(t); }61 Bool_t FillRChargevsTime( Float_t rq, Int_t t) const { return fHist->FillBlindPixelChargevsN(rq,t); }59 Bool_t FillCharge(const Float_t q); 60 Bool_t FillTime(const Float_t t); 61 Bool_t FillRChargevsTime(const Float_t rq, const Int_t t); 62 62 63 63 // Fits -
trunk/MagicSoft/Mars/mcalib/MCalibrationCalc.cc
r3019 r3029 68 68 // fits) 69 69 // 70 // Hi-Gain vs. Lo-Gain Calibration (very memory-intensive) 71 // can be skipped with the command: 72 // MalibrationCam::SkipHiLoGainCalibration() 73 // 70 74 // Input Containers: 71 75 // MRawEvtData … … 116 120 const Int_t MCalibrationCalc::fBlindPixelId = 559; 117 121 const Int_t MCalibrationCalc::fPINDiodeId = 9999; 122 const Byte_t MCalibrationCalc::fgSaturationLimit = 254; 123 const Byte_t MCalibrationCalc::fgBlindPixelFirst = 3; 124 const Byte_t MCalibrationCalc::fgBlindPixelLast = 12; 118 125 119 126 // -------------------------------------------------------------------------- … … 144 151 SETBIT(fFlags, kUseCosmicsRejection); 145 152 SETBIT(fFlags, kUseQualityChecks); 153 SETBIT(fFlags, kHiLoGainCalibration); 146 154 147 155 CLRBIT(fFlags, kBlindPixelOverFlow); … … 496 504 } 497 505 } 498 } 506 } /* if Use Times */ 499 507 500 508 switch(pixid) … … 502 510 503 511 case fBlindPixelId: 504 505 if (!blindpixel.FillCharge(sumhi)) 506 *fLog << warn << 507 "Overflow or Underflow occurred filling Blind Pixel sum = " << sumhi << endl; 508 509 if (TESTBIT(fFlags,kUseTimes)) 512 513 if (TESTBIT(fFlags,kUseBlindPixelFit)) 510 514 { 511 if (!blindpixel.FillTime(reltime)) 515 516 Float_t blindpixelsum = 0.; 517 // 518 // We need a dedicated signal extractor for the blind pixel 519 // 520 MPedestalPix &ped = (*fPedestals)[pixid]; 521 if (!CalcSignalBlindPixel(pixel.GetHiGainSamples(), blindpixelsum, ped.GetPedestal())) 522 return kFALSE; 523 524 if (!blindpixel.FillCharge(blindpixelsum)) 512 525 *fLog << warn << 513 "Overflow or Underflow occurred filling Blind Pixel time = " << reltime << endl; 514 } 515 516 if (!TESTBIT(fFlags,kBlindPixelOverFlow)) 517 if (!blindpixel.FillRChargevsTime(sumhi,fEvents)) 518 { 526 "Overflow or Underflow occurred filling Blind Pixel sum = " << blindpixelsum << endl; 527 528 if (TESTBIT(fFlags,kUseTimes)) 529 { 530 if (!blindpixel.FillTime(reltime)) 531 *fLog << warn << 532 "Overflow or Underflow occurred filling Blind Pixel time = " << reltime << endl; 533 } 534 535 if (!TESTBIT(fFlags,kBlindPixelOverFlow)) 536 if (!blindpixel.FillRChargevsTime(blindpixelsum,fEvents)) 537 { 538 *fLog << warn << 539 "Overflow or Underflow occurred filling Blind Pixel eventnr = " << fEvents << endl; 540 SETBIT(fFlags,kBlindPixelOverFlow); 541 } 542 } /* if use blind pixel */ 543 544 break; 545 546 case fPINDiodeId: 547 548 if (TESTBIT(fFlags,kUsePinDiodeFit)) 549 { 550 551 if (!pindiode.FillCharge(sumhi)) 519 552 *fLog << warn << 520 "Overflow or Underflow occurred filling Blind Pixel eventnr = " << fEvents << endl; 521 SETBIT(fFlags,kBlindPixelOverFlow); 522 } 553 "Overflow or Underflow occurred filling PINDiode: sum = " << sumhi << endl; 554 555 if (TESTBIT(fFlags,kUseTimes)) 556 { 557 if (!pindiode.FillAbsTime(abstime)) 558 *fLog << warn << 559 "Overflow or Underflow occurred filling PINDiode abs. time = " << abstime << endl; 560 if (!pindiode.FillRelTime(reltime)) 561 *fLog << warn << 562 "Overflow or Underflow occurred filling PINDiode rel. time = " << reltime << endl; 563 } 564 565 if (!TESTBIT(fFlags,kPINDiodeOverFlow)) 566 if (!pindiode.FillRChargevsTime(sumhi,fEvents)) 567 { 568 *fLog << warn 569 << "Overflow or Underflow occurred filling PINDiode: eventnr = " 570 << fEvents << endl; 571 SETBIT(fFlags,kPINDiodeOverFlow); 572 } 573 574 } /* if use PIN Diode */ 523 575 524 576 break; 525 526 case fPINDiodeId: 527 528 if (!pindiode.FillCharge(sumhi)) 529 *fLog << warn << 530 "Overflow or Underflow occurred filling PINDiode: sum = " << sumhi << endl; 531 532 if (TESTBIT(fFlags,kUseTimes)) 533 { 534 if (!pindiode.FillAbsTime(abstime)) 535 *fLog << warn << 536 "Overflow or Underflow occurred filling PINDiode abs. time = " << abstime << endl; 537 if (!pindiode.FillRelTime(reltime)) 538 *fLog << warn << 539 "Overflow or Underflow occurred filling PINDiode rel. time = " << reltime << endl; 540 } 541 542 if (!TESTBIT(fFlags,kPINDiodeOverFlow)) 543 if (!pindiode.FillRChargevsTime(sumhi,fEvents)) 544 { 545 *fLog << warn 546 << "Overflow or Underflow occurred filling PINDiode: eventnr = " 547 << fEvents << endl; 548 SETBIT(fFlags,kPINDiodeOverFlow); 549 } 550 break; 551 577 552 578 default: 553 554 pix.FillChargesInGraph(sumhi,sumlo); 555 579 556 580 if (!TESTBIT(fFlags,kLoGainOverFlow)) 557 581 if (!pix.FillRChargevsTimeLoGain(sumlo,fEvents)) … … 561 585 << fEvents << endl; 562 586 SETBIT(fFlags,kLoGainOverFlow); 587 SkipHiLoGainCalibration(); 563 588 } 564 589 … … 570 595 << fEvents << endl; 571 596 SETBIT(fFlags,kHiGainOverFlow); 597 SkipHiLoGainCalibration(); 572 598 } 573 599 574 600 601 if (TESTBIT(fFlags,kHiLoGainCalibration)) 602 pix.FillChargesInGraph(sumhi,sumlo); 603 575 604 if (sig.IsLoGainUsed()) 576 605 { … … 670 699 // Set the corresponding values 671 700 // 672 const Float_t nslices = (Float_t)fSignals->GetNumUsedFADCSlices(); 701 const Float_t nslices = (Float_t)(fgBlindPixelLast-fgBlindPixelFirst+1); 702 const Float_t sqrslice = TMath::Sqrt(nslices); 673 703 const ULong_t nentries = fPedestals->GetTotalEntries(); 674 704 675 705 const Float_t peddiff = (pedhist.GetChargeMean()-pedpix.GetPedestal())*nslices; 676 677 const Float_t sqrslice = TMath::Sqrt(nslices);678 706 679 707 Float_t pederr = pedhist.GetChargeMeanErr()*pedhist.GetChargeMeanErr(); … … 721 749 722 750 // 723 // get the pedestals724 //725 const Float_t ped = (*fPedestals)[pixid].GetPedestal() * fNumHiGainSamples;726 const Float_t prms = (*fPedestals)[pixid].GetPedestalRms() * fSqrtHiGainSamples;727 728 //729 // set them in the calibration camera730 //731 pix.SetPedestal(ped,prms);732 733 734 //735 751 // Check if the pixel has been excluded from the fits 736 752 // 737 753 if (pix.IsExcluded()) 738 754 continue; 755 756 // 757 // get the pedestals 758 // 759 const Float_t ped = (*fPedestals)[pixid].GetPedestal(); 760 const Float_t prms = (*fPedestals)[pixid].GetPedestalRms(); 761 762 // 763 // set them in the calibration camera 764 // 765 pix.SetPedestal(ped,prms,(Float_t)fNumHiGainSamples,(Float_t)fNumLoGainSamples); 739 766 740 767 // … … 793 820 } 794 821 822 Bool_t MCalibrationCalc::CalcSignalBlindPixel(Byte_t *ptr, Float_t &signal, const Float_t ped) const 823 { 824 825 Byte_t *start = ptr + fgBlindPixelFirst; 826 Byte_t *end = ptr + fgBlindPixelLast; 827 828 Byte_t sum = 0; 829 Int_t sat = 0; 830 831 ptr = start; 832 833 while (ptr<end) 834 { 835 sum += *ptr; 836 837 if (*ptr++ >= fgSaturationLimit) 838 sat++; 839 } 840 841 if (sat) 842 { 843 *fLog << err << "HI Gain Saturation occurred in the blind pixel! " 844 << " Do not know yet how to treat this ... aborting " << endl; 845 return kFALSE; 846 } 847 848 signal = (Float_t)sum - ped*(Float_t)(fgBlindPixelLast-fgBlindPixelFirst+1); 849 850 return kTRUE; 851 } -
trunk/MagicSoft/Mars/mcalib/MCalibrationCalc.h
r3019 r3029 41 41 static const Int_t fBlindPixelId; // ID of the blind pixel 42 42 static const Int_t fPINDiodeId; // ID of the PIN Diode 43 static const Byte_t fgSaturationLimit; // Saturation of Hi Gain 44 static const Byte_t fgBlindPixelFirst; // First FADC slice blind pixel 45 static const Byte_t fgBlindPixelLast; // Last FADC slice blind pixel 43 46 44 47 MPedestalCam *fPedestals; // Pedestals of all pixels in the camera … … 68 71 enum { kUseTimes, kUseBlindPixelFit, kUsePinDiodeFit, 69 72 kUseCosmicsRejection, kUseQualityChecks, 73 kHiLoGainCalibration, 70 74 kBlindPixelOverFlow, kPINDiodeOverFlow, 71 75 kHiGainOverFlow, kLoGainOverFlow }; … … 83 87 Int_t Process(); 84 88 Int_t PostProcess(); 89 90 Bool_t CalcSignalBlindPixel(Byte_t *ptr, Float_t &signal, const Float_t ped) const; 85 91 86 92 public: … … 101 107 void SkipQualityChecks(Bool_t b=kTRUE) 102 108 {b ? CLRBIT(fFlags, kUseQualityChecks) : SETBIT(fFlags, kUseQualityChecks);} 109 void SkipHiLoGainCalibration(Bool_t b=kTRUE) 110 {b ? CLRBIT(fFlags, kHiLoGainCalibration) : SETBIT(fFlags, kHiLoGainCalibration);} 103 111 104 112 -
trunk/MagicSoft/Mars/mcalib/MCalibrationCam.cc
r3012 r3029 267 267 { 268 268 269 Float_t rsigma = pix->GetRSigmaSquare();270 if (rsigma > 0.)271 rsigma = TMath::Sqrt(rsigma);272 273 269 *fLog << all << pix->GetPixId() << " Pedestals: " << pix->GetPed() << " +- " 274 270 << pix->GetPedRms() << " Reduced Charge: " << pix->GetCharge() << " +- " 275 << pix->GetSigmaCharge() << " Reduced Sigma: " << rsigma271 << pix->GetSigmaCharge() << " Reduced Sigma: " << pix->GetRSigmaCharge() 276 272 << " Nr Phe's: " << pix->GetPheFFactorMethod() << endl; 277 273 id++; 278 274 } 279 275 } … … 293 289 { 294 290 295 Float_t rsigma = pix->GetRSigmaSquare();296 if (rsigma > 0.)297 rsigma = TMath::Sqrt(rsigma);298 299 291 *fLog << all << pix->GetPixId() << " Pedestals: " << pix->GetPed() << " +- " 300 292 << pix->GetPedRms() << " Reduced Charge: " << pix->GetCharge() << " +- " 301 << pix->GetSigmaCharge() << " Reduced Sigma: " << rsigma<< endl;293 << pix->GetSigmaCharge() << " Reduced Sigma: " << pix->GetRSigmaCharge() << endl; 302 294 id++; 303 295 } … … 420 412 if (!(*this)[idx].IsTimeFitValid()) 421 413 return kFALSE; 422 val = (*this)[idx].Get Time() * gkTimeSliceWidth;414 val = (*this)[idx].GetMeanTimeOffset() * gkTimeSliceWidth; 423 415 break; 424 416 case 6: 425 417 if (!(*this)[idx].IsTimeFitValid()) 426 418 return kFALSE; 427 val = (*this)[idx].Get SigmaTime() * gkTimeSliceWidth;419 val = (*this)[idx].GetTimingPrecision() * gkTimeSliceWidth; 428 420 break; 429 421 case 7: … … 439 431 break; 440 432 case 10: 441 if ((*this)[idx].GetRSigmaSquare() > 0.) 442 val = TMath::Sqrt((*this)[idx].GetRSigmaSquare()); 443 else 444 val = -1.; 433 val = (*this)[idx].GetRSigmaCharge(); 445 434 break; 446 435 case 11: … … 469 458 break; 470 459 case 17: 471 if ( (*this)[idx].GetRSigmaSquare() > 0. && (*this)[idx].GetCharge() > 0. ) 472 val = TMath::Sqrt((*this)[idx].GetRSigmaSquare()) / (*this)[idx].GetCharge(); 473 else 474 val = -1.; 460 val = (*this)[idx].GetRSigmaCharge() / (*this)[idx].GetCharge(); 475 461 break; 476 462 case 18:
Note:
See TracChangeset
for help on using the changeset viewer.