Changeset 2347
- Timestamp:
- 09/16/03 14:17:22 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2333 r2347 1 1 -*-*- END OF LINE -*-*- 2 3 2003/09/16: Abelardo Moralejo 4 5 * manalysis MCerPhotCalc.[h,cc]: 6 - added the low gain treatment. It has first been implemented by 7 TB, and the version I submit is a slightly modified one. If any 8 high gain FADC slice is saturated, we switch to low gain. If low 9 gain is also saturated, the signal is nevertheless calculated 10 ("truncated" of course), and a warning is displayed reporting 11 the number of saturated pixels in the current event. 12 Fixed also the calculation of the mean pixel pedestal (added 13 variable fSumWeights), which previously would not work correctly 14 in the case that one sets weights different from 0 or 1 in the 15 array fWeight (which was anyway not done up to now, as far as I 16 know). It would be necessary to add to the parameters of the 17 analyzed events the number of saturated pixels in some way. 18 In the MC files produced with camera versions 0.6 or earlier, no 19 low gain is simulated, and saturation of high gain is not 20 correctly implemented, so this should not introduce any change 21 in the analysis of present or old MC files. 2 22 3 23 2003/09/12: Thomas Bretz -
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(); -
trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.h
r2251 r2347 35 35 TArrayF fWeight; // Weights for adding up the ADC slices 36 36 Float_t fSumQuadWeights; 37 Float_t fSumWeights; 37 38 38 39 void SetDefaultWeights();
Note:
See TracChangeset
for help on using the changeset viewer.