ATTPCROOT  0.3.0-alpha
A ROOT-based framework for analyzing data from active target detectors
AtPadFFT.h
Go to the documentation of this file.
1 // Pad object to hold the output of a FFT
2 #ifndef ATPADFFT_H
3 #define ATPADFFT_H
4 
5 #include "AtPadBase.h"
6 
7 #include <Rtypes.h> // for Double_t, THashConsistencyHolder, ClassDefOverride
8 #include <TComplex.h>
9 
10 #include <array> // for array
11 #include <memory> // for unique_ptr
12 #include <utility>
13 
14 class TVirtualFFT;
15 class TBuffer;
16 class TClass;
17 class TMemberInspector;
18 
19 class AtPadFFT : public AtPadBase {
20 public:
21  using TraceTrans = std::array<Double_t, 512 / 2 + 1>;
22 
23 protected:
24  // Output of FFT (stored in hermitian symmetric array)
27 
28 public:
29  virtual std::unique_ptr<AtPadBase> Clone() const override;
30 
31  Double_t GetPointRe(int i) const;
32  Double_t GetPointIm(int i) const;
33  Double_t GetPointMag(int i) const;
34  Double_t GetPointPhase(int i) const;
35  TComplex GetPointComplex(int i) const { return {GetPointRe(i), GetPointIm(i)}; }
36  std::pair<Double_t, Double_t> GetPoint(int i) const { return {GetPointRe(i), GetPointIm(i)}; }
37 
38  void SetPointRe(int i, Double_t val);
39  void SetPointIm(int i, Double_t val);
40  void SetPoint(int i, TComplex val);
41  void SetData(TraceTrans re, TraceTrans im);
42  void GetDataFromFFT(const TVirtualFFT *fft);
43  void SetFFTData(TVirtualFFT *fft);
44 
45  static std::unique_ptr<AtPadFFT> CreateFromFFT(const TVirtualFFT *fft);
47 };
48 
49 #endif //#ifndef ATPADFFT_H
AtPadFFT::Clone
virtual std::unique_ptr< AtPadBase > Clone() const override
Definition: AtPadFFT.cxx:9
AtPadFFT::SetData
void SetData(TraceTrans re, TraceTrans im)
Sets the real and imaginary parts of all frequency components.
Definition: AtPadFFT.cxx:74
AtPadFFT::CreateFromFFT
static std::unique_ptr< AtPadFFT > CreateFromFFT(const TVirtualFFT *fft)
Definition: AtPadFFT.cxx:112
AtPadFFT::SetPoint
void SetPoint(int i, TComplex val)
Definition: AtPadFFT.cxx:105
AtPadBase
Base class for AtPad composition pattern.
Definition: AtPadBase.h:37
AtPadFFT::SetPointIm
void SetPointIm(int i, Double_t val)
Sets the imaginary value of the ith frequency component.
Definition: AtPadFFT.cxx:63
AtPadFFT::fIm
TraceTrans fIm
Definition: AtPadFFT.h:26
AtPadFFT::SetPointRe
void SetPointRe(int i, Double_t val)
Sets the real value of the ith frequency component.
Definition: AtPadFFT.cxx:53
AtPadFFT::GetPointRe
Double_t GetPointRe(int i) const
Returns the real part of the ith frequency compnent.
Definition: AtPadFFT.cxx:17
AtPadFFT
Definition: AtPadFFT.h:19
AtPadFFT::GetPointIm
Double_t GetPointIm(int i) const
Returns the imaginary part of the ith frequency compnent.
Definition: AtPadFFT.cxx:29
AtPadFFT::ClassDefOverride
ClassDefOverride(AtPadFFT, 1)
AtPadFFT::GetPointPhase
Double_t GetPointPhase(int i) const
Returns the phase of the ith frequency compnent (-pi,pi].
Definition: AtPadFFT.cxx:46
AtPadFFT::TraceTrans
std::array< Double_t, 512/2+1 > TraceTrans
Definition: AtPadFFT.h:21
AtPadFFT::GetPointComplex
TComplex GetPointComplex(int i) const
Definition: AtPadFFT.h:35
AtPadFFT::fRe
TraceTrans fRe
Definition: AtPadFFT.h:25
AtPadFFT::GetDataFromFFT
void GetDataFromFFT(const TVirtualFFT *fft)
Sets the real and imaginary parts of all frequency components from the TVirtualFFT.
Definition: AtPadFFT.cxx:84
AtPadFFT::GetPoint
std::pair< Double_t, Double_t > GetPoint(int i) const
Definition: AtPadFFT.h:36
AtPadBase.h
AtPadFFT::GetPointMag
Double_t GetPointMag(int i) const
Returns the magnitude of the ith frequency compnent.
Definition: AtPadFFT.cxx:39
AtPadFFT::SetFFTData
void SetFFTData(TVirtualFFT *fft)
Sets the real and imaginary parts of all frequency components in a TVirtualFFT.
Definition: AtPadFFT.cxx:100