Skip to content

Commit 3c9ed5e

Browse files
committed
TPC: fix initialization of FFTW arrays
1 parent c12208e commit 3c9ed5e

3 files changed

Lines changed: 5 additions & 8 deletions

File tree

Detectors/TPC/calibration/include/TPCCalibration/IDCFourierTransform.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,13 @@ class IDCFourierTransform : public IDCFourierTransformBase<Type>
4343
/// \param timeFrames number of time frames which will be stored
4444
/// \param nFourierCoefficientsStore number of courier coefficients (real+imag) which will be stored (the maximum can be 'rangeIDC + 2', should be an even number when using naive FT). If less than maximum is setn the inverse fourier transform will not work.
4545
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)
47-
{
48-
initFFTW3Members();
49-
};
46+
IDCFourierTransform(const unsigned int rangeIDC = 200, const unsigned int nFourierCoefficientsStore = 200 + 2) : IDCFourierTransformAggregator(rangeIDC), mFourierCoefficients{1, nFourierCoefficientsStore}, mVal1DIDCs(sNThreads), mCoefficients(sNThreads) {}
5047

5148
/// constructor for EPN type
5249
/// \param rangeIDC number of IDCs for each interval which will be used to calculate the fourier coefficients
5350
/// \param nFourierCoefficientsStore number of courier coefficients (real+imag) which will be stored (the maximum can be 'rangeIDC + 2', should be an even number when using naive FT). If less than maximum is setn the inverse fourier transform will not work.
5451
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)
56-
{
57-
initFFTW3Members();
58-
};
52+
IDCFourierTransform(const unsigned int rangeIDC = 200, const unsigned int nFourierCoefficientsStore = 200 + 2) : IDCFourierTransformEPN(rangeIDC), mFourierCoefficients{1, nFourierCoefficientsStore}, mVal1DIDCs(sNThreads), mCoefficients(sNThreads) {}
5953

6054
// Destructor
6155
~IDCFourierTransform();

Detectors/TPC/calibration/src/IDCFourierTransform.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ o2::tpc::IDCFourierTransform<Type>::~IDCFourierTransform()
3535
template <class Type>
3636
void o2::tpc::IDCFourierTransform<Type>::initFFTW3Members()
3737
{
38+
mVal1DIDCs.resize(sNThreads);
39+
mCoefficients.resize(sNThreads);
3840
for (int thread = 0; thread < sNThreads; ++thread) {
3941
mVal1DIDCs[thread] = fftwf_alloc_real(this->mRangeIDC);
4042
mCoefficients[thread] = fftwf_alloc_complex(getNMaxCoefficients());

Detectors/TPC/workflow/include/TPCWorkflow/TPCFourierTransformAggregatorSpec.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ class TPCFourierTransformAggregatorSpec : public o2::framework::Task
6666
mEnableFFTCCDB = ic.options().get<bool>("enable-fft-CCDB");
6767
int nthreads = ic.options().get<int>("nthreads");
6868
TPCFourierTransformAggregatorSpec::IDCFType::setNThreads(nthreads);
69+
initFFTW3Members();
6970
resizeBuffer(mInputLanes);
7071
}
7172

0 commit comments

Comments
 (0)