ROOT
6.07/01
Reference Guide
|
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< TF1 > | fFunction1 |
std::shared_ptr< TF1 > | fFunction2 |
std::shared_ptr< TGraph > | fGraphConv |
std::vector< Double_t > | fParams1 |
std::vector< Double_t > | fParams2 |
std::vector< TString > | fParNames |
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>
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.
Definition at line 270 of file TF1Convolution.cxx.
Referenced by operator()().
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()().
|
inline |
Definition at line 67 of file TF1Convolution.h.
Referenced by fitConvolution(), and TFitEditor::GetFitFunction().
|
inline |
Definition at line 70 of file TF1Convolution.h.
Referenced by TFitEditor::GetFitFunction(), and InitializeDataMembers().
|
inline |
Definition at line 69 of file TF1Convolution.h.
Referenced by SetRange().
|
inline |
Definition at line 68 of file TF1Convolution.h.
Referenced by SetRange().
|
private |
use copy instead of Clone
Definition at line 72 of file TF1Convolution.cxx.
Referenced by TF1Convolution().
|
private |
perform the FFT of the two functions
Definition at line 207 of file TF1Convolution.cxx.
Referenced by EvalFFTConv().
Definition at line 304 of file TF1Convolution.cxx.
Definition at line 377 of file TF1Convolution.cxx.
Referenced by SetRange().
Definition at line 315 of file TF1Convolution.cxx.
Referenced by fitConvolution().
Definition at line 65 of file TF1Convolution.h.
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.
Definition at line 388 of file TF1Convolution.cxx.
Referenced by fitConvolution().
|
private |
Definition at line 41 of file TF1Convolution.h.
Referenced by InitializeDataMembers(), and SetParameters().
|
private |
Definition at line 43 of file TF1Convolution.h.
Referenced by InitializeDataMembers(), MakeFFTConv(), operator()(), SetNumConv(), and SetRange().
|
private |
Definition at line 44 of file TF1Convolution.h.
Referenced by EvalFFTConv(), InitializeDataMembers(), MakeFFTConv(), SetExtraRange(), SetNofPointsFFT(), SetParameters(), and SetRange().
|
private |
Definition at line 28 of file TF1Convolution.h.
Referenced by EvalNumConv(), InitializeDataMembers(), MakeFFTConv(), SetParameters(), SetRange(), and TF1Convolution().
|
private |
Definition at line 29 of file TF1Convolution.h.
Referenced by EvalNumConv(), InitializeDataMembers(), MakeFFTConv(), SetParameters(), and TF1Convolution().
|
private |
Definition at line 30 of file TF1Convolution.h.
Referenced by EvalFFTConv(), MakeFFTConv(), and SetNofPointsFFT().
|
private |
Definition at line 39 of file TF1Convolution.h.
Referenced by GetNpar(), InitializeDataMembers(), and SetParameters().
|
private |
Definition at line 40 of file TF1Convolution.h.
Referenced by GetNpar(), InitializeDataMembers(), and SetParameters().
|
private |
Definition at line 42 of file TF1Convolution.h.
Referenced by InitializeDataMembers(), MakeFFTConv(), and SetNofPointsFFT().
|
private |
Definition at line 32 of file TF1Convolution.h.
Referenced by InitializeDataMembers(), and SetParameters().
|
private |
Definition at line 33 of file TF1Convolution.h.
Referenced by InitializeDataMembers(), and SetParameters().
|
private |
Definition at line 35 of file TF1Convolution.h.
Referenced by GetParName(), and InitializeDataMembers().
|
private |
Definition at line 38 of file TF1Convolution.h.
Referenced by EvalNumConv(), GetXmax(), InitializeDataMembers(), MakeFFTConv(), SetExtraRange(), SetRange(), and TF1Convolution().
|
private |
Definition at line 37 of file TF1Convolution.h.
Referenced by EvalNumConv(), GetXmin(), InitializeDataMembers(), MakeFFTConv(), SetExtraRange(), SetRange(), and TF1Convolution().