Changeset 7876 for trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc
- Timestamp:
- 08/16/06 16:11:32 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc
r7829 r7876 742 742 for (UInt_t pixidx=0; pixidx<npix; pixidx++) 743 743 { 744 MBadPixelsPix &bpix = (*fBadPixels)[pixidx]; 744 745 745 if (data)746 if (data) 746 747 { 747 748 const MExtractedSignalPix &sig = (*fSignals)[pixidx]; … … 749 750 Float_t signal = 0.; 750 751 Float_t signalErr = 0.; 751 752 if (sig.IsLoGainUsed()) 752 Bool_t ok = kFALSE; 753 754 // If hi-gain is not saturated and has successfully been 755 // extracted use the hi-gain arrival time 756 if (!sig.IsHiGainSaturated() && sig.IsHiGainValid()) 753 757 { 754 if (fHiLoConv[pixidx] < 0.5) 755 { 756 signal = sig.GetExtractedSignalHiGain()*1.5; 757 signalErr = sig.GetExtractedSignalHiGain()*0.5; 758 } 759 else 760 { 761 const Float_t siglo = sig.GetExtractedSignalLoGain(); 762 763 if (siglo > 0.1) // low-gain signal has been extracted successfully 764 { 765 signal = siglo*fHiLoConv [pixidx]; 766 signalErr = siglo*fHiLoConvErr[pixidx]; 767 } 768 else // low-gain signal has not been extracted successfully, get a rough estimate from the high-gain 769 { 770 signal = sig.GetExtractedSignalHiGain()*1.5; 771 signalErr = sig.GetExtractedSignalHiGain()*0.5; 772 } 773 } 758 signal = sig.GetExtractedSignalHiGain(); 759 ok = kTRUE; 774 760 } 775 761 else 776 762 { 777 if (sig.GetExtractedSignalHiGain() <= 9999.) 778 signal = sig.GetExtractedSignalHiGain(); 763 // Use lo-gain if it can be used 764 if (sig.IsLoGainValid() && fHiLoConv[pixidx]>0.5) 765 { 766 signal = sig.GetExtractedSignalLoGain()*fHiLoConv[pixidx]; 767 signalErr = sig.GetExtractedSignalLoGain()*fHiLoConvErr[pixidx]; 768 ok = kTRUE; 769 } 779 770 } 771 772 // In this cases the signal extraction has failed. 773 if (!ok) 774 bpix.SetUnsuitable(MBadPixelsPix::kUnsuitableEvt); 780 775 781 776 const Float_t nphot = signal * fCalibConsts [pixidx]; … … 784 779 fCerPhotEvt->AddPixel(pixidx, nphot, nphotErr); 785 780 786 if (! (*fBadPixels)[pixidx].IsUnsuitable())781 if (!bpix.IsUnsuitable()) 787 782 { 788 783 if (sig.GetNumHiGainSaturated() > 0) … … 812 807 const Float_t mean = (*pedestal)[pixidx].GetPedestal() *pedmeancalib; 813 808 const Float_t rms = (*pedestal)[pixidx].GetPedestalRms()*pedrmscalib; 814 809 815 810 (*pedphot)[pixidx].Set(mean, rms); 816 811 pedphot->SetReadyToSave();
Note:
See TracChangeset
for help on using the changeset viewer.