Logo ROOT   6.08/07
Reference Guide
List of all members | Public Member Functions | Private Member Functions | Private Attributes | List of all members
TF1Convolution Class Reference

Class wrapping convolution of two functions.

Class wrapping convolution of two functions: evaluation of \(\int f(x)g(x-t)dx\)

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.

Definition at line 26 of file TF1Convolution.h.

Public Member Functions

 TF1Convolution (TF1 *function1, TF1 *function2, Bool_t useFFT=true)
 constructor from the two function pointer and a flag is using FFT More...
 
 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 More...
 
 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 More...
 
 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 More...
 
Int_t GetNpar () const
 
const char * GetParName (Int_t ipar) const
 
Double_t GetXmax () const
 
Double_t GetXmin () const
 
Double_t operator() (Double_t *t, Double_t *p)
 
void SetExtraRange (Double_t percentage)
 
void SetNofPointsFFT (Int_t n)
 
void SetNumConv (Bool_t flag=true)
 
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 SetRange (Double_t a, Double_t b)
 

Private Member Functions

Double_t EvalFFTConv (Double_t t)
 
Double_t EvalNumConv (Double_t t)
 perform numerical convolution could in principle cache the integral in a Graph as it is done for the FFTW More...
 
void InitializeDataMembers (TF1 *function1, TF1 *function2, Bool_t useFFT)
 use copy instead of Clone More...
 
void MakeFFTConv ()
 perform the FFT of the two functions More...
 

Private Attributes

Int_t fCstIndex
 
Bool_t fFlagFFT
 
Bool_t fFlagGraph
 
std::shared_ptr< TF1fFunction1
 
std::shared_ptr< TF1fFunction2
 
std::shared_ptr< TGraphfGraphConv
 
Int_t fNofParams1
 
Int_t fNofParams2
 
Int_t fNofPoints
 
std::vector< Double_tfParams1
 
std::vector< Double_tfParams2
 
std::vector< TStringfParNames
 
Double_t fXmax
 
Double_t fXmin
 

#include <TF1Convolution.h>

Constructor & Destructor Documentation

◆ TF1Convolution() [1/4]

TF1Convolution::TF1Convolution ( TF1 function1,
TF1 function2,
Bool_t  useFFT = true 
)

constructor from the two function pointer and a flag is using FFT

Definition at line 128 of file TF1Convolution.cxx.

◆ TF1Convolution() [2/4]

TF1Convolution::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

Definition at line 136 of file TF1Convolution.cxx.

◆ TF1Convolution() [3/4]

TF1Convolution::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

Definition at line 148 of file TF1Convolution.cxx.

◆ TF1Convolution() [4/4]

TF1Convolution::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

Definition at line 182 of file TF1Convolution.cxx.

Member Function Documentation

◆ EvalFFTConv()

Double_t TF1Convolution::EvalFFTConv ( Double_t  t)
private

Definition at line 275 of file TF1Convolution.cxx.

◆ EvalNumConv()

Double_t TF1Convolution::EvalNumConv ( Double_t  t)
private

perform numerical convolution could in principle cache the integral in a Graph as it is done for the FFTW

Definition at line 289 of file TF1Convolution.cxx.

◆ GetNpar()

Int_t TF1Convolution::GetNpar ( ) const
inline

Definition at line 67 of file TF1Convolution.h.

◆ GetParName()

const char* TF1Convolution::GetParName ( Int_t  ipar) const
inline

Definition at line 70 of file TF1Convolution.h.

◆ GetXmax()

Double_t TF1Convolution::GetXmax ( ) const
inline

Definition at line 69 of file TF1Convolution.h.

◆ GetXmin()

Double_t TF1Convolution::GetXmin ( ) const
inline

Definition at line 68 of file TF1Convolution.h.

◆ InitializeDataMembers()

void TF1Convolution::InitializeDataMembers ( TF1 function1,
TF1 function2,
Bool_t  useFFT 
)
private

use copy instead of Clone

Definition at line 76 of file TF1Convolution.cxx.

◆ MakeFFTConv()

void TF1Convolution::MakeFFTConv ( )
private

perform the FFT of the two functions

Definition at line 211 of file TF1Convolution.cxx.

◆ operator()()

Double_t TF1Convolution::operator() ( Double_t t,
Double_t p 
)

Definition at line 309 of file TF1Convolution.cxx.

◆ SetExtraRange()

void TF1Convolution::SetExtraRange ( Double_t  percentage)

Definition at line 382 of file TF1Convolution.cxx.

◆ SetNofPointsFFT()

void TF1Convolution::SetNofPointsFFT ( Int_t  n)

Definition at line 320 of file TF1Convolution.cxx.

◆ SetNumConv()

void TF1Convolution::SetNumConv ( Bool_t  flag = true)
inline

Definition at line 65 of file TF1Convolution.h.

◆ SetParameters() [1/2]

void TF1Convolution::SetParameters ( Double_t p)

Definition at line 330 of file TF1Convolution.cxx.

◆ SetParameters() [2/2]

void TF1Convolution::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. 
)

Definition at line 373 of file TF1Convolution.cxx.

◆ SetRange()

void TF1Convolution::SetRange ( Double_t  a,
Double_t  b 
)

Definition at line 393 of file TF1Convolution.cxx.

Member Data Documentation

◆ fCstIndex

Int_t TF1Convolution::fCstIndex
private

Definition at line 41 of file TF1Convolution.h.

◆ fFlagFFT

Bool_t TF1Convolution::fFlagFFT
private

Definition at line 43 of file TF1Convolution.h.

◆ fFlagGraph

Bool_t TF1Convolution::fFlagGraph
private

Definition at line 44 of file TF1Convolution.h.

◆ fFunction1

std::shared_ptr<TF1> TF1Convolution::fFunction1
private

Definition at line 28 of file TF1Convolution.h.

◆ fFunction2

std::shared_ptr<TF1> TF1Convolution::fFunction2
private

Definition at line 29 of file TF1Convolution.h.

◆ fGraphConv

std::shared_ptr<TGraph> TF1Convolution::fGraphConv
private

Definition at line 30 of file TF1Convolution.h.

◆ fNofParams1

Int_t TF1Convolution::fNofParams1
private

Definition at line 39 of file TF1Convolution.h.

◆ fNofParams2

Int_t TF1Convolution::fNofParams2
private

Definition at line 40 of file TF1Convolution.h.

◆ fNofPoints

Int_t TF1Convolution::fNofPoints
private

Definition at line 42 of file TF1Convolution.h.

◆ fParams1

std::vector< Double_t > TF1Convolution::fParams1
private

Definition at line 32 of file TF1Convolution.h.

◆ fParams2

std::vector< Double_t > TF1Convolution::fParams2
private

Definition at line 33 of file TF1Convolution.h.

◆ fParNames

std::vector< TString > TF1Convolution::fParNames
private

Definition at line 35 of file TF1Convolution.h.

◆ fXmax

Double_t TF1Convolution::fXmax
private

Definition at line 38 of file TF1Convolution.h.

◆ fXmin

Double_t TF1Convolution::fXmin
private

Definition at line 37 of file TF1Convolution.h.


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