Ignore:
Timestamp:
11/30/04 20:14:21 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc

    r5527 r5528  
    209209
    210210  fHiGainSignal.Set(range);
     211
    211212  range = (Int_t)(fLoGainLast - fLoGainFirst + 1);
    212213
     
    324325  // Calculate the sum of the first fWindowSize slices
    325326  //
    326   for (Int_t i=0;i<range-fWindowSizeHiGain;i++)
     327  for (Int_t i=0;i<range-fWindowSizeHiGain+1;i++)
    327328    {
    328329      sum      = 0.;
     
    347348        max_p     = i;
    348349      }
    349     } /*   for (Int_t i=0;i<range-fWindowSizeHiGain;i++) */
     350    } /*   for (Int_t i=0;i<range-fWindowSizeHiGain+1;i++) */
    350351
    351352  time = 0;
     
    384385    const Int_t   ids = max_p + sample;
    385386   
    386     const Float_t pex = ids < 0 ? 0. : ( ids > range ? 0. : fHiGainSignal[ids]);
     387    const Float_t pex = ids < 0 ? 0. : ( ids >= range ? 0. : fHiGainSignal[ids]);
    387388    sum              += fAmpWeightsHiGain [idx]*pex;
    388389    time_sum         += fTimeWeightsHiGain[idx]*pex;
     
    405406{
    406407
    407   Int_t range = fLoGainLast - fLoGainFirst + 1;
     408  const Int_t range = fLoGainLast - fLoGainFirst + 1;
     409
    408410  const Byte_t *end = ptr + range;
    409411  Byte_t *p     = ptr;
     
    443445        sat++;
    444446    }
    445  
     447
    446448  //
    447449  // Slide with a window of size fWindowSizeHiGain over the sample
     
    466468  // Calculate the sum of the first fWindowSize slices
    467469  //
    468   for (Int_t i=0;i<range-fWindowSizeLoGain;i++)
     470  for (Int_t i=0;i<range-fWindowSizeLoGain+1;i++)
    469471    {
    470472      sum      = 0.;
     
    489491        max_p     = i;
    490492      }
    491     } /*   for (Int_t i=0;i<range-fWindowSizeLoGain;i++) */
     493    } /*   for (Int_t i=0;i<range-fWindowSizeLoGain+1;i++) */
    492494
    493495  time = 0;
     
    526528    const Int_t   idx = fBinningResolutionLoGain*sample + fBinningResolutionHalfLoGain + t_iter;
    527529    const Int_t   ids = max_p + sample;;
    528     const Float_t pex = ids < 0 ? 0. : ( ids > range ? 0. : fLoGainSignal[ids]);
     530    const Float_t pex = ids < 0 ? 0. : ( ids >= range ? 0. : fLoGainSignal[ids]);
    529531    sum              += fAmpWeightsLoGain [idx]*pex;
    530532    time_sum         += fTimeWeightsLoGain[idx]*pex;
Note: See TracChangeset for help on using the changeset viewer.