12 #include "TFFTRealComplex.h" 13 #include "TFFTComplexReal.h" 32 template <
class T>
void DoFFT(std::vector<T> &
input,
33 std::vector<TComplex> &
output);
35 template <
class T>
void DoInvFFT(std::vector<TComplex> & input,
36 std::vector<T> & output);
38 template <
class T>
void Deconvolute(std::vector<T> & input,
39 std::vector<T> & respFunc);
41 template <
class T>
void Deconvolute(std::vector<T> & input,
42 std::vector<TComplex> & kern);
44 template <
class T>
void Convolute(std::vector<T> & input,
45 std::vector<T> & respFunc);
47 template <
class T>
void Convolute(std::vector<T> & input,
48 std::vector<TComplex> & kern);
50 template <
class T>
void Correlate(std::vector<T> & input,
51 std::vector<T> & respFunc);
53 template <
class T>
void Correlate(std::vector<T> & input,
54 std::vector<TComplex> & kern);
56 template <
class T>
void AlignedSum(std::vector<T> & input,
57 std::vector<T> &output,
60 void ShiftData(std::vector<TComplex> & input,
63 template <
class T>
void ShiftData(std::vector<T> & input,
67 std::vector<T> &shape2);
99 std::vector<TComplex> &
output)
102 double imaginary = 0.;
105 for(
size_t p = 0;
p < input.size(); ++
p)
106 fFFT->SetPoint(
p, input[
p]);
111 fFFT->GetPointComplex(i, real, imaginary);
112 output[i]=TComplex(real, imaginary);
127 double factor = 1.0/(double)
fSize;
129 for(
int i = 0; i <
fSize; ++i)
130 output[i] = factor*
fInverseFFT->GetPointReal(i,
false);
139 std::vector<T> & respFunction)
158 std::vector<TComplex> & kern)
174 std::vector<T> & shape2)
193 std::vector<TComplex> & kern)
208 std::vector<T> & shape2)
227 std::vector<TComplex> & kern)
232 fCompTemp[i]*=TComplex::Conjugate(kern[i]);
245 std::vector<T> & shape2,
252 if(add)
for(
int i = 0; i <
fSize; i++) shape1[i]+=shape2[i];
273 std::vector<T> & shape2)
276 std::vector<T> holder = shape1;
279 int maxT = max_element(holder.begin(), holder.end())-holder.begin();
284 if(startT+i < 0) offset=
fSize;
287 fConvHist->Fill(i,holder[i+startT+offset]);
292 return fPeakFit->GetParameter(1)+startT;
Namespace for general, non-LArSoft-specific utilities.
void resetSizePerRun(art::Run const &)
void ShiftData(std::vector< TComplex > &input, double shift)
Coord add(Coord c1, Coord c2)
std::vector< TComplex > fKern
void DoFFT(std::vector< T > &input, std::vector< TComplex > &output)
T PeakCorrelation(std::vector< T > &shape1, std::vector< T > &shape2)
void DoInvFFT(std::vector< TComplex > &input, std::vector< T > &output)
TFFTRealComplex * fFFT
object to do FFT
#define DECLARE_ART_SERVICE(svc, scope)
void Correlate(std::vector< T > &input, std::vector< T > &respFunc)
LArFFT(fhicl::ParameterSet const &pset, art::ActivityRegistry ®)
void Convolute(std::vector< T > &input, std::vector< T > &respFunc)
void Deconvolute(std::vector< T > &input, std::vector< T > &respFunc)
void AlignedSum(std::vector< T > &input, std::vector< T > &output, bool add=true)
std::vector< TComplex > fCompTemp
std::string FFTOptions() const
TFFTComplexReal * fInverseFFT
object to do Inverse FF
void ReinitializeFFT(int, std::string, int)