Changeset 841 for trunk/MagicSoft
- Timestamp:
- 06/06/01 15:03:45 (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MPedCalcPedRun.cc
r802 r841 74 74 75 75 MRawEvtPixelIter pixel(fRawEvt); 76 const Byte_t HiGainSamples = fRawEvt->GetNumHiGainSamples(); 76 77 77 78 while (pixel.Next()) … … 80 81 81 82 Byte_t *ptr = pixel.GetHiGainFadcSamples(); 82 const Byte_t *end = ptr + fRawEvt->GetNumHiGainSamples();83 const Byte_t *end = ptr + HiGainSamples; 83 84 84 Float_t HiGainPed = PedMeanCalcHiGain(ptr,end );85 Float_t HiGainRms = PedRmsCalcHiGain(ptr,end,HiGainPed );85 Float_t HiGainPed = PedMeanCalcHiGain(ptr,end,HiGainSamples); 86 Float_t HiGainRms = PedRmsCalcHiGain(ptr,end,HiGainPed,HiGainSamples); 86 87 87 Float_t HiGainPedErr = PedMeanErrCalcHiGain(HiGainRms );88 Float_t HiGainRmsErr = PedRmsErrCalcHiGain(HiGainRms );88 Float_t HiGainPedErr = PedMeanErrCalcHiGain(HiGainRms,HiGainSamples); 89 Float_t HiGainRmsErr = PedRmsErrCalcHiGain(HiGainRms,HiGainSamples); 89 90 90 91 (*fPedestals)[pixid].SetPedestal(HiGainPed,HiGainRms); … … 99 100 100 101 101 Float_t MPedCalcPedRun::PedMeanCalcHiGain(Byte_t *ptr, const Byte_t *end )102 Float_t MPedCalcPedRun::PedMeanCalcHiGain(Byte_t *ptr, const Byte_t *end, const Byte_t HiGainSamples) 102 103 { 103 104 Float_t sum=0; … … 106 107 while (ptr != end); 107 108 108 sum = sum/(Int_t) fRawEvt->GetNumHiGainSamples();109 sum = sum/(Int_t)HiGainSamples; 109 110 110 111 return sum; … … 112 113 113 114 114 Float_t MPedCalcPedRun::PedRmsCalcHiGain(Byte_t *ptr, const Byte_t *end, Float_t HiGainPed )115 Float_t MPedCalcPedRun::PedRmsCalcHiGain(Byte_t *ptr, const Byte_t *end, Float_t HiGainPed, const Byte_t HiGainSamples) 115 116 { 116 117 … … 118 119 119 120 do{ 120 rms = rms + pow((*ptr - HiGainPed),2);121 rms = rms + (*ptr - HiGainPed)*(*ptr - HiGainPed); 121 122 *ptr++; 122 123 }while (ptr != end); 123 124 124 rms = sqrt((Float_t)rms/((Int_t) fRawEvt->GetNumHiGainSamples()-1));125 rms = sqrt((Float_t)rms/((Int_t)HiGainSamples-1)); 125 126 126 127 return rms; … … 128 129 129 130 130 Float_t MPedCalcPedRun::PedMeanErrCalcHiGain(Float_t HiGainRms ){131 return HiGainRms/sqrt((Int_t) fRawEvt->GetNumHiGainSamples());131 Float_t MPedCalcPedRun::PedMeanErrCalcHiGain(Float_t HiGainRms, const Byte_t HiGainSamples){ 132 return HiGainRms/sqrt((Int_t)HiGainSamples); 132 133 } 133 134 134 135 135 Float_t MPedCalcPedRun::PedRmsErrCalcHiGain(Float_t HiGainRms ){136 return HiGainRms/sqrt(2*(Int_t) fRawEvt->GetNumHiGainSamples());136 Float_t MPedCalcPedRun::PedRmsErrCalcHiGain(Float_t HiGainRms, const Byte_t HiGainSamples){ 137 return HiGainRms/sqrt(2*(Int_t)HiGainSamples); 137 138 } 138 139
Note:
See TracChangeset
for help on using the changeset viewer.