NCFS-Pack
A generic (astro)particle physics analysis framework
 
Loading...
Searching...
No Matches
NcTransform.h
Go to the documentation of this file.
1#ifndef NcTransform_h
2#define NcTransform_h
3
4// Copyright(c) 2021 NCFS/IIHE, All Rights Reserved.
5// See cxx source for full Copyright notice.
6
7#include "TArrayD.h"
8#include "TVirtualFFT.h"
9
10#include "NcSample.h"
11
13
14class NcTransform : public TNamed
15{
16 public:
17 NcTransform(const char* name="",const char* title=""); // Default constructor
18 virtual ~NcTransform(); // Default destructor
19 NcTransform(const NcTransform& q); // Copy constructor
20 virtual TObject* Clone(const char* name="") const; // Make a deep copy and provide its pointer
21 void SetSamplingFrequency(Float_t f); // Set the actual DAQ sampling frequency in Hz
22 Float_t GetSamplingFrequency() const; // Provide the current DAQ sampling frequency in Hz
23 void Load(Int_t n,Double_t* re,Double_t* im=0,Float_t f=-1); // Provide new input data to be transformed
24 void Load(TArray* re,TArray* im=0,Float_t f=-1); // Provide new input data to be transformed
25 void Load(NcSample* s,Int_t i,Float_t f=-1); // Provide new input data to be transformed
26 void Load(NcSample* s,TString name,Float_t f=-1); // Provide new input data to be transformed
27 void Load(TH1* h,Float_t f=-1); // Provide new input data to be transformed
28 void Load(TGraph* gr,Float_t f=-1); // Provide new input data to be transformed
29 void LoadResult(); // Load the transformation result as new input data
30 void Fourier(TString mode,TH1* hist=0,TString sel="none"); // Perform a 1-dimensional Discrete Fourier Transform (DFT)
31 void Hartley(Int_t mode,TH1* hist=0,TString sel="none"); // Perform a 1-dimensional Discrete Hartley Transform (DHT)
32 void Cosine(Int_t type,TH1* hist=0,TString sel="none"); // Perform a 1-dimensional Discrete Cosine Transform (DCT)
33 void Sine(Int_t type,TH1* hist=0,TString sel="none"); // Perform a 1-dimensional Discrete Sine Transform (DST)
34 Int_t GetN() const; // Provide the number of data elements (to be) processed.
35 TArrayD GetData(TString mode) const; // Provide a selected set of data
36
37 protected:
38 TVirtualFFT* fProc; // The FFTW processor
39 Int_t fN; // The number of data elements to be transformed
40 TArrayD fReIn; // Input array for real components
41 TArrayD fImIn; // Input array for imaginary components
42 TArrayD fReOut; // Output array for real components
43 TArrayD fImOut; // Output array for imaginary components
44 Float_t fSample; // The actual data acquisition sampling frequency in Hz
45
46 // Internal member functions
47 void Reset(); // Reset all data and the processor
48
49 ClassDef(NcTransform,1) // Various transformations of (sequential) data samples
50};
51#endif
Sampling and statistics tools for various multi-dimensional data samples.
Definition NcSample.h:28
TArrayD GetData(TString mode) const
void SetSamplingFrequency(Float_t f)
void Load(Int_t n, Double_t *re, Double_t *im=0, Float_t f=-1)
NcTransform(const char *name="", const char *title="")
Int_t GetN() const
TVirtualFFT * fProc
Definition NcTransform.h:38
Float_t GetSamplingFrequency() const
virtual TObject * Clone(const char *name="") const
void LoadResult()
void Fourier(TString mode, TH1 *hist=0, TString sel="none")
TArrayD fImOut
Definition NcTransform.h:43
void Cosine(Int_t type, TH1 *hist=0, TString sel="none")
TArrayD fReIn
Definition NcTransform.h:40
TArrayD fImIn
Definition NcTransform.h:41
virtual ~NcTransform()
void Sine(Int_t type, TH1 *hist=0, TString sel="none")
Float_t fSample
Definition NcTransform.h:44
TArrayD fReOut
Definition NcTransform.h:42
void Hartley(Int_t mode, TH1 *hist=0, TString sel="none")