Changeset 2855 for trunk/MagicSoft/Mars/mcalib/MCalibrate.cc
- Timestamp:
- 01/20/04 11:34:33 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrate.cc
r2849 r2855 125 125 */ 126 126 127 const UInt_t imaxnumpix = fSignals->GetSize();127 UInt_t numpix = fSignals->GetSize(); 128 128 129 for (UInt_t pixidx=0; pixidx<imaxnumpix; pixidx++)129 for (UInt_t pixid=0; pixid< numpix; pixid++) 130 130 { 131 const MCalibrationPix &pix = (*fCalibrations)[pixidx]; 131 const MCalibrationPix &pix = (*fCalibrations)[pixid]; 132 133 if (!pix.IsFitValid()) 134 continue; 132 135 133 if (!pix.IsFitValid()) 134 continue; 136 MExtractedSignalPix &sig = (*fSignals)[pixid]; 137 138 Float_t signal; 139 Float_t signalErr = 0.; 140 141 if (sig.IsLoGainUsed()) 142 { 143 signal = sig.GetExtractedSignalLoGain()*pix.GetConversionHiLo(); 144 signalErr = signal*pix.GetConversionHiLoError(); 145 } 146 else 147 { 148 signal = sig.GetExtractedSignalHiGain(); 149 } 150 151 // Float_t calibrationConversionFactor = pix.GetMeanConversionFFactorMethod(); 152 const Float_t calibrationConversionFactor = pix.GetMeanConversionBlindPixelMethod(); 153 const Float_t calibrationConversionFactorError = pix.GetErrorConversionBlindPixelMethod(); 154 155 const Float_t nphot = signal*calibrationConversionFactor; 135 156 136 MExtractedSignalPix &sig = (*fSignals)[pixidx]; 157 Float_t nphotErr = signal*calibrationConversionFactorError 158 *signal*calibrationConversionFactorError; 137 159 138 Float_t signal; 139 Float_t signalErr = 0.; 140 141 if (sig.IsLoGainUsed()) 142 { 143 signal = sig.GetExtractedSignalLoGain()*pix.GetConversionHiLo(); 144 signalErr = signal*pix.GetConversionHiLoError(); 145 } 146 else 147 { 148 signal = sig.GetExtractedSignalHiGain(); 149 } 150 151 // Float_t calibrationConversionFactor = pix.GetMeanConversionFFactorMethod(); 152 const Float_t calibrationConversionFactor = pix.GetMeanConversionBlindPixelMethod(); 153 const Float_t calibrationConversionFactorError = pix.GetErrorConversionBlindPixelMethod(); 154 155 const Float_t nphot = signal*calibrationConversionFactor; 156 Float_t nphotErr = signal*calibrationConversionFactorError 157 *signal*calibrationConversionFactorError; 158 nphotErr += signalErr*calibrationConversionFactor 159 *signalErr*calibrationConversionFactor; 160 161 nphotErr = TMath::Sqrt(nphotErr); 162 163 164 fCerPhotEvt->AddPixel(pixidx, nphot, nphotErr); 165 166 if (sig.GetNumLoGainSaturated() > 0) 167 (*fCerPhotEvt)[pixidx].SetPixelSaturated(); 160 nphotErr += signalErr*calibrationConversionFactor 161 *signalErr*calibrationConversionFactor; 162 163 nphotErr = TMath::Sqrt(nphotErr); 164 165 fCerPhotEvt->AddPixel(pixid, nphot, nphotErr); 166 167 if (sig.GetNumLoGainSaturated() > 0) 168 (*fCerPhotEvt)[pixid].SetPixelSaturated(); 168 169 } 169 170 171 172 173 170 171 fCerPhotEvt->FixSize(); 172 fCerPhotEvt->SetReadyToSave(); 173 174 return kTRUE; 174 175 }
Note:
See TracChangeset
for help on using the changeset viewer.