Changeset 7876 for trunk/MagicSoft/Mars/mcalib
- Timestamp:
- 08/16/06 16:11:32 (18 years ago)
- Location:
- trunk/MagicSoft/Mars/mcalib
- Files:
-
- 2 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(); -
trunk/MagicSoft/Mars/mcalib/MCalibrateRelTimes.cc
r7843 r7876 132 132 133 133 (*fArrivalTime)[idx].SetArrivalTime(signal-offset); 134 (*fArrivalTime)[idx].SetLoGainUsed(sig.IsLoGainUsed());135 134 136 // FIXME: This is just a workaround to set pixels to bad for which137 // the extraction of hi- and lo-gain failed, should be moved to138 // the extraction139 if ( !sig.IsLoGainValid() && !sig.IsHiGainValid())135 // FIXME: Is this necessary or explicitly done by the signal- 136 // extractor (may depend on the fact whether independent 137 // extractor are or can be used for signal and arrival time) 138 if (fBadPixels && !sig.IsArrivalTimeValid()) 140 139 (*fBadPixels)[idx].SetUnsuitable(MBadPixelsPix::kUnsuitableEvt); 141 140 }
Note:
See TracChangeset
for help on using the changeset viewer.