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)
54 template <
bool IsEnabled = true,
typename std::enable_if<(IsEnabled && (std::is_same<Type, IDCFourierTransformBaseEPN>::value)),
int>::type = 0>
55 IDCFourierTransform(
const unsigned int rangeIDC = 200,
const unsigned int nFourierCoefficientsStore = 200 + 2) :
IDCFourierTransformEPN(rangeIDC), mFourierCoefficients{1, nFourierCoefficientsStore}, mVal1DIDCs(sNThreads), mCoefficients(sNThreads)
65 static void setFFT(
const bool fft) { sFftw = fft; }
69 template <
bool IsEnabled = true,
typename std::enable_if<(IsEnabled && (std::is_same<Type, IDCFourierTransformBaseAggregator>::value)),
int>::type = 0>
76 template <
bool IsEnabled = true,
typename std::enable_if<(IsEnabled && (std::is_same<Type, IDCFourierTransformBaseAggregator>::value)),
int>::type = 0>
79 mFourierCoefficients.
resize(timeFrames);
80 sFftw ? calcFourierCoefficientsFFTW3() : calcFourierCoefficientsNaive();
84 template <
bool IsEnabled = true,
typename std::enable_if<(IsEnabled && (std::is_same<Type, IDCFourierTransformBaseEPN>::value)),
int>::type = 0>
87 sFftw ? calcFourierCoefficientsFFTW3() : calcFourierCoefficientsNaive();
91 std::vector<std::vector<float>>
inverseFourierTransform()
const {
return sFftw ? inverseFourierTransformFFTW3() : inverseFourierTransformNaive(); }
108 void dumpToFile(
const char* outFileName =
"Fourier.root",
const char* outName =
"FourierCoefficients")
const;
112 void dumpToTree(
const char* outFileName =
"FourierTree.root")
const;
131 inline static int sFftw{1};
132 inline static int sNThreads{1};
134 std::vector<float*> mVal1DIDCs;
135 std::vector<fftwf_complex*> mCoefficients;
138 void calcFourierCoefficientsNaive();
141 void calcFourierCoefficientsFFTW3();
144 std::vector<std::vector<float>> inverseFourierTransformNaive()
const;
147 std::vector<std::vector<float>> inverseFourierTransformFFTW3()
const;
150 void normalizeCoefficients()
156 unsigned int getNMaxCoefficients()
const {
return this->mRangeIDC / 2 + 1; }
159 void initFFTW3Members();
162 void fftwLoop(
const std::vector<float>& idcOneExpanded,
const std::vector<unsigned int>& offsetIndex,
const unsigned int interval,
const unsigned int thread);
164 ClassDefNV(IDCFourierTransform, 1)