ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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...
 
double operator() (double *x, double *p)
 Overload the parenthesis to add the functions. More...
 
std::vector< doubleGetParameters () const
 Return array of parameters. More...
 
void SetScale (Double_t scale)
 
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...
 
Int_t GetNpar () const
 
Double_t GetScale () const
 
const char * GetParName (Int_t ipar) const
 

Protected Member Functions

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

Protected Attributes

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

#include <TF1NormSum.h>

Constructor & Destructor Documentation

TF1NormSum::TF1NormSum ( )

Definition at line 108 of file TF1NormSum.cxx.

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

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

Return array of parameters.

Definition at line 293 of file TF1NormSum.cxx.

Referenced by fitNormSum().

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

Definition at line 70 of file TF1NormSum.h.

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

Double_t TF1NormSum::GetScale ( ) const
inline

Definition at line 68 of file TF1NormSum.h.

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.

Referenced by TF1NormSum().

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

Overload the parenthesis to add the functions.

Definition at line 277 of file TF1NormSum.cxx.

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.

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

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.

void TF1NormSum::SetScale ( Double_t  scale)
inline

Definition at line 59 of file TF1NormSum.h.

Member Data Documentation

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

Definition at line 41 of file TF1NormSum.h.

Referenced by GetNpar(), GetParameters(), InitializeDataMembers(), SetParameters(), and TF1NormSum().

std::vector< std::shared_ptr < TF1 > > TF1NormSum::fFunctions
protected
unsigned int TF1NormSum::fNOfFunctions
protected
std::vector< TString > TF1NormSum::fParNames
protected

Definition at line 42 of file TF1NormSum.h.

Referenced by GetParName(), and InitializeDataMembers().

Double_t TF1NormSum::fScale
protected

Number of functions to add.

Definition at line 34 of file TF1NormSum.h.

Referenced by GetScale(), InitializeDataMembers(), operator()(), SetScale(), and TF1NormSum().

Collaboration diagram for TF1NormSum:
[legend]

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