ROOT  6.06/09
Reference Guide
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...
 
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)
 
void SetExtraRange (Double_t percentage)
 
void SetNofPointsFFT (Int_t n)
 
void SetNumConv (Bool_t flag=true)
 
Int_t GetNpar () const
 
Double_t GetXmin () const
 
Double_t GetXmax () const
 
const char * GetParName (Int_t ipar) const
 
Double_t operator() (Double_t *t, Double_t *p)
 

Private Member Functions

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...
 
Double_t EvalFFTConv (Double_t t)
 
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

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

#include <TF1Convolution.h>

+ Collaboration diagram for TF1Convolution:

Constructor & Destructor Documentation

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 124 of file TF1Convolution.cxx.

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 132 of file TF1Convolution.cxx.

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 144 of file TF1Convolution.cxx.

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 178 of file TF1Convolution.cxx.

Member Function Documentation

Double_t TF1Convolution::EvalFFTConv ( Double_t  t)
private

Definition at line 270 of file TF1Convolution.cxx.

Referenced by operator()().

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 284 of file TF1Convolution.cxx.

Referenced by EvalFFTConv(), and operator()().

Int_t TF1Convolution::GetNpar ( ) const
inline

Definition at line 67 of file TF1Convolution.h.

Referenced by TFitEditor::GetFitFunction().

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

Definition at line 70 of file TF1Convolution.h.

Referenced by TFitEditor::GetFitFunction(), and InitializeDataMembers().

Double_t TF1Convolution::GetXmax ( ) const
inline

Definition at line 69 of file TF1Convolution.h.

Referenced by SetRange().

Double_t TF1Convolution::GetXmin ( ) const
inline

Definition at line 68 of file TF1Convolution.h.

Referenced by SetRange().

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

use copy instead of Clone

Definition at line 72 of file TF1Convolution.cxx.

Referenced by TF1Convolution().

void TF1Convolution::MakeFFTConv ( )
private

perform the FFT of the two functions

Definition at line 207 of file TF1Convolution.cxx.

Referenced by EvalFFTConv().

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

Definition at line 304 of file TF1Convolution.cxx.

void TF1Convolution::SetExtraRange ( Double_t  percentage)

Definition at line 377 of file TF1Convolution.cxx.

Referenced by SetRange().

void TF1Convolution::SetNofPointsFFT ( Int_t  n)

Definition at line 315 of file TF1Convolution.cxx.

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

Definition at line 65 of file TF1Convolution.h.

void TF1Convolution::SetParameters ( Double_t p)

Definition at line 325 of file TF1Convolution.cxx.

Referenced by operator()(), and SetParameters().

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 368 of file TF1Convolution.cxx.

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

Definition at line 388 of file TF1Convolution.cxx.

Member Data Documentation

Int_t TF1Convolution::fCstIndex
private

Definition at line 41 of file TF1Convolution.h.

Referenced by InitializeDataMembers(), and SetParameters().

Bool_t TF1Convolution::fFlagFFT
private

Definition at line 43 of file TF1Convolution.h.

Referenced by InitializeDataMembers(), MakeFFTConv(), operator()(), and SetRange().

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

Definition at line 28 of file TF1Convolution.h.

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

Definition at line 29 of file TF1Convolution.h.

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

Definition at line 30 of file TF1Convolution.h.

Referenced by EvalFFTConv(), MakeFFTConv(), and SetNofPointsFFT().

Int_t TF1Convolution::fNofParams1
private

Definition at line 39 of file TF1Convolution.h.

Referenced by InitializeDataMembers(), and SetParameters().

Int_t TF1Convolution::fNofParams2
private

Definition at line 40 of file TF1Convolution.h.

Referenced by InitializeDataMembers(), and SetParameters().

Int_t TF1Convolution::fNofPoints
private

Definition at line 42 of file TF1Convolution.h.

Referenced by InitializeDataMembers(), MakeFFTConv(), and SetNofPointsFFT().

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

Definition at line 32 of file TF1Convolution.h.

Referenced by InitializeDataMembers(), and SetParameters().

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

Definition at line 33 of file TF1Convolution.h.

Referenced by InitializeDataMembers(), and SetParameters().

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

Definition at line 35 of file TF1Convolution.h.

Referenced by InitializeDataMembers().

Double_t TF1Convolution::fXmax
private
Double_t TF1Convolution::fXmin
private

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