Changeset 4119 for trunk/MagicSoft


Ignore:
Timestamp:
05/22/04 02:54:16 (21 years ago)
Author:
moralejo
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r4116 r4119  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20
     21 2004/05/22: Abelardo Moralejo
     22
     23   * msignal/MExtractFixedWindowPeakSearch.[h,cc]
     24     - changed name of variable fOffsetFromPeak to fOffsetFromWindow
     25       to avoid confusion.
     26     - introduced initialization to 0 of startslice and sat in FindPeak
     27     - changed initialization of maxsumhi in Process from 0 to -1e6
    2028
    2129 2004/05/20: Raquel de los Reyes
  • trunk/MagicSoft/Mars/msignal/MExtractFixedWindowPeakSearch.cc

    r4116 r4119  
    8282const Byte_t MExtractFixedWindowPeakSearch::fgLoGainWindowSize     = 6;
    8383const Byte_t MExtractFixedWindowPeakSearch::fgPeakSearchWindowSize = 4;
    84 const Byte_t MExtractFixedWindowPeakSearch::fgOffsetFromPeak       = 1;
     84const Byte_t MExtractFixedWindowPeakSearch::fgOffsetFromWindow     = 1;
    8585// --------------------------------------------------------------------------
    8686//
     
    9393//
    9494// Calls:
    95 // - SetOffsetFromPeak()
     95// - SetOffsetFromWindow()
    9696// - SetRange(fgHiGainFirst, fgHiGainLast, fgLoGainFirst, fgLoGainLast)
    9797//
     
    105105  fTitle = title ? title : "Task to extract the signal from the FADC slices";
    106106
    107   SetOffsetFromPeak();
     107  SetOffsetFromWindow();
    108108  SetRange(fgHiGainFirst, fgHiGainLast, fgLoGainFirst, fgLoGainLast);
    109109}
     
    239239// saturated slices.
    240240//
    241 void MExtractFixedWindowPeakSearch::FindPeak(Byte_t *ptr, Byte_t window, Byte_t &startslice,
    242                                Int_t &max, Int_t &sat) const
     241void MExtractFixedWindowPeakSearch::FindPeak(Byte_t *ptr, Byte_t window, Byte_t &startslice, Int_t &max, Int_t &sat) const
    243242{
    244243
    245244  const Byte_t *end = ptr + fHiGainLast - fHiGainFirst + 1;
    246245
     246  sat = 0;
     247  startslice = 0;
    247248  Int_t sum=0;
    248249
     
    339340  // Calculate the sum of the "window" slices starting in ptr
    340341  //
    341   sum = 0;
    342   sat = 0;
    343342  Byte_t *p = ptr;
    344343
     
    359358// "startslice" will mark the slice at which the highest sum begins for that pixel.
    360359// Then define the beginning of the integration window for ALL pixels as the slice
    361 // before that: startslice-fOffsetFromPeak, unless of course startslice-fOffsetFromPeak<=0,
     360// before that: startslice-fOffsetFromWindow, unless of course startslice-fOffsetFromWindow<=0,
    362361// in which case we start at 0. We will also check that the integration window does not
    363362// go beyond the FADC limits.
     
    369368
    370369  Int_t sat;
    371   Int_t maxsumhi = 0;
     370  Int_t maxsumhi = -1000000;
    372371  Byte_t startslice;
    373372  Byte_t hiGainFirst = 0;
     
    385384        {
    386385          maxsumhi = sumhi;
    387           if ((startslice-fOffsetFromPeak) > 0)
    388             hiGainFirst = fHiGainFirst + startslice - fOffsetFromPeak;
     386          if ((startslice-fOffsetFromWindow) > 0)
     387            hiGainFirst = fHiGainFirst + startslice - fOffsetFromWindow;
    389388          else
    390389            hiGainFirst = fHiGainFirst;
  • trunk/MagicSoft/Mars/msignal/MExtractFixedWindowPeakSearch.h

    r3951 r4119  
    1717  static const Byte_t fgLoGainWindowSize;     // Default for fWindowSizeLoGain (now set to: 6)
    1818  static const Byte_t fgPeakSearchWindowSize; // Default for fPeakSearchWindowSize (now set to: 4)
    19   static const Byte_t fgOffsetFromPeak;       // Default for fOffsetFromPeak   (now set to: 2)
     19  static const Byte_t fgOffsetFromWindow;     // Default for fOffsetFromWindow   (now set to: 2)
    2020 
    2121  Byte_t  fWindowSizeHiGain;     // Number of Hi Gain slices in window
    2222  Byte_t  fWindowSizeLoGain;     // Number of Lo Gain slices in window
    2323  Byte_t  fPeakSearchWindowSize; // Size of FADC window in the search for the highest peak of all pixels.
    24   Byte_t  fOffsetFromPeak;       // Number of slices to start extraction from global peak
     24  Byte_t  fOffsetFromWindow;     // Number of slices to start extraction before search window
    2525
    2626  void   FindSignalHiGain(Byte_t *ptr, Byte_t *logain, Int_t &sum, Byte_t &sat) const;
     
    3939    void SetWindows(Byte_t windowh=fgHiGainWindowSize, Byte_t windowl=fgLoGainWindowSize,
    4040                    Byte_t peaksearchwindow=fgPeakSearchWindowSize);
    41     void SetOffsetFromPeak(Byte_t offset=fgOffsetFromPeak)    {  fOffsetFromPeak = offset; }
     41    void SetOffsetFromWindow(Byte_t offset=fgOffsetFromWindow)  {  fOffsetFromWindow = offset; }
    4242   
    4343    ClassDef(MExtractFixedWindowPeakSearch, 0) // Signal Extractor for fixed size trigger-corrected extraction window
Note: See TracChangeset for help on using the changeset viewer.