Project
Loading...
Searching...
No Matches
o2::tpc::IDCFourierTransform< Type > Class Template Reference

#include <IDCFourierTransform.h>

Inherits o2::tpc::IDCFourierTransformBase< Type >.

Public Member Functions

template<bool IsEnabled = true, typename std::enable_if<(IsEnabled &&(std::is_same< Type, IDCFourierTransformBaseAggregator >::value)), int >::type = 0>
 IDCFourierTransform (const unsigned int rangeIDC=200, const unsigned int nFourierCoefficientsStore=200+2)
 
template<bool IsEnabled = true, typename std::enable_if<(IsEnabled &&(std::is_same< Type, IDCFourierTransformBaseEPN >::value)), int >::type = 0>
 IDCFourierTransform (const unsigned int rangeIDC=200, const unsigned int nFourierCoefficientsStore=200+2)
 
 ~IDCFourierTransform ()
 
template<bool IsEnabled = true, typename std::enable_if<(IsEnabled &&(std::is_same< Type, IDCFourierTransformBaseAggregator >::value)), int >::type = 0>
void calcFourierCoefficients (const unsigned int timeFrames=2000)
 calculate fourier coefficients for one TPC side
 
template<bool IsEnabled = true, typename std::enable_if<(IsEnabled &&(std::is_same< Type, IDCFourierTransformBaseEPN >::value)), int >::type = 0>
void calcFourierCoefficients ()
 calculate fourier coefficients for one TPC side
 
std::vector< std::vector< float > > inverseFourierTransform () const
 get IDC0 values from the inverse fourier transform. Can be used for debugging. std::vector<std::vector<float>>: first vector interval second vector IDC0 values
 
unsigned int getrangeIDC () const
 
const auto & getFourierCoefficients () const
 
void dumpToFile (const char *outFileName="Fourier.root", const char *outName="FourierCoefficients") const
 
void dumpToTree (const char *outFileName="FourierTree.root") const
 
void printFFTWPlan () const
 printing information about the algorithms which are used by FFTW for debugging e.g. seeing if SIMD instructions will be used
 
std::vector< std::pair< float, float > > getFrequencies (const float samplingFrequency=getSamplingFrequencyIDCHz()) const
 

Static Public Member Functions

static void setFFT (const bool fft)
 
template<bool IsEnabled = true, typename std::enable_if<(IsEnabled &&(std::is_same< Type, IDCFourierTransformBaseAggregator >::value)), int >::type = 0>
static void setNThreads (const int nThreads)
 
static bool getFFT ()
 get type of used fourier transform
 
static int getNThreads ()
 get the number of threads used for calculation of the fourier coefficients
 
static std::vector< std::pair< float, float > > getFrequencies (const FourierCoeff &coeff, const float samplingFrequency=getSamplingFrequencyIDCHz())
 
static float getSamplingFrequencyIDCHz ()
 

Detailed Description

template<class Type>
class o2::tpc::IDCFourierTransform< Type >

class for fourier transform of 1D-IDCs For example usage see testO2TPCIDCFourierTransform.cxx

Template Parameters
Typetype which can either be IDCFourierTransformBaseEPN for synchronous reconstruction or IDCFourierTransformBaseAggregator for aggregator

Definition at line 38 of file IDCFourierTransform.h.

Constructor & Destructor Documentation

◆ IDCFourierTransform() [1/2]

template<class Type >
template<bool IsEnabled = true, typename std::enable_if<(IsEnabled &&(std::is_same< Type, IDCFourierTransformBaseAggregator >::value)), int >::type = 0>
o2::tpc::IDCFourierTransform< Type >::IDCFourierTransform ( const unsigned int  rangeIDC = 200,
const unsigned int  nFourierCoefficientsStore = 200 + 2 
)
inline

constructor for AGGREGATOR type

Parameters
rangeIDCnumber of IDCs for each interval which will be used to calculate the fourier coefficients
timeFramesnumber of time frames which will be stored
nFourierCoefficientsStorenumber 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.

Definition at line 46 of file IDCFourierTransform.h.

◆ IDCFourierTransform() [2/2]

template<class Type >
template<bool IsEnabled = true, typename std::enable_if<(IsEnabled &&(std::is_same< Type, IDCFourierTransformBaseEPN >::value)), int >::type = 0>
o2::tpc::IDCFourierTransform< Type >::IDCFourierTransform ( const unsigned int  rangeIDC = 200,
const unsigned int  nFourierCoefficientsStore = 200 + 2 
)
inline

constructor for EPN type

Parameters
rangeIDCnumber of IDCs for each interval which will be used to calculate the fourier coefficients
nFourierCoefficientsStorenumber 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.

Definition at line 55 of file IDCFourierTransform.h.

◆ ~IDCFourierTransform()

template<class Type >
o2::tpc::IDCFourierTransform< Type >::~IDCFourierTransform ( )

Definition at line 26 of file IDCFourierTransform.cxx.

Member Function Documentation

◆ calcFourierCoefficients() [1/2]

template<class Type >
template<bool IsEnabled = true, typename std::enable_if<(IsEnabled &&(std::is_same< Type, IDCFourierTransformBaseEPN >::value)), int >::type = 0>
void o2::tpc::IDCFourierTransform< Type >::calcFourierCoefficients ( )
inline

calculate fourier coefficients for one TPC side

Definition at line 85 of file IDCFourierTransform.h.

◆ calcFourierCoefficients() [2/2]

template<class Type >
template<bool IsEnabled = true, typename std::enable_if<(IsEnabled &&(std::is_same< Type, IDCFourierTransformBaseAggregator >::value)), int >::type = 0>
void o2::tpc::IDCFourierTransform< Type >::calcFourierCoefficients ( const unsigned int  timeFrames = 2000)
inline

calculate fourier coefficients for one TPC side

Definition at line 77 of file IDCFourierTransform.h.

◆ dumpToFile()

template<class Type >
void o2::tpc::IDCFourierTransform< Type >::dumpToFile ( const char outFileName = "Fourier.root",
const char outName = "FourierCoefficients" 
) const

dump object to disc

Parameters
outFileNamename of the output file
outNamename of the object in the output file

Definition at line 188 of file IDCFourierTransform.cxx.

◆ dumpToTree()

template<class Type >
void o2::tpc::IDCFourierTransform< Type >::dumpToTree ( const char outFileName = "FourierTree.root") const

create debug tree

Parameters
outFileNamename of the output tree

Definition at line 196 of file IDCFourierTransform.cxx.

◆ getFFT()

template<class Type >
static bool o2::tpc::IDCFourierTransform< Type >::getFFT ( )
inlinestatic

get type of used fourier transform

Definition at line 100 of file IDCFourierTransform.h.

◆ getFourierCoefficients()

template<class Type >
const auto & o2::tpc::IDCFourierTransform< Type >::getFourierCoefficients ( ) const
inline
Returns
returns struct holding all fourier coefficients

Definition at line 97 of file IDCFourierTransform.h.

◆ getFrequencies() [1/2]

template<class Type >
std::vector< std::pair< float, float > > o2::tpc::IDCFourierTransform< Type >::getFrequencies ( const float  samplingFrequency = getSamplingFrequencyIDCHz()) const
inline

return the frequencies and the magnitude of the frequency. std::pair of <frequency, magnitude>

Parameters
samplingFrequencysampling frequency of the signal in Hz (default is IDC sampling rate in Hz)

Definition at line 119 of file IDCFourierTransform.h.

◆ getFrequencies() [2/2]

template<class Type >
std::vector< std::pair< float, float > > o2::tpc::IDCFourierTransform< Type >::getFrequencies ( const FourierCoeff coeff,
const float  samplingFrequency = getSamplingFrequencyIDCHz() 
)
static

return the frequencies and the magnitude of the frequency

Parameters
coefffourier coefficients
samplingFrequencysampling frequency of the signal in Hz (default is IDC sampling rate in Hz)

Definition at line 254 of file IDCFourierTransform.cxx.

◆ getNThreads()

template<class Type >
static int o2::tpc::IDCFourierTransform< Type >::getNThreads ( )
inlinestatic

get the number of threads used for calculation of the fourier coefficients

Definition at line 103 of file IDCFourierTransform.h.

◆ getrangeIDC()

template<class Type >
unsigned int o2::tpc::IDCFourierTransform< Type >::getrangeIDC ( ) const
inline
Returns
returns number of IDCs for each interval which will be used to calculate the fourier coefficients

Definition at line 94 of file IDCFourierTransform.h.

◆ getSamplingFrequencyIDCHz()

template<class Type >
static float o2::tpc::IDCFourierTransform< Type >::getSamplingFrequencyIDCHz ( )
inlinestatic
Returns
returns sampling frequency of IDCs in Hz

Definition at line 127 of file IDCFourierTransform.h.

◆ inverseFourierTransform()

template<class Type >
std::vector< std::vector< float > > o2::tpc::IDCFourierTransform< Type >::inverseFourierTransform ( ) const
inline

get IDC0 values from the inverse fourier transform. Can be used for debugging. std::vector<std::vector<float>>: first vector interval second vector IDC0 values

Definition at line 91 of file IDCFourierTransform.h.

◆ printFFTWPlan()

template<class Type >
void o2::tpc::IDCFourierTransform< Type >::printFFTWPlan ( ) const

printing information about the algorithms which are used by FFTW for debugging e.g. seeing if SIMD instructions will be used

Definition at line 232 of file IDCFourierTransform.cxx.

◆ setFFT()

template<class Type >
static void o2::tpc::IDCFourierTransform< Type >::setFFT ( const bool  fft)
inlinestatic

set fast fourier transform using FFTW3

Parameters
fftuse FFTW3 or not (naive approach)

Definition at line 65 of file IDCFourierTransform.h.

◆ setNThreads()

template<class Type >
template<bool IsEnabled = true, typename std::enable_if<(IsEnabled &&(std::is_same< Type, IDCFourierTransformBaseAggregator >::value)), int >::type = 0>
static void o2::tpc::IDCFourierTransform< Type >::setNThreads ( const int  nThreads)
inlinestatic

This function has to be called before the constructor is called

Parameters
nThreadsset the number of threads used for calculation of the fourier coefficients

Definition at line 70 of file IDCFourierTransform.h.


The documentation for this class was generated from the following files: