ROOT » HIST » HIST » TF1Convolution

class TF1Convolution


 (f*g)(t) = int(f(x)g(x-t)dx)   *

 class wrapping convolution of two function : evaluation of TF1(t) * TF1(x-t)

 The convolution is performed by default using FFTW if it is available .
 One can pass optionally the range of the convolution (by default the first function range is used).
 Note that when using Discrete Fouriere Transform (as FFTW), it is a circular transform, so the functions should be
 approximatly zero at the end of the range. If they are significantly different than zero on one side (e.g. the left side)
 a spill over will occur on the other side (e.g right side).
 If no function range is given by default the function1 range + 10% is used
 One shoud use also a not too small number of points for the DFT (a minimum of 1000).  By default 10000 points are used .

Function Members (Methods)

public:
~TF1Convolution()
Int_tGetNpar() const
const char*GetParName(Int_t ipar) const
Double_tGetXmax() const
Double_tGetXmin() const
Double_toperator()(Double_t* t, Double_t* p)
TF1Convolution&operator=(TF1Convolution&&)
TF1Convolution&operator=(const TF1Convolution&)
voidSetExtraRange(Double_t percentage)
voidSetNofPointsFFT(Int_t n)
voidSetNumConv(Bool_t flag = true)
voidSetParameters(Double_t* p)
voidSetParameters(Double_t p0, Double_t p1, Double_t p2 = 0., Double_t p3 = 0., Double_t p4 = 0., Double_t p5 = 0., Double_t p6 = 0., Double_t p7 = 0.)
voidSetRange(Double_t a, Double_t b)
TF1Convolution(TF1Convolution&&)
TF1Convolution(const TF1Convolution&)
TF1Convolution(TF1* function1, TF1* function2, Bool_t useFFT = true)
TF1Convolution(TString formula, Double_t xmin = 1., Double_t xmax = 0., Bool_t useFFT = true)
TF1Convolution(TF1* function1, TF1* function2, Double_t xmin, Double_t xmax, Bool_t useFFT = true)
TF1Convolution(TString formula1, TString formula2, Double_t xmin = 1., Double_t xmax = 0., Bool_t useFFT = true)
private:
Double_tEvalFFTConv(Double_t t)
Double_tEvalNumConv(Double_t t)
voidInitializeDataMembers(TF1* function1, TF1* function2, Bool_t useFFT)
voidMakeFFTConv()

Data Members

private:
Int_tfCstIndexindex of the constant parameter f the first function
Bool_tfFlagFFTchoose fft or numerical convolution
Bool_tfFlagGraphtells if the graph is already done or not
shared_ptr<TF1>fFunction1
shared_ptr<TF1>fFunction2
shared_ptr<TGraph>fGraphConv
Int_tfNofParams1
Int_tfNofParams2
Int_tfNofPointsnumber of point for FFT array
vector<TString>fParNamesparameter names
vector<Double_t>fParams1
vector<Double_t>fParams2
Double_tfXmaxmaximal bound of the range of the convolution
Double_tfXminminimal bound of the range of the convolution

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

void InitializeDataMembers(TF1* function1, TF1* function2, Bool_t useFFT)
 use copy instead of Clone
TF1Convolution(TF1* function1, TF1* function2, Bool_t useFFT = true)
 constructor from the two function pointer and a flag is using FFT
TF1Convolution(TF1* function1, TF1* function2, Double_t xmin, Double_t xmax, Bool_t useFFT = true)
 constructor from the two function pointer and the convolution range
TF1Convolution(TString formula, Double_t xmin = 1., Double_t xmax = 0., Bool_t useFFT = true)
 constructor from a formula expression as f1 * f2 where f1 and f2 are two functions known to ROOT
TF1Convolution(TString formula1, TString formula2, Double_t xmin = 1., Double_t xmax = 0., Bool_t useFFT = true)
 constructor from 2 function names where f1 and f2 are two functions known to ROOT
 if the function names are not knwon to ROOT then a corresponding
void MakeFFTConv()
perform the FFT of the two functions
Double_t EvalFFTConv(Double_t t)
Double_t EvalNumConv(Double_t t)
 perform numerical convolution
 could in principle cache the integral  in a Grap[h as it is done for the FFTW
Double_t operator()(Double_t* t, Double_t* p)
void SetNofPointsFFT(Int_t n)
void SetParameters(Double_t* p)
void SetParameters(Double_t p0, Double_t p1, Double_t p2 = 0., Double_t p3 = 0., Double_t p4 = 0., Double_t p5 = 0., Double_t p6 = 0., Double_t p7 = 0.)
void SetExtraRange(Double_t percentage)
void SetRange(Double_t a, Double_t b)
TF1Convolution(TF1* function1, TF1* function2, Bool_t useFFT = true)
TF1Convolution(TF1* function1, TF1* function2, Double_t xmin, Double_t xmax, Bool_t useFFT = true)
void SetNumConv(Bool_t flag = true)
{fFlagFFT=!flag;}
Int_t GetNpar() const
Double_t GetXmin() const
{return fXmin;}
Double_t GetXmax() const
{return fXmax;}
const char * GetParName(Int_t ipar) const
{ return fParNames.at(ipar).Data(); }