- Timestamp:
- 04/29/04 14:19:02 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/msignal/MExtractSlidingWindow.cc
r3883 r3885 33 33 // contents. 34 34 // 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 // 35 53 ////////////////////////////////////////////////////////////////////////////// 36 54 #include "MExtractSlidingWindow.h" … … 45 63 using namespace std; 46 64 47 const Byte_t MExtractSlidingWindow::fgHiGainFirst = 3;65 const Byte_t MExtractSlidingWindow::fgHiGainFirst = 0; 48 66 const Byte_t MExtractSlidingWindow::fgHiGainLast = 14; 49 67 const Byte_t MExtractSlidingWindow::fgLoGainFirst = 3; … … 55 73 // Default constructor. 56 74 // 75 // Sets: 76 // - fWindowSizeHiGain to fgWindowSizeHiGain 77 // - fWindowSizeLoGain to fgWindowSizeLoGain 78 // 79 // Calls: 80 // - SetRange(fgHiGainFirst, fgHiGainLast, fgLoGainFirst, fgLoGainLast) 81 // 57 82 MExtractSlidingWindow::MExtractSlidingWindow(const char *name, const char *title) 58 83 : fWindowSizeHiGain(fgHiGainWindowSize), … … 66 91 } 67 92 93 // -------------------------------------------------------------------------- 94 // 95 // SetRange: 96 // 97 // Calls: 98 // - MExtractor::SetRange(hifirst,hilast,lofirst,lolast); 99 // - SetWindowSize(fWindowSizeHiGain,fWindowSizeLoGain); 100 // 68 101 void MExtractSlidingWindow::SetRange(Byte_t hifirst, Byte_t hilast, Byte_t lofirst, Byte_t lolast) 69 102 { … … 79 112 } 80 113 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 // 81 127 void MExtractSlidingWindow::SetWindowSize(Byte_t windowh, Byte_t windowl) 82 128 { … … 137 183 138 184 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 // 139 196 void MExtractSlidingWindow::FindSignalHiGain(Byte_t *ptr, Int_t &max, Byte_t &sat) const 140 197 { … … 177 234 178 235 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 // 179 247 void MExtractSlidingWindow::FindSignalLoGain(Byte_t *ptr, Int_t &max, Byte_t &sat) const 180 248 {
Note:
See TracChangeset
for help on using the changeset viewer.