Changeset 5969 for trunk/MagicSoft/Mars
- Timestamp:
- 01/24/05 15:24:19 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc
r5927 r5969 334 334 } 335 335 336 dtime = 1.0;337 const Int_t uplim = range-fWindowSizeHiGain+1;338 339 if (maxpos > uplim)340 {341 time = 1.+uplim;342 for (Int_t ids=0; ids < fWindowSizeHiGain; ids++)343 {344 const Int_t idx = fArrBinningResHiGain[ids] + fRandomIter;345 sum += fAmpWeightsHiGain [idx]*fHiGainSignal[range-fWindowSizeHiGain+ids];346 }347 return;348 }349 350 maxpos -= 3;351 352 if (maxpos < 0)353 {354 time = 0.;355 for (Int_t ids=0; ids < fWindowSizeHiGain; ids++)356 {357 const Int_t idx = fArrBinningResHiGain[ids] + fRandomIter;358 sum += fAmpWeightsHiGain [idx]*fHiGainSignal[ids];359 }360 return;361 }362 363 336 Float_t time_sum = 0.; 364 337 Float_t fmax = 0.; … … 367 340 368 341 // 369 // Perform first only 3 temptative calculations around the maximum!370 // 371 for (Int_t i= maxpos; i<maxpos+fWindowSizeHiGain+3;i++)342 // Calculate the sum of the first fWindowSize slices 343 // 344 for (Int_t i=0;i<range-fWindowSizeHiGain+1;i++) 372 345 { 373 346 sum = 0.; 374 347 time_sum = 0.; 375 348 376 349 // 377 // Slide with a window of size fWindowSizeHiGain over the sample 350 // Slide with a window of size fWindowSizeHiGain over the sample 378 351 // and multiply the entries with the corresponding weights 379 352 // 380 353 for (Int_t sample=0; sample < fWindowSizeHiGain; sample++) 381 354 { 382 const Int_t idx = f ArrBinningResHalfHiGain[sample];355 const Int_t idx = fBinningResolutionHiGain*sample+fBinningResolutionHalfHiGain; 383 356 const Float_t pex = fHiGainSignal[sample+i]; 384 sum += fAmpWeightsHiGain [idx]*pex; 385 357 sum += fAmpWeightsHiGain [idx]*pex; 358 time_sum += fTimeWeightsHiGain[idx]*pex; 386 359 } 387 360 388 361 if (sum>fmax) 389 362 { 390 391 392 363 fmax = sum; 364 ftime_max = time_sum; 365 max_p = i; 393 366 } 394 } /* for (Int_t i=maxpos;i<maxpos+fWindowSizeHiGain+3;i++) */ 395 396 time = 0; 367 } /* for (Int_t i=0;i<range-fWindowSizeHiGain+1;i++) */ 368 397 369 if (fmax==0) 398 370 return;
Note:
See TracChangeset
for help on using the changeset viewer.