Changeset 5743 for trunk/MagicSoft


Ignore:
Timestamp:
01/08/05 12:32:08 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r5723 r5743  
    260260      end = logain + fHiLoLast;
    261261
    262       ids = fHiGainFirst;
     262      ids = fHiGainFirst + range;
    263263      sample = fHiGainSignal.GetArray();
    264264      while (logain<end)
     
    266266
    267267          *sample++ = (Float_t)*logain - pedmean[(ids++ + abflag) & 0x1];
    268           range++;
    269268
    270269          if (*logain > max)
     
    276275          if (*logain++ >= fSaturationLimit)
    277276            sat++;
    278         }
    279     }
    280 
    281   //
    282   // allow one saturated slice
     277
     278          range++;
     279        }
     280    }
     281
     282  //
     283  // allow no saturated slice
    283284  //
    284285  if (sat > 0)
     
    291292  if (IsNoiseCalculation())
    292293    {
    293       if (fRandomIter == 10)
     294      if (fRandomIter == fBinningResolution)
    294295        fRandomIter = 0;
    295296      for (Int_t ids=0; ids < fWindowSizeHiGain; ids++)
    296       {
     297        {
    297298          const Int_t   idx = fBinningResolutionHiGain*ids + fRandomIter;
    298299          sum              += fAmpWeightsHiGain [idx]*fHiGainSignal[ids];
     
    425426
    426427  //
    427   // Slide with a window of size fWindowSizeHiGain over the sample
     428  // Slide with a window of size fWindowSizeLoGain over the sample
    428429  // and multiply the entries with the corresponding weights
    429430  //
    430431  if (IsNoiseCalculation())
    431432    {
     433      if (fRandomIter == fBinningResolutionLoGain)
     434        fRandomIter = 0;
    432435      for (Int_t ids=0; ids < fWindowSizeLoGain; ids++)
    433436        {
    434           const Int_t   idx = fBinningResolutionHiGain*ids + fRandomIter;
     437          const Int_t   idx = fBinningResolutionLoGain*ids + fRandomIter;
    435438          sum              += fAmpWeightsLoGain [idx]*fLoGainSignal[ids];
    436439        }
Note: See TracChangeset for help on using the changeset viewer.