Changeset 3883 for trunk/MagicSoft
- Timestamp:
- 04/29/04 14:06:19 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/msignal
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/msignal/MExtractFixedWindow.cc
r3882 r3883 28 28 // MExtractFixedWindow 29 29 // 30 // Extracts the signal from a fixed window 30 // Extracts the signal from a fixed window in a given range. 31 // 32 // Call: SetRange(fHiGainFirst, fHiGainLast, fLoGainFirst, fLoGainLast) 33 // to modify the ranges. 34 // Defaults are: 35 // 36 // fHiGainFirst = fgHiGainFirst = 3 37 // fHiGainLast = fgHiGainLast = 14 38 // fLoGainFirst = fgLoGainFirst = 3 39 // fLoGainLast = fgLoGainLast = 14 31 40 // 32 41 ////////////////////////////////////////////////////////////////////////////// -
trunk/MagicSoft/Mars/msignal/MExtractFixedWindow.h
r3868 r3883 31 31 MExtractFixedWindow(const char *name=NULL, const char *title=NULL); 32 32 33 void SetRange(Byte_t hifirst=0, Byte_t hilast=0, Byte_t lofirst=0, Byte_t lolast=0); 34 33 35 ClassDef(MExtractFixedWindow, 0) // Signal Extractor for a fixed extraction window 34 36 }; -
trunk/MagicSoft/Mars/msignal/MExtractSlidingWindow.cc
r3868 r3883 40 40 #include "MLogManip.h" 41 41 42 42 43 ClassImp(MExtractSlidingWindow); 43 44 … … 55 56 // 56 57 MExtractSlidingWindow::MExtractSlidingWindow(const char *name, const char *title) 58 : fWindowSizeHiGain(fgHiGainWindowSize), 59 fWindowSizeLoGain(fgLoGainWindowSize) 57 60 { 58 61 … … 61 64 62 65 SetRange(fgHiGainFirst, fgHiGainLast, fgLoGainFirst, fgLoGainLast); 63 SetWindowSize(); 64 66 } 67 68 void MExtractSlidingWindow::SetRange(Byte_t hifirst, Byte_t hilast, Byte_t lofirst, Byte_t lolast) 69 { 70 71 MExtractor::SetRange(hifirst,hilast,lofirst,lolast); 72 73 // 74 // Redo the checks if the window is still inside the ranges 75 // 76 77 SetWindowSize(fWindowSizeHiGain,fWindowSizeLoGain); 78 65 79 } 66 80 … … 72 86 73 87 if (fWindowSizeHiGain != windowh) 74 *fLog << warn << "MExtractSignal2::SetRange -Hi Gain window size has to be even, set to: "88 *fLog << warn << GetDescriptor() << ": Hi Gain window size has to be even, set to: " 75 89 << int(fWindowSizeHiGain) << " samples " << endl; 76 90 77 78 *fLog << warn << "MExtractSignal2::SetRange -Lo Gain window size has to be even, set to: "79 91 if (fWindowSizeLoGain != windowl) 92 *fLog << warn << GetDescriptor() << ": Lo Gain window size has to be even, set to: " 93 << int(fWindowSizeLoGain) << " samples " << endl; 80 94 81 if (fWindowSizeHiGain<2) 82 { 83 fWindowSizeHiGain = 2; 84 *fLog << warn << "MExtractSignal2::SetRange - Hi Gain window size set to two samples" << endl; 85 } 95 const Byte_t availhirange = (fHiGainLast-fHiGainFirst+1) & ~1; 96 const Byte_t availlorange = (fLoGainLast-fLoGainFirst+1) & ~1; 97 98 if (fWindowSizeHiGain > availhirange) 99 { 100 *fLog << warn << GetDescriptor() 101 << Form("%s%2i%s%2i%s%2i%s",": Hi Gain window size: ",(int)fWindowSizeHiGain, 102 " is bigger than available range: [",(int)fHiGainFirst,",",(int)fHiGainLast,"]") << endl; 103 *fLog << warn << GetDescriptor() 104 << ": Will set window size to: " << (int)availhirange << endl; 105 fWindowSizeHiGain = availhirange; 106 } 107 108 if (fWindowSizeLoGain > availlorange) 109 { 110 *fLog << warn << GetDescriptor() 111 << Form("%s%2i%s%2i%s%2i%s",": Lo Gain window size: ",(int)fWindowSizeLoGain, 112 " is bigger than available range: [",(int)fLoGainFirst,",",(int)fLoGainLast,"]") << endl; 113 *fLog << warn << GetDescriptor() 114 << ": Will set window size to: " << (int)availlorange << endl; 115 fWindowSizeLoGain = availlorange; 116 } 117 118 if (fWindowSizeHiGain<2) 119 { 120 fWindowSizeHiGain = 2; 121 *fLog << warn << GetDescriptor() << ": Hi Gain window size set to two samples" << endl; 122 } 123 124 if (fWindowSizeLoGain<2) 125 { 126 fWindowSizeLoGain = 2; 127 *fLog << warn << GetDescriptor() << ": Lo Gain window size set to two samples" << endl; 128 } 86 129 87 if (fWindowSizeLoGain<2) 88 { 89 fWindowSizeLoGain = 2; 90 *fLog << warn << "MExtractSignal2::SetRange - Lo Gain window size set to two samples" << endl; 91 } 92 93 fNumHiGainSamples = (Float_t)fWindowSizeHiGain; 94 fNumLoGainSamples = (Float_t)fWindowSizeLoGain; 95 96 fSqrtHiGainSamples = TMath::Sqrt(fNumHiGainSamples); 97 fSqrtLoGainSamples = TMath::Sqrt(fNumLoGainSamples); 98 } 99 130 fNumHiGainSamples = (Float_t)fWindowSizeHiGain; 131 fNumLoGainSamples = (Float_t)fWindowSizeLoGain; 132 133 fSqrtHiGainSamples = TMath::Sqrt(fNumHiGainSamples); 134 fSqrtLoGainSamples = TMath::Sqrt(fNumLoGainSamples); 135 136 } 100 137 101 138 -
trunk/MagicSoft/Mars/msignal/MExtractSlidingWindow.h
r3868 r3883 23 23 void FindSignalLoGain(Byte_t *ptr, Int_t &max, Byte_t &sat) const; 24 24 25 25 26 public: 26 27 MExtractSlidingWindow(const char *name=NULL, const char *title=NULL); 27 28 29 void SetRange(Byte_t hifirst=0, Byte_t hilast=0, Byte_t lofirst=0, Byte_t lolast=0); 28 30 void SetWindowSize(Byte_t windowh=fgHiGainWindowSize, 29 31 Byte_t windowl=fgLoGainWindowSize);
Note:
See TracChangeset
for help on using the changeset viewer.