Ignore:
Timestamp:
02/10/05 02:40:51 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r6328 r6332  
    8383const Byte_t MExtractTimeAndChargeDigitalFilterPeakSearch::fgPeakSearchWindowSize    =  2;
    8484const Int_t  MExtractTimeAndChargeDigitalFilterPeakSearch::fgHiGainFailureLimit      = 10;
    85 const Int_t  MExtractTimeAndChargeDigitalFilterPeakSearch::fgLoGainFailureLimit      = 15;
     85const Int_t  MExtractTimeAndChargeDigitalFilterPeakSearch::fgLoGainFailureLimit      = 25;
    8686// --------------------------------------------------------------------------
    8787//
     
    340340  // Shift the last slice to the right:
    341341  //
    342   const Byte_t rlim = higainfirst + fOffsetRightFromPeak + fWindowSizeHiGain;
     342  const Byte_t rlim = higainfirst + fOffsetRightFromPeak + fWindowSizeHiGain - 1;
    343343  if (rlim <= fHiGainLast+fHiLoLast)
    344344    if (rlim > fHiGainLast)
    345       fHiLoLast   = rlim - fHiGainLast;
     345      {
     346        fHiLoLast   = rlim - fHiGainLast;
     347        fHiGainLast = pixel.GetNumHiGainSamples() - 1;
     348      }
    346349    else
    347350      {
     
    355358    }
    356359 
    357   const Byte_t llim = fHiGainFirst + (Int_t)fOffsetLoGain;
    358   if ( llim >= fLoGainFirst )
    359     fLoGainFirst = llim;
     360  const Byte_t llim = higainfirst + (Int_t)fOffsetLoGain;
     361  if ( llim  >= fLoGainFirst + fOffsetLeftFromPeak)
     362    fLoGainFirst = llim - fOffsetLeftFromPeak;
    360363  else
    361364    fLoGainOutOfRangeLeft++;
     
    364367  // Make sure we will not integrate beyond the lo gain limit:
    365368  //
    366   if (fLoGainFirst+fWindowSizeLoGain+fOffsetRightFromPeak <= pixel.GetNumLoGainSamples())
    367     fLoGainLast = fLoGainFirst+fWindowSizeLoGain+fOffsetRightFromPeak;
     369  const Byte_t lolast = fLoGainFirst+fWindowSizeLoGain+fOffsetRightFromPeak-1; 
     370  if (lolast < pixel.GetNumLoGainSamples())
     371    fLoGainLast = lolast;
    368372  else
    369     fLoGainOutOfRangeRight++;
     373    {
     374      fLoGainOutOfRangeRight++;
     375      //      *fLog << err << (Int_t)higainfirst << "   " << peakpixel << "  " << (int)fLoGainFirst << endl;     
     376    }
     377 
     378  //  *fLog << inf << (int)fHiGainFirst << "  " << (int)higainfirst << "  " << (int)fHiGainLast
     379  //        << "  " << (int)fLoGainFirst << "  " << (int)fLoGainLast << endl;
    370380
    371381  pixel.Reset();
Note: See TracChangeset for help on using the changeset viewer.