Changeset 17872 for trunk/Mars
- Timestamp:
- 05/21/14 16:47:27 (11 years ago)
- Location:
- trunk/Mars/msignal
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/msignal/MFilterData.cc
r17836 r17872 54 54 fName = name ? name : "MFilterData"; 55 55 fTitle = title ? title : "Class to filter the data"; 56 57 // Default weights 58 fWeights.resize(14); 59 fWeights[ 0] = -0.217305; 60 fWeights[ 1] = -0.213277; 61 fWeights[ 2] = -0.193537; 62 fWeights[ 3] = -0.181686; 63 fWeights[ 4] = -0.15356; 64 fWeights[ 5] = -0.129926; 65 fWeights[ 6] = -0.0792033; 66 fWeights[ 7] = -0.0219311; 67 fWeights[ 8] = 0.0550301; 68 fWeights[ 9] = 0.127364; 69 fWeights[10] = 0.206711; 70 fWeights[11] = 0.246864; 71 fWeights[12] = 0.271012; 72 fWeights[13] = 0.283444; 56 73 } 57 74 … … 71 88 return kFALSE; 72 89 73 if (fWeights.size()==0)74 {75 fWeights.resize(14);76 fWeights[ 0] = -0.217305;77 fWeights[ 1] = -0.213277;78 fWeights[ 2] = -0.193537;79 fWeights[ 3] = -0.181686;80 fWeights[ 4] = -0.15356;81 fWeights[ 5] = -0.129926;82 fWeights[ 6] = -0.0792033;83 fWeights[ 7] = -0.0219311;84 fWeights[ 8] = 0.0550301;85 fWeights[ 9] = 0.127364;86 fWeights[10] = 0.206711;87 fWeights[11] = 0.246864;88 fWeights[12] = 0.271012;89 fWeights[13] = 0.283444;90 }91 92 90 return kTRUE; 93 91 } 94 92 95 // -------------------------------------------------------------------------- 96 // 97 // 98 Int_t MFilterData::Process() 93 void MFilterData::Filter(UShort_t npix, UShort_t nroi, const Float_t *beg, Float_t *out) const 99 94 { 100 // FIXME: Implement an alternative: the simple filter 101 // (p[10]+p[11]+p[12]) - (p[0]+p[1]+p[2]) 102 // Store first sum in ring-buffer 103 104 const uint16_t nroi = fSignalIn->GetNumSamples(); 105 const uint16_t npix = fSignalIn->GetNumPixels(); 106 const uint16_t nw = fWeights.size(); 107 //const uint16_t last = nroi-1; 108 109 if (fSignalIn!=fSignalOut) 110 fSignalOut->InitSamples(nroi); // contains setting to 0 95 const uint16_t nw = fWeights.size(); 111 96 112 97 const float *begw = fWeights.data(); 113 98 const float *endw = fWeights.data()+nw; 114 99 115 const Float_t *beg = fSignalIn->GetSamples();116 117 Float_t *out = fSignalOut->GetSamples();118 100 for (const Float_t *in=beg; in<beg+nroi*npix; ) 119 101 { … … 146 128 // } 147 129 } 130 } 131 132 // -------------------------------------------------------------------------- 133 // 134 // 135 Int_t MFilterData::Process() 136 { 137 // FIXME: Implement an alternative: the simple filter 138 // (p[10]+p[11]+p[12]) - (p[0]+p[1]+p[2]) 139 // Store first sum in ring-buffer 140 141 const uint16_t nroi = fSignalIn->GetNumSamples(); 142 const uint16_t npix = fSignalIn->GetNumPixels(); 143 144 if (fSignalIn!=fSignalOut) 145 fSignalOut->InitSamples(nroi); // contains setting to 0 146 147 Filter(npix, nroi, fSignalIn->GetSamples(), fSignalOut->GetSamples()); 148 148 149 149 return kTRUE; -
trunk/Mars/msignal/MFilterData.h
r17830 r17872 34 34 void SetAverage(const UInt_t n) { fWeights.assign(n, 1./n); } 35 35 36 void Filter(UShort_t npix, UShort_t nroi, const Float_t *beg, Float_t *out) const; 37 36 38 ClassDef(MFilterData, 0) // Class to filter the calibrated data 37 39 };
Note:
See TracChangeset
for help on using the changeset viewer.