```
```

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

• `sin(x)/x`
• `*sin(x) + *exp(-*x)`
• `x + y**2`
• `x^2 + y^2`
• `*pow(,4)`
• `2*pi*sqrt(x/y)`
• `gaus(0)*expo(3) + ypol3(5)*x`
• `gausn(0)*expo(3) + ypol3(5)*x`

In the last example above:

• `gaus(0)` is a substitute for `*exp(-0.5*((x-)/)**2)` and (0) means start numbering parameters at 0
• `gausn(0)` is a substitute for `*exp(-0.5*((x-)/)**2)/(sqrt(2*pi)*))` and (0) means start numbering parameters at 0
• `expo(3)` is a substitute for `exp(+*x`
• `pol3(5)` is a substitute for `par+par*x+par*x**2+par*x**3` (`PolN` stands for Polynomial of degree N)

`TMath` functions can be part of the expression, eg:

• `TMath::Landau(x)*sin(x)`
• `TMath::Erf(x)`

Formula may contain constans, eg:

• `sqrt2`
• `e`
• `pi`
• `ln10`
• `infinity`

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<0.5 || x>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,x,x,x,....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`.

```

## Function Members (Methods)

public:
 ~TFormulaParamOrder() bool operator()(const TString& a, const TString& b) const TFormulaParamOrder& operator=(const TFormulaParamOrder&) TFormulaParamOrder& operator=(TFormulaParamOrder&&) TFormulaParamOrder() TFormulaParamOrder(const TFormulaParamOrder&) TFormulaParamOrder(TFormulaParamOrder&&)

## Class Charts ## Function documentation

bool operator()(const TString& a, const TString& b) const
``` implement comparison used to set parameter orders in TFormula
want p2 to be before p10
```
TFormula& operator=(const TFormula &rhs)