ROOT  6.06/09
Reference Guide
Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
TFormula Class Reference

The F O R M U L A class.

This is a new version of the TFormula class based on Cling. This class is not 100% backward compatible with the old TFOrmula class, which is still available in ROOT as ROOT::v5::TFormula. Some of the TFormula member funtions available in version 5, such as Analyze and AnalyzeFunction are not available in the new TFormula. On the other hand formula expressions which were valid in version 5 are still valid in TFormula version 6

This class has been implemented during Google Summer of Code 2013 by Maciej Zimnoch.

Example of valid expressions:

In the last example above:

TMath functions can be part of the expression, eg:

Formula may contain constans, eg:

and more.

Comparisons operators are also supported (&&, ||, ==, <=, >=, !)

Examples:

    `sin(x*(x<0.5 || x>1))`

If the result of a comparison is TRUE, the result is 1, otherwise 0.

Already predefined names can be given. For example, if the formula

 `TFormula old("old",sin(x*(x<0.5 || x>1)))`

one can assign a name to the formula. By default the name of the object = title = formula itself.

 `TFormula new("new","x*old")`

is equivalent to:

 `TFormula new("new","x*sin(x*(x&lt;0.5 || x&gt;1))")`

The class supports unlimited numer of variables and parameters. By default the names which can be used for the variables are x,y,z,t or x[0],x[1],x[2],x[3],....x[N] for N-dimensionals formula.

This class is not anymore the base class for the function classes TF1, but it has now adata member of TF1 which can be access via TF1::GetFormula.

Definition at line 89 of file TFormula.h.

Public Types

enum  { kNotGlobal = BIT(10), kNormalized = BIT(14), kLinear = BIT(16), kLambda = BIT(17) }
 
- Public Types inherited from TObject
enum  EStatusBits {
  kCanDelete = BIT(0), kMustCleanup = BIT(3), kObjInCanvas = BIT(3), kIsReferenced = BIT(4),
  kHasUUID = BIT(5), kCannotPick = BIT(6), kNoContextMenu = BIT(8), kInvalidObject = BIT(13)
}
 
enum  { kIsOnHeap = 0x01000000, kNotDeleted = 0x02000000, kZombie = 0x04000000, kBitMask = 0x00ffffff }
 
enum  { kSingleKey = BIT(0), kOverwrite = BIT(1), kWriteDelete = BIT(2) }
 

Public Member Functions

 TFormula ()
 
virtual ~TFormula ()
 
TFormulaoperator= (const TFormula &rhs)
 
 TFormula (const char *name, const char *formula="", bool addToGlobList=true)
 
 TFormula (const char *name, const char *formula, int ndim, int npar, bool addToGlobList=true)
 constructor from a full compileable C++ expression More...
 
 TFormula (const TFormula &formula)
 
void AddParameter (const TString &name, Double_t value=0)
 
void AddVariable (const TString &name, Double_t value=0)
 
void AddVariables (const TString *vars, const Int_t size)
 
Int_t Compile (const char *expression="")
 
virtual void Copy (TObject &f1) const
 Copy this to obj. More...
 
virtual void Clear (Option_t *option="")
 Set name and title to empty strings (""). More...
 
Double_t Eval (Double_t x) const
 
Double_t Eval (Double_t x, Double_t y) const
 
Double_t Eval (Double_t x, Double_t y, Double_t z) const
 
Double_t Eval (Double_t x, Double_t y, Double_t z, Double_t t) const
 
Double_t EvalPar (const Double_t *x, const Double_t *params=0) const
 
TString GetExpFormula (Option_t *option="") const
 return the expression formula If option = "P" replace the parameter names with their values If option = "CLING" return the actual expression used to build the function passed to cling If option = "CLINGP" replace in the CLING expression the parameter with their values More...
 
const TObjectGetLinearPart (Int_t i) const
 
Int_t GetNdim () const
 
Int_t GetNpar () const
 
Int_t GetNumber () const
 
const char * GetParName (Int_t ipar) const
 
Int_t GetParNumber (const char *name) const
 
Double_t GetParameter (const char *name) const
 
Double_t GetParameter (Int_t param) const
 
Double_tGetParameters () const
 
void GetParameters (Double_t *params) const
 
Double_t GetVariable (const char *name) const
 
Int_t GetVarNumber (const char *name) const
 
TString GetVarName (Int_t ivar) const
 
Bool_t IsValid () const
 
Bool_t IsLinear () const
 
void Print (Option_t *option="") const
 print the formula and its attributes More...
 
void SetName (const char *name)
 Change (i.e. More...
 
void SetParameter (const char *name, Double_t value)
 
void SetParameter (Int_t param, Double_t value)
 
void SetParameters (const Double_t *params)
 
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)
 
void SetParName (Int_t ipar, const char *name)
 
void SetParNames (const char *name0="p0", const char *name1="p1", const char *name2="p2", const char *name3="p3", const char *name4="p4", const char *name5="p5", const char *name6="p6", const char *name7="p7", const char *name8="p8", const char *name9="p9", const char *name10="p10")
 
void SetVariable (const TString &name, Double_t value)
 
void SetVariables (const std::pair< TString, Double_t > *vars, const Int_t size)
 
- Public Member Functions inherited from TNamed
 TNamed ()
 
 TNamed (const char *name, const char *title)
 
 TNamed (const TString &name, const TString &title)
 
 TNamed (const TNamed &named)
 
TNamedoperator= (const TNamed &rhs)
 TNamed assignment operator. More...
 
virtual ~TNamed ()
 
virtual TObjectClone (const char *newname="") const
 Make a clone of an object using the Streamer facility. More...
 
virtual Int_t Compare (const TObject *obj) const
 Compare two TNamed objects. More...
 
virtual void FillBuffer (char *&buffer)
 Encode TNamed into output buffer. More...
 
virtual const char * GetName () const
 Returns name of object. More...
 
virtual const char * GetTitle () const
 Returns title of object. More...
 
virtual ULong_t Hash () const
 Return hash value for this object. More...
 
virtual Bool_t IsSortable () const
 
virtual void SetNameTitle (const char *name, const char *title)
 Change (i.e. set) all the TNamed parameters (name and title). More...
 
virtual void SetTitle (const char *title="")
 Change (i.e. set) the title of the TNamed. More...
 
virtual void ls (Option_t *option="") const
 List TNamed name and title. More...
 
virtual Int_t Sizeof () const
 Return size of the TNamed part of the TObject. More...
 
- Public Member Functions inherited from TObject
 TObject ()
 
 TObject (const TObject &object)
 TObject copy ctor. More...
 
TObjectoperator= (const TObject &rhs)
 TObject assignment operator. More...
 
virtual ~TObject ()
 TObject destructor. More...
 
virtual void AppendPad (Option_t *option="")
 Append graphics object to current pad. More...
 
virtual void Browse (TBrowser *b)
 Browse object. May be overridden for another default action. More...
 
virtual const char * ClassName () const
 Returns name of class to which the object belongs. More...
 
virtual void Delete (Option_t *option="")
 Delete this object. More...
 
virtual Int_t DistancetoPrimitive (Int_t px, Int_t py)
 Computes distance from point (px,py) to the object. More...
 
virtual void Draw (Option_t *option="")
 Default Draw method for all objects. More...
 
virtual void DrawClass () const
 Draw class inheritance tree of the class to which this object belongs. More...
 
virtual TObjectDrawClone (Option_t *option="") const
 Draw a clone of this object in the current pad. More...
 
virtual void Dump () const
 Dump contents of object on stdout. More...
 
virtual void Execute (const char *method, const char *params, Int_t *error=0)
 Execute method on this object with the given parameter string, e.g. More...
 
virtual void Execute (TMethod *method, TObjArray *params, Int_t *error=0)
 Execute method on this object with parameters stored in the TObjArray. More...
 
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
 Execute action corresponding to an event at (px,py). More...
 
virtual TObjectFindObject (const char *name) const
 Must be redefined in derived classes. More...
 
virtual TObjectFindObject (const TObject *obj) const
 Must be redefined in derived classes. More...
 
virtual Option_tGetDrawOption () const
 Get option used by the graphics system to draw this object. More...
 
virtual UInt_t GetUniqueID () const
 Return the unique object id. More...
 
virtual const char * GetIconName () const
 Returns mime type name of object. More...
 
virtual Option_tGetOption () const
 
virtual char * GetObjectInfo (Int_t px, Int_t py) const
 Returns string containing info about the object at position (px,py). More...
 
virtual Bool_t HandleTimer (TTimer *timer)
 Execute action in response of a timer timing out. More...
 
virtual Bool_t InheritsFrom (const char *classname) const
 Returns kTRUE if object inherits from class "classname". More...
 
virtual Bool_t InheritsFrom (const TClass *cl) const
 Returns kTRUE if object inherits from TClass cl. More...
 
virtual void Inspect () const
 Dump contents of this object in a graphics canvas. More...
 
virtual Bool_t IsFolder () const
 Returns kTRUE in case object contains browsable objects (like containers or lists of other objects). More...
 
virtual Bool_t IsEqual (const TObject *obj) const
 Default equal comparison (objects are equal if they have the same address in memory). More...
 
Bool_t IsOnHeap () const
 
Bool_t IsZombie () const
 
virtual Bool_t Notify ()
 This method must be overridden to handle object notification. More...
 
virtual void Paint (Option_t *option="")
 This method must be overridden if a class wants to paint itself. More...
 
virtual void Pop ()
 Pop on object drawn in a pad to the top of the display list. More...
 
virtual Int_t Read (const char *name)
 Read contents of object with specified name from the current directory. More...
 
virtual void RecursiveRemove (TObject *obj)
 Recursively remove this object from a list. More...
 
virtual void SaveAs (const char *filename="", Option_t *option="") const
 Save this object in the file specified by filename. More...
 
virtual void SavePrimitive (std::ostream &out, Option_t *option="")
 Save a primitive as a C++ statement(s) on output stream "out". More...
 
virtual void SetDrawOption (Option_t *option="")
 Set drawing option for object. More...
 
virtual void SetUniqueID (UInt_t uid)
 Set the unique object id. More...
 
virtual void UseCurrentStyle ()
 Set current style settings in this object This function is called when either TCanvas::UseCurrentStyle or TROOT::ForceStyle have been invoked. More...
 
virtual Int_t Write (const char *name=0, Int_t option=0, Int_t bufsize=0)
 Write this object to the current directory. More...
 
virtual Int_t Write (const char *name=0, Int_t option=0, Int_t bufsize=0) const
 Write this object to the current directory. More...
 
voidoperator new (size_t sz)
 
voidoperator new[] (size_t sz)
 
voidoperator new (size_t sz, void *vp)
 
voidoperator new[] (size_t sz, void *vp)
 
void operator delete (void *ptr)
 Operator delete. More...
 
void operator delete[] (void *ptr)
 Operator delete []. More...
 
void SetBit (UInt_t f, Bool_t set)
 Set or unset the user status bits as specified in f. More...
 
void SetBit (UInt_t f)
 
void ResetBit (UInt_t f)
 
Bool_t TestBit (UInt_t f) const
 
Int_t TestBits (UInt_t f) const
 
void InvertBit (UInt_t f)
 
virtual void Info (const char *method, const char *msgfmt,...) const
 Issue info message. More...
 
virtual void Warning (const char *method, const char *msgfmt,...) const
 Issue warning message. More...
 
virtual void Error (const char *method, const char *msgfmt,...) const
 Issue error message. More...
 
virtual void SysError (const char *method, const char *msgfmt,...) const
 Issue system error message. More...
 
virtual void Fatal (const char *method, const char *msgfmt,...) const
 Issue fatal error message. More...
 
void AbstractMethod (const char *method) const
 Use this method to implement an "abstract" method that you don't want to leave purely abstract. More...
 
void MayNotUse (const char *method) const
 Use this method to signal that a method (defined in a base class) may not be called in a derived class (in principle against good design since a child class should not provide less functionality than its parent, however, sometimes it is necessary). More...
 
void Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const
 Use this method to declare a method obsolete. More...
 

Protected Member Functions

void ExtractFunctors (TString &formula)
 
void PreProcessFormula (TString &formula)
 
void ProcessFormula (TString &formula)
 
Bool_t PrepareFormula (TString &formula)
 
void ReplaceParamName (TString &formula, const TString &oldname, const TString &name)
 
void DoAddParameter (const TString &name, Double_t value, bool processFormula)
 
void DoSetParameters (const Double_t *p, Int_t size)
 
void SetPredefinedParamNames ()
 
Double_t DoEval (const Double_t *x, const Double_t *p=nullptr) const
 
- Protected Member Functions inherited from TObject
void MakeZombie ()
 
virtual void DoError (int level, const char *location, const char *fmt, va_list va) const
 Interface to ErrorHandler (protected). More...
 

Static Protected Member Functions

static Bool_t IsOperator (const char c)
 
static Bool_t IsBracket (const char c)
 
static Bool_t IsFunctionNameChar (const char c)
 
static Bool_t IsScientificNotation (const TString &formula, int ipos)
 
static Bool_t IsHexadecimal (const TString &formula, int ipos)
 

Protected Attributes

std::list< TFormulaFunctionfFuncs
 
std::map< TString, TFormulaVariablefVars
 
std::map< TString, Int_t, TFormulaParamOrderfParams
 list of variable names More...
 
std::map< TString, Double_tfConsts
 
std::map< TString, TStringfFunctionsShortcuts
 
TString fFormula
 
Int_t fNdim
 
Int_t fNpar
 
Int_t fNumber
 
std::vector< TObject * > fLinearParts
 
- Protected Attributes inherited from TNamed
TString fName
 
TString fTitle
 

Private Member Functions

void InputFormulaIntoCling ()
 pointer to the lambda function More...
 
Bool_t PrepareEvalMethod ()
 
void FillDefaults ()
 
void HandlePolN (TString &formula)
 
void HandleParametrizedFunctions (TString &formula)
 
void HandleExponentiation (TString &formula)
 
void HandleLinear (TString &formula)
 
Bool_t InitLambdaExpression (const char *formula)
 

Static Private Member Functions

static Bool_t IsDefaultVariableName (const TString &name)
 

Private Attributes

TString fClingInput
 
std::vector< Double_tfClingVariables
 input function passed to Cling More...
 
std::vector< Double_tfClingParameters
 cached variables More...
 
Bool_t fReadyToExecute
 
Bool_t fClingInitialized
 trasient to force initialization More...
 
Bool_t fAllParametersSetted
 transient to force re-initialization More...
 
TMethodCallfMethod
 
TString fClingName
 pointer to methocall More...
 
TInterpreter::CallFuncIFacePtr_t::Generic_t fFuncPtr
 unique name passed to Cling to define the function ( double clingName(double*x, double*p) ) More...
 
voidfLambdaPtr
 function pointer More...
 

Additional Inherited Members

- Static Public Member Functions inherited from TObject
static Long_t GetDtorOnly ()
 Return destructor only flag. More...
 
static void SetDtorOnly (void *obj)
 Set destructor only flag. More...
 
static Bool_t GetObjectStat ()
 Get status of object stat flag. More...
 
static void SetObjectStat (Bool_t stat)
 Turn on/off tracking of objects in the TObjectTable. More...
 

#include "inc/TFormula.h"

+ Inheritance diagram for TFormula:
+ Collaboration diagram for TFormula:

Member Enumeration Documentation

anonymous enum
Enumerator
kNotGlobal 
kNormalized 
kLinear 
kLambda 

Definition at line 147 of file TFormula.h.

Constructor & Destructor Documentation

TFormula::TFormula ( )

Definition at line 246 of file TFormula.cxx.

Referenced by ClassImp(), Copy(), and HandleLinear().

TFormula::~TFormula ( )
virtual

Definition at line 274 of file TFormula.cxx.

Referenced by ClassImp().

TFormula::TFormula ( const char *  name,
const char *  formula = "",
bool  addToGlobList = true 
)

Definition at line 294 of file TFormula.cxx.

TFormula::TFormula ( const char *  name,
const char *  formula,
int  ndim,
int  npar,
bool  addToGlobList = true 
)

constructor from a full compileable C++ expression

Definition at line 334 of file TFormula.cxx.

TFormula::TFormula ( const TFormula formula)

Definition at line 377 of file TFormula.cxx.

Member Function Documentation

void TFormula::AddParameter ( const TString name,
Double_t  value = 0 
)
inline

Definition at line 161 of file TFormula.h.

Referenced by TF1::AddParameter().

void TFormula::AddVariable ( const TString name,
Double_t  value = 0 
)

Definition at line 1982 of file TFormula.cxx.

Referenced by ProcessFormula().

void TFormula::AddVariables ( const TString vars,
const Int_t  size 
)

Definition at line 2017 of file TFormula.cxx.

void TFormula::Clear ( Option_t option = "")
virtual

Set name and title to empty strings ("").

Reimplemented from TNamed.

Definition at line 591 of file TFormula.cxx.

Referenced by ClassImp(), and Compile().

Int_t TFormula::Compile ( const char *  expression = "")

Definition at line 479 of file TFormula.cxx.

Referenced by ClassImp().

void TFormula::Copy ( TObject named) const
virtual

Copy this to obj.

Reimplemented from TNamed.

Definition at line 518 of file TFormula.cxx.

Referenced by ClassImp(), Copy(), TF1::Copy(), and operator=().

void TFormula::DoAddParameter ( const TString name,
Double_t  value,
bool  processFormula 
)
protected

Definition at line 2169 of file TFormula.cxx.

Referenced by ExtractFunctors(), and TFormula().

Double_t TFormula::DoEval ( const Double_t x,
const Double_t p = nullptr 
) const
protected

Definition at line 2547 of file TFormula.cxx.

Referenced by Eval(), and EvalPar().

void TFormula::DoSetParameters ( const Double_t p,
Int_t  size 
)
protected

Definition at line 2384 of file TFormula.cxx.

Referenced by SetParameters().

Double_t TFormula::Eval ( Double_t  x) const
Double_t TFormula::Eval ( Double_t  x,
Double_t  y 
) const

Definition at line 2530 of file TFormula.cxx.

Double_t TFormula::Eval ( Double_t  x,
Double_t  y,
Double_t  z 
) const

Definition at line 2522 of file TFormula.cxx.

Double_t TFormula::Eval ( Double_t  x,
Double_t  y,
Double_t  z,
Double_t  t 
) const

Definition at line 2514 of file TFormula.cxx.

Double_t TFormula::EvalPar ( const Double_t x,
const Double_t params = 0 
) const
void TFormula::ExtractFunctors ( TString formula)
protected

Definition at line 1346 of file TFormula.cxx.

Referenced by PrepareFormula(), and ProcessFormula().

void TFormula::FillDefaults ( )
private

Definition at line 690 of file TFormula.cxx.

Referenced by Compile(), and TFormula().

TString TFormula::GetExpFormula ( Option_t option = "") const

return the expression formula If option = "P" replace the parameter names with their values If option = "CLING" return the actual expression used to build the function passed to cling If option = "CLINGP" replace in the CLING expression the parameter with their values

Definition at line 2610 of file TFormula.cxx.

Referenced by ClassImp(), Copy(), ExtractFunctors(), TF1::GetExpFormula(), ProcessFormula(), and TFormula().

const TObject * TFormula::GetLinearPart ( Int_t  i) const

Definition at line 1968 of file TFormula.cxx.

Referenced by TLinearFitter::AddToDesign(), ClassImp(), and TF1::GetLinearPart().

Int_t TFormula::GetNdim ( ) const
inline

Definition at line 174 of file TFormula.h.

Referenced by TF1::TF1(), and TFormula().

Int_t TFormula::GetNpar ( ) const
inline
Int_t TFormula::GetNumber ( ) const
inline

Definition at line 176 of file TFormula.h.

Referenced by TF1::GetNumber(), TLinearFitter::SetFormula(), and TFormula().

Double_t TFormula::GetParameter ( const char *  name) const

Definition at line 2263 of file TFormula.cxx.

Referenced by ClassImp(), ExtractFunctors(), GetExpFormula(), and TF1::GetParameter().

Double_t TFormula::GetParameter ( Int_t  param) const

Definition at line 2276 of file TFormula.cxx.

Double_t * TFormula::GetParameters ( ) const

Definition at line 2303 of file TFormula.cxx.

Referenced by Copy(), and TF1::GetParameters().

void TFormula::GetParameters ( Double_t params) const

Definition at line 2310 of file TFormula.cxx.

const char * TFormula::GetParName ( Int_t  ipar) const
Int_t TFormula::GetParNumber ( const char *  name) const

Definition at line 2251 of file TFormula.cxx.

Referenced by ClassImp(), GetParameter(), TF1::GetParNumber(), and SetParameter().

Double_t TFormula::GetVariable ( const char *  name) const

Definition at line 2111 of file TFormula.cxx.

Referenced by TF1::GetVariable().

TString TFormula::GetVarName ( Int_t  ivar) const

Definition at line 2138 of file TFormula.cxx.

Referenced by Print().

Int_t TFormula::GetVarNumber ( const char *  name) const

Definition at line 2124 of file TFormula.cxx.

void TFormula::HandleExponentiation ( TString formula)
private

Definition at line 1145 of file TFormula.cxx.

Referenced by PreProcessFormula().

void TFormula::HandleLinear ( TString formula)
private

Definition at line 1245 of file TFormula.cxx.

Referenced by PreProcessFormula().

void TFormula::HandleParametrizedFunctions ( TString formula)
private

Definition at line 881 of file TFormula.cxx.

Referenced by PreProcessFormula().

void TFormula::HandlePolN ( TString formula)
private

Definition at line 788 of file TFormula.cxx.

Referenced by PreProcessFormula().

Bool_t TFormula::InitLambdaExpression ( const char *  formula)
private

Definition at line 442 of file TFormula.cxx.

Referenced by Compile(), Copy(), and TFormula().

void TFormula::InputFormulaIntoCling ( )
private

pointer to the lambda function

Definition at line 679 of file TFormula.cxx.

Referenced by DoEval(), and ProcessFormula().

Bool_t TFormula::IsBracket ( const char  c)
staticprotected

Definition at line 162 of file TFormula.cxx.

Referenced by HandleExponentiation().

Bool_t TFormula::IsDefaultVariableName ( const TString name)
staticprivate

Definition at line 177 of file TFormula.cxx.

Bool_t TFormula::IsFunctionNameChar ( const char  c)
staticprotected

Definition at line 172 of file TFormula.cxx.

Referenced by ExtractFunctors(), HandleParametrizedFunctions(), and HandlePolN().

Bool_t TFormula::IsHexadecimal ( const TString formula,
int  ipos 
)
staticprotected

Definition at line 194 of file TFormula.cxx.

Referenced by ExtractFunctors().

Bool_t TFormula::IsLinear ( ) const
inline

Definition at line 187 of file TFormula.h.

Referenced by TF1::IsLinear().

Bool_t TFormula::IsOperator ( const char  c)
staticprotected
Bool_t TFormula::IsScientificNotation ( const TString formula,
int  ipos 
)
staticprotected

Definition at line 183 of file TFormula.cxx.

Referenced by ExtractFunctors(), and HandleExponentiation().

Bool_t TFormula::IsValid ( ) const
inline

Definition at line 186 of file TFormula.h.

Referenced by Compile(), TF1::IsValid(), and TF1Convolution::TF1Convolution().

TFormula & TFormula::operator= ( const TFormula rhs)

Definition at line 430 of file TFormula.cxx.

Referenced by ClassImp().

bool TFormula::PrepareEvalMethod ( )
private

Definition at line 623 of file TFormula.cxx.

Referenced by InputFormulaIntoCling().

Bool_t TFormula::PrepareFormula ( TString formula)
protected

Definition at line 1315 of file TFormula.cxx.

Referenced by Compile(), and TFormula().

void TFormula::PreProcessFormula ( TString formula)
protected

Definition at line 1293 of file TFormula.cxx.

Referenced by Compile(), ExtractFunctors(), ProcessFormula(), and TFormula().

void TFormula::Print ( Option_t option = "") const
virtual

print the formula and its attributes

Reimplemented from TNamed.

Definition at line 2682 of file TFormula.cxx.

Referenced by ClassImp(), and TF1::Print().

void TFormula::ProcessFormula ( TString formula)
protected

Definition at line 1549 of file TFormula.cxx.

Referenced by AddVariable(), AddVariables(), DoAddParameter(), and PrepareFormula().

void TFormula::ReplaceParamName ( TString formula,
const TString oldname,
const TString name 
)
protected

Definition at line 2481 of file TFormula.cxx.

Referenced by SetParName().

void TFormula::SetName ( const char *  name)
virtual

Change (i.e.

set) the name of the TNamed. WARNING: if the object is a member of a THashTable or THashList container the container must be Rehash()'ed after SetName(). For example the list of objects in the current directory is a THashList.

Reimplemented from TNamed.

Definition at line 2065 of file TFormula.cxx.

void TFormula::SetParameter ( const char *  name,
Double_t  value 
)
void TFormula::SetParameter ( Int_t  param,
Double_t  value 
)

Definition at line 2427 of file TFormula.cxx.

void TFormula::SetParameters ( const Double_t params)
void TFormula::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 
)

Definition at line 2408 of file TFormula.cxx.

void TFormula::SetParName ( Int_t  ipar,
const char *  name 
)

Definition at line 2454 of file TFormula.cxx.

Referenced by ClassImp(), TF1::SetParName(), SetParNames(), and SetPredefinedParamNames().

void TFormula::SetParNames ( const char *  name0 = "p0",
const char *  name1 = "p1",
const char *  name2 = "p2",
const char *  name3 = "p3",
const char *  name4 = "p4",
const char *  name5 = "p5",
const char *  name6 = "p6",
const char *  name7 = "p7",
const char *  name8 = "p8",
const char *  name9 = "p9",
const char *  name10 = "p10" 
)

Definition at line 2438 of file TFormula.cxx.

Referenced by ClassImp(), and TF1::SetParNames().

void TFormula::SetPredefinedParamNames ( )
protected

Definition at line 1899 of file TFormula.cxx.

Referenced by PrepareFormula().

void TFormula::SetVariable ( const TString name,
Double_t  value 
)

Definition at line 2155 of file TFormula.cxx.

void TFormula::SetVariables ( const std::pair< TString, Double_t > *  vars,
const Int_t  size 
)

Definition at line 2087 of file TFormula.cxx.

Member Data Documentation

Bool_t TFormula::fAllParametersSetted
private

transient to force re-initialization

Definition at line 100 of file TFormula.h.

Referenced by Clear(), Copy(), DoSetParameters(), Print(), ProcessFormula(), SetParameter(), and TFormula().

Bool_t TFormula::fClingInitialized
private

trasient to force initialization

Definition at line 99 of file TFormula.h.

Referenced by Clear(), Copy(), DoEval(), InitLambdaExpression(), InputFormulaIntoCling(), PrepareFormula(), ProcessFormula(), and TFormula().

TString TFormula::fClingInput
private
TString TFormula::fClingName
private

pointer to methocall

Definition at line 102 of file TFormula.h.

Referenced by Clear(), Copy(), DoEval(), PrepareEvalMethod(), and ProcessFormula().

std::vector<Double_t> TFormula::fClingParameters
private

cached variables

Definition at line 97 of file TFormula.h.

Referenced by Clear(), Copy(), DoAddParameter(), DoEval(), DoSetParameters(), GetParameter(), GetParameters(), Print(), SetParameter(), and TFormula().

std::vector<Double_t> TFormula::fClingVariables
private

input function passed to Cling

Definition at line 96 of file TFormula.h.

Referenced by AddVariable(), AddVariables(), Clear(), Copy(), DoEval(), FillDefaults(), Print(), SetVariable(), and SetVariables().

std::map<TString,Double_t> TFormula::fConsts
protected

Definition at line 121 of file TFormula.h.

Referenced by Clear(), Copy(), FillDefaults(), and ProcessFormula().

TString TFormula::fFormula
protected
TInterpreter::CallFuncIFacePtr_t::Generic_t TFormula::fFuncPtr
private

unique name passed to Cling to define the function ( double clingName(double*x, double*p) )

Definition at line 104 of file TFormula.h.

Referenced by Copy(), PrepareEvalMethod(), and ProcessFormula().

std::list<TFormulaFunction> TFormula::fFuncs
protected
std::map<TString,TString> TFormula::fFunctionsShortcuts
protected

Definition at line 122 of file TFormula.h.

Referenced by Clear(), Copy(), FillDefaults(), and ProcessFormula().

void* TFormula::fLambdaPtr
private

function pointer

Definition at line 105 of file TFormula.h.

Referenced by Copy(), DoEval(), InitLambdaExpression(), and TFormula().

std::vector<TObject*> TFormula::fLinearParts
protected

Definition at line 127 of file TFormula.h.

Referenced by Clear(), Copy(), GetLinearPart(), and HandleLinear().

TMethodCall* TFormula::fMethod
private

Definition at line 101 of file TFormula.h.

Referenced by Clear(), Copy(), PrepareEvalMethod(), and TFormula().

Int_t TFormula::fNdim
protected

Definition at line 124 of file TFormula.h.

Referenced by Clear(), Copy(), GetVarName(), PrepareEvalMethod(), Print(), ProcessFormula(), and TFormula().

Int_t TFormula::fNpar
protected
Int_t TFormula::fNumber
protected
std::map<TString,Int_t,TFormulaParamOrder> TFormula::fParams
protected

list of variable names

Definition at line 120 of file TFormula.h.

Referenced by Clear(), Copy(), DoAddParameter(), GetParName(), GetParNumber(), Print(), ProcessFormula(), SetParameter(), SetParName(), and TFormula().

Bool_t TFormula::fReadyToExecute
private
std::map<TString,TFormulaVariable> TFormula::fVars
protected

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