13 #include "TFFTComplexReal.h" 14 #include "TFFTRealComplex.h" 32 void DoFFT(std::vector<T>& input, std::vector<TComplex>& output);
35 void DoInvFFT(std::vector<TComplex>& input, std::vector<T>& output);
38 void Deconvolute(std::vector<T>& input, std::vector<T>& respFunc);
41 void Deconvolute(std::vector<T>& input, std::vector<TComplex>& kern);
44 void Convolute(std::vector<T>& input, std::vector<T>& respFunc);
47 void Convolute(std::vector<T>& input, std::vector<TComplex>& kern);
50 void Correlate(std::vector<T>& input, std::vector<T>& respFunc);
53 void Correlate(std::vector<T>& input, std::vector<TComplex>& kern);
56 void AlignedSum(std::vector<T>& input, std::vector<T>& output,
bool add =
true);
58 void ShiftData(std::vector<TComplex>& input,
double shift);
61 void ShiftData(std::vector<T>& input,
double shift);
98 double imaginary = 0.;
101 for (
size_t p = 0; p < input.size(); ++p)
102 fFFT->SetPoint(p, input[p]);
107 fFFT->GetPointComplex(i, real, imaginary);
108 output[i] = TComplex(real, imaginary);
123 double factor = 1.0 / (double)
fSize;
125 for (
int i = 0; i <
fSize; ++i)
126 output[i] = factor *
fInverseFFT->GetPointReal(i,
false);
228 fCompTemp[i] *= TComplex::Conjugate(kern[i]);
248 for (
int i = 0; i <
fSize; i++)
249 shape1[i] += shape2[i];
273 std::vector<T> holder = shape1;
276 int maxT = max_element(holder.begin(), holder.end()) - holder.begin();
280 for (
int i = 0; i <
fFitBins; i++) {
283 else if (startT + i >
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)
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)