Changeset 5833 for trunk/MagicSoft/Mars/msignal
- Timestamp:
- 01/14/05 10:28:56 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc
r5822 r5833 246 246 247 247 Int_t range = fHiGainLast - fHiGainFirst + 1; 248 Int_t maxpos = 0; 248 249 249 250 const Byte_t *end = ptr + range; 250 251 Byte_t *p = ptr; 251 Byte_t maxpos = 0;252 252 Byte_t max = 0; 253 253 … … 309 309 if (sat > 0) 310 310 return; 311 311 312 312 // 313 313 // Slide with a window of size fWindowSizeHiGain over the sample … … 327 327 } 328 328 329 dtime = 1.0; 330 const Int_t uplim = range-fWindowSizeHiGain+1; 331 332 if (maxpos > uplim) 333 { 334 time = uplim+1; 335 return; 336 } 337 338 maxpos -= 3; 339 340 if (maxpos < 0) 341 { 342 time = 0.; 343 return; 344 } 345 329 346 Float_t time_sum = 0.; 330 347 Float_t fmax = 0.; … … 333 350 334 351 // 335 // Calculate the sum of the first fWindowSize slices336 // 337 for (Int_t i= 0;i<range-fWindowSizeHiGain+1;i++)352 // Perform first only 3 temptative calculations around the maximum! 353 // 354 for (Int_t i=maxpos; i<maxpos+fWindowSizeHiGain+3;i++) 338 355 { 339 356 sum = 0.; … … 358 375 max_p = i; 359 376 } 360 } /* for (Int_t i= 0;i<range-fWindowSizeHiGain+1;i++) */377 } /* for (Int_t i=maxpos;i<maxpos+fWindowSizeHiGain+3;i++) */ 361 378 362 379 time = 0; … … 419 436 const Byte_t *end = ptr + range; 420 437 Byte_t *p = ptr; 421 Byte_t maxpos = 0;422 Byte_t max = 0;423 424 438 // 425 439 // Prepare the low-gain pedestal … … 438 452 { 439 453 *sample++ = (Float_t)*p - pedmean[(ids++ + abflag) & 0x1]; 440 441 if (*p > max)442 {443 max = *p;444 maxpos = p-ptr;445 }446 454 447 455 if (*p++ >= fSaturationLimit)
Note:
See TracChangeset
for help on using the changeset viewer.