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

Class adding two functions: c1*f1+c2*f2.

Definition at line 26 of file TF1NormSum.h.

Public Member Functions

 TF1NormSum ()
 
 TF1NormSum (const std::vector< TF1 *> &functions, const std::vector< Double_t > &coeffs, Double_t scale=1.)
 
 TF1NormSum (TF1 *function1, TF1 *function2, Double_t coeff1=1., Double_t coeff2=1., Double_t scale=1.)
 TF1NormSum constructor taking 2 functions, and 2 coefficients (if not equal to 1) More...
 
 TF1NormSum (TF1 *function1, TF1 *function2, TF1 *function3, Double_t coeff1=1., Double_t coeff2=1., Double_t coeff3=1., Double_t scale=1.)
 TF1NormSum constructor taking 3 functions, and 3 coefficients (if not equal to 1) More...
 
 TF1NormSum (const TString &formula, Double_t xmin, Double_t xmax)
 TF1NormSum constructor taking any addition of formulas with coefficient or not. More...
 
Int_t GetNpar () const
 
std::vector< double > GetParameters () const
 Return array of parameters. More...
 
const char * GetParName (Int_t ipar) const
 
Double_t GetScale () const
 
double operator() (double *x, double *p)
 Overload the parenthesis to add the functions. More...
 
void SetParameters (const double *params)
 Initialize array of all parameters. More...
 
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., Double_t p8=0., Double_t p9=0., Double_t p10=0.)
 Initialize array of all parameters. More...
 
void SetScale (Double_t scale)
 

Protected Member Functions

void InitializeDataMembers (const std::vector< std::shared_ptr< TF1 >> &functions, const std::vector< Double_t > &coeffs, Double_t scale)
 

Protected Attributes

std::vector< Double_tfCoeffs
 
std::vector< Int_tfCstIndexes
 
std::vector< std::shared_ptr< TF1 > > fFunctions
 
unsigned int fNOfFunctions
 
std::vector< TStringfParNames
 
Double_t fScale
 Number of functions to add. More...
 

#include <TF1NormSum.h>

Constructor & Destructor Documentation

◆ TF1NormSum() [1/5]

TF1NormSum::TF1NormSum ( )

Definition at line 108 of file TF1NormSum.cxx.

◆ TF1NormSum() [2/5]

TF1NormSum::TF1NormSum ( const std::vector< TF1 *> &  functions,
const std::vector< Double_t > &  coeffs,
Double_t  scale = 1. 
)

Definition at line 119 of file TF1NormSum.cxx.

◆ TF1NormSum() [3/5]

TF1NormSum::TF1NormSum ( TF1 function1,
TF1 function2,
Double_t  coeff1 = 1.,
Double_t  coeff2 = 1.,
Double_t  scale = 1. 
)

TF1NormSum constructor taking 2 functions, and 2 coefficients (if not equal to 1)

Definition at line 133 of file TF1NormSum.cxx.

◆ TF1NormSum() [4/5]

TF1NormSum::TF1NormSum ( TF1 function1,
TF1 function2,
TF1 function3,
Double_t  coeff1 = 1.,
Double_t  coeff2 = 1.,
Double_t  coeff3 = 1.,
Double_t  scale = 1. 
)

TF1NormSum constructor taking 3 functions, and 3 coefficients (if not equal to 1)

Definition at line 163 of file TF1NormSum.cxx.

◆ TF1NormSum() [5/5]

TF1NormSum::TF1NormSum ( const TString formula,
Double_t  xmin,
Double_t  xmax 
)

TF1NormSum constructor taking any addition of formulas with coefficient or not.

  • example 1 : 2.*expo + gauss + 0.5* gauss
  • example 2 : expo + 0.3*f1 if f1 is defined in the list of fucntions

Definition at line 202 of file TF1NormSum.cxx.

Member Function Documentation

◆ GetNpar()

Int_t TF1NormSum::GetNpar ( ) const

Definition at line 362 of file TF1NormSum.cxx.

◆ GetParameters()

std::vector< double > TF1NormSum::GetParameters ( ) const

Return array of parameters.

Definition at line 293 of file TF1NormSum.cxx.

◆ GetParName()

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

Definition at line 70 of file TF1NormSum.h.

◆ GetScale()

Double_t TF1NormSum::GetScale ( ) const
inline

Definition at line 68 of file TF1NormSum.h.

◆ InitializeDataMembers()

void TF1NormSum::InitializeDataMembers ( const std::vector< std::shared_ptr< TF1 >> &  functions,
const std::vector< Double_t > &  coeffs,
Double_t  scale 
)
protected

Definition at line 65 of file TF1NormSum.cxx.

◆ operator()()

double TF1NormSum::operator() ( double *  x,
double *  p 
)

Overload the parenthesis to add the functions.

Definition at line 277 of file TF1NormSum.cxx.

◆ SetParameters() [1/2]

void TF1NormSum::SetParameters ( const double *  params)

Initialize array of all parameters.

double *params must contains first an array of the coefficients, then an array of the parameters.

Definition at line 317 of file TF1NormSum.cxx.

◆ SetParameters() [2/2]

void TF1NormSum::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.,
Double_t  p8 = 0.,
Double_t  p9 = 0.,
Double_t  p10 = 0. 
)

Initialize array of all parameters.

Overload the TF1::SetParameters() method. A maximum of 10 parameters must be used, with first the coefficients, then the parameters

Definition at line 354 of file TF1NormSum.cxx.

◆ SetScale()

void TF1NormSum::SetScale ( Double_t  scale)
inline

Definition at line 59 of file TF1NormSum.h.

Member Data Documentation

◆ fCoeffs

std::vector< Double_t > TF1NormSum::fCoeffs
protected

Definition at line 36 of file TF1NormSum.h.

◆ fCstIndexes

std::vector< Int_t > TF1NormSum::fCstIndexes
protected

Definition at line 41 of file TF1NormSum.h.

◆ fFunctions

std::vector< std::shared_ptr < TF1 > > TF1NormSum::fFunctions
protected

Definition at line 35 of file TF1NormSum.h.

◆ fNOfFunctions

unsigned int TF1NormSum::fNOfFunctions
protected

Definition at line 32 of file TF1NormSum.h.

◆ fParNames

std::vector< TString > TF1NormSum::fParNames
protected

Definition at line 42 of file TF1NormSum.h.

◆ fScale

Double_t TF1NormSum::fScale
protected

Number of functions to add.

Definition at line 34 of file TF1NormSum.h.


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