Changeset 2347 for trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc
- Timestamp:
- 09/16/03 14:17:22 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc
r2325 r2347 116 116 return kFALSE; 117 117 118 // Calculate quadratic sum of weights: 118 // Calculate sum and quadratic sum of weights: 119 fSumWeights = 0; 119 120 fSumQuadWeights = 0; 120 121 for (Int_t i=0; i<fWeight.GetSize(); i++) 121 fSumQuadWeights += fWeight[i]*fWeight[i]; 122 { 123 fSumWeights += fWeight[i]; 124 fSumQuadWeights += fWeight[i]*fWeight[i]; 125 } 122 126 123 127 fSumQuadWeights = sqrt(fSumQuadWeights); … … 182 186 const Double_t offset = fEnableFix ? ped.GetPedestal()-0.5 : ped.GetPedestal(); 183 187 184 ped.Set(offset*fSum QuadWeights*fSumQuadWeights,188 ped.Set(offset*fSumWeights, 185 189 ped.GetPedestalRms()*fSumQuadWeights); 186 190 } … … 202 206 203 207 MRawEvtPixelIter pixel(fRawEvt); 208 209 Int_t SaturatedPixels = 0; 204 210 205 211 while (pixel.Next()) … … 222 228 Byte_t *ptr = pixel.GetHiGainSamples(); 223 229 224 Float_t nphot = 0; 225 for(Int_t i=0; i<fWeight.GetSize(); i++) 230 Int_t i; 231 Double_t nphot = 0; 232 for (i=0; i<fWeight.GetSize(); i++) 233 { 234 if (ptr[i]==0xff) 235 break; 226 236 nphot += ptr[i]*fWeight[i]; 227 228 nphot -= ped.GetPedestal(); 237 } 238 239 Bool_t SaturatedLG = kFALSE; 240 241 if (i<fWeight.GetSize()) 242 { 243 nphot = 0; 244 245 ptr = pixel.GetLoGainSamples(); 246 if (ptr==NULL) 247 { 248 *fLog << warn << "WARNING - Pixel #" << idx << " saturated but has no lo gains.. skipping!" << endl; 249 return kCONTINUE; 250 } 251 252 for (i=0; i<fWeight.GetSize(); i++) 253 { 254 if (ptr[i]==0xff) 255 SaturatedLG = kTRUE; 256 257 nphot += ptr[i]*fWeight[i]; 258 } 259 260 nphot -= ped.GetPedestal(); 261 nphot *= 10; 262 } 263 else 264 nphot -= ped.GetPedestal(); 229 265 230 266 fCerPhotEvt->AddPixel(idx, nphot, 0); 231 267 232 // FIXME! Handling of Lo Gains is missing! 233 } 268 if (SaturatedLG) 269 SaturatedPixels ++; 270 } 271 272 if (SaturatedPixels > 0) 273 *fLog << warn << "WARNING " << SaturatedPixels << "pixels had saturating low gains..." << endl; 234 274 235 275 fCerPhotEvt->FixSize();
Note:
See TracChangeset
for help on using the changeset viewer.