11 float sum = std::accumulate(a_wf, a_wf+a_num,0.0);
27 for(uint iS = 0; iS < a_num;iS++)
29 float sampleVal =
static_cast<float>( a_wf[iS] );
30 accum+=(sampleVal-mean)*(sampleVal-mean);
32 a_sigma=sqrt(accum/
static_cast<float>(a_num));
46 float mean = a_baseline;
48 for(uint iS = 0; iS < a_num;iS++)
50 float sampleVal =
static_cast<float>( a_wf[iS] );
51 float diff = sampleVal-mean;
95 for(uint iS=0; iS<a_num; iS++)
97 float sampleVal =
static_cast<float>( a_wf[iS] );
98 if(abs(sampleVal-a_baseline)>a_threshold)
112 float returnIntegral=0;
113 for(
int iS=a_startSample; iS<a_stopSample+1; iS++)
115 float sampleVal =
static_cast<float>( a_wf[iS] );
116 returnIntegral += sampleVal-a_baseline;
120 returnIntegral = -returnIntegral;
122 return returnIntegral;
128 template <
class T> std::vector<std::pair<int,int>>
135 std::vector<std::pair<int,int>> results;
139 for(
int iS = 0; iS < a_num-1;iS++)
141 if(a_wf[iS] - a_baseline> a_max)
145 for(;iSOv<a_num;iSOv++)
147 if(a_wf[iSOv] - a_baseline < a_max)
154 results.push_back(std::make_pair(start,stop));
161 template <
class T> std::vector<std::pair<int,int>>
168 std::vector<std::pair<int,int>> results;
172 for(
int iS = 0; iS < a_num-1;iS++)
175 if(a_baseline - a_wf[iS] > a_max)
179 for(;iSOv<a_num;iSOv++)
181 if(a_baseline - a_wf[iSOv] < a_max)
188 results.push_back(std::make_pair(start,stop));
200 std::vector<double> wfVec(a_wf, a_wf+a_range);
202 unsigned long n = a_range;
205 std::vector< std::complex < double > > f(n);
206 std::vector< std::complex < double > > fHat(n);
209 for(
int i = 0; i < a_range; i++)
211 f[i] = {wfVec[i], 0};
215 double norm = 1.0/(double)sqrt(n);
216 for(
auto & eL : fHat )
Definition: FFT1DBRI.H:11
virtual void forwardFFTCC(std::vector< std::complex< double > > &a_fHat, const std::vector< std::complex< double > > &f) const
Definition: FFT1DBRI.cpp:21
static std::vector< std::pair< int, int > > overThreshold(T *a_wf, uint a_num, float a_baseline, float a_max)
Definition: WFOperations.hpp:129
static float getCFD(T *a_wf, uint a_num, float a_mean, float a_frac, bool a_negPulse)
Definition: WFOperations.hpp:77
static std::vector< std::complex< double > > getWfFFT(T *a_wf, int a_range)
For FFT stuff - Added 01/30/24.
Definition: WFOperations.hpp:196
static int findSampleLeadingEdgeTrig(T *a_wf, uint a_num, float a_baseline, float a_threshold)
Definition: WFOperations.hpp:89
static float estimateBaseline(T *a_wf, uint a_num)
this function averages the number of samples specified
Definition: WFOperations.hpp:6
static std::vector< std::pair< int, int > > underThreshold(T *a_wf, uint a_num, float a_baseline, float a_max)
Definition: WFOperations.hpp:162
static float integrateTrace(T *a_wf, float a_baseline, int a_startSample, int a_stopSample, bool a_negPulse)
Definition: WFOperations.hpp:106
static void estimateBaselineDel(T *a_wf, uint a_num, float a_baseline, float &a_Dmax)
Definition: WFOperations.hpp:40