45 template <
bool IsEnabled = true,
typename std::enable_if<(IsEnabled && (std::is_same<Type, IDCFourierTransformBaseAggregator>::value)),
int>::type = 0>
46 IDCFourierTransform(
const unsigned int rangeIDC = 200,
const unsigned int nFourierCoefficientsStore = 200 + 2) :
IDCFourierTransformAggregator(rangeIDC), mFourierCoefficients{1, nFourierCoefficientsStore}, mVal1DIDCs(sNThreads), mCoefficients(sNThreads)
53 template <
bool IsEnabled = true,
typename std::enable_if<(IsEnabled && (std::is_same<Type, IDCFourierTransformBaseEPN>::value)),
int>::type = 0>
54 IDCFourierTransform(
const unsigned int rangeIDC = 200,
const unsigned int nFourierCoefficientsStore = 200 + 2) :
IDCFourierTransformEPN(rangeIDC), mFourierCoefficients{1, nFourierCoefficientsStore}, mVal1DIDCs(sNThreads), mCoefficients(sNThreads)
63 static void setFFT(
const bool fft) { sFftw = fft; }
67 template <
bool IsEnabled = true,
typename std::enable_if<(IsEnabled && (std::is_same<Type, IDCFourierTransformBaseAggregator>::value)),
int>::type = 0>
77 template <
bool IsEnabled = true,
typename std::enable_if<(IsEnabled && (std::is_same<Type, IDCFourierTransformBaseAggregator>::value)),
int>::type = 0>
80 mFourierCoefficients.
resize(timeFrames);
81 sFftw ? calcFourierCoefficientsFFTW3() : calcFourierCoefficientsNaive();
85 template <
bool IsEnabled = true,
typename std::enable_if<(IsEnabled && (std::is_same<Type, IDCFourierTransformBaseEPN>::value)),
int>::type = 0>
88 sFftw ? calcFourierCoefficientsFFTW3() : calcFourierCoefficientsNaive();
92 std::vector<std::vector<float>>
inverseFourierTransform()
const {
return sFftw ? inverseFourierTransformFFTW3() : inverseFourierTransformNaive(); }
109 void dumpToFile(
const char* outFileName =
"Fourier.root",
const char* outName =
"FourierCoefficients")
const;
113 void dumpToTree(
const char* outFileName =
"FourierTree.root")
const;
132 inline static int sFftw{1};
133 inline static int sNThreads{1};
135 std::vector<float*> mVal1DIDCs;
136 std::vector<fftwf_complex*> mCoefficients;
139 void calcFourierCoefficientsNaive();
142 void calcFourierCoefficientsFFTW3();
145 std::vector<std::vector<float>> inverseFourierTransformNaive()
const;
148 std::vector<std::vector<float>> inverseFourierTransformFFTW3()
const;
151 void normalizeCoefficients()
157 unsigned int getNMaxCoefficients()
const {
return this->mRangeIDC / 2 + 1; }
160 void fftwLoop(
const std::vector<float>& idcOneExpanded,
const std::vector<unsigned int>& offsetIndex,
const unsigned int interval,
const unsigned int thread);
162 ClassDefNV(IDCFourierTransform, 1)