Logo ROOT  
Reference Guide
TFormula.h
Go to the documentation of this file.
1 // @(#)root/hist:$Id$
2 // Author: Nicolas Brun 19/08/95
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 // ---------------------------------- Formula.h
12 
13 #ifndef ROOT_v5_TFormula
14 #define ROOT_v5_TFormula
15 
16 
17 
18 //////////////////////////////////////////////////////////////////////////
19 // //
20 // TFormula //
21 // //
22 // The old formula base class f(x,y,z,par) //
23 // mantained for backward compatibility and TTree usage //
24 //////////////////////////////////////////////////////////////////////////
25 
26 #include "TNamed.h"
27 #include "TBits.h"
28 #include "TObjArray.h"
29 
30 
31 const Int_t kMAXFOUND = 500;
32 const Int_t kTFOperMask = 0x7fffff;
33 const UChar_t kTFOperShift = 23;
34 
35 
36 
37 namespace ROOT {
38  namespace v5 {
39 
40  class TFormulaPrimitive;
41 
42 class TOperOffset {
43  friend class TFormula;
44 public:
45  enum {
46  kVariable = 0,
49  };
50  TOperOffset();
51 protected:
52  Short_t fType0; // type of operand 0
53  Short_t fOffset0; // offset of operand 0
54  Short_t fType1; // type of operand 1
55  Short_t fOffset1; // offset of operand 1
56  Short_t fType2; // type of operand 2
57  Short_t fOffset2; // offset of operand 2
58  Short_t fType3; // type of operand 3
59  Short_t fOffset3; // offset of operand 3
60  Short_t fToJump; // where to jump in case of optimized boolen
61  Short_t fOldAction; // temporary variable used during optimization
62 };
63 
64 
65 class TFormula : public TNamed {
66 
67 protected:
68 
69  typedef Double_t (TObject::*TFuncG)(const Double_t*,const Double_t*) const;
70 
71  Int_t fNdim; //Dimension of function (1=1-Dim, 2=2-Dim,etc)
72  Int_t fNpar; //Number of parameters
73  Int_t fNoper; //Number of operators
74  Int_t fNconst; //Number of constants
75  Int_t fNumber; //formula number identifier
76  Int_t fNval; //Number of different variables in expression
77  Int_t fNstring; //Number of different constants character strings
78  TString *fExpr; //[fNoper] List of expressions
79 private:
80  Int_t *fOper; //[fNoper] List of operators. (See documentation for changes made at version 7)
81 protected:
82  Double_t *fConst; //[fNconst] Array of fNconst formula constants
83  Double_t *fParams; //[fNpar] Array of fNpar parameters
84  TString *fNames; //[fNpar] Array of parameter names
85  TObjArray fFunctions; //Array of function calls to make
86  TObjArray fLinearParts; //Linear parts if the formula is linear (contains '|' or "++")
87 
88  TBits fAlreadyFound; //! cache for information
89 
90  // Optimized expression
91  Int_t fNOperOptimized; //!Number of operators after optimization
92  TString *fExprOptimized; //![fNOperOptimized] List of expressions
93  Int_t *fOperOptimized; //![fNOperOptimized] List of operators. (See documentation for changes made at version 7)
94  TOperOffset *fOperOffset; //![fNOperOptimized] Offsets of operrands
95  TFormulaPrimitive **fPredefined; //![fNPar] predefined function
96  TFuncG fOptimal; //!pointer to optimal function
97 
99  virtual Bool_t CheckOperands(Int_t operation, Int_t &err);
100  virtual Bool_t CheckOperands(Int_t leftoperand, Int_t rightoperartion, Int_t &err);
101  virtual Bool_t StringToNumber(Int_t code);
102  void MakePrimitive(const char *expr, Int_t pos);
103  inline Int_t *GetOper() const { return fOper; }
104  inline Short_t GetAction(Int_t code) const { return fOper[code] >> kTFOperShift; }
105  inline Int_t GetActionParam(Int_t code) const { return fOper[code] & kTFOperMask; }
106 
107  inline void SetAction(Int_t code, Int_t value, Int_t param = 0) {
108  fOper[code] = (value) << kTFOperShift;
109  fOper[code] += param;
110  }
111  inline Int_t *GetOperOptimized() const { return fOperOptimized; }
112  inline Short_t GetActionOptimized(Int_t code) const { return fOperOptimized[code] >> kTFOperShift; }
113  inline Int_t GetActionParamOptimized(Int_t code) const { return fOperOptimized[code] & kTFOperMask; }
114 
115  inline void SetActionOptimized(Int_t code, Int_t value, Int_t param = 0) {
116  fOperOptimized[code] = (value) << kTFOperShift;
117  fOperOptimized[code] += param;
118  }
119 
120  void ClearFormula(Option_t *option="");
121  virtual Bool_t IsString(Int_t oper) const;
122 
123  virtual void Convert(UInt_t fromVersion);
124  //
125  // Functions - used for formula evaluation
126  Double_t EvalParFast(const Double_t *x, const Double_t *params);
127  Double_t EvalPrimitive(const Double_t *x, const Double_t *params);
128  Double_t EvalPrimitive0(const Double_t *x, const Double_t *params);
129  Double_t EvalPrimitive1(const Double_t *x, const Double_t *params);
130  Double_t EvalPrimitive2(const Double_t *x, const Double_t *params);
131  Double_t EvalPrimitive3(const Double_t *x, const Double_t *params);
132  Double_t EvalPrimitive4(const Double_t *x, const Double_t *params);
133 
134  // Action code for Version 6 and above.
135  enum {
136  kEnd = 0,
137  kAdd = 1, kSubstract = 2,
138  kMultiply = 3, kDivide = 4,
139  kModulo = 5,
140 
141  kcos = 10, ksin = 11 , ktan = 12,
142  kacos = 13, kasin = 14 , katan = 15,
143  katan2 = 16,
144  kfmod = 17,
145 
146  kpow = 20, ksq = 21, ksqrt = 22,
147 
148  kstrstr = 23,
149 
150  kmin = 24, kmax = 25,
151 
152  klog = 30, kexp = 31, klog10 = 32,
153 
154  kpi = 40,
155 
156  kabs = 41 , ksign= 42,
157  kint = 43 ,
158  kSignInv= 44 ,
159  krndm = 50 ,
160 
161  kAnd = 60, kOr = 61,
162  kEqual = 62, kNotEqual = 63,
163  kLess = 64, kGreater = 65,
165  kNot = 68,
166 
167  kcosh = 70 , ksinh = 71, ktanh = 72,
168  kacosh = 73 , kasinh = 74, katanh = 75,
169 
171 
172  kBitAnd = 78, kBitOr = 79,
174 
175  kJumpIf = 82, kJump = 83,
176 
177  kexpo = 100 , kxexpo = 100, kyexpo = 101, kzexpo = 102, kxyexpo = 105,
178  kgaus = 110 , kxgaus = 110, kygaus = 111, kzgaus = 112, kxygaus = 115,
179  klandau = 120 , kxlandau = 120, kylandau = 121, kzlandau = 122, kxylandau = 125,
180  kpol = 130 , kxpol = 130, kypol = 131, kzpol = 132,
181 
182  kParameter = 140,
183  kConstant = 141,
186  kVariable = 144,
188  kData = 146,
189  kUnary = 147,
190  kBinary = 148,
191  kThree = 149,
194  //
195  kPlusD = 152,
196  kPlusDD = 153,
197  kMultD = 154,
198  kMultDD = 155,
201  kBoolSet = 158,
202  kFDM = 159,
203  kFD0 = 160,
204  kFD1 = 161,
205  kFD2 = 162,
206  kFD3 = 163
207  };
208 
209 public:
210  // TFormula status bits
211  enum {
212  kNotGlobal = BIT(10), // don't store in gROOT->GetListOfFunction
213  kNormalized = BIT(14), // set to true if the function (ex gausn) is normalized
214  kLinear = BIT(16) //set to true if the function is for linear fitting
215  };
216 
217  TFormula();
218  TFormula(const char *name,const char *formula);
219  TFormula(const TFormula &formula);
220  TFormula& operator=(const TFormula &rhs);
221  virtual ~TFormula();
222 
223  public:
224  void Optimize();
225  virtual void Analyze(const char *schain, Int_t &err, Int_t offset=0);
226  virtual Bool_t AnalyzeFunction(TString &chaine, Int_t &err, Int_t offset=0);
227  virtual Int_t Compile(const char *expression="");
228  virtual void Copy(TObject &formula) const;
229  virtual void Clear(Option_t *option="");
230  virtual char *DefinedString(Int_t code);
231  virtual Double_t DefinedValue(Int_t code);
232  virtual Int_t DefinedVariable(TString &variable,Int_t &action);
233  virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const;
234  virtual Double_t EvalParOld(const Double_t *x, const Double_t *params=0);
235  virtual Double_t EvalPar(const Double_t *x, const Double_t *params=0){return ((*this).*fOptimal)(x,params);};
236  virtual const TObject *GetLinearPart(Int_t i);
237  virtual Int_t GetNdim() const {return fNdim;}
238  virtual Int_t GetNpar() const {return fNpar;}
239  virtual Int_t GetNumber() const {return fNumber;}
240  virtual TString GetExpFormula(Option_t *option="") const;
241  Double_t GetParameter(Int_t ipar) const;
242  Double_t GetParameter(const char *name) const;
243  virtual Double_t *GetParameters() const {return fParams;}
244  virtual void GetParameters(Double_t *params){for(Int_t i=0;i<fNpar;i++) params[i] = fParams[i];}
245  virtual const char *GetParName(Int_t ipar) const;
246  virtual Int_t GetParNumber(const char *name) const;
247  virtual Bool_t IsLinear() const {return TestBit(kLinear);}
248  virtual Bool_t IsNormalized() const {return TestBit(kNormalized);}
249  virtual void Print(Option_t *option="") const; // *MENU*
250  virtual void ProcessLinear(TString &replaceformula);
251  virtual void SetNumber(Int_t number) {fNumber = number;}
252  virtual void SetParameter(const char *name, Double_t parvalue);
253  virtual void SetParameter(Int_t ipar, Double_t parvalue);
254  virtual void SetParameters(const Double_t *params);
255  virtual void SetParameters(Double_t p0,Double_t p1,Double_t p2=0,Double_t p3=0,Double_t p4=0,
256  Double_t p5=0,Double_t p6=0,Double_t p7=0,Double_t p8=0,
257  Double_t p9=0,Double_t p10=0); // *MENU*
258  virtual void SetParName(Int_t ipar, const char *name);
259  virtual void SetParNames(const char *name0="p0",const char *name1="p1",const char
260  *name2="p2",const char *name3="p3",const char
261  *name4="p4", const char *name5="p5",const char *name6="p6",const char *name7="p7",const char
262  *name8="p8",const char *name9="p9",const char *name10="p10"); // *MENU*
263  virtual void Update() {;}
264 
265  static void SetMaxima(Int_t maxop=1000, Int_t maxpar=1000, Int_t maxconst=1000);
266  static void GetMaxima(Int_t& maxop, Int_t& maxpar, Int_t& maxconst);
267 
268  void Streamer(TBuffer &b, const TClass *onfile_class);
269  void Streamer(TBuffer &b, Int_t version, UInt_t start, UInt_t count, const TClass *onfile_class = 0);
270 
271  ClassDef(ROOT::v5::TFormula,8) //The formula base class f(x,y,z,par)
272 };
273 
274  } // end namespace v5
275 
276 } // end namespace ROOT
277 
278 #endif
ROOT::v5::TFormula::kexp
@ kexp
Definition: TFormula.h:152
ROOT::v5::TFormula::kLessThan
@ kLessThan
Definition: TFormula.h:164
ROOT::v5::TFormula::GetNpar
virtual Int_t GetNpar() const
Definition: TFormula.h:238
ROOT::v5::TFormula::kpi
@ kpi
Definition: TFormula.h:154
ROOT::v5::TFormula::operator=
TFormula & operator=(const TFormula &rhs)
Operator =.
Definition: TFormula_v5.cxx:303
ROOT::v5::TFormula::kUnary
@ kUnary
Definition: TFormula.h:189
ROOT::v5::TFormula::fNpar
Int_t fNpar
Definition: TFormula.h:72
ROOT::v5::TFormula::fConst
Double_t * fConst
Definition: TFormula.h:82
ROOT::v5::TFormula::~TFormula
virtual ~TFormula()
Formula default destructor.
Definition: TFormula_v5.cxx:314
ROOT::v5::TOperOffset::TOperOffset
TOperOffset()
TOper offset - helper class for TFormula* specify type of operand fTypeX = kVariable = kParameter = k...
Definition: TFormula_v5.cxx:3728
ROOT::v5::TFormula::kxygaus
@ kxygaus
Definition: TFormula.h:178
ROOT::v5::TFormula::kPlusD
@ kPlusD
Definition: TFormula.h:195
TObject::TestBit
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition: TObject.h:172
ROOT::v5::TFormula::GetParameter
Double_t GetParameter(Int_t ipar) const
Return value of parameter number ipar.
Definition: TFormula_v5.cxx:3222
ROOT::v5::TFormula::GetParName
virtual const char * GetParName(Int_t ipar) const
Return name of one parameter.
Definition: TFormula_v5.cxx:3245
ROOT::v5::TFormula::fOper
Int_t * fOper
Definition: TFormula.h:80
TObjArray
Definition: TObjArray.h:37
ROOT::v5::TFormula::kxylandau
@ kxylandau
Definition: TFormula.h:179
ROOT::v5::TFormula::ksign
@ ksign
Definition: TFormula.h:156
ROOT::v5::TOperOffset::fOldAction
Short_t fOldAction
Definition: TFormula.h:61
ROOT::v5::TFormula::kRightShift
@ kRightShift
Definition: TFormula.h:173
ROOT::v5::TFormula::kylandau
@ kylandau
Definition: TFormula.h:179
ROOT::v5::TFormula::kFDM
@ kFDM
Definition: TFormula.h:202
ROOT::v5::TFormula::kstrstr
@ kstrstr
Definition: TFormula.h:148
ROOT::v5::TFormula::kSignInv
@ kSignInv
Definition: TFormula.h:158
kTFOperMask
const Int_t kTFOperMask
Definition: TFormula.h:32
ROOT::v5::TFormula::fNstring
Int_t fNstring
Definition: TFormula.h:77
TFormula
Definition: TFormula.h:85
ROOT::v5::TFormula::kFunctionCall
@ kFunctionCall
Definition: TFormula.h:187
ROOT::v5::TOperOffset::kParameter
@ kParameter
Definition: TFormula.h:47
ROOT::v5::TFormula::EvalPrimitive4
Double_t EvalPrimitive4(const Double_t *x, const Double_t *params)
Evaluate primitive formula.
Definition: TFormula_v5.cxx:4173
ROOT::v5::TFormula::kGreater
@ kGreater
Definition: TFormula.h:163
ROOT::v5::TFormula::AnalyzeFunction
virtual Bool_t AnalyzeFunction(TString &chaine, Int_t &err, Int_t offset=0)
Check if the chain as function call.
Definition: TFormula_v5.cxx:347
ROOT::v5::TOperOffset
Definition: TFormula.h:42
ROOT::v5::TFormula::fNval
Int_t fNval
Definition: TFormula.h:76
ROOT::v5::TFormula::kConstant
@ kConstant
Definition: TFormula.h:183
ROOT::v5::TFormula::kMultD
@ kMultD
Definition: TFormula.h:197
ROOT::v5::TFormula::SetParName
virtual void SetParName(Int_t ipar, const char *name)
Set name of parameter number ipar.
Definition: TFormula_v5.cxx:3432
ROOT::v5::TFormula::fPredefined
TFormulaPrimitive ** fPredefined
[fNOperOptimized] Offsets of operrands
Definition: TFormula.h:95
ROOT::v5::TFormula::kacos
@ kacos
Definition: TFormula.h:142
ROOT::v5::TFormula::kxlandau
@ kxlandau
Definition: TFormula.h:179
ROOT::v5::TFormula::fNames
TString * fNames
Definition: TFormula.h:84
ROOT::v5::TFormula::kBitAnd
@ kBitAnd
Definition: TFormula.h:172
ROOT::v5::TFormula::kGreaterThan
@ kGreaterThan
Definition: TFormula.h:164
ROOT::v5::TFormula::fLinearParts
TObjArray fLinearParts
Definition: TFormula.h:86
ROOT::v5::TFormula::kgaus
@ kgaus
Definition: TFormula.h:178
ROOT::v5::TFormula::fNumber
Int_t fNumber
Definition: TFormula.h:75
ROOT::v5::TFormula::kexpo
@ kexpo
Definition: TFormula.h:177
TNamed.h
ROOT::v5::TFormula::kSubstract
@ kSubstract
Definition: TFormula.h:137
ROOT::v5::TFormula::ClearFormula
void ClearFormula(Option_t *option="")
Resets the objects.
Definition: TFormula_v5.cxx:2223
ROOT::v5::TFormula::kBoolOptimizeOr
@ kBoolOptimizeOr
Definition: TFormula.h:199
ROOT::v5::TFormula::SetParNames
virtual 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")
Set up to 11 parameter names.
Definition: TFormula_v5.cxx:3441
ROOT::v5::TFormula::kLinear
@ kLinear
Definition: TFormula.h:214
ROOT::v5::TFormula::DefinedValue
virtual Double_t DefinedValue(Int_t code)
Return value corresponding to special code.
Definition: TFormula_v5.cxx:2586
ROOT::v5::TFormula::kPlusDD
@ kPlusDD
Definition: TFormula.h:196
ROOT::v5::TFormula::TFuncG
Double_t(TObject::* TFuncG)(const Double_t *, const Double_t *) const
Definition: TFormula.h:69
ROOT::v5::TFormula::SetParameter
virtual void SetParameter(const char *name, Double_t parvalue)
Initialize parameter number ipar.
Definition: TFormula_v5.cxx:3375
ROOT::v5::TFormula::fNoper
Int_t fNoper
Definition: TFormula.h:73
ROOT::v5::TFormula::kDivide
@ kDivide
Definition: TFormula.h:138
Int_t
int Int_t
Definition: RtypesCore.h:45
ROOT::v5::TFormula::fOperOffset
TOperOffset * fOperOffset
[fNOperOptimized] List of operators. (See documentation for changes made at version 7)
Definition: TFormula.h:94
ROOT::v5::TFormula::kVariable
@ kVariable
Definition: TFormula.h:186
ROOT::v5::TFormula::kEnd
@ kEnd
Definition: TFormula.h:136
ROOT::v5::TFormula::kypol
@ kypol
Definition: TFormula.h:180
ROOT::v5::TFormula::kBitOr
@ kBitOr
Definition: TFormula.h:172
ROOT::v5::TFormula::GetNumber
virtual Int_t GetNumber() const
Definition: TFormula.h:239
x
Double_t x[n]
Definition: legend1.C:17
ROOT::v5::TFormula::TFormula
TFormula()
Formula default constructor.
Definition: TFormula_v5.cxx:136
ROOT::v5::TFormula::kFD1
@ kFD1
Definition: TFormula.h:204
ROOT::v5::TFormula::kData
@ kData
Definition: TFormula.h:188
ROOT::v5::TFormula::kStringEqual
@ kStringEqual
Definition: TFormula.h:170
TBits
Definition: TBits.h:26
TBuffer
Definition: TBuffer.h:43
ROOT::v5::TFormula::kfmod
@ kfmod
Definition: TFormula.h:144
ROOT::v5::TFormula::kParameter
@ kParameter
Definition: TFormula.h:182
ROOT::v5::TFormula::katanh
@ katanh
Definition: TFormula.h:168
ROOT::v5::TFormula::kLess
@ kLess
Definition: TFormula.h:163
ROOT::v5::TFormula::GetOperOptimized
Int_t * GetOperOptimized() const
Definition: TFormula.h:111
TString
Definition: TString.h:136
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
ROOT::v5::TFormula::kDefinedString
@ kDefinedString
Definition: TFormula.h:193
ROOT::v5::TFormula::EvalParOld
virtual Double_t EvalParOld(const Double_t *x, const Double_t *params=0)
Evaluate this formula.
Definition: TFormula_v5.cxx:2687
b
#define b(i)
Definition: RSha256.hxx:118
ROOT::v5::TFormula::kNotGlobal
@ kNotGlobal
Definition: TFormula.h:212
ROOT::v5::TFormula::GetActionParamOptimized
Int_t GetActionParamOptimized(Int_t code) const
Definition: TFormula.h:113
ROOT::v5::TFormula::klandau
@ klandau
Definition: TFormula.h:179
ROOT::v5::TFormula::GetActionParam
Int_t GetActionParam(Int_t code) const
Definition: TFormula.h:105
ROOT::v5::TFormula::fNdim
Int_t fNdim
Definition: TFormula.h:71
bool
ROOT::v5::TFormula::kNotEqual
@ kNotEqual
Definition: TFormula.h:162
ROOT::v5::TOperOffset::fType2
Short_t fType2
Definition: TFormula.h:56
ROOT::v5::TFormula::kFD2
@ kFD2
Definition: TFormula.h:205
ROOT::v5::TFormula::kBoolOptimize
@ kBoolOptimize
Definition: TFormula.h:184
ROOT::v5::TFormula::kEqual
@ kEqual
Definition: TFormula.h:162
ROOT::v5::TFormula::kxyexpo
@ kxyexpo
Definition: TFormula.h:177
ROOT::v5::TFormula::EvalPrimitive2
Double_t EvalPrimitive2(const Double_t *x, const Double_t *params)
Evaluate primitive formula.
Definition: TFormula_v5.cxx:4153
ROOT::v5::TFormula::StringToNumber
virtual Bool_t StringToNumber(Int_t code)
Try to 'demote' a string into an array bytes.
Definition: TFormula_v5.cxx:2202
ROOT::v5::TFormula::EvalPar
virtual Double_t EvalPar(const Double_t *x, const Double_t *params=0)
Definition: TFormula.h:235
ROOT::v5::TFormula::EvalPrimitive1
Double_t EvalPrimitive1(const Double_t *x, const Double_t *params)
Evaluate primitive formula.
Definition: TFormula_v5.cxx:4144
ROOT::v5::TFormula::fOptimal
TFuncG fOptimal
[fNPar] predefined function
Definition: TFormula.h:96
ROOT::v5::TFormula::kygaus
@ kygaus
Definition: TFormula.h:178
ROOT::v5::TOperOffset::kConstant
@ kConstant
Definition: TFormula.h:48
ROOT::v5::TFormula::fNOperOptimized
Int_t fNOperOptimized
cache for information
Definition: TFormula.h:91
ROOT::v5::TFormula::krndm
@ krndm
Definition: TFormula.h:159
ROOT::v5::TFormula::ktanh
@ ktanh
Definition: TFormula.h:167
ROOT::v5::TFormula::kFD3
@ kFD3
Definition: TFormula.h:206
ROOT::v5::TFormula::GetParNumber
virtual Int_t GetParNumber(const char *name) const
Return parameter number by name.
Definition: TFormula_v5.cxx:3255
ROOT::v5::TFormula::fOperOptimized
Int_t * fOperOptimized
[fNOperOptimized] List of expressions
Definition: TFormula.h:93
ROOT::v5::TFormula::kBoolSet
@ kBoolSet
Definition: TFormula.h:201
ROOT::v5::TFormula::kModulo
@ kModulo
Definition: TFormula.h:139
ROOT::v5::TFormula::GetParameters
virtual void GetParameters(Double_t *params)
Definition: TFormula.h:244
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
ROOT::v5::TFormula::Analyze
virtual void Analyze(const char *schain, Int_t &err, Int_t offset=0)
Analyze a sub-expression in one formula.
Definition: TFormula_v5.cxx:713
ROOT::v5::TFormula::GetActionOptimized
Short_t GetActionOptimized(Int_t code) const
Definition: TFormula.h:112
ROOT::v5::TFormula::klog10
@ klog10
Definition: TFormula.h:152
ROOT::v5::TFormula::katan
@ katan
Definition: TFormula.h:142
ROOT::v5::TFormula::Convert
virtual void Convert(UInt_t fromVersion)
Definition: TFormula_v5.cxx:3564
ROOT::v5::TFormula::EvalPrimitive3
Double_t EvalPrimitive3(const Double_t *x, const Double_t *params)
Evaluate primitive formula.
Definition: TFormula_v5.cxx:4163
ROOT::v5::TFormula::GetParameters
virtual Double_t * GetParameters() const
Definition: TFormula.h:243
ROOT::v5::TFormula::fExpr
TString * fExpr
Definition: TFormula.h:78
ROOT::v5::TFormula::kzlandau
@ kzlandau
Definition: TFormula.h:179
ROOT::v5::TFormula::Update
virtual void Update()
Definition: TFormula.h:263
ROOT::v5::TFormula::SetNumber
virtual void SetNumber(Int_t number)
Definition: TFormula.h:251
TNamed
Definition: TNamed.h:29
ROOT::v5::TFormula::kStringNotEqual
@ kStringNotEqual
Definition: TFormula.h:170
ROOT::v5::TOperOffset::fOffset2
Short_t fOffset2
Definition: TFormula.h:57
ROOT::v5::TFormula::PreCompile
Int_t PreCompile()
pointer to optimal function
Definition: TFormula_v5.cxx:4481
ROOT::v5::TFormula::fParams
Double_t * fParams
Definition: TFormula.h:83
ROOT::v5::TFormula::SetParameters
virtual void SetParameters(const Double_t *params)
Initialize array of all parameters.
Definition: TFormula_v5.cxx:3397
ROOT::v5::TFormula::kxgaus
@ kxgaus
Definition: TFormula.h:178
ROOT::v5::TFormula::kLeftShift
@ kLeftShift
Definition: TFormula.h:173
ROOT::v5::TFormula::GetExpFormula
virtual TString GetExpFormula(Option_t *option="") const
Reconstruct the formula expression from the internal TFormula member variables.
Definition: TFormula_v5.cxx:3022
ROOT::v5::TFormula::kint
@ kint
Definition: TFormula.h:157
ROOT::v5::TFormula::fExprOptimized
TString * fExprOptimized
Number of operators after optimization.
Definition: TFormula.h:92
ROOT::v5::TOperOffset::fOffset3
Short_t fOffset3
Definition: TFormula.h:59
ROOT::v5::TFormula::DefinedString
virtual char * DefinedString(Int_t code)
Return address of string corresponding to special code.
Definition: TFormula_v5.cxx:2555
ROOT::v5::TFormula::GetAction
Short_t GetAction(Int_t code) const
Definition: TFormula.h:104
ROOT::v5::TFormula::kzexpo
@ kzexpo
Definition: TFormula.h:177
ROOT::v5::TFormula::kzpol
@ kzpol
Definition: TFormula.h:180
BIT
#define BIT(n)
Definition: Rtypes.h:85
ROOT::v5::TFormula::ProcessLinear
virtual void ProcessLinear(TString &replaceformula)
If the formula is for linear fitting, change the title to normal and fill the LinearParts array.
Definition: TFormula_v5.cxx:3306
ROOT::v5::TFormula::Optimize
void Optimize()
MI include.
Definition: TFormula_v5.cxx:3818
ROOT::v5::TFormula::Print
virtual void Print(Option_t *option="") const
Dump this formula with its attributes.
Definition: TFormula_v5.cxx:3277
ROOT::v5::TFormula::IsString
virtual Bool_t IsString(Int_t oper) const
Return true if the expression at the index 'oper' has to be treated as a string.
Definition: TFormula_v5.cxx:3269
y
Double_t y[n]
Definition: legend1.C:17
ROOT::v5::TFormula::fNconst
Int_t fNconst
Definition: TFormula.h:74
ROOT::v5::TFormula::kpow
@ kpow
Definition: TFormula.h:146
Short_t
short Short_t
Definition: RtypesCore.h:39
ROOT::v5::TFormula::IsLinear
virtual Bool_t IsLinear() const
Definition: TFormula.h:247
ROOT::v5::TFormula::Streamer
void Streamer(TBuffer &b, const TClass *onfile_class)
Stream a class object.
Definition: TFormula_v5.cxx:3460
ROOT::v5::TFormula::fAlreadyFound
TBits fAlreadyFound
Definition: TFormula.h:88
ROOT::v5::TFormula::kBoolOptimizeAnd
@ kBoolOptimizeAnd
Definition: TFormula.h:200
ROOT::v5::TFormula::kasinh
@ kasinh
Definition: TFormula.h:168
ROOT::v5::TFormula::kAnd
@ kAnd
Definition: TFormula.h:161
ROOT::v5::TFormula::kThree
@ kThree
Definition: TFormula.h:191
unsigned int
ROOT::v5::TFormula::kxexpo
@ kxexpo
Definition: TFormula.h:177
ROOT::v5::TFormula::kBinary
@ kBinary
Definition: TFormula.h:190
ROOT::v5::TOperOffset::fOffset0
Short_t fOffset0
Definition: TFormula.h:53
ROOT::v5::TFormula::kyexpo
@ kyexpo
Definition: TFormula.h:177
ROOT::v5::TFormula::kacosh
@ kacosh
Definition: TFormula.h:168
ROOT::v5::TFormula::MakePrimitive
void MakePrimitive(const char *expr, Int_t pos)
MakePrimitive find TFormulaPrimitive replacement for some operands.
Definition: TFormula_v5.cxx:3746
ROOT::v5::TFormula::kmax
@ kmax
Definition: TFormula.h:150
ROOT::v5::TFormula::kDefinedVariable
@ kDefinedVariable
Definition: TFormula.h:192
Double_t
double Double_t
Definition: RtypesCore.h:59
ROOT::v5::TFormula
Definition: TFormula.h:65
ROOT::v5::TFormula::ksin
@ ksin
Definition: TFormula.h:141
ROOT::v5::TOperOffset::fType3
Short_t fType3
Definition: TFormula.h:58
ROOT::v5::TFormula::EvalPrimitive
Double_t EvalPrimitive(const Double_t *x, const Double_t *params)
Evaluate primitive formula.
Definition: TFormula_v5.cxx:4114
ROOT::v5::TFormula::kOr
@ kOr
Definition: TFormula.h:161
ROOT::v5::TFormula::SetAction
void SetAction(Int_t code, Int_t value, Int_t param=0)
Definition: TFormula.h:107
ROOT::v5::TFormula::kAdd
@ kAdd
Definition: TFormula.h:137
TObjArray.h
ROOT::v5::TFormula::SetActionOptimized
void SetActionOptimized(Int_t code, Int_t value, Int_t param=0)
Definition: TFormula.h:115
TBits.h
TClass
Definition: TClass.h:80
ROOT::v5::TFormula::GetOper
Int_t * GetOper() const
Definition: TFormula.h:103
ROOT::v5::TFormula::kStringConst
@ kStringConst
Definition: TFormula.h:185
UChar_t
unsigned char UChar_t
Definition: RtypesCore.h:38
kMAXFOUND
const Int_t kMAXFOUND
Definition: TFormula.h:31
ROOT::v5::TFormula::DefinedVariable
virtual Int_t DefinedVariable(TString &variable, Int_t &action)
Check if expression is in the list of defined variables.
Definition: TFormula_v5.cxx:2621
ROOT::v5::TFormula::fFunctions
TObjArray fFunctions
Definition: TFormula.h:85
ROOT::v5::TFormula::klog
@ klog
Definition: TFormula.h:152
TObject
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
ROOT::v5::TFormula::kcosh
@ kcosh
Definition: TFormula.h:167
ROOT::v5::TFormula::kpol
@ kpol
Definition: TFormula.h:180
ROOT::v5::TFormula::kabs
@ kabs
Definition: TFormula.h:156
name
char name[80]
Definition: TGX11.cxx:110
ROOT::v5::TFormula::Clear
virtual void Clear(Option_t *option="")
Resets the objects.
Definition: TFormula_v5.cxx:2213
ROOT::v5::TFormula::kxpol
@ kxpol
Definition: TFormula.h:180
ROOT::v5::TFormula::EvalPrimitive0
Double_t EvalPrimitive0(const Double_t *x, const Double_t *params)
Evaluate primitive formula.
Definition: TFormula_v5.cxx:4135
ROOT::v5::TFormula::kNot
@ kNot
Definition: TFormula.h:165
ROOT::v5::TFormula::GetNdim
virtual Int_t GetNdim() const
Definition: TFormula.h:237
ROOT::v5::TFormula::CheckOperands
virtual Bool_t CheckOperands(Int_t operation, Int_t &err)
Check whether the operand at 'oper-1' is compatible with the operation at 'oper'.
Definition: TFormula_v5.cxx:2168
ROOT::v5::TFormula::ksq
@ ksq
Definition: TFormula.h:146
ROOT::v5::TOperOffset::kVariable
@ kVariable
Definition: TFormula.h:46
ROOT::v5::TOperOffset::fOffset1
Short_t fOffset1
Definition: TFormula.h:55
ROOT::v5::TFormula::kFD0
@ kFD0
Definition: TFormula.h:203
ROOT::v5::TFormula::SetMaxima
static void SetMaxima(Int_t maxop=1000, Int_t maxpar=1000, Int_t maxconst=1000)
static function to set the maximum value of 3 parameters
Definition: TFormula_v5.cxx:4527
ROOT::v5::TFormula::kmin
@ kmin
Definition: TFormula.h:150
ROOT::v5::TFormula::kzgaus
@ kzgaus
Definition: TFormula.h:178
kTFOperShift
const UChar_t kTFOperShift
Definition: TFormula.h:33
ROOT::v5::TFormula::Compile
virtual Int_t Compile(const char *expression="")
Compile expression already stored in fTitle.
Definition: TFormula_v5.cxx:2292
ROOT::v5::TFormula::ksqrt
@ ksqrt
Definition: TFormula.h:146
ROOT::v5::TFormula::Copy
virtual void Copy(TObject &formula) const
Copy this formula.
Definition: TFormula_v5.cxx:2461
ROOT::v5::TFormula::ktan
@ ktan
Definition: TFormula.h:141
ROOT::v5::TFormula::EvalParFast
Double_t EvalParFast(const Double_t *x, const Double_t *params)
Evaluate this formula.
Definition: TFormula_v5.cxx:4189
ROOT::v5::TFormula::GetMaxima
static void GetMaxima(Int_t &maxop, Int_t &maxpar, Int_t &maxconst)
static function to get the maximum value of 3 parameters -maxop : maximum number of operations -maxpa...
Definition: TFormula_v5.cxx:4540
ROOT::v5::TFormula::kJump
@ kJump
Definition: TFormula.h:175
ROOT::v5::TOperOffset::fToJump
Short_t fToJump
Definition: TFormula.h:60
ROOT::v5::TFormula::kasin
@ kasin
Definition: TFormula.h:142
ROOT::v5::TFormula::kMultDD
@ kMultDD
Definition: TFormula.h:198
ROOT::v5::TFormula::Eval
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
Evaluate this formula.
Definition: TFormula_v5.cxx:2668
ROOT
VSD Structures.
Definition: StringConv.hxx:21
ROOT::v5::TFormula::kJumpIf
@ kJumpIf
Definition: TFormula.h:175
ROOT::v5::TFormula::kNormalized
@ kNormalized
Definition: TFormula.h:213
ROOT::v5::TFormula::ksinh
@ ksinh
Definition: TFormula.h:167
ROOT::v5::TOperOffset::fType1
Short_t fType1
Definition: TFormula.h:54
ROOT::v5::TFormulaPrimitive
Definition: TFormulaPrimitive.h:37
ROOT::v5::TFormula::kcos
@ kcos
Definition: TFormula.h:141
ROOT::v5::TFormula::GetLinearPart
virtual const TObject * GetLinearPart(Int_t i)
Return linear part.
Definition: TFormula_v5.cxx:3212
ROOT::v5::TFormula::katan2
@ katan2
Definition: TFormula.h:143
int
ROOT::v5::TFormula::IsNormalized
virtual Bool_t IsNormalized() const
Definition: TFormula.h:248
ROOT::v5::TOperOffset::fType0
Short_t fType0
Definition: TFormula.h:52
ROOT::v5::TFormula::kMultiply
@ kMultiply
Definition: TFormula.h:138