Ignore:
Timestamp:
04/29/04 14:19:02 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r3883 r3885  
    3333//  contents.
    3434//
     35//  Call: SetRange(higainfirst, higainlast, logainfirst, logainlast)
     36//  to modify the ranges in which the window is allowed to move.
     37//  Defaults are:
     38//
     39//   fHiGainFirst =  fgHiGainFirst =  0
     40//   fHiGainLast  =  fgHiGainLast  =  14
     41//   fLoGainFirst =  fgLoGainFirst =  3
     42//   fLoGainLast  =  fgLoGainLast  =  14
     43//
     44//  Call: SetWindowSize(windowhigain, windowlogain)
     45//  to modify the sliding window widths. Windows have to be an even number.
     46//  In case of odd numbers, the window will be modified.
     47//
     48//  Defaults are:
     49//
     50//   fHiGainWindowSize = fgHiGainWindowSize = 6
     51//   fLoGainWindowSize = fgLoGainWindowSize = 6
     52//
    3553//////////////////////////////////////////////////////////////////////////////
    3654#include "MExtractSlidingWindow.h"
     
    4563using namespace std;
    4664
    47 const Byte_t MExtractSlidingWindow::fgHiGainFirst      = 3;
     65const Byte_t MExtractSlidingWindow::fgHiGainFirst      = 0;
    4866const Byte_t MExtractSlidingWindow::fgHiGainLast       = 14;
    4967const Byte_t MExtractSlidingWindow::fgLoGainFirst      = 3;
     
    5573// Default constructor.
    5674//
     75// Sets:
     76// - fWindowSizeHiGain to fgWindowSizeHiGain
     77// - fWindowSizeLoGain to fgWindowSizeLoGain
     78//
     79// Calls:
     80// - SetRange(fgHiGainFirst, fgHiGainLast, fgLoGainFirst, fgLoGainLast)
     81//
    5782MExtractSlidingWindow::MExtractSlidingWindow(const char *name, const char *title)
    5883    : fWindowSizeHiGain(fgHiGainWindowSize),
     
    6691}
    6792
     93// --------------------------------------------------------------------------
     94//
     95// SetRange:
     96//
     97// Calls:
     98// - MExtractor::SetRange(hifirst,hilast,lofirst,lolast);
     99// - SetWindowSize(fWindowSizeHiGain,fWindowSizeLoGain);
     100//
    68101void MExtractSlidingWindow::SetRange(Byte_t hifirst, Byte_t hilast, Byte_t lofirst, Byte_t lolast)
    69102{
     
    79112}
    80113
     114// --------------------------------------------------------------------------
     115//
     116// Checks:
     117// - if a window is odd, subtract one
     118// - if a window is bigger than the one defined by the ranges, set it to the available range
     119// - if a window is smaller than 2, set it to 2
     120//
     121// Sets:
     122// - fNumHiGainSamples to: (Float_t)fWindowSizeHiGain
     123// - fNumLoGainSamples to: (Float_t)fWindowSizeLoGain
     124// - fSqrtHiGainSamples to: TMath::Sqrt(fNumHiGainSamples)
     125// - fSqrtLoGainSamples to: TMath::Sqrt(fNumLoGainSamples) 
     126// 
    81127void MExtractSlidingWindow::SetWindowSize(Byte_t windowh, Byte_t windowl)
    82128{
     
    137183
    138184
     185// --------------------------------------------------------------------------
     186//
     187// FindSignalHiGain:
     188//
     189// - Loop from ptr to (ptr+fWindowSizeHiGain)
     190// - Sum up contents of *ptr
     191// - If *ptr is greater than fSaturationLimit, raise sat by 1
     192// - Loop from (ptr+fWindowSizeHiGain) to (ptr+fHiGainLast-fHiGainFirst)
     193// - Sum the content of *(ptr+fWindowSizeHiGain) and subtract *ptr
     194// - Check if the sum has become bigger and store it in case yes.
     195//
    139196void MExtractSlidingWindow::FindSignalHiGain(Byte_t *ptr, Int_t &max, Byte_t &sat) const
    140197{
     
    177234
    178235
     236// --------------------------------------------------------------------------
     237//
     238// FindSignalLoGain:
     239//
     240// - Loop from ptr to (ptr+fWindowSizeLoGain)
     241// - Sum up contents of *ptr
     242// - If *ptr is greater than fSaturationLimit, raise sat by 1
     243// - Loop from (ptr+fWindowSizeLoGain) to (ptr+fLoGainLast-fLoGainFirst)
     244// - Sum the content of *(ptr+fWindowSizeLoGain) and subtract *ptr
     245// - Check if the sum has become bigger and store it in case yes.
     246//
    179247void MExtractSlidingWindow::FindSignalLoGain(Byte_t *ptr, Int_t &max, Byte_t &sat) const
    180248{
Note: See TracChangeset for help on using the changeset viewer.