// @(#)root/hist:$Id$
// Author: Maciej Zimnoch 30/09/2013

/*************************************************************************
 * Copyright (C) 1995-2013, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#if __cplusplus >= 201103L
#define ROOT_CPLUSPLUS11 1
#endif

#include "TROOT.h"
#include "TClass.h"
#include "TMethod.h"
#include "TMath.h"
#include "TF1.h"
#include "TMethodCall.h"
#include <TBenchmark.h>
#include "TError.h"
#include "TInterpreter.h"
#include "TFormula.h"
#include <cassert>
#include <iostream>
#include <unordered_map>

using namespace std;

// #define __STDC_LIMIT_MACROS
// #define __STDC_CONSTANT_MACROS

// #include  "cling/Interpreter/Interpreter.h"
// #include  "cling/Interpreter/Value.h"
// #include  "cling/Interpreter/StoredValueRef.h"


#ifdef WIN32
#pragma optimize("",off)
#endif
#include "v5/TFormula.h"

ClassImp(TFormula)
//______________________________________________________________________________
/******************************************************************************
Begin_Html
<h1>The  F O R M U L A  class</h1>

<p>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
<code>ROOT::v5::TFormula</code>. Some of the TFormula member funtions available in version 5, such as
<code>Analyze</code> and <code>AnalyzeFunction</code> 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</p>

<p>This class has been implemented during Google Summer of Code 2013 by Maciej Zimnoch.</p>

<h3>Example of valid expressions:</h3>

<ul>
<li><code>sin(x)/x</code></li>
<li><code>[0]*sin(x) + [1]*exp(-[2]*x)</code></li>
<li><code>x + y**2</code></li>
<li><code>x^2 + y^2</code></li>
<li><code>[0]*pow([1],4)</code></li>
<li><code>2*pi*sqrt(x/y)</code></li>
<li><code>gaus(0)*expo(3)  + ypol3(5)*x</code></li>
<li><code>gausn(0)*expo(3) + ypol3(5)*x</code></li>
</ul>

<p>In the last example above:</p>

<ul>
<li><code>gaus(0)</code> is a substitute for <code>[0]*exp(-0.5*((x-[1])/[2])**2)</code>
         and (0) means start numbering parameters at 0</li>
<li><code>gausn(0)</code> is a substitute for <code>[0]*exp(-0.5*((x-[1])/[2])**2)/(sqrt(2*pi)*[2]))</code>
         and (0) means start numbering parameters at 0</li>
<li><code>expo(3)</code> is a substitute for <code>exp([3]+[4]*x</code></li>
<li><code>pol3(5)</code> is a substitute for <code>par[5]+par[6]*x+par[7]*x**2+par[8]*x**3</code>
          (<code>PolN</code> stands for Polynomial of degree N)</li>
</ul>

<p><code>TMath</code> functions can be part of the expression, eg:</p>

<ul>
<li><code>TMath::Landau(x)*sin(x)</code></li>
<li><code>TMath::Erf(x)</code></li>
</ul>

<p>Formula may contain constans, eg:</p>

<ul>
<li><code>sqrt2</code></li>
<li><code>e</code></li>
<li><code>pi</code></li>
<li><code>ln10</code></li>
<li><code>infinity</code></li>
</ul>

<p>and more.</p>

<p>Comparisons operators are also supported <code>(&amp;&amp;, ||, ==, &lt;=, &gt;=, !)</code></p>

<p>Examples:</p>

<pre><code>    `sin(x*(x&lt;0.5 || x&gt;1))`
</code></pre>

<p>If the result of a comparison is TRUE, the result is 1, otherwise 0.</p>

<p>Already predefined names can be given. For example, if the formula</p>

<pre><code> `TFormula old("old",sin(x*(x&lt;0.5 || x&gt;1)))`
</code></pre>

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

<pre><code> `TFormula new("new","x*old")`
</code></pre>

<p>is equivalent to:</p>

<pre><code> `TFormula new("new","x*sin(x*(x&lt;0.5 || x&gt;1))")`
</code></pre>

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

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


End_Html
********************************************************************************/
   
//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

// prefix used for function name passed to Cling
static const TString gNamePrefix = "TFormula__";
// function index number used to append in cling name to avoid a clash
static std::atomic<unsigned int> gFormulaAtomicIndex(0);

// static map of function pointers and expressions
//static std::unordered_map<std::string,  TInterpreter::CallFuncIFacePtr_t::Generic_t> gClingFunctions = std::unordered_map<TString,  TInterpreter::CallFuncIFacePtr_t::Generic_t>();
static std::unordered_map<std::string,  void *> gClingFunctions = std::unordered_map<std::string,  void * >();

Bool_t TFormula::IsOperator(const char c)
{
   // operator ":" must be handled separatly
   char ops[] = { '+','^', '-','/','*','<','>','|','&','!','=','?'};
   Int_t opsLen = sizeof(ops)/sizeof(char);
   for(Int_t i = 0; i < opsLen; ++i)
      if(ops[i] == c)
         return true;
   return false;
}

Bool_t TFormula::IsBracket(const char c)
{
   char brackets[] = { ')','(','{','}'};
   Int_t bracketsLen = sizeof(brackets)/sizeof(char);
   for(Int_t i = 0; i < bracketsLen; ++i)
      if(brackets[i] == c)
         return true;
   return false;
}

Bool_t TFormula::IsFunctionNameChar(const char c)
{
   return !IsBracket(c) && !IsOperator(c) && c != ',' && c != ' ';
}

Bool_t TFormula::IsDefaultVariableName(const TString &name)
{
   return name == "x" || name == "z" || name == "y" || name == "t";
}


Bool_t TFormula::IsScientificNotation(const TString & formula, int i)
{
   // check if the character at position i  is part of a scientific notation
   if ( (formula[i] == 'e' || formula[i] == 'E')  &&  (i > 0 && i <  formula.Length()-1) )  {
      // handle cases:  2e+3 2e-3 2e3 and 2.e+3
      if ( (isdigit(formula[i-1]) || formula[i-1] == '.') && ( isdigit(formula[i+1]) || formula[i+1] == '+' || formula[i+1] == '-' ) )
         return true;
   }
   return false; 
}

bool TFormulaParamOrder::operator() (const TString& a, const TString& b) const {
   // implement comparison used to set parameter orders in TFormula
   // want p2 to be before p10 
   
   // strip first character in case you have (p0, p1, pN)  
   if ( a[0] == 'p' && a.Length() > 1)  {
      if ( b[0] == 'p' &&  b.Length() > 1)  {
         // strip first character
         TString lhs = a(1,a.Length()-1); 
         TString rhs = b(1,b.Length()-1);
         if (lhs.IsDigit() && rhs.IsDigit() )
            return (lhs.Atoi() < rhs.Atoi() );
      }
      else {
         return true;  // assume a(a numeric name) is always before b (an alphanumeric name) 
      }
   }
   else {
      if (  b[0] == 'p' &&  b.Length() > 1) 
         // now b is numeric and a is not so return false
         return false;
      
      // case both names are numeric
      if (a.IsDigit() && b.IsDigit() ) 
         return (a.Atoi() < b.Atoi() );

   }
   
   return a < b;
}

TFormula::TFormula()
{
   fName = "";
   fTitle = "";
   fClingInput = "";
   fReadyToExecute = false;
   fClingInitialized = false;
   fAllParametersSetted = false;
   fMethod = 0;
   fNdim = 0;
   fNpar = 0;
   fNumber = 0;
   fClingName = "";
   fFormula = "";
}

//______________________________________________________________________________
static bool IsReservedName(const char* name){
   if (strlen(name)!=1) return false;
   for (auto const & specialName : {"x","y","z","t"}){
      if (strcmp(name,specialName)==0) return true;
   }
   return false;
}


TFormula::~TFormula()
{

   // N.B. a memory leak may happen if user set bit after constructing the object,
   // Setting of bit should be done only internally
   if (!TestBit(TFormula::kNotGlobal) && gROOT ) {
      R__LOCKGUARD2(gROOTMutex);
      gROOT->GetListOfFunctions()->Remove(this);
   }

   if(fMethod)
   {
      fMethod->Delete();
   }
   int nLinParts = fLinearParts.size();
   if (nLinParts > 0) {
      for (int i = 0; i < nLinParts; ++i) delete fLinearParts[i];
   }
}

#ifdef OLD_VERSION
TFormula::TFormula(const char *name, Int_t nparams, Int_t ndims)
{
   //*-*
   //*-*  Constructor
   //*-*  When TF1 is constructed using C++ function, TF1 need space to keep parameters values.
   //*-*

   fName = name;
   fTitle = "";
   fClingInput = "";
   fReadyToExecute = false;
   fClingInitialized = false;
   fAllParametersSetted = false;
   fMethod = 0;
   fNdim = ndims;
   fNpar = 0;
   fNumber = 0;
   fClingName = "";
   fFormula = "";
   for(Int_t i = 0; i < nparams; ++i)
   {
      TString parName = TString::Format("%d",i);
      DoAddParameter(parName,0,false);
   }
}
#endif

TFormula::TFormula(const char *name, const char *formula, bool addToGlobList)   :
   TNamed(name,formula),
   fClingInput(formula),fFormula(formula)
{
   fReadyToExecute = false;
   fClingInitialized = false;
   fMethod = 0;
   fNdim = 0;
   fNpar = 0;
   fNumber = 0;
   FillDefaults();


   if (addToGlobList && gROOT) {
      TFormula *old = 0;
      R__LOCKGUARD2(gROOTMutex);
      old = dynamic_cast<TFormula*> ( gROOT->GetListOfFunctions()->FindObject(name) );
      if (old)
         gROOT->GetListOfFunctions()->Remove(old);
      if (IsReservedName(name))
         Error("TFormula","The name %s is reserved as a TFormula variable name.\n",name);
      else
         gROOT->GetListOfFunctions()->Add(this);
   }
   SetBit(kNotGlobal,!addToGlobList);

   //fName = gNamePrefix + name;  // is this needed

   // do not process null formulas.
   if (!fFormula.IsNull() ) { 
      PreProcessFormula(fFormula);

      PrepareFormula(fFormula);
   }

}

TFormula::TFormula(const TFormula &formula) : TNamed(formula.GetName(),formula.GetTitle())
{
   fReadyToExecute = false;
   fClingInitialized = false;
   fMethod = 0;
   fNdim = formula.GetNdim();
   fNpar = formula.GetNpar();
   fNumber = formula.GetNumber();
   fFormula = formula.GetExpFormula();

   FillDefaults();
   //fName = gNamePrefix + formula.GetName();

   if (!TestBit(TFormula::kNotGlobal) && gROOT ) {
      R__LOCKGUARD2(gROOTMutex);
      TFormula *old = (TFormula*)gROOT->GetListOfFunctions()->FindObject(formula.GetName());
      if (old)
         gROOT->GetListOfFunctions()->Remove(old);

      if (IsReservedName(formula.GetName())) {
         Error("TFormula","The name %s is reserved as a TFormula variable name.\n",formula.GetName());
      } else
         gROOT->GetListOfFunctions()->Add(this);
   }

   PreProcessFormula(fFormula);
   PrepareFormula(fFormula);
}

TFormula& TFormula::operator=(const TFormula &rhs)
{
   //*-*
   //*-*  = Operator
   //*-*

   if (this != &rhs) {
      rhs.Copy(*this);
   }
   return *this;
}

Int_t TFormula::Compile(const char *expression)
{   
    // Compile the given expression with Cling
    // backward compatibility method to be used in combination with the empty constructor
    // if no expression is given , the current stored formula (retrieved with GetExpFormula()) or the title  is used.
   // return 0 if the formula compilation is successfull

   
   TString formula = expression;
   if (formula.IsNull() ) {
      formula = fFormula;
      if (formula.IsNull() ) formula = GetTitle();
   }
   
   if (formula.IsNull() ) return -1; 

   // do not re-process if it was done before 
   if (IsValid() && formula == fFormula ) return 0;

   // clear if a formula was already existing
   if (!fFormula.IsNull() ) Clear(); 

   fFormula = formula;
   if (fVars.empty() ) FillDefaults(); 
   // prepare the formula for Cling
   printf("compile: processing formula %s\n",fFormula.Data() );
   PreProcessFormula(fFormula);
   // pass formula in CLing
   bool ret = PrepareFormula(fFormula);

   return (ret) ? 0 : 1;      
}

void TFormula::Copy(TObject &obj) const
{
   TNamed::Copy(obj);
   // need to copy also cling parameters
   TFormula & fnew = dynamic_cast<TFormula&>(obj);

   fnew.fClingParameters = fClingParameters;
   fnew.fClingVariables = fClingVariables;

   fnew.fFuncs = fFuncs;
   fnew.fVars = fVars;
   fnew.fParams = fParams;
   fnew.fConsts = fConsts;
   fnew.fFunctionsShortcuts = fFunctionsShortcuts;
   fnew.fFormula  = fFormula;
   fnew.fNdim = fNdim;
   fnew.fNpar = fNpar;
   fnew.fNumber = fNumber;
   fnew.SetParameters(GetParameters());
   // copy Linear parts (it is a vector of TFormula pointers) needs to be copied one by one
   // looping at all the elements
   // delete first previous elements
   int nLinParts = fnew.fLinearParts.size();
   if (nLinParts > 0) {
      for (int i = 0; i < nLinParts; ++i) delete fnew.fLinearParts[i];
      fnew.fLinearParts.clear();
   }
   // old size that needs to be copied
   nLinParts = fLinearParts.size();
   if (nLinParts > 0) {
      fnew.fLinearParts.reserve(nLinParts);
      for (int i = 0; i < nLinParts; ++i) {
         TFormula * linearNew = new TFormula();
         TFormula * linearOld = (TFormula*) fLinearParts[i];
         if (linearOld) {
            linearOld->Copy(*linearNew);
            fnew.fLinearParts.push_back(linearNew);
         }
         else
            Warning("Copy","Function %s - expr %s has a dummy linear part %d",GetName(),GetExpFormula().Data(),i);
      }
   }

   fnew.fClingInput = fClingInput;
   fnew.fReadyToExecute = fReadyToExecute;
   fnew.fClingInitialized = fClingInitialized;
   fnew.fAllParametersSetted = fAllParametersSetted;
   fnew.fClingName = fClingName;

   if (fMethod) {
      if (fnew.fMethod) delete fnew.fMethod;
      // use copy-constructor of TMethodCall
      TMethodCall *m = new TMethodCall(*fMethod);
      fnew.fMethod  = m;
   }

   fnew.fFuncPtr = fFuncPtr;

}

void TFormula::Clear(Option_t * )
{
   // clear the formula setting expression to empty and reset the variables and parameters containers
   fNdim = 0;
   fNpar = 0;
   fNumber = 0; 
   fFormula = "";
   fClingName = "";
  

   if(fMethod) fMethod->Delete();
   fMethod = nullptr; 

   fClingVariables.clear();
   fClingParameters.clear();
   fReadyToExecute = false;
   fClingInitialized = false;
   fAllParametersSetted = false; 
   fFuncs.clear();
   fVars.clear();
   fParams.clear();
   fConsts.clear();
   fFunctionsShortcuts.clear();
   
   // delete linear parts 
   int nLinParts = fLinearParts.size();
   if (nLinParts > 0) {
      for (int i = 0; i < nLinParts; ++i) delete fLinearParts[i];
   }
   fLinearParts.clear();

}
bool TFormula::PrepareEvalMethod()
{
   //*-*
   //*-*    Sets TMethodCall to function inside Cling environment
   //*-*    TFormula uses it to execute function.
   //*-*    After call, TFormula should be ready to evaluate formula.
   //*-*
   if(!fMethod)
   {
      fMethod = new TMethodCall();

      Bool_t hasParameters = (fNpar > 0);
      Bool_t hasVariables  = (fNdim > 0);
      TString prototypeArguments = "";
      if(hasVariables)
      {
         prototypeArguments.Append("Double_t*");
      }
      if(hasVariables && hasParameters)
      {
         prototypeArguments.Append(",");
      }
      if(hasParameters)
      {
         prototypeArguments.Append("Double_t*");
      }
      // init method call using real function name (cling name) which is defined in ProcessFormula
      fMethod->InitWithPrototype(fClingName,prototypeArguments);
      if(!fMethod->IsValid())
      {
         Error("Eval","Can't find %s function prototype with arguments %s",fClingName.Data(),prototypeArguments.Data());
         return false;
      }

      // not needed anymore since we use the function pointer
      // if(hasParameters)
      // {
      //    Long_t args[2];
      //    args[0] = (Long_t)fClingVariables.data();
      //    args[1] = (Long_t)fClingParameters.data();
      //    fMethod->SetParamPtrs(args,2);
      // }
      // else
      // {
      //    Long_t args[1];
      //    args[0] = (Long_t)fClingVariables.data();
      //    fMethod->SetParamPtrs(args,1);
      // }

      CallFunc_t * callfunc = fMethod->GetCallFunc();
      TInterpreter::CallFuncIFacePtr_t faceptr = gCling->CallFunc_IFacePtr(callfunc);
      fFuncPtr = faceptr.fGeneric;
   }
   return true; 
}

void TFormula::InputFormulaIntoCling()
{
   //*-*
   //*-*    Inputs formula, transfered to C++ code into Cling
   //*-*
   if(!fClingInitialized && fReadyToExecute && fClingInput.Length() > 0)
   {
      gCling->Declare(fClingInput);
      fClingInitialized = PrepareEvalMethod();
   }
}
void TFormula::FillDefaults()
{
   //*-*
   //*-*    Fill structures with default variables, constants and function shortcuts
   //*-*
//#ifdef ROOT_CPLUSPLUS11

   const TString defvars[] = { "x","y","z","t"};
   const pair<TString,Double_t> defconsts[] = { {"pi",TMath::Pi()}, {"sqrt2",TMath::Sqrt2()},
         {"infinity",TMath::Infinity()}, {"e",TMath::E()}, {"ln10",TMath::Ln10()},
         {"loge",TMath::LogE()}, {"c",TMath::C()}, {"g",TMath::G()},
         {"h",TMath::H()}, {"k",TMath::K()},{"sigma",TMath::Sigma()},
         {"r",TMath::R()}, {"eg",TMath::EulerGamma()},{"true",1},{"false",0} };
   // const pair<TString,Double_t> defconsts[] = { {"pi",TMath::Pi()}, {"sqrt2",TMath::Sqrt2()},
   //       {"infinity",TMath::Infinity()}, {"ln10",TMath::Ln10()},
   //       {"loge",TMath::LogE()}, {"true",1},{"false",0} };
   const pair<TString,TString> funShortcuts[] =
      { {"sin","TMath::Sin" },
        {"cos","TMath::Cos" }, {"exp","TMath::Exp"}, {"log","TMath::Log"}, {"log10","TMath::Log10"},
        {"tan","TMath::Tan"}, {"sinh","TMath::SinH"}, {"cosh","TMath::CosH"},
        {"tanh","TMath::TanH"}, {"asin","TMath::ASin"}, {"acos","TMath::ACos"},
        {"atan","TMath::ATan"}, {"atan2","TMath::ATan2"}, {"sqrt","TMath::Sqrt"},
        {"ceil","TMath::Ceil"}, {"floor","TMath::Floor"}, {"pow","TMath::Power"},
        {"binomial","TMath::Binomial"},{"abs","TMath::Abs"},
        {"min","TMath::Min"},{"max","TMath::Max"},{"sign","TMath::Sign" },
        {"sq","TMath::Sq"}  
      };
   
   std::vector<TString> defvars2(10);
   for (int i = 0; i < 9; ++i)
      defvars2[i] = TString::Format("x[%d]",i);

   for(auto var : defvars)
   {
      int pos = fVars.size();
      fVars[var] = TFormulaVariable(var,0,pos);
      fClingVariables.push_back(0);
   }
   // add also the variables definesd like x[0],x[1],x[2],...
   // support up to x[9] - if needed extend that to higher value
   // const int maxdim = 10;
   // for (int i = 0; i < maxdim;  ++i) {
   //    TString xvar = TString::Format("x[%d]",i);
   //    fVars[xvar] =  TFormulaVariable(xvar,0,i);
   //    fClingVariables.push_back(0);
   // }

   for(auto con : defconsts)
   {
      fConsts[con.first] = con.second;
   }
   for(auto fun : funShortcuts)
   {
      fFunctionsShortcuts[fun.first] = fun.second;
   }

/*** - old code tu support C++03
#else

   TString  defvarsNames[] = {"x","y","z","t"};
   Int_t    defvarsLength = sizeof(defvarsNames)/sizeof(TString);

   TString  defconstsNames[] = {"pi","sqrt2","infinity","e","ln10","loge","c","g","h","k","sigma","r","eg","true","false"};
   Double_t defconstsValues[] = {TMath::Pi(),TMath::Sqrt2(),TMath::Infinity(),TMath::E(),TMath::Ln10(),TMath::LogE(),
                                 TMath::C(),TMath::G(),TMath::H(),TMath::K(),TMath::Sigma(),TMath::R(),TMath::EulerGamma(), 1, 0};
   Int_t    defconstsLength = sizeof(defconstsNames)/sizeof(TString);

   TString  funShortcutsNames[] = {"sin","cos","exp","log","tan","sinh","cosh","tanh","asin","acos","atan","atan2","sqrt",
                                  "ceil","floor","pow","binomial","abs"};
   TString  funShortcutsExtendedNames[] = {"TMath::Sin","TMath::Cos","TMath::Exp","TMath::Log","TMath::Tan","TMath::SinH",
                                           "TMath::CosH","TMath::TanH","TMath::ASin","TMath::ACos","TMath::ATan","TMath::ATan2",
                                           "TMath::Sqrt","TMath::Ceil","TMath::Floor","TMath::Power","TMath::Binomial","TMath::Abs"};
   Int_t    funShortcutsLength = sizeof(funShortcutsNames)/sizeof(TString);

   for(Int_t i = 0; i < defvarsLength; ++i)
   {
      TString var = defvarsNames[i];
      Double_t value = 0;
      unsigned int pos = fVars.size();
      fVars[var] = TFormulaVariable(var,value,pos);
      fClingVariables.push_back(value);
   }

   for(Int_t i = 0; i < defconstsLength; ++i)
   {
      fConsts[defconstsNames[i]] = defconstsValues[i];
   }
   for(Int_t i = 0; i < funShortcutsLength; ++i)
   {
      pair<TString,TString> fun(funShortcutsNames[i],funShortcutsExtendedNames[i]);
      fFunctionsShortcuts[fun.first] = fun.second;
   }

#endif
***/

}

void TFormula::HandlePolN(TString &formula)
{
   //*-*
   //*-*    Handling polN
   //*-*    If before 'pol' exist any name, this name will be treated as variable used in polynomial
   //*-*    eg.
   //*-*    varpol2(5) will be replaced with: [5] + [6]*var + [7]*var^2
   //*-*    Empty name is treated like variable x.
   //*-*
   Int_t polPos = formula.Index("pol");
   while(polPos != kNPOS)
   {
      SetBit(kLinear,1);

      Bool_t defaultVariable = false;
      TString variable;
      Int_t openingBracketPos = formula.Index('(',polPos);
      Bool_t defaultCounter = openingBracketPos == kNPOS;
      Bool_t defaultDegree = true;
      Int_t degree,counter;
      TString sdegree;
      if(!defaultCounter)
      {
         // veryfy first of opening parenthesis belongs to pol expression
         // character between 'pol' and '(' must all be digits
         sdegree = formula(polPos + 3,openingBracketPos - polPos - 3);
         if (!sdegree.IsDigit() ) defaultCounter = true;
      }
      if (!defaultCounter) { 
          degree = sdegree.Atoi();
          counter = TString(formula(openingBracketPos+1,formula.Index(')',polPos) - openingBracketPos)).Atoi();
      }
      else
      {
         Int_t temp = polPos+3;
         while(temp < formula.Length() && isdigit(formula[temp]))
         {
            defaultDegree = false;
            temp++;
         }
         degree = TString(formula(polPos+3,temp - polPos - 3)).Atoi();
         counter = 0;
      }
      fNumber = 300 + degree;
      TString replacement = TString::Format("[%d]",counter);
      if(polPos - 1 < 0 || !IsFunctionNameChar(formula[polPos-1]) || formula[polPos-1] == ':' )
      {
         variable = "x";
         defaultVariable = true;
      }
      else
      {
         Int_t tmp = polPos - 1;
         while(tmp >= 0 && IsFunctionNameChar(formula[tmp]) && formula[tmp] != ':')
         {
            tmp--;
         }
         variable = formula(tmp + 1, polPos - (tmp+1));
      }
      Int_t param = counter + 1;
      Int_t tmp = 1;
      while(tmp <= degree)
      {
         replacement.Append(TString::Format("+[%d]*%s^%d",param,variable.Data(),tmp));
         param++;
         tmp++;
      }
      TString pattern;
      if(defaultCounter && !defaultDegree)
      {
         pattern = TString::Format("%spol%d",(defaultVariable ? "" : variable.Data()),degree);
      }
      else if(defaultCounter && defaultDegree)
      {
         pattern = TString::Format("%spol",(defaultVariable ? "" : variable.Data()));
      }
      else
      {
         pattern = TString::Format("%spol%d(%d)",(defaultVariable ? "" : variable.Data()),degree,counter);
      }

      if (!formula.Contains(pattern)) {
         Error("HandlePolN","Error handling polynomial function - expression is %s - trying to replace %s with %s ", formula.Data(), pattern.Data(), replacement.Data() );
         break;
      }
      formula.ReplaceAll(pattern,replacement);
      polPos = formula.Index("pol");
   }
}
void TFormula::HandleParametrizedFunctions(TString &formula)
{
   //*-*
   //*-*    Handling parametrized functions
   //*-*    Function can be normalized, and have different variable then x.
   //*-*    Variables should be placed in brackets after function name.
   //*-*    No brackets are treated like [x].
   //*-*    Normalized function has char 'n' after name, eg.
   //*-*    gausn[var](0) will be replaced with [0]*exp(-0.5*((var-[1])/[2])^2)/(sqrt(2*pi)*[2])
   //*-*
   //*-*    Adding function is easy, just follow these rules:
   //*-*    - Key for function map is pair of name and dimension of function
   //*-*    - value of key is a pair function body and normalized function body
   //*-*    - {Vn} is a place where variable appear, n represents n-th variable from variable list.
   //*-*      Count starts from 0.
   //*-*    - [num] stands for parameter number.
   //*-*      If user pass to function argument 5, num will stand for (5 + num) parameter.
   //*-*

   map< pair<TString,Int_t> ,pair<TString,TString> > functions;
   functions.insert(make_pair(make_pair("gaus",1),make_pair("[0]*exp(-0.5*(({V0}-[1])/[2])*(({V0}-[1])/[2]))","[0]*exp(-0.5*(({V0}-[1])/[2])*(({V0}-[1])/[2]))/(sqrt(2*pi)*[2])")));
   functions.insert(make_pair(make_pair("landau",1),make_pair("[0]*TMath::Landau({V0},[1],[2],false)","[0]*TMath::Landau({V0},[1],[2],true)")));
   functions.insert(make_pair(make_pair("expo",1),make_pair("exp([0]+[1]*{V0})","")));
   functions.insert(make_pair(make_pair("crystalball",1),make_pair("[0]*ROOT::Math::crystalball_function({V0},[3],[4],[2],[1])","[0]*ROOT::Math::crystalball_pdf({V0},[3],[4],[2],[1])")));
   functions.insert(make_pair(make_pair("breitwigner",1),make_pair("[0]*ROOT::Math::breitwigner_pdf({V0},[2],[1])","[0]*ROOT::Math::breitwigner_pdf({V0},[2],[4],[1])")));
   // chebyshev polynomial
   functions.insert(make_pair(make_pair("cheb0" ,1),make_pair("ROOT::Math::Chebyshev0({V0},[0])","")));
   functions.insert(make_pair(make_pair("cheb1" ,1),make_pair("ROOT::Math::Chebyshev1({V0},[0],[1])","")));
   functions.insert(make_pair(make_pair("cheb2" ,1),make_pair("ROOT::Math::Chebyshev2({V0},[0],[1],[2])","")));
   functions.insert(make_pair(make_pair("cheb3" ,1),make_pair("ROOT::Math::Chebyshev3({V0},[0],[1],[2],[3])","")));
   functions.insert(make_pair(make_pair("cheb4" ,1),make_pair("ROOT::Math::Chebyshev4({V0},[0],[1],[2],[3],[4])","")));
   functions.insert(make_pair(make_pair("cheb5" ,1),make_pair("ROOT::Math::Chebyshev5({V0},[0],[1],[2],[3],[4],[5])","")));
   functions.insert(make_pair(make_pair("cheb6" ,1),make_pair("ROOT::Math::Chebyshev6({V0},[0],[1],[2],[3],[4],[5],[6])","")));
   functions.insert(make_pair(make_pair("cheb7" ,1),make_pair("ROOT::Math::Chebyshev7({V0},[0],[1],[2],[3],[4],[5],[6],[7])","")));
   functions.insert(make_pair(make_pair("cheb8" ,1),make_pair("ROOT::Math::Chebyshev8({V0},[0],[1],[2],[3],[4],[5],[6],[7],[8])","")));
   functions.insert(make_pair(make_pair("cheb9" ,1),make_pair("ROOT::Math::Chebyshev9({V0},[0],[1],[2],[3],[4],[5],[6],[7],[8],[9])","")));
   functions.insert(make_pair(make_pair("cheb10",1),make_pair("ROOT::Math::Chebyshev10({V0},[0],[1],[2],[3],[4],[5],[6],[7],[8],[9],[10])","")));
   // 2-dimensional functions
   functions.insert(make_pair(make_pair("gaus",2),make_pair("[0]*exp(-0.5*(({V0}-[1])/[2])^2 - 0.5*(({V1}-[3])/[4])^2)","")));
   functions.insert(make_pair(make_pair("landau",2),make_pair("[0]*TMath::Landau({V0},[1],[2],false)*TMath::Landau({V1},[3],[4],false)","")));
   functions.insert(make_pair(make_pair("expo",2),make_pair("exp([0]+[1]*{V0})","exp([0]+[1]*{V0}+[2]*{V1})")));

   map<TString,Int_t> functionsNumbers;
   functionsNumbers["gaus"] = 100;
   functionsNumbers["landau"] = 400;
   functionsNumbers["expo"] = 200;
   functionsNumbers["crystalball"] = 500;

   // replace old names xygaus -> gaus[x,y]
   formula.ReplaceAll("xygaus","gaus[x,y]");
   formula.ReplaceAll("xylandau","landau[x,y]");
   formula.ReplaceAll("xyexpo","expo[x,y]");

   for(map<pair<TString,Int_t>,pair<TString,TString> >::iterator it = functions.begin(); it != functions.end(); ++it)
   {

      TString funName = it->first.first;
      Int_t funPos = formula.Index(funName);



      //std::cout << formula << " ---- " << funName << "  " << funPos << std::endl;
      while(funPos != kNPOS)
      {

         // should also check that function is not something else (e.g. exponential - parse the expo)
         Int_t lastFunPos = funPos + funName.Length();

         // check that first and last character is not alphanumeric
         Int_t iposBefore = funPos - 1;
         //std::cout << "looping on  funpos is " << funPos << " formula is " << formula << std::endl;
         if (iposBefore >= 0) {
            assert( iposBefore < formula.Length() );
            if (isalpha(formula[iposBefore] ) ) {
               //std::cout << "previous character for function " << funName << " is -" << formula[iposBefore] << "- skip " << std::endl;
               break;
            }
         }

         Bool_t isNormalized = false;
         if (lastFunPos < formula.Length() ) {
            // check if function is normalized by looking at "n" character after function name (e.g. gausn)
            isNormalized = (formula[lastFunPos] == 'n');
            if (isNormalized) lastFunPos += 1;
            if (lastFunPos < formula.Length() ) {
               // check if also last character is not alphanumeric or a digit
               if (isalnum(formula[lastFunPos] ) ) break;
               if (formula[lastFunPos] != '[' && formula[lastFunPos] != '(' && ! IsOperator(formula[lastFunPos] ) ) {
                  funPos = formula.Index(funName,lastFunPos);
                  continue;
               }
            }
         }
         
         if(isNormalized)
         {
            SetBit(kNormalized,1);
         }
         std::vector<TString> variables;
         Int_t dim = 0;
         TString varList = "";
         Bool_t defaultVariable = false;

         // check if function has specified the [...] e.g. gaus[x,y]
         Int_t openingBracketPos = funPos + funName.Length() + (isNormalized ? 1 : 0);
         Int_t closingBracketPos = kNPOS;
         if(openingBracketPos > formula.Length() || formula[openingBracketPos] != '[')
         {
            dim = 1;
            variables.resize(dim);
            variables[0] = "x";
            defaultVariable = true;
         }
         else
         {
            // in case of [..] found, assume they specify all the variables. Use it to get function dimension
            closingBracketPos = formula.Index(']',openingBracketPos);
            varList = formula(openingBracketPos+1,closingBracketPos - openingBracketPos - 1);
            dim = varList.CountChar(',') + 1;
            variables.resize(dim);
            Int_t Nvar = 0;
            TString varName = "";
            for(Int_t i = 0 ; i < varList.Length(); ++i)
            {
               if(IsFunctionNameChar(varList[i]))
               {
                  varName.Append(varList[i]);
               }
               if(varList[i] == ',')
               {
                  variables[Nvar] = varName;
                  varName = "";
                  Nvar++;
               }
            }
            if(varName != "") // we will miss last variable
            {
               variables[Nvar] = varName;
            }
         }
         // chech if dimension obtained from [...] is compatible with existing pre-defined functions
         if(dim != it->first.second)
         {
            pair<TString,Int_t> key = make_pair(funName,dim);
            if(functions.find(key) == functions.end())
            {
               Error("PreProcessFormula","%d dimension function %s is not defined as parametrized function.",dim,funName.Data());
               return;
            }
            break;
         }
         // look now for the (..) brackets to get the parameter counter (e.g. gaus(0) + gaus(3) )
         // need to start for a position
         Int_t openingParenthesisPos = (closingBracketPos == kNPOS) ? openingBracketPos : closingBracketPos + 1;
         bool defaultCounter = (openingParenthesisPos > formula.Length() || formula[openingParenthesisPos] != '(');

         //Int_t openingParenthesisPos = formula.Index('(',funPos);
         //Bool_t defaultCounter = (openingParenthesisPos == kNPOS);
         Int_t counter;
         if(defaultCounter)
         {
            counter = 0;
         }
         else
         {
            counter = TString(formula(openingParenthesisPos+1,formula.Index(')',funPos) - openingParenthesisPos -1)).Atoi();
         }
         //std::cout << "openingParenthesisPos  " << openingParenthesisPos << " counter is " << counter <<  std::endl;

         TString body = (isNormalized ? it->second.second : it->second.first);
         if(isNormalized && body == "")
         {
            Error("PreprocessFormula","%d dimension function %s has no normalized form.",it->first.second,funName.Data());
            break;
         }
         for(int i = 0 ; i < body.Length() ; ++i)
         {
            if(body[i] == '{')
            {
               // replace {Vn} with variable names
               i += 2; // skip '{' and 'V'
               Int_t num = TString(body(i,body.Index('}',i) - i)).Atoi();
               TString variable = variables[num];
               TString pattern = TString::Format("{V%d}",num);
               i -= 2; // restore original position
               body.Replace(i, pattern.Length(),variable,variable.Length());
               i += variable.Length()-1;   // update i to reflect change in body string
            }
            else if(body[i] == '[')
            {
               // update parameter counters in case of many functions (e.g. gaus(0)+gaus(3) )
               Int_t tmp = i;
               while(tmp < body.Length() && body[tmp] != ']')
               {
                  tmp++;
               }
               Int_t num = TString(body(i+1,tmp - 1 - i)).Atoi();
               num += counter;
               TString replacement = TString::Format("%d",num);

               body.Replace(i+1,tmp - 1 - i,replacement,replacement.Length());
               i += replacement.Length() + 1;
            }
         }
         TString pattern;
         if(defaultCounter && defaultVariable)
         {
            pattern = TString::Format("%s%s",
                           funName.Data(),
                           (isNormalized ? "n" : ""));
         }
         if(!defaultCounter && defaultVariable)
         {
            pattern = TString::Format("%s%s(%d)",
                           funName.Data(),
                           (isNormalized ? "n" : ""),
                           counter);
         }
         if(defaultCounter && !defaultVariable)
         {
            pattern = TString::Format("%s%s[%s]",
                           funName.Data(),
                           (isNormalized ? "n":""),
                           varList.Data());
         }
         if(!defaultCounter && !defaultVariable)
         {
            pattern = TString::Format("%s%s[%s](%d)",
                           funName.Data(),
                           (isNormalized ? "n" : ""),
                           varList.Data(),
                           counter);
         }
         TString replacement = body;

         // set the number (only in case a function exists without anything else
         if (fNumber == 0 && formula.Length() <= (pattern.Length()-funPos) +1 ) { // leave 1 extra
            fNumber = functionsNumbers[funName] + 10*(dim-1);            
         }

         formula.Replace(funPos,pattern.Length(),replacement,replacement.Length());
        
         funPos = formula.Index(funName);
      }
      //std::cout << " formula is now " << formula << std::endl;
   }

}
void TFormula::HandleExponentiation(TString &formula)
{
   //*-*
   //*-*    Handling exponentiation
   //*-*    Can handle multiple carets, eg.
   //*-*    2^3^4 will be treated like 2^(3^4)
   //*-*
   Int_t caretPos = formula.Last('^');
   while(caretPos != kNPOS)
   {

      TString right,left;
      Int_t temp = caretPos;
      temp--;
      // get the expression in ( ) which has the operator^ applied
      if(formula[temp] == ')')
      {
         Int_t depth = 1;
         temp--;
         while(depth != 0 && temp > 0)
         {
            if(formula[temp] == ')')
               depth++;
            if(formula[temp] == '(')
               depth--;
            temp--;
         }
         if (depth == 0) temp++;
      }
      // this in case of someting like sin(x+2)^2
      do {
         temp--;  // go down one
         // handle scientific notation cases (1.e-2 ^ 3 )
         if (temp>=2 && IsScientificNotation(formula, temp-1) ) temp-=3;
      }
      while(temp >= 0 && !IsOperator(formula[temp]) && !IsBracket(formula[temp]) );
      
      assert(temp+1 >= 0);
      Int_t leftPos = temp+1;
      left = formula(leftPos, caretPos - leftPos);
      //std::cout << "left to replace is " << left << std::endl;

      // look now at the expression after the ^ operator
      temp = caretPos;
      temp++;
      if (temp >= formula.Length() ) {
         Error("HandleExponentiation","Invalid position of operator ^");
         return;
      }
      if(formula[temp] == '(')
      {
         Int_t depth = 1;
         temp++;
         while(depth != 0 && temp < formula.Length())
         {
            if(formula[temp] == ')')
               depth--;
            if(formula[temp] == '(')
               depth++;
            temp++;
         }
         temp--;
      }
      else {
         // handle case  first character is operator - or + continue
         if (formula[temp] == '-' || formula[temp] == '+' ) temp++;
         // handle cases x^-2 or x^+2
         // need to handle also cases x^sin(x+y)
         Int_t depth = 0; 
         while(temp < formula.Length() && ( (depth > 0) || !IsOperator(formula[temp]) ) ) 
         {
            temp++;
            // handle scientific notation cases (1.e-2 ^ 3 )
            if (temp>=2 && IsScientificNotation(formula, temp) ) temp+=2;
            // for internal parenthesis
            if (formula[temp] == '(') depth++;
            if (depth > 0 && formula[temp] == ')') depth--;
         }
      }
      right = formula(caretPos + 1, (temp - 1) - caretPos );

      TString pattern = TString::Format("%s^%s",left.Data(),right.Data());
      TString replacement = TString::Format("pow(%s,%s)",left.Data(),right.Data());

      //std::cout << "pattern : " << pattern << std::endl;
      //std::cout << "replacement : " << replacement << std::endl;
      formula.Replace(leftPos,pattern.Length(),replacement,replacement.Length());

      caretPos = formula.Last('^');
   }
}

// handle linear functions defined with the operator ++
void TFormula::HandleLinear(TString &formula)
{
   formula.ReplaceAll("++","@");
   Int_t linPos = formula.Index("@");
   if (linPos == kNPOS ) return;  // function is not linear
   Int_t NofLinParts = formula.CountChar((int)'@');
   assert(NofLinParts > 0);
   fLinearParts.reserve(NofLinParts + 1);
   Int_t Nlinear = 0;
   bool first = true;
   while(linPos != kNPOS)
   {
      SetBit(kLinear,1);
      // analyze left part only the first time
      Int_t temp = 0;
      TString left;
      if (first) {
         temp = linPos - 1;
         while(temp >= 0 && formula[temp] != '@')
         {
            temp--;
         }
         left = formula(temp+1,linPos - (temp +1));
      }
      temp = linPos + 1;
      while(temp < formula.Length() && formula[temp] != '@')
      {
         temp++;
      }
      TString right = formula(linPos+1,temp - (linPos+1));

      TString pattern     = (first) ? TString::Format("%s@%s",left.Data(),right.Data()) : TString::Format("@%s",right.Data());
      TString replacement = (first) ? TString::Format("([%d]*(%s))+([%d]*(%s))",Nlinear,left.Data(),Nlinear+1,right.Data()) : TString::Format("+([%d]*(%s))",Nlinear,right.Data());
      Nlinear += (first) ? 2 : 1;

      formula.ReplaceAll(pattern,replacement);
      if (first) {
         TFormula *lin1 = new TFormula("__linear1",left,false);
         fLinearParts.push_back(lin1);
      }
      TFormula *lin2 = new TFormula("__linear2",right,false);
      fLinearParts.push_back(lin2);

      linPos = formula.Index("@");
      first = false;
   }
}

void TFormula::PreProcessFormula(TString &formula)
{
   //*-*
   //*-*    Preprocessing of formula
   //*-*    Replace all ** by ^, and removes spaces.
   //*-*    Handle also parametrized functions like polN,gaus,expo,landau
   //*-*    and exponentiation.
   //*-*    Similar functionality should be added here.
   //*-*
   formula.ReplaceAll("**","^");
   formula.ReplaceAll(" ","");
   HandlePolN(formula);
   HandleParametrizedFunctions(formula);
   HandleExponentiation(formula);
   HandleLinear(formula);
}
Bool_t TFormula::PrepareFormula(TString &formula)
{
   // prepare the formula to be executed
   // normally is called with fFormula
   
   fFuncs.clear();
   fReadyToExecute = false;
   ExtractFunctors(formula);

   // update the expression with the new formula
   fFormula = formula;
   // save formula to parse variable and parameters for Cling
   fClingInput = formula; 
   // replace all { and }
   fFormula.ReplaceAll("{","");
   fFormula.ReplaceAll("}","");

   //std::cout << "functors are extracted formula is " << std::endl;
   //std::cout << fFormula << std::endl << std::endl;

   fFuncs.sort();
   fFuncs.unique();

   // use inputFormula for Cling
   ProcessFormula(fClingInput);

   // for pre-defined functions (need after processing)
   if (fNumber != 0) SetPredefinedParamNames();

   return fReadyToExecute && fClingInitialized;
}
void TFormula::ExtractFunctors(TString &formula)
{
   //*-*
   //*-*    Extracts functors from formula, and put them in fFuncs.
   //*-*    Simple grammar:
   //*-*    <function>  := name(arg1,arg2...)
   //*-*    <variable>  := name
   //*-*    <parameter> := [number]
   //*-*    <name>      := String containing lower and upper letters, numbers, underscores
   //*-*    <number>    := Integer number
   //*-*    Operators are omitted.
   //*-*
   TString name = "";
   TString body = "";
   //printf("formula is : %s \n",formula.Data() );
   for(Int_t i = 0 ; i < formula.Length(); ++i )
   {

      //std::cout << "loop on character : " << i << " " << formula[i] << std::endl;
      // case of parameters
      if(formula[i] == '[')
      {
         Int_t tmp = i;
         i++;
         TString param = "";
         while(formula[i] != ']' && i < formula.Length())
         {
            param.Append(formula[i++]);
         }
         i++;
         //rename parameter name XX to pXX
         if (param.IsDigit() ) param.Insert(0,'p');
         DoAddParameter(param,0,false);
         TString replacement = TString::Format("{[%s]}",param.Data());
         formula.Replace(tmp,i - tmp, replacement,replacement.Length());
         fFuncs.push_back(TFormulaFunction(param));
         //printf("found parameter %s \n",param.Data() );
         continue;
      }
      // case of strings
      if (formula[i] == '\"') {
         // look for next instance of "\"
         do {
            i++;
         } while(formula[i] != '\"');
      }
      // case of e or E for numbers in exponential notaton (e.g. 2.2e-3)
      if (IsScientificNotation(formula, i) )
         continue; 

      //std::cout << "investigating character : " << i << " " << formula[i] << " of formula " << formula << std::endl;
      // look for variable and function names. They  start in C++ with alphanumeric characters
      if(isalpha(formula[i]) && !IsOperator(formula[i]))  // not really needed to check if operator (if isalpha is not an operator)
      {
         //std::cout << "character : " << i << " " << formula[i] << " is not an operator and is alpha " << std::endl;

         while( IsFunctionNameChar(formula[i]) && i < formula.Length())
         {
            // need special case for separting operator  ":" from scope operator "::"
            if (formula[i] == ':' && ( (i+1) < formula.Length() ) ) {
               if ( formula[i+1]  == ':' ) {
                  // case of :: (scopeOperator)
                  name.Append("::");
                  i+=2;
                  continue;
               }
               else
                  break;
            }

            name.Append(formula[i++]);
         }
         //printf(" build a name %s \n",name.Data() );
         if(formula[i] == '(')
         {
            i++;
            if(formula[i] == ')')
            {
               fFuncs.push_back(TFormulaFunction(name,body,0));
               name = body = "";
               continue;
            }
            Int_t depth = 1;
            Int_t args  = 1; // we will miss first argument
            while(depth != 0 && i < formula.Length())
            {
               switch(formula[i])
               {
                  case '(': depth++;   break;
                  case ')': depth--;   break;
                  case ',': if(depth == 1) args++; break;
               }
               if(depth != 0) // we don't want last ')' inside body
               {
                  body.Append(formula[i++]);
               }
            }
            Int_t originalBodyLen = body.Length();
            ExtractFunctors(body);
            formula.Replace(i-originalBodyLen,originalBodyLen,body,body.Length());
            i += body.Length() - originalBodyLen;
            fFuncs.push_back(TFormulaFunction(name,body,args));
         }
         else
         {

            //std::cout << "check if character : " << i << " " << formula[i] << " from name " << name << "  is a function " << std::endl;

            // check if function is provided by gROOT
            TObject *obj = gROOT->GetListOfFunctions()->FindObject(name);
            TFormula * f = dynamic_cast<TFormula*> (obj);
            if (!f) {
               // maybe object is a TF1
               TF1 * f1 = dynamic_cast<TF1*> (obj);
               if (f1) f = f1->GetFormula();
            }
            if (f) {
               TString replacementFormula = f->GetExpFormula();
               // analyze expression string
               //std::cout << "formula to replace for " << f->GetName() << " is " << replacementFormula << std::endl;
               PreProcessFormula(replacementFormula);
               // we need to define different parameters if we use the unnamed default parameters ([0])
               // I need to replace all the terms in the functor for backward compatibility of the case
               // f1("[0]*x") f2("[0]*x") f1+f2 - it is weird but it is better to support
               //std::cout << "current number of parameter is " << fNpar << std::endl;
               int nparOffset = 0;
               //if (fParams.find("0") != fParams.end() ) {
               // do in any case if parameters are existing
               if (fNpar > 0) {
                  nparOffset = fNpar;
                  // start from higher number to avoid overlap
                  for (int jpar = f->GetNpar()-1; jpar >= 0; --jpar ) {
                     TString oldName = TString::Format("[%s]",f->GetParName(jpar));
                     TString newName = TString::Format("[p%d]",nparOffset+jpar);
                     //std::cout << "replace - parameter " << f->GetParName(jpar) << " with " <<  newName << std::endl;
                     replacementFormula.ReplaceAll(oldName,newName);
                  }
                  //std::cout << "after replacing params " << replacementFormula << std::endl;
               }
               ExtractFunctors(replacementFormula);
               //std::cout << "after re-extracting functors " << replacementFormula << std::endl;

               // set parameter value from replacement formula
               for (int jpar = 0; jpar < f->GetNpar(); ++jpar) {
                  if (nparOffset> 0) {
                     // parameter have an offset- so take this into accound
                     TString newName = TString::Format("p%d",nparOffset+jpar);
                     SetParameter(newName,  f->GetParameter(jpar) );
                  }
                  else
                     // names are the same between current formula and replaced one
                     SetParameter(f->GetParName(jpar),  f->GetParameter(jpar) );
               }
               // need to add parenthesis at begin end end of replacementFormula
               replacementFormula.Insert(0,'(');
               replacementFormula.Insert(replacementFormula.Length(),')');
               formula.Replace(i-name.Length(),name.Length(), replacementFormula, replacementFormula.Length());
               // move forward the index i of the main loop
               i += replacementFormula.Length()-name.Length();

               // we have extracted all the functor for "fname"
               //std::cout << " i = " << i << " f[i] = " << formula[i] << " - " << formula << std::endl;

               continue;
            }

            // add now functor in
            TString replacement = TString::Format("{%s}",name.Data());
            formula.Replace(i-name.Length(),name.Length(),replacement,replacement.Length());
            i += 2;
            fFuncs.push_back(TFormulaFunction(name));
         }
      }
      name = body = "";

   }
}
void TFormula::ProcessFormula(TString &formula)
{
   //*-*
   //*-*    Iterates through funtors in fFuncs and performs the appropriate action.
   //*-*    If functor has 0 arguments (has only name) can be:
   //*-*     - variable
   //*-*       * will be replaced with x[num], where x is an array containing value of this variable under num.
   //*-*     - pre-defined formula
   //*-*       * will be replaced with formulas body
   //*-*     - constant
   //*-*       * will be replaced with constant value
   //*-*     - parameter
   //*-*       * will be replaced with p[num], where p is an array containing value of this parameter under num.
   //*-*    If has arguments it can be :
   //*-*     - function shortcut, eg. sin
   //*-*       * will be replaced with fullname of function, eg. sin -> TMath::Sin
   //*-*     - function from cling environment, eg. TMath::BreitWigner(x,y,z)
   //*-*       * first check if function exists, and has same number of arguments, then accept it and set as found.
   //*-*    If all functors after iteration are matched with corresponding action,
   //*-*    it inputs C++ code of formula into cling, and sets flag that formula is ready to evaluate.
   //*-*

   // std::cout << "Begin: formula is " << formula << " list of functors " << fFuncs.size() << std::endl;

   for(list<TFormulaFunction>::iterator funcsIt = fFuncs.begin(); funcsIt != fFuncs.end(); ++funcsIt)
   {
      TFormulaFunction & fun = *funcsIt;

      //std::cout << "fun is " << fun.GetName() << std::endl;

      if(fun.fFound)
         continue;
      if(fun.IsFuncCall())
      {
         map<TString,TString>::iterator it = fFunctionsShortcuts.find(fun.GetName());
         if(it != fFunctionsShortcuts.end())
         {
            TString shortcut = it->first;
            TString full = it->second;
            //std::cout << " functor " << fun.GetName() << " found - replace " <<  shortcut << " with " << full << " in " << formula << std::endl;
            // replace all functors
            Ssiz_t index = formula.Index(shortcut,0);
            while ( index != kNPOS) {
               // check that function is not in a namespace and is not in other characters
               //std::cout << "analyzing " << shortcut << " in " << formula << std::endl;
               Ssiz_t i2 = index + shortcut.Length();
               if ( (index > 0) && (isalpha( formula[index-1] )  || formula[index-1] == ':' )) {
                  index = formula.Index(shortcut,i2);
                  continue;
               }
               if (i2 < formula.Length()  && formula[i2] != '(') {
                  index = formula.Index(shortcut,i2);
                  continue;
               }
               // now replace the string
               formula.Replace(index, shortcut.Length(), full);
               Ssiz_t inext = index + full.Length(); 
               index = formula.Index(shortcut,inext);
               fun.fFound = true;
            }
         }
         if(fun.fName.Contains("::")) // add support for nested namespaces
         {
            // look for last occurence of "::"
            std::string name(fun.fName);
            size_t index = name.rfind("::");
            assert(index != std::string::npos);
            TString className = fun.fName(0,fun.fName(0,index).Length());
            TString functionName = fun.fName(index + 2, fun.fName.Length());

            Bool_t silent = true;
            TClass *tclass = new TClass(className,silent);
            // std::cout << "looking for class " << className << std::endl;
            const TList *methodList = tclass->GetListOfAllPublicMethods();
            TIter next(methodList);
            TMethod *p;
            while ((p = (TMethod*) next()))
            {
               if (strcmp(p->GetName(),functionName.Data()) == 0  &&
                   (fun.GetNargs() <=  p->GetNargs() && fun.GetNargs() >=  p->GetNargs() - p->GetNargsOpt() ) )
               {
                  fun.fFound = true;
                  break;
               }
            }
         }
         if(!fun.fFound)
         {
            // try to look into all the global functions in gROOT
            TFunction * f = (TFunction*) gROOT->GetListOfGlobalFunctions(true)->FindObject(fun.fName);
            // if found a function with matching arguments
            if (f && fun.GetNargs() <=  f->GetNargs() && fun.GetNargs() >=  f->GetNargs() - f->GetNargsOpt() )
            {
               fun.fFound = true;
            }
         }

         if(!fun.fFound)
         {
            // ignore not found functions
            if (gDebug) 
               Info("TFormula","Could not find %s function with %d argument(s)",fun.GetName(),fun.GetNargs());
            fun.fFound = false;
         }
      }
      else
      {
         TFormula *old = (TFormula*)gROOT->GetListOfFunctions()->FindObject(gNamePrefix + fun.fName);
         if(old)
         {
            // we should not go here (this analysis is done before in ExtractFunctors)
            assert(false);
            fun.fFound = true;
            TString pattern = TString::Format("{%s}",fun.GetName());
            TString replacement = old->GetExpFormula();
            PreProcessFormula(replacement);
            ExtractFunctors(replacement);
            formula.ReplaceAll(pattern,replacement);
            continue;
         }
         // looking for default variables defined in fVars

         map<TString,TFormulaVariable>::iterator varsIt = fVars.find(fun.GetName());
         if(varsIt!= fVars.end())
         {

            TString name = (*varsIt).second.GetName();
            Double_t value = (*varsIt).second.fValue;

            
            AddVariable(name,value); // this set the cling variable
            if(!fVars[name].fFound)
            {


               fVars[name].fFound = true;
               int varDim =  (*varsIt).second.fArrayPos;  // variable dimenions (0 for x, 1 for y, 2, for z)
               if (varDim >= fNdim) {
                  fNdim = varDim+1;
                  
                  // we need to be sure that all other variables are added with position less
                  for ( auto &v : fVars) {
                     if (v.second.fArrayPos < varDim && !v.second.fFound ) {
                        AddVariable(v.first, v.second.fValue);
                        v.second.fFound = true;
                     }
                  }
               }
            }
            // remove the "{.. }" added around the variable
            TString pattern = TString::Format("{%s}",name.Data());
            TString replacement = TString::Format("x[%d]",(*varsIt).second.fArrayPos);
            formula.ReplaceAll(pattern,replacement);

            //std::cout << "Found an observable for " << fun.GetName()  << std::endl;

            fun.fFound = true;
            continue;
         }
         // check for observables defined as x[0],x[1],....
         // maybe could use a regular expression here
         // only in case match with defined variables is not successfull
         TString funname = fun.GetName();
         if (funname.Contains("x[") && funname.Contains("]") ) {
            TString sdigit = funname(2,funname.Index("]") );
            int digit = sdigit.Atoi();
            if (digit >= fNdim) {
               fNdim = digit+1;
               // we need to add the variables in fVars all of them before x[n]
               for (int j = 0; j < fNdim; ++j) {
                  TString vname = TString::Format("x[%d]",j);
                     if (fVars.find(vname) == fVars.end() ) {
                        fVars[vname] = TFormulaVariable(vname,0,j);
                        fVars[vname].fFound = true;
                        AddVariable(vname,0.);
                     }
               }
            }
            //std::cout << "Found matching observable for " << funname  << std::endl;
            fun.fFound = true;
            // remove the "{.. }" added around the variable
            TString pattern = TString::Format("{%s}",funname.Data());
            formula.ReplaceAll(pattern,funname);
            continue;
         }
         //}

         auto paramsIt = fParams.find(fun.GetName());
         if(paramsIt != fParams.end())
         {
            //TString name = (*paramsIt).second.GetName();
            TString pattern = TString::Format("{[%s]}",fun.GetName());
            //std::cout << "pattern is " << pattern << std::endl;
            if(formula.Index(pattern) != kNPOS)
            {
               //TString replacement = TString::Format("p[%d]",(*paramsIt).second.fArrayPos);
               TString replacement = TString::Format("p[%d]",(*paramsIt).second);
               //std::cout << "replace pattern  " << pattern << " with " << replacement << std::endl;
               formula.ReplaceAll(pattern,replacement);

            }
            fun.fFound = true;
            continue;
         }
         else {
            //std::cout << "functor  " << fun.GetName() << " is not a parameter " << std::endl;
         }

         // looking for constants (needs to be done after looking at the parameters)
         map<TString,Double_t>::iterator constIt = fConsts.find(fun.GetName());
         if(constIt != fConsts.end())
         {
            TString pattern = TString::Format("{%s}",fun.GetName());
            TString value = TString::Format("%lf",(*constIt).second);
            formula.ReplaceAll(pattern,value);
            fun.fFound = true;
            //std::cout << "constant with name " << fun.GetName() << " is found " << std::endl;
            continue;
         }


         fun.fFound = false;
      }
   }
   //std::cout << "End: formula is " << formula << std::endl;

   // ignore case of functors have been matched - try to pass it to Cling
   if(!fReadyToExecute)
   {
      fReadyToExecute = true;
      Bool_t hasVariables = (fNdim > 0);
      Bool_t hasParameters = (fNpar > 0);
      if(!hasParameters)
      {
         fAllParametersSetted = true;
      }
      // assume a function without variables is always 1-dimensional
      if (hasParameters && ! hasVariables) {
         fNdim = 1;
         AddVariable("x",0);
         hasVariables = true;
      }
      Bool_t hasBoth = hasVariables && hasParameters;
      Bool_t inputIntoCling = (formula.Length() > 0);
      if (inputIntoCling) {

         // save copy of inputFormula in a std::strig for the unordered map
         // and also formula is same as FClingInput typically and it will be modified 
         std::string inputFormula = std::string(formula); 

         
         // valid input formula - try to put into Cling
         TString argumentsPrototype =
            TString::Format("%s%s%s",(hasVariables ? "Double_t *x" : ""), (hasBoth ? "," : ""),
                        (hasParameters  ? "Double_t *p" : ""));


         // set the name for Cling using the hash_function
         fClingName = gNamePrefix; 

         // check if formula exist already in the map
         R__LOCKGUARD2(gROOTMutex);

         auto funcit = gClingFunctions.find(inputFormula);

         if (funcit != gClingFunctions.end() ) {
            fFuncPtr = (  TInterpreter::CallFuncIFacePtr_t::Generic_t) funcit->second;
            fClingInitialized = true; 
            inputIntoCling = false;
         }
         
         // set the cling name using hash of the static formulae map
         auto hasher = gClingFunctions.hash_function();
         fClingName = TString::Format("%s__id%zu",gNamePrefix.Data(),(unsigned long) hasher(inputFormula) );

         fClingInput = TString::Format("Double_t %s(%s){ return %s ; }", fClingName.Data(),argumentsPrototype.Data(),inputFormula.c_str());

         // this is not needed (maybe can be re-added in case of recompilation of identical expressions
         // // check in case of a change if need to re-initialize
         // if (fClingInitialized) {
         //    if (oldClingInput == fClingInput)
         //       inputIntoCling = false;
         //    else
         //       fClingInitialized = false;
         // }


         if(inputIntoCling) {
            InputFormulaIntoCling();
            if (fClingInitialized) {
               // if Cling has been succesfully initialized
               // dave function ptr in the static map 
               R__LOCKGUARD2(gROOTMutex);
               gClingFunctions.insert ( std::make_pair ( inputFormula, (void*) fFuncPtr) );
            }
            
         }
         else {
            fAllParametersSetted = true;
            fClingInitialized = true;
         }
      }
   }
      

   // IN case of a Cling Error check components wich are not found in Cling
   // check that all formula components arematched otherwise emit an error
   if (!fClingInitialized) { 
      Bool_t allFunctorsMatched = true;
      for(list<TFormulaFunction>::iterator it = fFuncs.begin(); it != fFuncs.end(); it++)
      {
         if(!it->fFound)
         {
            allFunctorsMatched = false;
            if (it->GetNargs() == 0) 
               Error("ProcessFormula","\"%s\" has not been matched in the formula expression",it->GetName() );
            else
               Error("ProcessFormula","Could not find %s function with %d argument(s)",it->GetName(),it->GetNargs());
         }
      }
      if (!allFunctorsMatched) {
         Error("ProcessFormula","Formula \"%s\" is invalid !", GetExpFormula().Data() );
         fReadyToExecute = false;
      }
   }

   // clean up un-used default variables in case formula is valid
   if (fClingInitialized && fReadyToExecute) { 
      auto itvar = fVars.begin();
      do
      {
         if ( ! itvar->second.fFound ) {
            //std::cout << "Erase variable " << itvar->first << std::endl;
            itvar = fVars.erase(itvar);
         }
         else
            itvar++;
      }
      while( itvar != fVars.end() );
   }

}
void TFormula::SetPredefinedParamNames() {

   // set parameter names only in case of pre-defined functions
   if (fNumber == 0) return;

   if (fNumber == 100) { // Gaussian
      SetParName(0,"Constant");
      SetParName(1,"Mean");
      SetParName(2,"Sigma");
      return;
   }
   if (fNumber == 110) { 
      SetParName(0,"Constant");
      SetParName(1,"MeanX");
      SetParName(2,"SigmaX");
      SetParName(3,"MeanY");
      SetParName(4,"SigmaY");
      return;
   }
   if (fNumber == 200) { // exponential
      SetParName(0,"Constant");
      SetParName(1,"Slope");
      return;
   }
   if (fNumber == 400) { // landau
      SetParName(0,"Constant");
      SetParName(1,"MPV");
      SetParName(2,"Sigma");
      return;
   }
   if (fNumber == 500) { // crystal-ball
      SetParName(0,"Constant");
      SetParName(1,"Mean");
      SetParName(2,"Sigma");
      SetParName(3,"Alpha");
      SetParName(4,"N");
      return;
   }
   if (fNumber == 600) { // breit-wigner
      SetParName(0,"Constant");
      SetParName(1,"Mean");
      SetParName(2,"Gamma");
      return;
   }
   // if formula is a polynomial (or chebyshev), set parameter names
   // not needed anymore (p0 is assigned by default)
   // if (fNumber == (300+fNpar-1) ) {
   //    for (int i = 0; i < fNpar; i++) SetParName(i,TString::Format("p%d",i));
   //    return;
   // }

   // // general case if parameters are digits (XX) change to pXX
   // auto paramMap = fParams;  // need to copy the map because SetParName is going to modify it 
   // for ( auto & p : paramMap) {
   //    if (p.first.IsDigit() ) 
   //        SetParName(p.second,TString::Format("p%s",p.first.Data()));
   // }

   return;
}
const TObject* TFormula::GetLinearPart(Int_t i) const
{
   // Return linear part.

   if (!fLinearParts.empty()) {
      int n = fLinearParts.size();
      if (i < 0 || i >= n ) {
         Error("GetLinearPart","Formula %s has only %d linear parts - requested %d",GetName(),n,i);
         return nullptr;
      }
      return fLinearParts[i];
   }
   return nullptr;
}
void TFormula::AddVariable(const TString &name, double value)
{
   //*-*
   //*-*    Adds variable to known variables, and reprocess formula.
   //*-*

   if(fVars.find(name) != fVars.end() )
   {
      TFormulaVariable & var = fVars[name];
      var.fValue = value;

      // If the position is not defined in the Cling vectors, make space for it
      // but normally is variable is defined in fVars a slot should be also present in fClingVariables
      if(var.fArrayPos < 0)
      {
         var.fArrayPos = fVars.size();
      }
      if(var.fArrayPos >= (int)fClingVariables.size())
      {
         fClingVariables.resize(var.fArrayPos+1);
      }
      fClingVariables[var.fArrayPos] = value;
   }
   else
   {
      TFormulaVariable var(name,value,fVars.size());
      fVars[name] = var;
      fClingVariables.push_back(value);
      if (!fFormula.IsNull() ) {
         //printf("process formula again - %s \n",fClingInput.Data() );
         ProcessFormula(fClingInput);
      }
   }

}
void TFormula::AddVariables(const TString *vars, const Int_t size)
{
   //*-*
   //*-*    Adds multiple variables.
   //*-*    First argument is an array of pairs<TString,Double>, where
   //*-*    first argument is name of variable,
   //*-*    second argument represents value.
   //*-*    size - number of variables passed in first argument
   //*-*

   Bool_t anyNewVar = false;
   for(Int_t i = 0 ; i < size; ++i)
   {

      const TString & vname = vars[i];

      TFormulaVariable &var = fVars[vname];
      if(var.fArrayPos < 0)
      {

         var.fName = vname;
         var.fArrayPos = fVars.size();
         anyNewVar = true;
         var.fValue = 0;
         if(var.fArrayPos >= (int)fClingVariables.capacity())
         {
            Int_t multiplier = 2;
            if(fFuncs.size() > 100)
            {
               multiplier = TMath::Floor(TMath::Log10(fFuncs.size()) * 10);
            }
            fClingVariables.reserve(multiplier * fClingVariables.capacity());
         }
         fClingVariables.push_back(0.0);
      }
      // else
      // {
      //    var.fValue = v.second;
      //    fClingVariables[var.fArrayPos] = v.second;
      // }
   }
   if(anyNewVar && !fFormula.IsNull())
   {
      ProcessFormula(fClingInput);
   }

}

void TFormula::SetName(const char* name)
{
   // Set the name of the formula. We need to allow the list of function to
   // properly handle the hashes.
   if (IsReservedName(name)) {
      Error("SetName","The name \'%s\' is reserved as a TFormula variable name.\n"
         "\tThis function will not be renamed.",name);
   } else {
      // Here we need to remove and re-add to keep the hashes consistent with
      // the underlying names.
      auto listOfFunctions = gROOT->GetListOfFunctions();
      TObject* thisAsFunctionInList = nullptr;
      R__LOCKGUARD2(gROOTMutex);
      if (listOfFunctions){
         thisAsFunctionInList = listOfFunctions->FindObject(this);
         if (thisAsFunctionInList) listOfFunctions->Remove(thisAsFunctionInList);
      }
      TNamed::SetName(name);
      if (thisAsFunctionInList) listOfFunctions->Add(thisAsFunctionInList);
   }
}

void TFormula::SetVariables(const pair<TString,Double_t> *vars, const Int_t size)
{
   //*-*
   //*-*    Sets multiple variables.
   //*-*    First argument is an array of pairs<TString,Double>, where
   //*-*    first argument is name of variable,
   //*-*    second argument represents value.
   //*-*    size - number of variables passed in first argument
   //*-*
   for(Int_t i = 0; i < size; ++i)
   {
      pair<TString,Double_t> v = vars[i];
      if(fVars.find(v.first) != fVars.end())
      {
         fVars[v.first].fValue = v.second;
         fClingVariables[fVars[v.first].fArrayPos] = v.second;
      }
      else
      {
         Error("SetVariables","Variable %s is not defined.",v.first.Data());
      }
   }
}

Double_t TFormula::GetVariable(const char *name) const
{
   //*-*
   //*-*    Returns variable value.
   //*-*
   TString sname(name); 
   if(fVars.find(sname) == fVars.end())
   {
      Error("GetVariable","Variable %s is not defined.",sname.Data());
      return -1;
   }
   return fVars.find(sname)->second.fValue;
}
Int_t TFormula::GetVarNumber(const char *name) const
{
   //*-*
   //*-*    Returns variable number (positon in array) given its name 
   //*-*
   TString sname(name); 
   if(fVars.find(sname) == fVars.end())
   {
      Error("GetVarNumber","Variable %s is not defined.",sname.Data());
      return -1;
   }
   return fVars.find(sname)->second.fArrayPos;
}

TString TFormula::GetVarName(Int_t ivar) const
{
   //*-*
   //*-*    Returns variable name given its position in the array
   //*-*

   if (ivar < 0 || ivar >= fNdim) return "";

   // need to loop on the map to find corresponding variable
   for ( auto & v : fVars) {
      if (v.second.fArrayPos == ivar) return v.first;
   }
   Error("GetVarName","Variable with index %d not found !!",ivar);
   //return TString::Format("x%d",ivar);
   return TString(); 
}

void TFormula::SetVariable(const TString &name, Double_t value)
{
   //*-*
   //*-*    Sets variable value.
   //*-*
   if(fVars.find(name) == fVars.end())
   {
      Error("SetVariable","Variable %s is not defined.",name.Data());
      return;
   }
   fVars[name].fValue = value;
   fClingVariables[fVars[name].fArrayPos] = value;
}

void TFormula::DoAddParameter(const TString &name, Double_t value, Bool_t processFormula)
{
   //*-*
   //*-*    Adds parameter to known parameters.
   //*-*    User should use SetParameter, because parameters are added during initialization part,
   //*-*    and after that adding new will be pointless.
   //*-*

   //std::cout << "adding parameter " << name << std::endl;

   // if parameter is already defined in fParams - just set the new value
   if(fParams.find(name) != fParams.end() )
   {
      int ipos = fParams[name];
      //TFormulaVariable & par = fParams[name];
      //par.fValue = value;
      if (ipos < 0)
      {
         ipos = fParams.size();
         fParams[name] = ipos;
      }
//     
      if(ipos >= (int)fClingParameters.size())
      {
         if(ipos >= (int)fClingParameters.capacity())            
            fClingParameters.reserve( TMath::Max(int(fParams.size()), ipos+1));
         fClingParameters.insert(fClingParameters.end(),ipos+1-fClingParameters.size(),0.0);
      }
      fClingParameters[ipos] = value;
   }
   else
   {
      // new parameter defined
      fNpar++;
      //TFormulaVariable(name,value,fParams.size());
      int pos = fParams.size();
      //fParams.insert(std::make_pair<TString,TFormulaVariable>(name,TFormulaVariable(name,value,pos)));
      auto ret = fParams.insert(std::make_pair(name,pos));
      // map returns a std::pair<iterator, bool>
      // use map the order for defult position of parameters in the vector
      // (i.e use the alphabetic order)
      if (ret.second) {
         // a new element is inserted
         if (ret.first == fParams.begin() )
            pos = 0;
         else {
            auto previous = (ret.first);
            --previous;
            pos = previous->second + 1;
         }            
         fClingParameters.insert(fClingParameters.begin()+pos,value);        
         // need to adjust all other positions
         for ( auto it = ret.first; it != fParams.end(); ++it ) {
            it->second = pos;
            pos++;
         }
      }
      if (processFormula) {
         // replace first in input parameter name with [name]
         fClingInput.ReplaceAll(name,TString::Format("[%s]",name.Data() ) );
         ProcessFormula(fClingInput);
      }
   }

}
Int_t TFormula::GetParNumber(const char * name) const {
   // return parameter index given a name (return -1 for not existing parameters)
   // non need to print an error
   auto it = fParams.find(name);
   if(it == fParams.end())
   {
      return -1;
   }
   return it->second;

}

Double_t TFormula::GetParameter(const char * name) const
{
   //*-*
   //*-*    Returns parameter value given by string.
   //*-*
   int i = GetParNumber(name);
   if (i  == -1) {
      Error("GetParameter","Parameter %s is not defined.",name);
      return TMath::QuietNaN();
   }
      
   return GetParameter( GetParNumber(name) );
}
Double_t TFormula::GetParameter(Int_t param) const
{
   //*-*
   //*-*    Return parameter value given by integer.
   //*-*
   //*-*
   //TString name = TString::Format("%d",param);
   if(param >=0 && param < (int) fClingParameters.size())
      return fClingParameters[param];
   Error("GetParameter","wrong index used - use GetParameter(name)");
   return TMath::QuietNaN(); 
}
const char * TFormula::GetParName(Int_t ipar) const
{
   //*-*
   //*-*    Return parameter name given by integer.
   //*-*
   if (ipar < 0 || ipar >= fNpar) return "";

   // need to loop on the map to find corresponding parameter
   for ( auto & p : fParams) {
      if (p.second == ipar) return p.first.Data();
   }
   Error("GetParName","Parameter with index %d not found !!",ipar);
   //return TString::Format("p%d",ipar);
   return TString();
}
Double_t* TFormula::GetParameters() const
{
   if(!fClingParameters.empty())
      return const_cast<Double_t*>(&fClingParameters[0]);
   return 0;
}

void TFormula::GetParameters(Double_t *params) const
{
   for(Int_t i = 0; i < fNpar; ++i)
   {
      if (Int_t(fClingParameters.size()) > i)
         params[i] = fClingParameters[i];
      else
         params[i] = -1;
   }
}

void TFormula::SetParameter(const char *name, Double_t value)
{
   //*-*
   //*-*    Sets parameter value.
   //*-*

   SetParameter( GetParNumber(name), value);

   // do we need this ???
#ifdef OLDPARAMS
   if(fParams.find(name) == fParams.end())
   {
      Error("SetParameter","Parameter %s is not defined.",name.Data());
      return;
   }
   fParams[name].fValue = value;
   fParams[name].fFound = true;
   fClingParameters[fParams[name].fArrayPos] = value;
   fAllParametersSetted = true;
   for(map<TString,TFormulaVariable>::iterator it = fParams.begin(); it != fParams.end(); it++)
   {
      if(!it->second.fFound)
      {
         fAllParametersSetted = false;
         break;
      }
   }
#endif
}
#ifdef OLDPARAMS
void TFormula::SetParameters(const pair<TString,Double_t> *params,const Int_t size)
{
   //*-*
   //*-*    Set multiple parameters.
   //*-*    First argument is an array of pairs<TString,Double>, where
   //*-*    first argument is name of parameter,
   //*-*    second argument represents value.
   //*-*    size - number of params passed in first argument
   //*-*
   for(Int_t i = 0 ; i < size ; ++i)
   {
      pair<TString,Double_t> p = params[i];
      if(fParams.find(p.first) == fParams.end())
      {
         Error("SetParameters","Parameter %s is not defined",p.first.Data());
         continue;
      }
      fParams[p.first].fValue = p.second;
      fParams[p.first].fFound = true;
      fClingParameters[fParams[p.first].fArrayPos] = p.second;
   }
   fAllParametersSetted = true;
   for(map<TString,TFormulaVariable>::iterator it = fParams.begin(); it != fParams.end(); it++)
   {
      if(!it->second.fFound)
      {
         fAllParametersSetted = false;
         break;
      }
   }
}
#endif

void TFormula::DoSetParameters(const Double_t *params, Int_t size)
{
   if(!params || size < 0 || size > fNpar) return;
   // reset vector of cling parameters
   if (size != (int) fClingParameters.size() ) {
      Warning("SetParameters","size is not same of cling parameter size %d - %d",size,int(fClingParameters.size()) );
      for(Int_t i = 0; i < size; ++i)
      {
         TString name = TString::Format("%d",i);
         SetParameter(name,params[i]);
      }
      return;
   }
   fAllParametersSetted = true;
   std::copy(params, params+size, fClingParameters.begin() );
}

void TFormula::SetParameters(const Double_t *params)
{
   // set a vector of parameters value
   // Order in the vector is by default the aphabetic order given to the parameters
   // apart if the users has defined explicitly the parameter names 
   DoSetParameters(params,fNpar);
}
void TFormula::SetParameters(Double_t p0,Double_t p1,Double_t p2,Double_t p3,Double_t p4,
                   Double_t p5,Double_t p6,Double_t p7,Double_t p8,
                   Double_t p9,Double_t p10)
{
   // Set a list of parameters.
   // The order is by default the aphabetic order given to the parameters
   // apart if the users has defined explicitly the parameter names 
   if(fNpar >= 1) SetParameter(0,p0);
   if(fNpar >= 2) SetParameter(1,p1);
   if(fNpar >= 3) SetParameter(2,p2);
   if(fNpar >= 4) SetParameter(3,p3);
   if(fNpar >= 5) SetParameter(4,p4);
   if(fNpar >= 6) SetParameter(5,p5);
   if(fNpar >= 7) SetParameter(6,p6);
   if(fNpar >= 8) SetParameter(7,p7);
   if(fNpar >= 9) SetParameter(8,p8);
   if(fNpar >= 10) SetParameter(9,p9);
   if(fNpar >= 11) SetParameter(10,p10);
}
void TFormula::SetParameter(Int_t param, Double_t value)
{
   // Set a parameter given a parameter index
   // The parameter index is by default the aphabetic order given to the parameters
   // apart if the users has defined explicitly the parameter names
   if (param < 0 || param >= fNpar) return;
   assert(int(fClingParameters.size()) == fNpar);
   fClingParameters[param] = value;
   // TString name = TString::Format("%d",param);
   // SetParameter(name,value);
}
void TFormula::SetParNames(const char *name0,const char *name1,const char *name2,const char *name3,
                 const char *name4, const char *name5,const char *name6,const char *name7,
                 const char *name8,const char *name9,const char *name10)
{
  if(fNpar >= 1) SetParName(0,name0);
  if(fNpar >= 2) SetParName(1,name1);
  if(fNpar >= 3) SetParName(2,name2);
  if(fNpar >= 4) SetParName(3,name3);
  if(fNpar >= 5) SetParName(4,name4);
  if(fNpar >= 6) SetParName(5,name5);
  if(fNpar >= 7) SetParName(6,name6);
  if(fNpar >= 8) SetParName(7,name7);
  if(fNpar >= 9) SetParName(8,name8);
  if(fNpar >= 10) SetParName(9,name9);
  if(fNpar >= 11) SetParName(10,name10);
}
void TFormula::SetParName(Int_t ipar, const char * name)
{

   if (ipar < 0 || ipar > fNpar) {
      Error("SetParName","Wrong Parameter index %d ",ipar);
      return;
   }
   TString oldName;
   // find parameter with given index
   for ( auto &it : fParams) {
      if (it.second  == ipar) {
         oldName =  it.first;
         fParams.erase(oldName);
         fParams.insert(std::make_pair(name, ipar) );
         break;
      }
   }
   if (oldName.IsNull() ) {
      Error("SetParName","Parameter %d is not existing.",ipar);
      return;
   }

   //replace also parameter name in formula expression
   ReplaceParamName(fFormula, oldName, name); 

}

void TFormula::ReplaceParamName(TString & formula, const TString & oldName, const TString & name){
      // replace in Formula expression the parameter name
   if (!formula.IsNull() ) {
      bool found = false;
      for(list<TFormulaFunction>::iterator it = fFuncs.begin(); it != fFuncs.end(); ++it)
      {
         if(oldName == it->GetName())
         {
            found = true;
            it->fName = name;
            break;
         }
      }
      if(!found)
      {
         Error("SetParName","Parameter %s is not defined.",oldName.Data());
         return;
      }
      TString pattern = TString::Format("[%s]",oldName.Data());
      TString replacement = TString::Format("[%s]",name.Data());
      formula.ReplaceAll(pattern,replacement);
   }

}

Double_t TFormula::EvalPar(const Double_t *x,const Double_t *params) const 
{

   return DoEval(x, params);
}
Double_t TFormula::Eval(Double_t x, Double_t y, Double_t z, Double_t t) const
{
   //*-*
   //*-*    Sets first 4  variables (e.g. x, y, z, t) and evaluate formula.
   //*-*
   double xxx[4] = {x,y,z,t};
   return DoEval(xxx);
}
Double_t TFormula::Eval(Double_t x, Double_t y , Double_t z) const
{
   //*-*
   //*-*    Sets first 3  variables (e.g. x, y, z) and evaluate formula.
   //*-*
   double xxx[3] = {x,y,z};
   return DoEval(xxx);
}
Double_t TFormula::Eval(Double_t x, Double_t y) const
{
   //*-*
   //*-*    Sets first 2  variables (e.g. x and y) and evaluate formula.
   //*-*
   double xxx[2] = {x,y};
   return DoEval(xxx);
}
Double_t TFormula::Eval(Double_t x) const
{
   //*-*
   //*-*    Sets first variable (e.g. x) and evaluate formula.
   //*-*
   //double xxx[1] = {x};
   double * xxx = &x;
   return DoEval(xxx);
}
Double_t TFormula::DoEval(const double * x, const double * params) const
{
   //*-*
   //*-*    Evaluate formula.
   //*-*    If formula is not ready to execute(missing parameters/variables),
   //*-*    print these which are not known.
   //*-*    If parameter has default value, and has not been setted, appropriate warning is shown.
   //*-*


   if(!fReadyToExecute)
   {
      Error("Eval","Formula is invalid and not ready to execute ");
      for(auto it = fFuncs.begin(); it != fFuncs.end(); ++it)
      {
         TFormulaFunction fun = *it;
         if(!fun.fFound)
         {
            printf("%s is unknown.\n",fun.GetName());
         }
      }
      return TMath::QuietNaN();
   }
   // this is needed when reading from a file
   if (!fClingInitialized) {
      Error("Eval","Formula is invalid or not properly initialized - try calling TFormula::Compile");
      return TMath::QuietNaN();
#ifdef EVAL_IS_NOT_CONST      
      // need to replace in cling the name of the pointer of this object 
      TString oldClingName = fClingName;
      fClingName.Replace(fClingName.Index("_0x")+1,fClingName.Length(), TString::Format("%p",this) );
      fClingInput.ReplaceAll(oldClingName, fClingName);
      InputFormulaIntoCling();
#endif      
   }

   Double_t result = 0;
   void* args[2];
   double * vars = (x) ? const_cast<double*>(x) : const_cast<double*>(fClingVariables.data());
   args[0] = &vars;
   if (fNpar <= 0)
      (*fFuncPtr)(0, 1, args, &result);
   else {
      double * pars = (params) ? const_cast<double*>(params) : const_cast<double*>(fClingParameters.data());
      args[1] = &pars;
      (*fFuncPtr)(0, 2, args, &result);
   }
   return result;
}

//______________________________________________________________________________
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 

   TString opt(option);
   if (opt.IsNull() ) return fFormula;
   opt.ToUpper();

   //  if (opt.Contains("N") ) {
   //    TString formula = fFormula;
   //    ReplaceParName(formula, ....) 
   // }

   if (opt.Contains("CLING") ) {
      std::string clingFunc = fClingInput.Data();
      std::size_t found = clingFunc.find("return");
      std::size_t found2 = clingFunc.rfind(";");
      if (found == std::string::npos || found2 == std::string::npos) {
         Error("GetExpFormula","Invalid Cling expression - return default formula expression");
         return fFormula; 
      }
      TString clingFormula = fClingInput(found+7,found2-found-7); 
      // to be implemented
      if (!opt.Contains("P")) return clingFormula;
      // replace all "p[" with "[parname"
      int i = 0; 
      while (i < clingFormula.Length()-2 ) {
         // look for p[number
         if (clingFormula[i] == 'p' && clingFormula[i+1] == '[' && isdigit(clingFormula[i+2]) ) {
            int j = i+3;
            while ( isdigit(clingFormula[j]) ) { j++;}
            if (clingFormula[j] != ']') {
               Error("GetExpFormula","Parameters not found - invalid expression - return default cling formula");
               return clingFormula;                   
            }
            TString parNumbName = clingFormula(i+2,j-i-2);
            int parNumber = parNumbName.Atoi();
            assert(parNumber < fNpar);
            TString replacement = TString::Format("%f",GetParameter(parNumber));
            clingFormula.Replace(i,j-i+1, replacement );
            i += replacement.Length();
         }
         i++;
      }
      return clingFormula; 
   }
   if (opt.Contains("P") ) {
      // replace parameter names with their values 
      TString expFormula = fFormula;
      int i = 0; 
      while (i < expFormula.Length()-2 ) {
         // look for [parName]
         if (expFormula[i] == '[') {
            int j = i+1;
            while ( expFormula[j] != ']' ) { j++;}
            if (expFormula[j] != ']') {
               Error("GetExpFormula","Parameter names not found - invalid expression - return default formula");
               return expFormula;                   
            }
            TString parName = expFormula(i+1,j-i-1);
            TString replacement = TString::Format("%g",GetParameter(parName));
            expFormula.Replace(i,j-i+1, replacement );
            i += replacement.Length();
         }
         i++;
      }
      return expFormula; 
   }
   Warning("GetExpFormula","Invalid option - return defult formula expression");
   return fFormula; 
}   
//______________________________________________________________________________
void TFormula::Print(Option_t *option) const
{
   // print the formula and its attributes
   printf(" %20s : %s Ndim= %d, Npar= %d, Number= %d \n",GetName(),GetTitle(), fNdim,fNpar,fNumber);
   printf(" Formula expression: \n");
   printf("\t%s \n",fFormula.Data() );
   TString opt(option);
   opt.ToUpper();
   // do an evaluation as a cross-check
   //if (fReadyToExecute) Eval();

   if (opt.Contains("V") ) {
      if (fNdim > 0) {
         printf("List of  Variables: \n");
         assert(int(fClingVariables.size()) >= fNdim); 
         for ( int ivar = 0; ivar < fNdim ; ++ivar) {
            printf("Var%4d %20s =  %10f \n",ivar,GetVarName(ivar).Data(), fClingVariables[ivar]);
         }
      }
      if (fNpar > 0) {
         printf("List of  Parameters: \n");
         if ( int(fClingParameters.size()) < fNpar)
            Error("Print","Number of stored parameters in vector %lu in map %lu is different than fNpar %d",fClingParameters.size(), fParams.size(), fNpar);
         assert(int(fClingParameters.size()) >= fNpar); 
         // print with order passed to Cling function
         for ( int ipar = 0; ipar < fNpar ; ++ipar) {
            printf("Par%4d %20s =  %10f \n",ipar,GetParName(ipar), fClingParameters[ipar] );
         }
      }
      printf("Expression passed to Cling:\n");
      printf("\t%s\n",fClingInput.Data() );
   }
   if(!fReadyToExecute)
   {
      Warning("Print","Formula is not ready to execute. Missing parameters/variables");
      for(list<TFormulaFunction>::const_iterator it = fFuncs.begin(); it != fFuncs.end(); ++it)
      {
         TFormulaFunction fun = *it;
         if(!fun.fFound)
         {
            printf("%s is unknown.\n",fun.GetName());
         }
      }
   }
   if(!fAllParametersSetted)
   {
      // we can skip this
      // Info("Print","Not all parameters are setted.");
      // for(map<TString,TFormulaVariable>::const_iterator it = fParams.begin(); it != fParams.end(); ++it)
      // {
      //    pair<TString,TFormulaVariable> param = *it;
      //    if(!param.second.fFound)
      //    {
      //       printf("%s has default value %lf\n",param.first.Data(),param.second.GetInitialValue());
      //    }
      // }

   }


}
//______________________________________________________________________________
void TFormula::Streamer(TBuffer &b)
{
   // Stream a class object.
   if (b.IsReading() ) {
      UInt_t R__s, R__c;
      Version_t v = b.ReadVersion(&R__s, &R__c);
      //std::cout << "version " << v << std::endl;
      if (v <= 8 && v > 3 && v != 6) {
         // old TFormula class
         ROOT::v5::TFormula * fold = new ROOT::v5::TFormula();
         // read old TFormula class
         fold->Streamer(b, v,  R__s, R__c, TFormula::Class());
         //std::cout << "read old tformula class " << std::endl;
         TFormula fnew(fold->GetName(), fold->GetExpFormula() );

         *this = fnew;

         printf("copying content in a new TFormula \n");
         SetParameters(fold->GetParameters() );
         if (!fReadyToExecute ) {
            Error("Streamer","Old formula read from file is NOT valid");
            Print("v");
         }
         delete fold;
         return;
      }
      else if (v > 8) {
         // new TFormula class
         b.ReadClassBuffer(TFormula::Class(), this, v, R__s, R__c);

         //std::cout << "reading npar = " << GetNpar() << std::endl;

         // initialize the formula
         // need to set size of fClingVariables which is transient
         //fClingVariables.resize(fNdim);

         // case of formula contains only parameters
         if (fFormula.IsNull() ) return;

         // store parameter values, names and order 
         std::vector<double> parValues = fClingParameters;
         auto paramMap = fParams;
         fNpar = fParams.size();
         fClingParameters.clear();  // need to be reset before re-initializing it
         
         FillDefaults();

         //std::cout << "Streamer::Reading preprocess the formula " << fFormula << " ndim = " << fNdim << " npar = " << fNpar << std::endl;

         PreProcessFormula(fFormula);

         //std::cout << "Streamer::after pre-process the formula " << fFormula << " ndim = " << fNdim << " npar = " << fNpar << std::endl;

         PrepareFormula(fFormula);

         //std::cout << "Streamer::after prepared " << fClingInput << " ndim = " << fNdim << " npar = " << fNpar << std::endl;


         // restore parameter values
         if (fNpar != (int) parValues.size() ) {
            Error("Streamer","number of parameters computed (%d) is not same as the stored parameters (%d)",fNpar,int(parValues.size()) );
            Print("v");
         }
         assert(fNpar == (int) parValues.size() );
         std::copy( parValues.begin(), parValues.end(), fClingParameters.begin() );
         // restore parameter names and order
         if (fParams.size() != paramMap.size() ) {
            Warning("Streamer","number of parameters list found (%lu) is not same as the stored one (%lu) - use re-created list",fParams.size(),paramMap.size()) ;
            //Print("v");
         }
         else 
            //assert(fParams.size() == paramMap.size() );
            fParams = paramMap;
         
         // input formula into Cling
             // need to replace in cling the name of the pointer of this object
         // TString oldClingName = fClingName;
         // fClingName.Replace(fClingName.Index("_0x")+1,fClingName.Length(), TString::Format("%p",this) );
         // fClingInput.ReplaceAll(oldClingName, fClingName);
         // InputFormulaIntoCling();

         if (!TestBit(kNotGlobal)) {
            R__LOCKGUARD2(gROOTMutex);
            gROOT->GetListOfFunctions()->Add(this);
         }
         if (!fReadyToExecute ) {
            Error("Streamer","Formula read from file is NOT ready to execute");
            Print("v");
         }
         //std::cout << "reading 2 npar = " << GetNpar() << std::endl;

         return;
      }
      else {
         Error("Streamer","Reading version %d is not supported",v);
         return;
      }
   }
   else {
      // case of writing
       b.WriteClassBuffer(TFormula::Class(),this);
       //std::cout << "writing npar = " << GetNpar() << std::endl;
   }
}
 TFormula.cxx:1
 TFormula.cxx:2
 TFormula.cxx:3
 TFormula.cxx:4
 TFormula.cxx:5
 TFormula.cxx:6
 TFormula.cxx:7
 TFormula.cxx:8
 TFormula.cxx:9
 TFormula.cxx:10
 TFormula.cxx:11
 TFormula.cxx:12
 TFormula.cxx:13
 TFormula.cxx:14
 TFormula.cxx:15
 TFormula.cxx:16
 TFormula.cxx:17
 TFormula.cxx:18
 TFormula.cxx:19
 TFormula.cxx:20
 TFormula.cxx:21
 TFormula.cxx:22
 TFormula.cxx:23
 TFormula.cxx:24
 TFormula.cxx:25
 TFormula.cxx:26
 TFormula.cxx:27
 TFormula.cxx:28
 TFormula.cxx:29
 TFormula.cxx:30
 TFormula.cxx:31
 TFormula.cxx:32
 TFormula.cxx:33
 TFormula.cxx:34
 TFormula.cxx:35
 TFormula.cxx:36
 TFormula.cxx:37
 TFormula.cxx:38
 TFormula.cxx:39
 TFormula.cxx:40
 TFormula.cxx:41
 TFormula.cxx:42
 TFormula.cxx:43
 TFormula.cxx:44
 TFormula.cxx:45
 TFormula.cxx:46
 TFormula.cxx:47
 TFormula.cxx:48
 TFormula.cxx:49
 TFormula.cxx:50
 TFormula.cxx:51
 TFormula.cxx:52
 TFormula.cxx:53
 TFormula.cxx:54
 TFormula.cxx:55
 TFormula.cxx:56
 TFormula.cxx:57
 TFormula.cxx:58
 TFormula.cxx:59
 TFormula.cxx:60
 TFormula.cxx:61
 TFormula.cxx:62
 TFormula.cxx:63
 TFormula.cxx:64
 TFormula.cxx:65
 TFormula.cxx:66
 TFormula.cxx:67
 TFormula.cxx:68
 TFormula.cxx:69
 TFormula.cxx:70
 TFormula.cxx:71
 TFormula.cxx:72
 TFormula.cxx:73
 TFormula.cxx:74
 TFormula.cxx:75
 TFormula.cxx:76
 TFormula.cxx:77
 TFormula.cxx:78
 TFormula.cxx:79
 TFormula.cxx:80
 TFormula.cxx:81
 TFormula.cxx:82
 TFormula.cxx:83
 TFormula.cxx:84
 TFormula.cxx:85
 TFormula.cxx:86
 TFormula.cxx:87
 TFormula.cxx:88
 TFormula.cxx:89
 TFormula.cxx:90
 TFormula.cxx:91
 TFormula.cxx:92
 TFormula.cxx:93
 TFormula.cxx:94
 TFormula.cxx:95
 TFormula.cxx:96
 TFormula.cxx:97
 TFormula.cxx:98
 TFormula.cxx:99
 TFormula.cxx:100
 TFormula.cxx:101
 TFormula.cxx:102
 TFormula.cxx:103
 TFormula.cxx:104
 TFormula.cxx:105
 TFormula.cxx:106
 TFormula.cxx:107
 TFormula.cxx:108
 TFormula.cxx:109
 TFormula.cxx:110
 TFormula.cxx:111
 TFormula.cxx:112
 TFormula.cxx:113
 TFormula.cxx:114
 TFormula.cxx:115
 TFormula.cxx:116
 TFormula.cxx:117
 TFormula.cxx:118
 TFormula.cxx:119
 TFormula.cxx:120
 TFormula.cxx:121
 TFormula.cxx:122
 TFormula.cxx:123
 TFormula.cxx:124
 TFormula.cxx:125
 TFormula.cxx:126
 TFormula.cxx:127
 TFormula.cxx:128
 TFormula.cxx:129
 TFormula.cxx:130
 TFormula.cxx:131
 TFormula.cxx:132
 TFormula.cxx:133
 TFormula.cxx:134
 TFormula.cxx:135
 TFormula.cxx:136
 TFormula.cxx:137
 TFormula.cxx:138
 TFormula.cxx:139
 TFormula.cxx:140
 TFormula.cxx:141
 TFormula.cxx:142
 TFormula.cxx:143
 TFormula.cxx:144
 TFormula.cxx:145
 TFormula.cxx:146
 TFormula.cxx:147
 TFormula.cxx:148
 TFormula.cxx:149
 TFormula.cxx:150
 TFormula.cxx:151
 TFormula.cxx:152
 TFormula.cxx:153
 TFormula.cxx:154
 TFormula.cxx:155
 TFormula.cxx:156
 TFormula.cxx:157
 TFormula.cxx:158
 TFormula.cxx:159
 TFormula.cxx:160
 TFormula.cxx:161
 TFormula.cxx:162
 TFormula.cxx:163
 TFormula.cxx:164
 TFormula.cxx:165
 TFormula.cxx:166
 TFormula.cxx:167
 TFormula.cxx:168
 TFormula.cxx:169
 TFormula.cxx:170
 TFormula.cxx:171
 TFormula.cxx:172
 TFormula.cxx:173
 TFormula.cxx:174
 TFormula.cxx:175
 TFormula.cxx:176
 TFormula.cxx:177
 TFormula.cxx:178
 TFormula.cxx:179
 TFormula.cxx:180
 TFormula.cxx:181
 TFormula.cxx:182
 TFormula.cxx:183
 TFormula.cxx:184
 TFormula.cxx:185
 TFormula.cxx:186
 TFormula.cxx:187
 TFormula.cxx:188
 TFormula.cxx:189
 TFormula.cxx:190
 TFormula.cxx:191
 TFormula.cxx:192
 TFormula.cxx:193
 TFormula.cxx:194
 TFormula.cxx:195
 TFormula.cxx:196
 TFormula.cxx:197
 TFormula.cxx:198
 TFormula.cxx:199
 TFormula.cxx:200
 TFormula.cxx:201
 TFormula.cxx:202
 TFormula.cxx:203
 TFormula.cxx:204
 TFormula.cxx:205
 TFormula.cxx:206
 TFormula.cxx:207
 TFormula.cxx:208
 TFormula.cxx:209
 TFormula.cxx:210
 TFormula.cxx:211
 TFormula.cxx:212
 TFormula.cxx:213
 TFormula.cxx:214
 TFormula.cxx:215
 TFormula.cxx:216
 TFormula.cxx:217
 TFormula.cxx:218
 TFormula.cxx:219
 TFormula.cxx:220
 TFormula.cxx:221
 TFormula.cxx:222
 TFormula.cxx:223
 TFormula.cxx:224
 TFormula.cxx:225
 TFormula.cxx:226
 TFormula.cxx:227
 TFormula.cxx:228
 TFormula.cxx:229
 TFormula.cxx:230
 TFormula.cxx:231
 TFormula.cxx:232
 TFormula.cxx:233
 TFormula.cxx:234
 TFormula.cxx:235
 TFormula.cxx:236
 TFormula.cxx:237
 TFormula.cxx:238
 TFormula.cxx:239
 TFormula.cxx:240
 TFormula.cxx:241
 TFormula.cxx:242
 TFormula.cxx:243
 TFormula.cxx:244
 TFormula.cxx:245
 TFormula.cxx:246
 TFormula.cxx:247
 TFormula.cxx:248
 TFormula.cxx:249
 TFormula.cxx:250
 TFormula.cxx:251
 TFormula.cxx:252
 TFormula.cxx:253
 TFormula.cxx:254
 TFormula.cxx:255
 TFormula.cxx:256
 TFormula.cxx:257
 TFormula.cxx:258
 TFormula.cxx:259
 TFormula.cxx:260
 TFormula.cxx:261
 TFormula.cxx:262
 TFormula.cxx:263
 TFormula.cxx:264
 TFormula.cxx:265
 TFormula.cxx:266
 TFormula.cxx:267
 TFormula.cxx:268
 TFormula.cxx:269
 TFormula.cxx:270
 TFormula.cxx:271
 TFormula.cxx:272
 TFormula.cxx:273
 TFormula.cxx:274
 TFormula.cxx:275
 TFormula.cxx:276
 TFormula.cxx:277
 TFormula.cxx:278
 TFormula.cxx:279
 TFormula.cxx:280
 TFormula.cxx:281
 TFormula.cxx:282
 TFormula.cxx:283
 TFormula.cxx:284
 TFormula.cxx:285
 TFormula.cxx:286
 TFormula.cxx:287
 TFormula.cxx:288
 TFormula.cxx:289
 TFormula.cxx:290
 TFormula.cxx:291
 TFormula.cxx:292
 TFormula.cxx:293
 TFormula.cxx:294
 TFormula.cxx:295
 TFormula.cxx:296
 TFormula.cxx:297
 TFormula.cxx:298
 TFormula.cxx:299
 TFormula.cxx:300
 TFormula.cxx:301
 TFormula.cxx:302
 TFormula.cxx:303
 TFormula.cxx:304
 TFormula.cxx:305
 TFormula.cxx:306
 TFormula.cxx:307
 TFormula.cxx:308
 TFormula.cxx:309
 TFormula.cxx:310
 TFormula.cxx:311
 TFormula.cxx:312
 TFormula.cxx:313
 TFormula.cxx:314
 TFormula.cxx:315
 TFormula.cxx:316
 TFormula.cxx:317
 TFormula.cxx:318
 TFormula.cxx:319
 TFormula.cxx:320
 TFormula.cxx:321
 TFormula.cxx:322
 TFormula.cxx:323
 TFormula.cxx:324
 TFormula.cxx:325
 TFormula.cxx:326
 TFormula.cxx:327
 TFormula.cxx:328
 TFormula.cxx:329
 TFormula.cxx:330
 TFormula.cxx:331
 TFormula.cxx:332
 TFormula.cxx:333
 TFormula.cxx:334
 TFormula.cxx:335
 TFormula.cxx:336
 TFormula.cxx:337
 TFormula.cxx:338
 TFormula.cxx:339
 TFormula.cxx:340
 TFormula.cxx:341
 TFormula.cxx:342
 TFormula.cxx:343
 TFormula.cxx:344
 TFormula.cxx:345
 TFormula.cxx:346
 TFormula.cxx:347
 TFormula.cxx:348
 TFormula.cxx:349
 TFormula.cxx:350
 TFormula.cxx:351
 TFormula.cxx:352
 TFormula.cxx:353
 TFormula.cxx:354
 TFormula.cxx:355
 TFormula.cxx:356
 TFormula.cxx:357
 TFormula.cxx:358
 TFormula.cxx:359
 TFormula.cxx:360
 TFormula.cxx:361
 TFormula.cxx:362
 TFormula.cxx:363
 TFormula.cxx:364
 TFormula.cxx:365
 TFormula.cxx:366
 TFormula.cxx:367
 TFormula.cxx:368
 TFormula.cxx:369
 TFormula.cxx:370
 TFormula.cxx:371
 TFormula.cxx:372
 TFormula.cxx:373
 TFormula.cxx:374
 TFormula.cxx:375
 TFormula.cxx:376
 TFormula.cxx:377
 TFormula.cxx:378
 TFormula.cxx:379
 TFormula.cxx:380
 TFormula.cxx:381
 TFormula.cxx:382
 TFormula.cxx:383
 TFormula.cxx:384
 TFormula.cxx:385
 TFormula.cxx:386
 TFormula.cxx:387
 TFormula.cxx:388
 TFormula.cxx:389
 TFormula.cxx:390
 TFormula.cxx:391
 TFormula.cxx:392
 TFormula.cxx:393
 TFormula.cxx:394
 TFormula.cxx:395
 TFormula.cxx:396
 TFormula.cxx:397
 TFormula.cxx:398
 TFormula.cxx:399
 TFormula.cxx:400
 TFormula.cxx:401
 TFormula.cxx:402
 TFormula.cxx:403
 TFormula.cxx:404
 TFormula.cxx:405
 TFormula.cxx:406
 TFormula.cxx:407
 TFormula.cxx:408
 TFormula.cxx:409
 TFormula.cxx:410
 TFormula.cxx:411
 TFormula.cxx:412
 TFormula.cxx:413
 TFormula.cxx:414
 TFormula.cxx:415
 TFormula.cxx:416
 TFormula.cxx:417
 TFormula.cxx:418
 TFormula.cxx:419
 TFormula.cxx:420
 TFormula.cxx:421
 TFormula.cxx:422
 TFormula.cxx:423
 TFormula.cxx:424
 TFormula.cxx:425
 TFormula.cxx:426
 TFormula.cxx:427
 TFormula.cxx:428
 TFormula.cxx:429
 TFormula.cxx:430
 TFormula.cxx:431
 TFormula.cxx:432
 TFormula.cxx:433
 TFormula.cxx:434
 TFormula.cxx:435
 TFormula.cxx:436
 TFormula.cxx:437
 TFormula.cxx:438
 TFormula.cxx:439
 TFormula.cxx:440
 TFormula.cxx:441
 TFormula.cxx:442
 TFormula.cxx:443
 TFormula.cxx:444
 TFormula.cxx:445
 TFormula.cxx:446
 TFormula.cxx:447
 TFormula.cxx:448
 TFormula.cxx:449
 TFormula.cxx:450
 TFormula.cxx:451
 TFormula.cxx:452
 TFormula.cxx:453
 TFormula.cxx:454
 TFormula.cxx:455
 TFormula.cxx:456
 TFormula.cxx:457
 TFormula.cxx:458
 TFormula.cxx:459
 TFormula.cxx:460
 TFormula.cxx:461
 TFormula.cxx:462
 TFormula.cxx:463
 TFormula.cxx:464
 TFormula.cxx:465
 TFormula.cxx:466
 TFormula.cxx:467
 TFormula.cxx:468
 TFormula.cxx:469
 TFormula.cxx:470
 TFormula.cxx:471
 TFormula.cxx:472
 TFormula.cxx:473
 TFormula.cxx:474
 TFormula.cxx:475
 TFormula.cxx:476
 TFormula.cxx:477
 TFormula.cxx:478
 TFormula.cxx:479
 TFormula.cxx:480
 TFormula.cxx:481
 TFormula.cxx:482
 TFormula.cxx:483
 TFormula.cxx:484
 TFormula.cxx:485
 TFormula.cxx:486
 TFormula.cxx:487
 TFormula.cxx:488
 TFormula.cxx:489
 TFormula.cxx:490
 TFormula.cxx:491
 TFormula.cxx:492
 TFormula.cxx:493
 TFormula.cxx:494
 TFormula.cxx:495
 TFormula.cxx:496
 TFormula.cxx:497
 TFormula.cxx:498
 TFormula.cxx:499
 TFormula.cxx:500
 TFormula.cxx:501
 TFormula.cxx:502
 TFormula.cxx:503
 TFormula.cxx:504
 TFormula.cxx:505
 TFormula.cxx:506
 TFormula.cxx:507
 TFormula.cxx:508
 TFormula.cxx:509
 TFormula.cxx:510
 TFormula.cxx:511
 TFormula.cxx:512
 TFormula.cxx:513
 TFormula.cxx:514
 TFormula.cxx:515
 TFormula.cxx:516
 TFormula.cxx:517
 TFormula.cxx:518
 TFormula.cxx:519
 TFormula.cxx:520
 TFormula.cxx:521
 TFormula.cxx:522
 TFormula.cxx:523
 TFormula.cxx:524
 TFormula.cxx:525
 TFormula.cxx:526
 TFormula.cxx:527
 TFormula.cxx:528
 TFormula.cxx:529
 TFormula.cxx:530
 TFormula.cxx:531
 TFormula.cxx:532
 TFormula.cxx:533
 TFormula.cxx:534
 TFormula.cxx:535
 TFormula.cxx:536
 TFormula.cxx:537
 TFormula.cxx:538
 TFormula.cxx:539
 TFormula.cxx:540
 TFormula.cxx:541
 TFormula.cxx:542
 TFormula.cxx:543
 TFormula.cxx:544
 TFormula.cxx:545
 TFormula.cxx:546
 TFormula.cxx:547
 TFormula.cxx:548
 TFormula.cxx:549
 TFormula.cxx:550
 TFormula.cxx:551
 TFormula.cxx:552
 TFormula.cxx:553
 TFormula.cxx:554
 TFormula.cxx:555
 TFormula.cxx:556
 TFormula.cxx:557
 TFormula.cxx:558
 TFormula.cxx:559
 TFormula.cxx:560
 TFormula.cxx:561
 TFormula.cxx:562
 TFormula.cxx:563
 TFormula.cxx:564
 TFormula.cxx:565
 TFormula.cxx:566
 TFormula.cxx:567
 TFormula.cxx:568
 TFormula.cxx:569
 TFormula.cxx:570
 TFormula.cxx:571
 TFormula.cxx:572
 TFormula.cxx:573
 TFormula.cxx:574
 TFormula.cxx:575
 TFormula.cxx:576
 TFormula.cxx:577
 TFormula.cxx:578
 TFormula.cxx:579
 TFormula.cxx:580
 TFormula.cxx:581
 TFormula.cxx:582
 TFormula.cxx:583
 TFormula.cxx:584
 TFormula.cxx:585
 TFormula.cxx:586
 TFormula.cxx:587
 TFormula.cxx:588
 TFormula.cxx:589
 TFormula.cxx:590
 TFormula.cxx:591
 TFormula.cxx:592
 TFormula.cxx:593
 TFormula.cxx:594
 TFormula.cxx:595
 TFormula.cxx:596
 TFormula.cxx:597
 TFormula.cxx:598
 TFormula.cxx:599
 TFormula.cxx:600
 TFormula.cxx:601
 TFormula.cxx:602
 TFormula.cxx:603
 TFormula.cxx:604
 TFormula.cxx:605
 TFormula.cxx:606
 TFormula.cxx:607
 TFormula.cxx:608
 TFormula.cxx:609
 TFormula.cxx:610
 TFormula.cxx:611
 TFormula.cxx:612
 TFormula.cxx:613
 TFormula.cxx:614
 TFormula.cxx:615
 TFormula.cxx:616
 TFormula.cxx:617
 TFormula.cxx:618
 TFormula.cxx:619
 TFormula.cxx:620
 TFormula.cxx:621
 TFormula.cxx:622
 TFormula.cxx:623
 TFormula.cxx:624
 TFormula.cxx:625
 TFormula.cxx:626
 TFormula.cxx:627
 TFormula.cxx:628
 TFormula.cxx:629
 TFormula.cxx:630
 TFormula.cxx:631
 TFormula.cxx:632
 TFormula.cxx:633
 TFormula.cxx:634
 TFormula.cxx:635
 TFormula.cxx:636
 TFormula.cxx:637
 TFormula.cxx:638
 TFormula.cxx:639
 TFormula.cxx:640
 TFormula.cxx:641
 TFormula.cxx:642
 TFormula.cxx:643
 TFormula.cxx:644
 TFormula.cxx:645
 TFormula.cxx:646
 TFormula.cxx:647
 TFormula.cxx:648
 TFormula.cxx:649
 TFormula.cxx:650
 TFormula.cxx:651
 TFormula.cxx:652
 TFormula.cxx:653
 TFormula.cxx:654
 TFormula.cxx:655
 TFormula.cxx:656
 TFormula.cxx:657
 TFormula.cxx:658
 TFormula.cxx:659
 TFormula.cxx:660
 TFormula.cxx:661
 TFormula.cxx:662
 TFormula.cxx:663
 TFormula.cxx:664
 TFormula.cxx:665
 TFormula.cxx:666
 TFormula.cxx:667
 TFormula.cxx:668
 TFormula.cxx:669
 TFormula.cxx:670
 TFormula.cxx:671
 TFormula.cxx:672
 TFormula.cxx:673
 TFormula.cxx:674
 TFormula.cxx:675
 TFormula.cxx:676
 TFormula.cxx:677
 TFormula.cxx:678
 TFormula.cxx:679
 TFormula.cxx:680
 TFormula.cxx:681
 TFormula.cxx:682
 TFormula.cxx:683
 TFormula.cxx:684
 TFormula.cxx:685
 TFormula.cxx:686
 TFormula.cxx:687
 TFormula.cxx:688
 TFormula.cxx:689
 TFormula.cxx:690
 TFormula.cxx:691
 TFormula.cxx:692
 TFormula.cxx:693
 TFormula.cxx:694
 TFormula.cxx:695
 TFormula.cxx:696
 TFormula.cxx:697
 TFormula.cxx:698
 TFormula.cxx:699
 TFormula.cxx:700
 TFormula.cxx:701
 TFormula.cxx:702
 TFormula.cxx:703
 TFormula.cxx:704
 TFormula.cxx:705
 TFormula.cxx:706
 TFormula.cxx:707
 TFormula.cxx:708
 TFormula.cxx:709
 TFormula.cxx:710
 TFormula.cxx:711
 TFormula.cxx:712
 TFormula.cxx:713
 TFormula.cxx:714
 TFormula.cxx:715
 TFormula.cxx:716
 TFormula.cxx:717
 TFormula.cxx:718
 TFormula.cxx:719
 TFormula.cxx:720
 TFormula.cxx:721
 TFormula.cxx:722
 TFormula.cxx:723
 TFormula.cxx:724
 TFormula.cxx:725
 TFormula.cxx:726
 TFormula.cxx:727
 TFormula.cxx:728
 TFormula.cxx:729
 TFormula.cxx:730
 TFormula.cxx:731
 TFormula.cxx:732
 TFormula.cxx:733
 TFormula.cxx:734
 TFormula.cxx:735
 TFormula.cxx:736
 TFormula.cxx:737
 TFormula.cxx:738
 TFormula.cxx:739
 TFormula.cxx:740
 TFormula.cxx:741
 TFormula.cxx:742
 TFormula.cxx:743
 TFormula.cxx:744
 TFormula.cxx:745
 TFormula.cxx:746
 TFormula.cxx:747
 TFormula.cxx:748
 TFormula.cxx:749
 TFormula.cxx:750
 TFormula.cxx:751
 TFormula.cxx:752
 TFormula.cxx:753
 TFormula.cxx:754
 TFormula.cxx:755
 TFormula.cxx:756
 TFormula.cxx:757
 TFormula.cxx:758
 TFormula.cxx:759
 TFormula.cxx:760
 TFormula.cxx:761
 TFormula.cxx:762
 TFormula.cxx:763
 TFormula.cxx:764
 TFormula.cxx:765
 TFormula.cxx:766
 TFormula.cxx:767
 TFormula.cxx:768
 TFormula.cxx:769
 TFormula.cxx:770
 TFormula.cxx:771
 TFormula.cxx:772
 TFormula.cxx:773
 TFormula.cxx:774
 TFormula.cxx:775
 TFormula.cxx:776
 TFormula.cxx:777
 TFormula.cxx:778
 TFormula.cxx:779
 TFormula.cxx:780
 TFormula.cxx:781
 TFormula.cxx:782
 TFormula.cxx:783
 TFormula.cxx:784
 TFormula.cxx:785
 TFormula.cxx:786
 TFormula.cxx:787
 TFormula.cxx:788
 TFormula.cxx:789
 TFormula.cxx:790
 TFormula.cxx:791
 TFormula.cxx:792
 TFormula.cxx:793
 TFormula.cxx:794
 TFormula.cxx:795
 TFormula.cxx:796
 TFormula.cxx:797
 TFormula.cxx:798
 TFormula.cxx:799
 TFormula.cxx:800
 TFormula.cxx:801
 TFormula.cxx:802
 TFormula.cxx:803
 TFormula.cxx:804
 TFormula.cxx:805
 TFormula.cxx:806
 TFormula.cxx:807
 TFormula.cxx:808
 TFormula.cxx:809
 TFormula.cxx:810
 TFormula.cxx:811
 TFormula.cxx:812
 TFormula.cxx:813
 TFormula.cxx:814
 TFormula.cxx:815
 TFormula.cxx:816
 TFormula.cxx:817
 TFormula.cxx:818
 TFormula.cxx:819
 TFormula.cxx:820
 TFormula.cxx:821
 TFormula.cxx:822
 TFormula.cxx:823
 TFormula.cxx:824
 TFormula.cxx:825
 TFormula.cxx:826
 TFormula.cxx:827
 TFormula.cxx:828
 TFormula.cxx:829
 TFormula.cxx:830
 TFormula.cxx:831
 TFormula.cxx:832
 TFormula.cxx:833
 TFormula.cxx:834
 TFormula.cxx:835
 TFormula.cxx:836
 TFormula.cxx:837
 TFormula.cxx:838
 TFormula.cxx:839
 TFormula.cxx:840
 TFormula.cxx:841
 TFormula.cxx:842
 TFormula.cxx:843
 TFormula.cxx:844
 TFormula.cxx:845
 TFormula.cxx:846
 TFormula.cxx:847
 TFormula.cxx:848
 TFormula.cxx:849
 TFormula.cxx:850
 TFormula.cxx:851
 TFormula.cxx:852
 TFormula.cxx:853
 TFormula.cxx:854
 TFormula.cxx:855
 TFormula.cxx:856
 TFormula.cxx:857
 TFormula.cxx:858
 TFormula.cxx:859
 TFormula.cxx:860
 TFormula.cxx:861
 TFormula.cxx:862
 TFormula.cxx:863
 TFormula.cxx:864
 TFormula.cxx:865
 TFormula.cxx:866
 TFormula.cxx:867
 TFormula.cxx:868
 TFormula.cxx:869
 TFormula.cxx:870
 TFormula.cxx:871
 TFormula.cxx:872
 TFormula.cxx:873
 TFormula.cxx:874
 TFormula.cxx:875
 TFormula.cxx:876
 TFormula.cxx:877
 TFormula.cxx:878
 TFormula.cxx:879
 TFormula.cxx:880
 TFormula.cxx:881
 TFormula.cxx:882
 TFormula.cxx:883
 TFormula.cxx:884
 TFormula.cxx:885
 TFormula.cxx:886
 TFormula.cxx:887
 TFormula.cxx:888
 TFormula.cxx:889
 TFormula.cxx:890
 TFormula.cxx:891
 TFormula.cxx:892
 TFormula.cxx:893
 TFormula.cxx:894
 TFormula.cxx:895
 TFormula.cxx:896
 TFormula.cxx:897
 TFormula.cxx:898
 TFormula.cxx:899
 TFormula.cxx:900
 TFormula.cxx:901
 TFormula.cxx:902
 TFormula.cxx:903
 TFormula.cxx:904
 TFormula.cxx:905
 TFormula.cxx:906
 TFormula.cxx:907
 TFormula.cxx:908
 TFormula.cxx:909
 TFormula.cxx:910
 TFormula.cxx:911
 TFormula.cxx:912
 TFormula.cxx:913
 TFormula.cxx:914
 TFormula.cxx:915
 TFormula.cxx:916
 TFormula.cxx:917
 TFormula.cxx:918
 TFormula.cxx:919
 TFormula.cxx:920
 TFormula.cxx:921
 TFormula.cxx:922
 TFormula.cxx:923
 TFormula.cxx:924
 TFormula.cxx:925
 TFormula.cxx:926
 TFormula.cxx:927
 TFormula.cxx:928
 TFormula.cxx:929
 TFormula.cxx:930
 TFormula.cxx:931
 TFormula.cxx:932
 TFormula.cxx:933
 TFormula.cxx:934
 TFormula.cxx:935
 TFormula.cxx:936
 TFormula.cxx:937
 TFormula.cxx:938
 TFormula.cxx:939
 TFormula.cxx:940
 TFormula.cxx:941
 TFormula.cxx:942
 TFormula.cxx:943
 TFormula.cxx:944
 TFormula.cxx:945
 TFormula.cxx:946
 TFormula.cxx:947
 TFormula.cxx:948
 TFormula.cxx:949
 TFormula.cxx:950
 TFormula.cxx:951
 TFormula.cxx:952
 TFormula.cxx:953
 TFormula.cxx:954
 TFormula.cxx:955
 TFormula.cxx:956
 TFormula.cxx:957
 TFormula.cxx:958
 TFormula.cxx:959
 TFormula.cxx:960
 TFormula.cxx:961
 TFormula.cxx:962
 TFormula.cxx:963
 TFormula.cxx:964
 TFormula.cxx:965
 TFormula.cxx:966
 TFormula.cxx:967
 TFormula.cxx:968
 TFormula.cxx:969
 TFormula.cxx:970
 TFormula.cxx:971
 TFormula.cxx:972
 TFormula.cxx:973
 TFormula.cxx:974
 TFormula.cxx:975
 TFormula.cxx:976
 TFormula.cxx:977
 TFormula.cxx:978
 TFormula.cxx:979
 TFormula.cxx:980
 TFormula.cxx:981
 TFormula.cxx:982
 TFormula.cxx:983
 TFormula.cxx:984
 TFormula.cxx:985
 TFormula.cxx:986
 TFormula.cxx:987
 TFormula.cxx:988
 TFormula.cxx:989
 TFormula.cxx:990
 TFormula.cxx:991
 TFormula.cxx:992
 TFormula.cxx:993
 TFormula.cxx:994
 TFormula.cxx:995
 TFormula.cxx:996
 TFormula.cxx:997
 TFormula.cxx:998
 TFormula.cxx:999
 TFormula.cxx:1000
 TFormula.cxx:1001
 TFormula.cxx:1002
 TFormula.cxx:1003
 TFormula.cxx:1004
 TFormula.cxx:1005
 TFormula.cxx:1006
 TFormula.cxx:1007
 TFormula.cxx:1008
 TFormula.cxx:1009
 TFormula.cxx:1010
 TFormula.cxx:1011
 TFormula.cxx:1012
 TFormula.cxx:1013
 TFormula.cxx:1014
 TFormula.cxx:1015
 TFormula.cxx:1016
 TFormula.cxx:1017
 TFormula.cxx:1018
 TFormula.cxx:1019
 TFormula.cxx:1020
 TFormula.cxx:1021
 TFormula.cxx:1022
 TFormula.cxx:1023
 TFormula.cxx:1024
 TFormula.cxx:1025
 TFormula.cxx:1026
 TFormula.cxx:1027
 TFormula.cxx:1028
 TFormula.cxx:1029
 TFormula.cxx:1030
 TFormula.cxx:1031
 TFormula.cxx:1032
 TFormula.cxx:1033
 TFormula.cxx:1034
 TFormula.cxx:1035
 TFormula.cxx:1036
 TFormula.cxx:1037
 TFormula.cxx:1038
 TFormula.cxx:1039
 TFormula.cxx:1040
 TFormula.cxx:1041
 TFormula.cxx:1042
 TFormula.cxx:1043
 TFormula.cxx:1044
 TFormula.cxx:1045
 TFormula.cxx:1046
 TFormula.cxx:1047
 TFormula.cxx:1048
 TFormula.cxx:1049
 TFormula.cxx:1050
 TFormula.cxx:1051
 TFormula.cxx:1052
 TFormula.cxx:1053
 TFormula.cxx:1054
 TFormula.cxx:1055
 TFormula.cxx:1056
 TFormula.cxx:1057
 TFormula.cxx:1058
 TFormula.cxx:1059
 TFormula.cxx:1060
 TFormula.cxx:1061
 TFormula.cxx:1062
 TFormula.cxx:1063
 TFormula.cxx:1064
 TFormula.cxx:1065
 TFormula.cxx:1066
 TFormula.cxx:1067
 TFormula.cxx:1068
 TFormula.cxx:1069
 TFormula.cxx:1070
 TFormula.cxx:1071
 TFormula.cxx:1072
 TFormula.cxx:1073
 TFormula.cxx:1074
 TFormula.cxx:1075
 TFormula.cxx:1076
 TFormula.cxx:1077
 TFormula.cxx:1078
 TFormula.cxx:1079
 TFormula.cxx:1080
 TFormula.cxx:1081
 TFormula.cxx:1082
 TFormula.cxx:1083
 TFormula.cxx:1084
 TFormula.cxx:1085
 TFormula.cxx:1086
 TFormula.cxx:1087
 TFormula.cxx:1088
 TFormula.cxx:1089
 TFormula.cxx:1090
 TFormula.cxx:1091
 TFormula.cxx:1092
 TFormula.cxx:1093
 TFormula.cxx:1094
 TFormula.cxx:1095
 TFormula.cxx:1096
 TFormula.cxx:1097
 TFormula.cxx:1098
 TFormula.cxx:1099
 TFormula.cxx:1100
 TFormula.cxx:1101
 TFormula.cxx:1102
 TFormula.cxx:1103
 TFormula.cxx:1104
 TFormula.cxx:1105
 TFormula.cxx:1106
 TFormula.cxx:1107
 TFormula.cxx:1108
 TFormula.cxx:1109
 TFormula.cxx:1110
 TFormula.cxx:1111
 TFormula.cxx:1112
 TFormula.cxx:1113
 TFormula.cxx:1114
 TFormula.cxx:1115
 TFormula.cxx:1116
 TFormula.cxx:1117
 TFormula.cxx:1118
 TFormula.cxx:1119
 TFormula.cxx:1120
 TFormula.cxx:1121
 TFormula.cxx:1122
 TFormula.cxx:1123
 TFormula.cxx:1124
 TFormula.cxx:1125
 TFormula.cxx:1126
 TFormula.cxx:1127
 TFormula.cxx:1128
 TFormula.cxx:1129
 TFormula.cxx:1130
 TFormula.cxx:1131
 TFormula.cxx:1132
 TFormula.cxx:1133
 TFormula.cxx:1134
 TFormula.cxx:1135
 TFormula.cxx:1136
 TFormula.cxx:1137
 TFormula.cxx:1138
 TFormula.cxx:1139
 TFormula.cxx:1140
 TFormula.cxx:1141
 TFormula.cxx:1142
 TFormula.cxx:1143
 TFormula.cxx:1144
 TFormula.cxx:1145
 TFormula.cxx:1146
 TFormula.cxx:1147
 TFormula.cxx:1148
 TFormula.cxx:1149
 TFormula.cxx:1150
 TFormula.cxx:1151
 TFormula.cxx:1152
 TFormula.cxx:1153
 TFormula.cxx:1154
 TFormula.cxx:1155
 TFormula.cxx:1156
 TFormula.cxx:1157
 TFormula.cxx:1158
 TFormula.cxx:1159
 TFormula.cxx:1160
 TFormula.cxx:1161
 TFormula.cxx:1162
 TFormula.cxx:1163
 TFormula.cxx:1164
 TFormula.cxx:1165
 TFormula.cxx:1166
 TFormula.cxx:1167
 TFormula.cxx:1168
 TFormula.cxx:1169
 TFormula.cxx:1170
 TFormula.cxx:1171
 TFormula.cxx:1172
 TFormula.cxx:1173
 TFormula.cxx:1174
 TFormula.cxx:1175
 TFormula.cxx:1176
 TFormula.cxx:1177
 TFormula.cxx:1178
 TFormula.cxx:1179
 TFormula.cxx:1180
 TFormula.cxx:1181
 TFormula.cxx:1182
 TFormula.cxx:1183
 TFormula.cxx:1184
 TFormula.cxx:1185
 TFormula.cxx:1186
 TFormula.cxx:1187
 TFormula.cxx:1188
 TFormula.cxx:1189
 TFormula.cxx:1190
 TFormula.cxx:1191
 TFormula.cxx:1192
 TFormula.cxx:1193
 TFormula.cxx:1194
 TFormula.cxx:1195
 TFormula.cxx:1196
 TFormula.cxx:1197
 TFormula.cxx:1198
 TFormula.cxx:1199
 TFormula.cxx:1200
 TFormula.cxx:1201
 TFormula.cxx:1202
 TFormula.cxx:1203
 TFormula.cxx:1204
 TFormula.cxx:1205
 TFormula.cxx:1206
 TFormula.cxx:1207
 TFormula.cxx:1208
 TFormula.cxx:1209
 TFormula.cxx:1210
 TFormula.cxx:1211
 TFormula.cxx:1212
 TFormula.cxx:1213
 TFormula.cxx:1214
 TFormula.cxx:1215
 TFormula.cxx:1216
 TFormula.cxx:1217
 TFormula.cxx:1218
 TFormula.cxx:1219
 TFormula.cxx:1220
 TFormula.cxx:1221
 TFormula.cxx:1222
 TFormula.cxx:1223
 TFormula.cxx:1224
 TFormula.cxx:1225
 TFormula.cxx:1226
 TFormula.cxx:1227
 TFormula.cxx:1228
 TFormula.cxx:1229
 TFormula.cxx:1230
 TFormula.cxx:1231
 TFormula.cxx:1232
 TFormula.cxx:1233
 TFormula.cxx:1234
 TFormula.cxx:1235
 TFormula.cxx:1236
 TFormula.cxx:1237
 TFormula.cxx:1238
 TFormula.cxx:1239
 TFormula.cxx:1240
 TFormula.cxx:1241
 TFormula.cxx:1242
 TFormula.cxx:1243
 TFormula.cxx:1244
 TFormula.cxx:1245
 TFormula.cxx:1246
 TFormula.cxx:1247
 TFormula.cxx:1248
 TFormula.cxx:1249
 TFormula.cxx:1250
 TFormula.cxx:1251
 TFormula.cxx:1252
 TFormula.cxx:1253
 TFormula.cxx:1254
 TFormula.cxx:1255
 TFormula.cxx:1256
 TFormula.cxx:1257
 TFormula.cxx:1258
 TFormula.cxx:1259
 TFormula.cxx:1260
 TFormula.cxx:1261
 TFormula.cxx:1262
 TFormula.cxx:1263
 TFormula.cxx:1264
 TFormula.cxx:1265
 TFormula.cxx:1266
 TFormula.cxx:1267
 TFormula.cxx:1268
 TFormula.cxx:1269
 TFormula.cxx:1270
 TFormula.cxx:1271
 TFormula.cxx:1272
 TFormula.cxx:1273
 TFormula.cxx:1274
 TFormula.cxx:1275
 TFormula.cxx:1276
 TFormula.cxx:1277
 TFormula.cxx:1278
 TFormula.cxx:1279
 TFormula.cxx:1280
 TFormula.cxx:1281
 TFormula.cxx:1282
 TFormula.cxx:1283
 TFormula.cxx:1284
 TFormula.cxx:1285
 TFormula.cxx:1286
 TFormula.cxx:1287
 TFormula.cxx:1288
 TFormula.cxx:1289
 TFormula.cxx:1290
 TFormula.cxx:1291
 TFormula.cxx:1292
 TFormula.cxx:1293
 TFormula.cxx:1294
 TFormula.cxx:1295
 TFormula.cxx:1296
 TFormula.cxx:1297
 TFormula.cxx:1298
 TFormula.cxx:1299
 TFormula.cxx:1300
 TFormula.cxx:1301
 TFormula.cxx:1302
 TFormula.cxx:1303
 TFormula.cxx:1304
 TFormula.cxx:1305
 TFormula.cxx:1306
 TFormula.cxx:1307
 TFormula.cxx:1308
 TFormula.cxx:1309
 TFormula.cxx:1310
 TFormula.cxx:1311
 TFormula.cxx:1312
 TFormula.cxx:1313
 TFormula.cxx:1314
 TFormula.cxx:1315
 TFormula.cxx:1316
 TFormula.cxx:1317
 TFormula.cxx:1318
 TFormula.cxx:1319
 TFormula.cxx:1320
 TFormula.cxx:1321
 TFormula.cxx:1322
 TFormula.cxx:1323
 TFormula.cxx:1324
 TFormula.cxx:1325
 TFormula.cxx:1326
 TFormula.cxx:1327
 TFormula.cxx:1328
 TFormula.cxx:1329
 TFormula.cxx:1330
 TFormula.cxx:1331
 TFormula.cxx:1332
 TFormula.cxx:1333
 TFormula.cxx:1334
 TFormula.cxx:1335
 TFormula.cxx:1336
 TFormula.cxx:1337
 TFormula.cxx:1338
 TFormula.cxx:1339
 TFormula.cxx:1340
 TFormula.cxx:1341
 TFormula.cxx:1342
 TFormula.cxx:1343
 TFormula.cxx:1344
 TFormula.cxx:1345
 TFormula.cxx:1346
 TFormula.cxx:1347
 TFormula.cxx:1348
 TFormula.cxx:1349
 TFormula.cxx:1350
 TFormula.cxx:1351
 TFormula.cxx:1352
 TFormula.cxx:1353
 TFormula.cxx:1354
 TFormula.cxx:1355
 TFormula.cxx:1356
 TFormula.cxx:1357
 TFormula.cxx:1358
 TFormula.cxx:1359
 TFormula.cxx:1360
 TFormula.cxx:1361
 TFormula.cxx:1362
 TFormula.cxx:1363
 TFormula.cxx:1364
 TFormula.cxx:1365
 TFormula.cxx:1366
 TFormula.cxx:1367
 TFormula.cxx:1368
 TFormula.cxx:1369
 TFormula.cxx:1370
 TFormula.cxx:1371
 TFormula.cxx:1372
 TFormula.cxx:1373
 TFormula.cxx:1374
 TFormula.cxx:1375
 TFormula.cxx:1376
 TFormula.cxx:1377
 TFormula.cxx:1378
 TFormula.cxx:1379
 TFormula.cxx:1380
 TFormula.cxx:1381
 TFormula.cxx:1382
 TFormula.cxx:1383
 TFormula.cxx:1384
 TFormula.cxx:1385
 TFormula.cxx:1386
 TFormula.cxx:1387
 TFormula.cxx:1388
 TFormula.cxx:1389
 TFormula.cxx:1390
 TFormula.cxx:1391
 TFormula.cxx:1392
 TFormula.cxx:1393
 TFormula.cxx:1394
 TFormula.cxx:1395
 TFormula.cxx:1396
 TFormula.cxx:1397
 TFormula.cxx:1398
 TFormula.cxx:1399
 TFormula.cxx:1400
 TFormula.cxx:1401
 TFormula.cxx:1402
 TFormula.cxx:1403
 TFormula.cxx:1404
 TFormula.cxx:1405
 TFormula.cxx:1406
 TFormula.cxx:1407
 TFormula.cxx:1408
 TFormula.cxx:1409
 TFormula.cxx:1410
 TFormula.cxx:1411
 TFormula.cxx:1412
 TFormula.cxx:1413
 TFormula.cxx:1414
 TFormula.cxx:1415
 TFormula.cxx:1416
 TFormula.cxx:1417
 TFormula.cxx:1418
 TFormula.cxx:1419
 TFormula.cxx:1420
 TFormula.cxx:1421
 TFormula.cxx:1422
 TFormula.cxx:1423
 TFormula.cxx:1424
 TFormula.cxx:1425
 TFormula.cxx:1426
 TFormula.cxx:1427
 TFormula.cxx:1428
 TFormula.cxx:1429
 TFormula.cxx:1430
 TFormula.cxx:1431
 TFormula.cxx:1432
 TFormula.cxx:1433
 TFormula.cxx:1434
 TFormula.cxx:1435
 TFormula.cxx:1436
 TFormula.cxx:1437
 TFormula.cxx:1438
 TFormula.cxx:1439
 TFormula.cxx:1440
 TFormula.cxx:1441
 TFormula.cxx:1442
 TFormula.cxx:1443
 TFormula.cxx:1444
 TFormula.cxx:1445
 TFormula.cxx:1446
 TFormula.cxx:1447
 TFormula.cxx:1448
 TFormula.cxx:1449
 TFormula.cxx:1450
 TFormula.cxx:1451
 TFormula.cxx:1452
 TFormula.cxx:1453
 TFormula.cxx:1454
 TFormula.cxx:1455
 TFormula.cxx:1456
 TFormula.cxx:1457
 TFormula.cxx:1458
 TFormula.cxx:1459
 TFormula.cxx:1460
 TFormula.cxx:1461
 TFormula.cxx:1462
 TFormula.cxx:1463
 TFormula.cxx:1464
 TFormula.cxx:1465
 TFormula.cxx:1466
 TFormula.cxx:1467
 TFormula.cxx:1468
 TFormula.cxx:1469
 TFormula.cxx:1470
 TFormula.cxx:1471
 TFormula.cxx:1472
 TFormula.cxx:1473
 TFormula.cxx:1474
 TFormula.cxx:1475
 TFormula.cxx:1476
 TFormula.cxx:1477
 TFormula.cxx:1478
 TFormula.cxx:1479
 TFormula.cxx:1480
 TFormula.cxx:1481
 TFormula.cxx:1482
 TFormula.cxx:1483
 TFormula.cxx:1484
 TFormula.cxx:1485
 TFormula.cxx:1486
 TFormula.cxx:1487
 TFormula.cxx:1488
 TFormula.cxx:1489
 TFormula.cxx:1490
 TFormula.cxx:1491
 TFormula.cxx:1492
 TFormula.cxx:1493
 TFormula.cxx:1494
 TFormula.cxx:1495
 TFormula.cxx:1496
 TFormula.cxx:1497
 TFormula.cxx:1498
 TFormula.cxx:1499
 TFormula.cxx:1500
 TFormula.cxx:1501
 TFormula.cxx:1502
 TFormula.cxx:1503
 TFormula.cxx:1504
 TFormula.cxx:1505
 TFormula.cxx:1506
 TFormula.cxx:1507
 TFormula.cxx:1508
 TFormula.cxx:1509
 TFormula.cxx:1510
 TFormula.cxx:1511
 TFormula.cxx:1512
 TFormula.cxx:1513
 TFormula.cxx:1514
 TFormula.cxx:1515
 TFormula.cxx:1516
 TFormula.cxx:1517
 TFormula.cxx:1518
 TFormula.cxx:1519
 TFormula.cxx:1520
 TFormula.cxx:1521
 TFormula.cxx:1522
 TFormula.cxx:1523
 TFormula.cxx:1524
 TFormula.cxx:1525
 TFormula.cxx:1526
 TFormula.cxx:1527
 TFormula.cxx:1528
 TFormula.cxx:1529
 TFormula.cxx:1530
 TFormula.cxx:1531
 TFormula.cxx:1532
 TFormula.cxx:1533
 TFormula.cxx:1534
 TFormula.cxx:1535
 TFormula.cxx:1536
 TFormula.cxx:1537
 TFormula.cxx:1538
 TFormula.cxx:1539
 TFormula.cxx:1540
 TFormula.cxx:1541
 TFormula.cxx:1542
 TFormula.cxx:1543
 TFormula.cxx:1544
 TFormula.cxx:1545
 TFormula.cxx:1546
 TFormula.cxx:1547
 TFormula.cxx:1548
 TFormula.cxx:1549
 TFormula.cxx:1550
 TFormula.cxx:1551
 TFormula.cxx:1552
 TFormula.cxx:1553
 TFormula.cxx:1554
 TFormula.cxx:1555
 TFormula.cxx:1556
 TFormula.cxx:1557
 TFormula.cxx:1558
 TFormula.cxx:1559
 TFormula.cxx:1560
 TFormula.cxx:1561
 TFormula.cxx:1562
 TFormula.cxx:1563
 TFormula.cxx:1564
 TFormula.cxx:1565
 TFormula.cxx:1566
 TFormula.cxx:1567
 TFormula.cxx:1568
 TFormula.cxx:1569
 TFormula.cxx:1570
 TFormula.cxx:1571
 TFormula.cxx:1572
 TFormula.cxx:1573
 TFormula.cxx:1574
 TFormula.cxx:1575
 TFormula.cxx:1576
 TFormula.cxx:1577
 TFormula.cxx:1578
 TFormula.cxx:1579
 TFormula.cxx:1580
 TFormula.cxx:1581
 TFormula.cxx:1582
 TFormula.cxx:1583
 TFormula.cxx:1584
 TFormula.cxx:1585
 TFormula.cxx:1586
 TFormula.cxx:1587
 TFormula.cxx:1588
 TFormula.cxx:1589
 TFormula.cxx:1590
 TFormula.cxx:1591
 TFormula.cxx:1592
 TFormula.cxx:1593
 TFormula.cxx:1594
 TFormula.cxx:1595
 TFormula.cxx:1596
 TFormula.cxx:1597
 TFormula.cxx:1598
 TFormula.cxx:1599
 TFormula.cxx:1600
 TFormula.cxx:1601
 TFormula.cxx:1602
 TFormula.cxx:1603
 TFormula.cxx:1604
 TFormula.cxx:1605
 TFormula.cxx:1606
 TFormula.cxx:1607
 TFormula.cxx:1608
 TFormula.cxx:1609
 TFormula.cxx:1610
 TFormula.cxx:1611
 TFormula.cxx:1612
 TFormula.cxx:1613
 TFormula.cxx:1614
 TFormula.cxx:1615
 TFormula.cxx:1616
 TFormula.cxx:1617
 TFormula.cxx:1618
 TFormula.cxx:1619
 TFormula.cxx:1620
 TFormula.cxx:1621
 TFormula.cxx:1622
 TFormula.cxx:1623
 TFormula.cxx:1624
 TFormula.cxx:1625
 TFormula.cxx:1626
 TFormula.cxx:1627
 TFormula.cxx:1628
 TFormula.cxx:1629
 TFormula.cxx:1630
 TFormula.cxx:1631
 TFormula.cxx:1632
 TFormula.cxx:1633
 TFormula.cxx:1634
 TFormula.cxx:1635
 TFormula.cxx:1636
 TFormula.cxx:1637
 TFormula.cxx:1638
 TFormula.cxx:1639
 TFormula.cxx:1640
 TFormula.cxx:1641
 TFormula.cxx:1642
 TFormula.cxx:1643
 TFormula.cxx:1644
 TFormula.cxx:1645
 TFormula.cxx:1646
 TFormula.cxx:1647
 TFormula.cxx:1648
 TFormula.cxx:1649
 TFormula.cxx:1650
 TFormula.cxx:1651
 TFormula.cxx:1652
 TFormula.cxx:1653
 TFormula.cxx:1654
 TFormula.cxx:1655
 TFormula.cxx:1656
 TFormula.cxx:1657
 TFormula.cxx:1658
 TFormula.cxx:1659
 TFormula.cxx:1660
 TFormula.cxx:1661
 TFormula.cxx:1662
 TFormula.cxx:1663
 TFormula.cxx:1664
 TFormula.cxx:1665
 TFormula.cxx:1666
 TFormula.cxx:1667
 TFormula.cxx:1668
 TFormula.cxx:1669
 TFormula.cxx:1670
 TFormula.cxx:1671
 TFormula.cxx:1672
 TFormula.cxx:1673
 TFormula.cxx:1674
 TFormula.cxx:1675
 TFormula.cxx:1676
 TFormula.cxx:1677
 TFormula.cxx:1678
 TFormula.cxx:1679
 TFormula.cxx:1680
 TFormula.cxx:1681
 TFormula.cxx:1682
 TFormula.cxx:1683
 TFormula.cxx:1684
 TFormula.cxx:1685
 TFormula.cxx:1686
 TFormula.cxx:1687
 TFormula.cxx:1688
 TFormula.cxx:1689
 TFormula.cxx:1690
 TFormula.cxx:1691
 TFormula.cxx:1692
 TFormula.cxx:1693
 TFormula.cxx:1694
 TFormula.cxx:1695
 TFormula.cxx:1696
 TFormula.cxx:1697
 TFormula.cxx:1698
 TFormula.cxx:1699
 TFormula.cxx:1700
 TFormula.cxx:1701
 TFormula.cxx:1702
 TFormula.cxx:1703
 TFormula.cxx:1704
 TFormula.cxx:1705
 TFormula.cxx:1706
 TFormula.cxx:1707
 TFormula.cxx:1708
 TFormula.cxx:1709
 TFormula.cxx:1710
 TFormula.cxx:1711
 TFormula.cxx:1712
 TFormula.cxx:1713
 TFormula.cxx:1714
 TFormula.cxx:1715
 TFormula.cxx:1716
 TFormula.cxx:1717
 TFormula.cxx:1718
 TFormula.cxx:1719
 TFormula.cxx:1720
 TFormula.cxx:1721
 TFormula.cxx:1722
 TFormula.cxx:1723
 TFormula.cxx:1724
 TFormula.cxx:1725
 TFormula.cxx:1726
 TFormula.cxx:1727
 TFormula.cxx:1728
 TFormula.cxx:1729
 TFormula.cxx:1730
 TFormula.cxx:1731
 TFormula.cxx:1732
 TFormula.cxx:1733
 TFormula.cxx:1734
 TFormula.cxx:1735
 TFormula.cxx:1736
 TFormula.cxx:1737
 TFormula.cxx:1738
 TFormula.cxx:1739
 TFormula.cxx:1740
 TFormula.cxx:1741
 TFormula.cxx:1742
 TFormula.cxx:1743
 TFormula.cxx:1744
 TFormula.cxx:1745
 TFormula.cxx:1746
 TFormula.cxx:1747
 TFormula.cxx:1748
 TFormula.cxx:1749
 TFormula.cxx:1750
 TFormula.cxx:1751
 TFormula.cxx:1752
 TFormula.cxx:1753
 TFormula.cxx:1754
 TFormula.cxx:1755
 TFormula.cxx:1756
 TFormula.cxx:1757
 TFormula.cxx:1758
 TFormula.cxx:1759
 TFormula.cxx:1760
 TFormula.cxx:1761
 TFormula.cxx:1762
 TFormula.cxx:1763
 TFormula.cxx:1764
 TFormula.cxx:1765
 TFormula.cxx:1766
 TFormula.cxx:1767
 TFormula.cxx:1768
 TFormula.cxx:1769
 TFormula.cxx:1770
 TFormula.cxx:1771
 TFormula.cxx:1772
 TFormula.cxx:1773
 TFormula.cxx:1774
 TFormula.cxx:1775
 TFormula.cxx:1776
 TFormula.cxx:1777
 TFormula.cxx:1778
 TFormula.cxx:1779
 TFormula.cxx:1780
 TFormula.cxx:1781
 TFormula.cxx:1782
 TFormula.cxx:1783
 TFormula.cxx:1784
 TFormula.cxx:1785
 TFormula.cxx:1786
 TFormula.cxx:1787
 TFormula.cxx:1788
 TFormula.cxx:1789
 TFormula.cxx:1790
 TFormula.cxx:1791
 TFormula.cxx:1792
 TFormula.cxx:1793
 TFormula.cxx:1794
 TFormula.cxx:1795
 TFormula.cxx:1796
 TFormula.cxx:1797
 TFormula.cxx:1798
 TFormula.cxx:1799
 TFormula.cxx:1800
 TFormula.cxx:1801
 TFormula.cxx:1802
 TFormula.cxx:1803
 TFormula.cxx:1804
 TFormula.cxx:1805
 TFormula.cxx:1806
 TFormula.cxx:1807
 TFormula.cxx:1808
 TFormula.cxx:1809
 TFormula.cxx:1810
 TFormula.cxx:1811
 TFormula.cxx:1812
 TFormula.cxx:1813
 TFormula.cxx:1814
 TFormula.cxx:1815
 TFormula.cxx:1816
 TFormula.cxx:1817
 TFormula.cxx:1818
 TFormula.cxx:1819
 TFormula.cxx:1820
 TFormula.cxx:1821
 TFormula.cxx:1822
 TFormula.cxx:1823
 TFormula.cxx:1824
 TFormula.cxx:1825
 TFormula.cxx:1826
 TFormula.cxx:1827
 TFormula.cxx:1828
 TFormula.cxx:1829
 TFormula.cxx:1830
 TFormula.cxx:1831
 TFormula.cxx:1832
 TFormula.cxx:1833
 TFormula.cxx:1834
 TFormula.cxx:1835
 TFormula.cxx:1836
 TFormula.cxx:1837
 TFormula.cxx:1838
 TFormula.cxx:1839
 TFormula.cxx:1840
 TFormula.cxx:1841
 TFormula.cxx:1842
 TFormula.cxx:1843
 TFormula.cxx:1844
 TFormula.cxx:1845
 TFormula.cxx:1846
 TFormula.cxx:1847
 TFormula.cxx:1848
 TFormula.cxx:1849
 TFormula.cxx:1850
 TFormula.cxx:1851
 TFormula.cxx:1852
 TFormula.cxx:1853
 TFormula.cxx:1854
 TFormula.cxx:1855
 TFormula.cxx:1856
 TFormula.cxx:1857
 TFormula.cxx:1858
 TFormula.cxx:1859
 TFormula.cxx:1860
 TFormula.cxx:1861
 TFormula.cxx:1862
 TFormula.cxx:1863
 TFormula.cxx:1864
 TFormula.cxx:1865
 TFormula.cxx:1866
 TFormula.cxx:1867
 TFormula.cxx:1868
 TFormula.cxx:1869
 TFormula.cxx:1870
 TFormula.cxx:1871
 TFormula.cxx:1872
 TFormula.cxx:1873
 TFormula.cxx:1874
 TFormula.cxx:1875
 TFormula.cxx:1876
 TFormula.cxx:1877
 TFormula.cxx:1878
 TFormula.cxx:1879
 TFormula.cxx:1880
 TFormula.cxx:1881
 TFormula.cxx:1882
 TFormula.cxx:1883
 TFormula.cxx:1884
 TFormula.cxx:1885
 TFormula.cxx:1886
 TFormula.cxx:1887
 TFormula.cxx:1888
 TFormula.cxx:1889
 TFormula.cxx:1890
 TFormula.cxx:1891
 TFormula.cxx:1892
 TFormula.cxx:1893
 TFormula.cxx:1894
 TFormula.cxx:1895
 TFormula.cxx:1896
 TFormula.cxx:1897
 TFormula.cxx:1898
 TFormula.cxx:1899
 TFormula.cxx:1900
 TFormula.cxx:1901
 TFormula.cxx:1902
 TFormula.cxx:1903
 TFormula.cxx:1904
 TFormula.cxx:1905
 TFormula.cxx:1906
 TFormula.cxx:1907
 TFormula.cxx:1908
 TFormula.cxx:1909
 TFormula.cxx:1910
 TFormula.cxx:1911
 TFormula.cxx:1912
 TFormula.cxx:1913
 TFormula.cxx:1914
 TFormula.cxx:1915
 TFormula.cxx:1916
 TFormula.cxx:1917
 TFormula.cxx:1918
 TFormula.cxx:1919
 TFormula.cxx:1920
 TFormula.cxx:1921
 TFormula.cxx:1922
 TFormula.cxx:1923
 TFormula.cxx:1924
 TFormula.cxx:1925
 TFormula.cxx:1926
 TFormula.cxx:1927
 TFormula.cxx:1928
 TFormula.cxx:1929
 TFormula.cxx:1930
 TFormula.cxx:1931
 TFormula.cxx:1932
 TFormula.cxx:1933
 TFormula.cxx:1934
 TFormula.cxx:1935
 TFormula.cxx:1936
 TFormula.cxx:1937
 TFormula.cxx:1938
 TFormula.cxx:1939
 TFormula.cxx:1940
 TFormula.cxx:1941
 TFormula.cxx:1942
 TFormula.cxx:1943
 TFormula.cxx:1944
 TFormula.cxx:1945
 TFormula.cxx:1946
 TFormula.cxx:1947
 TFormula.cxx:1948
 TFormula.cxx:1949
 TFormula.cxx:1950
 TFormula.cxx:1951
 TFormula.cxx:1952
 TFormula.cxx:1953
 TFormula.cxx:1954
 TFormula.cxx:1955
 TFormula.cxx:1956
 TFormula.cxx:1957
 TFormula.cxx:1958
 TFormula.cxx:1959
 TFormula.cxx:1960
 TFormula.cxx:1961
 TFormula.cxx:1962
 TFormula.cxx:1963
 TFormula.cxx:1964
 TFormula.cxx:1965
 TFormula.cxx:1966
 TFormula.cxx:1967
 TFormula.cxx:1968
 TFormula.cxx:1969
 TFormula.cxx:1970
 TFormula.cxx:1971
 TFormula.cxx:1972
 TFormula.cxx:1973
 TFormula.cxx:1974
 TFormula.cxx:1975
 TFormula.cxx:1976
 TFormula.cxx:1977
 TFormula.cxx:1978
 TFormula.cxx:1979
 TFormula.cxx:1980
 TFormula.cxx:1981
 TFormula.cxx:1982
 TFormula.cxx:1983
 TFormula.cxx:1984
 TFormula.cxx:1985
 TFormula.cxx:1986
 TFormula.cxx:1987
 TFormula.cxx:1988
 TFormula.cxx:1989
 TFormula.cxx:1990
 TFormula.cxx:1991
 TFormula.cxx:1992
 TFormula.cxx:1993
 TFormula.cxx:1994
 TFormula.cxx:1995
 TFormula.cxx:1996
 TFormula.cxx:1997
 TFormula.cxx:1998
 TFormula.cxx:1999
 TFormula.cxx:2000
 TFormula.cxx:2001
 TFormula.cxx:2002
 TFormula.cxx:2003
 TFormula.cxx:2004
 TFormula.cxx:2005
 TFormula.cxx:2006
 TFormula.cxx:2007
 TFormula.cxx:2008
 TFormula.cxx:2009
 TFormula.cxx:2010
 TFormula.cxx:2011
 TFormula.cxx:2012
 TFormula.cxx:2013
 TFormula.cxx:2014
 TFormula.cxx:2015
 TFormula.cxx:2016
 TFormula.cxx:2017
 TFormula.cxx:2018
 TFormula.cxx:2019
 TFormula.cxx:2020
 TFormula.cxx:2021
 TFormula.cxx:2022
 TFormula.cxx:2023
 TFormula.cxx:2024
 TFormula.cxx:2025
 TFormula.cxx:2026
 TFormula.cxx:2027
 TFormula.cxx:2028
 TFormula.cxx:2029
 TFormula.cxx:2030
 TFormula.cxx:2031
 TFormula.cxx:2032
 TFormula.cxx:2033
 TFormula.cxx:2034
 TFormula.cxx:2035
 TFormula.cxx:2036
 TFormula.cxx:2037
 TFormula.cxx:2038
 TFormula.cxx:2039
 TFormula.cxx:2040
 TFormula.cxx:2041
 TFormula.cxx:2042
 TFormula.cxx:2043
 TFormula.cxx:2044
 TFormula.cxx:2045
 TFormula.cxx:2046
 TFormula.cxx:2047
 TFormula.cxx:2048
 TFormula.cxx:2049
 TFormula.cxx:2050
 TFormula.cxx:2051
 TFormula.cxx:2052
 TFormula.cxx:2053
 TFormula.cxx:2054
 TFormula.cxx:2055
 TFormula.cxx:2056
 TFormula.cxx:2057
 TFormula.cxx:2058
 TFormula.cxx:2059
 TFormula.cxx:2060
 TFormula.cxx:2061
 TFormula.cxx:2062
 TFormula.cxx:2063
 TFormula.cxx:2064
 TFormula.cxx:2065
 TFormula.cxx:2066
 TFormula.cxx:2067
 TFormula.cxx:2068
 TFormula.cxx:2069
 TFormula.cxx:2070
 TFormula.cxx:2071
 TFormula.cxx:2072
 TFormula.cxx:2073
 TFormula.cxx:2074
 TFormula.cxx:2075
 TFormula.cxx:2076
 TFormula.cxx:2077
 TFormula.cxx:2078
 TFormula.cxx:2079
 TFormula.cxx:2080
 TFormula.cxx:2081
 TFormula.cxx:2082
 TFormula.cxx:2083
 TFormula.cxx:2084
 TFormula.cxx:2085
 TFormula.cxx:2086
 TFormula.cxx:2087
 TFormula.cxx:2088
 TFormula.cxx:2089
 TFormula.cxx:2090
 TFormula.cxx:2091
 TFormula.cxx:2092
 TFormula.cxx:2093
 TFormula.cxx:2094
 TFormula.cxx:2095
 TFormula.cxx:2096
 TFormula.cxx:2097
 TFormula.cxx:2098
 TFormula.cxx:2099
 TFormula.cxx:2100
 TFormula.cxx:2101
 TFormula.cxx:2102
 TFormula.cxx:2103
 TFormula.cxx:2104
 TFormula.cxx:2105
 TFormula.cxx:2106
 TFormula.cxx:2107
 TFormula.cxx:2108
 TFormula.cxx:2109
 TFormula.cxx:2110
 TFormula.cxx:2111
 TFormula.cxx:2112
 TFormula.cxx:2113
 TFormula.cxx:2114
 TFormula.cxx:2115
 TFormula.cxx:2116
 TFormula.cxx:2117
 TFormula.cxx:2118
 TFormula.cxx:2119
 TFormula.cxx:2120
 TFormula.cxx:2121
 TFormula.cxx:2122
 TFormula.cxx:2123
 TFormula.cxx:2124
 TFormula.cxx:2125
 TFormula.cxx:2126
 TFormula.cxx:2127
 TFormula.cxx:2128
 TFormula.cxx:2129
 TFormula.cxx:2130
 TFormula.cxx:2131
 TFormula.cxx:2132
 TFormula.cxx:2133
 TFormula.cxx:2134
 TFormula.cxx:2135
 TFormula.cxx:2136
 TFormula.cxx:2137
 TFormula.cxx:2138
 TFormula.cxx:2139
 TFormula.cxx:2140
 TFormula.cxx:2141
 TFormula.cxx:2142
 TFormula.cxx:2143
 TFormula.cxx:2144
 TFormula.cxx:2145
 TFormula.cxx:2146
 TFormula.cxx:2147
 TFormula.cxx:2148
 TFormula.cxx:2149
 TFormula.cxx:2150
 TFormula.cxx:2151
 TFormula.cxx:2152
 TFormula.cxx:2153
 TFormula.cxx:2154
 TFormula.cxx:2155
 TFormula.cxx:2156
 TFormula.cxx:2157
 TFormula.cxx:2158
 TFormula.cxx:2159
 TFormula.cxx:2160
 TFormula.cxx:2161
 TFormula.cxx:2162
 TFormula.cxx:2163
 TFormula.cxx:2164
 TFormula.cxx:2165
 TFormula.cxx:2166
 TFormula.cxx:2167
 TFormula.cxx:2168
 TFormula.cxx:2169
 TFormula.cxx:2170
 TFormula.cxx:2171
 TFormula.cxx:2172
 TFormula.cxx:2173
 TFormula.cxx:2174
 TFormula.cxx:2175
 TFormula.cxx:2176
 TFormula.cxx:2177
 TFormula.cxx:2178
 TFormula.cxx:2179
 TFormula.cxx:2180
 TFormula.cxx:2181
 TFormula.cxx:2182
 TFormula.cxx:2183
 TFormula.cxx:2184
 TFormula.cxx:2185
 TFormula.cxx:2186
 TFormula.cxx:2187
 TFormula.cxx:2188
 TFormula.cxx:2189
 TFormula.cxx:2190
 TFormula.cxx:2191
 TFormula.cxx:2192
 TFormula.cxx:2193
 TFormula.cxx:2194
 TFormula.cxx:2195
 TFormula.cxx:2196
 TFormula.cxx:2197
 TFormula.cxx:2198
 TFormula.cxx:2199
 TFormula.cxx:2200
 TFormula.cxx:2201
 TFormula.cxx:2202
 TFormula.cxx:2203
 TFormula.cxx:2204
 TFormula.cxx:2205
 TFormula.cxx:2206
 TFormula.cxx:2207
 TFormula.cxx:2208
 TFormula.cxx:2209
 TFormula.cxx:2210
 TFormula.cxx:2211
 TFormula.cxx:2212
 TFormula.cxx:2213
 TFormula.cxx:2214
 TFormula.cxx:2215
 TFormula.cxx:2216
 TFormula.cxx:2217
 TFormula.cxx:2218
 TFormula.cxx:2219
 TFormula.cxx:2220
 TFormula.cxx:2221
 TFormula.cxx:2222
 TFormula.cxx:2223
 TFormula.cxx:2224
 TFormula.cxx:2225
 TFormula.cxx:2226
 TFormula.cxx:2227
 TFormula.cxx:2228
 TFormula.cxx:2229
 TFormula.cxx:2230
 TFormula.cxx:2231
 TFormula.cxx:2232
 TFormula.cxx:2233
 TFormula.cxx:2234
 TFormula.cxx:2235
 TFormula.cxx:2236
 TFormula.cxx:2237
 TFormula.cxx:2238
 TFormula.cxx:2239
 TFormula.cxx:2240
 TFormula.cxx:2241
 TFormula.cxx:2242
 TFormula.cxx:2243
 TFormula.cxx:2244
 TFormula.cxx:2245
 TFormula.cxx:2246
 TFormula.cxx:2247
 TFormula.cxx:2248
 TFormula.cxx:2249
 TFormula.cxx:2250
 TFormula.cxx:2251
 TFormula.cxx:2252
 TFormula.cxx:2253
 TFormula.cxx:2254
 TFormula.cxx:2255
 TFormula.cxx:2256
 TFormula.cxx:2257
 TFormula.cxx:2258
 TFormula.cxx:2259
 TFormula.cxx:2260
 TFormula.cxx:2261
 TFormula.cxx:2262
 TFormula.cxx:2263
 TFormula.cxx:2264
 TFormula.cxx:2265
 TFormula.cxx:2266
 TFormula.cxx:2267
 TFormula.cxx:2268
 TFormula.cxx:2269
 TFormula.cxx:2270
 TFormula.cxx:2271
 TFormula.cxx:2272
 TFormula.cxx:2273
 TFormula.cxx:2274
 TFormula.cxx:2275
 TFormula.cxx:2276
 TFormula.cxx:2277
 TFormula.cxx:2278
 TFormula.cxx:2279
 TFormula.cxx:2280
 TFormula.cxx:2281
 TFormula.cxx:2282
 TFormula.cxx:2283
 TFormula.cxx:2284
 TFormula.cxx:2285
 TFormula.cxx:2286
 TFormula.cxx:2287
 TFormula.cxx:2288
 TFormula.cxx:2289
 TFormula.cxx:2290
 TFormula.cxx:2291
 TFormula.cxx:2292
 TFormula.cxx:2293
 TFormula.cxx:2294
 TFormula.cxx:2295
 TFormula.cxx:2296
 TFormula.cxx:2297
 TFormula.cxx:2298
 TFormula.cxx:2299
 TFormula.cxx:2300
 TFormula.cxx:2301
 TFormula.cxx:2302
 TFormula.cxx:2303
 TFormula.cxx:2304
 TFormula.cxx:2305
 TFormula.cxx:2306
 TFormula.cxx:2307
 TFormula.cxx:2308
 TFormula.cxx:2309
 TFormula.cxx:2310
 TFormula.cxx:2311
 TFormula.cxx:2312
 TFormula.cxx:2313
 TFormula.cxx:2314
 TFormula.cxx:2315
 TFormula.cxx:2316
 TFormula.cxx:2317
 TFormula.cxx:2318
 TFormula.cxx:2319
 TFormula.cxx:2320
 TFormula.cxx:2321
 TFormula.cxx:2322
 TFormula.cxx:2323
 TFormula.cxx:2324
 TFormula.cxx:2325
 TFormula.cxx:2326
 TFormula.cxx:2327
 TFormula.cxx:2328
 TFormula.cxx:2329
 TFormula.cxx:2330
 TFormula.cxx:2331
 TFormula.cxx:2332
 TFormula.cxx:2333
 TFormula.cxx:2334
 TFormula.cxx:2335
 TFormula.cxx:2336
 TFormula.cxx:2337
 TFormula.cxx:2338
 TFormula.cxx:2339
 TFormula.cxx:2340
 TFormula.cxx:2341
 TFormula.cxx:2342
 TFormula.cxx:2343
 TFormula.cxx:2344
 TFormula.cxx:2345
 TFormula.cxx:2346
 TFormula.cxx:2347
 TFormula.cxx:2348
 TFormula.cxx:2349
 TFormula.cxx:2350
 TFormula.cxx:2351
 TFormula.cxx:2352
 TFormula.cxx:2353
 TFormula.cxx:2354
 TFormula.cxx:2355
 TFormula.cxx:2356
 TFormula.cxx:2357
 TFormula.cxx:2358
 TFormula.cxx:2359
 TFormula.cxx:2360
 TFormula.cxx:2361
 TFormula.cxx:2362
 TFormula.cxx:2363
 TFormula.cxx:2364
 TFormula.cxx:2365
 TFormula.cxx:2366
 TFormula.cxx:2367
 TFormula.cxx:2368
 TFormula.cxx:2369
 TFormula.cxx:2370
 TFormula.cxx:2371
 TFormula.cxx:2372
 TFormula.cxx:2373
 TFormula.cxx:2374
 TFormula.cxx:2375
 TFormula.cxx:2376
 TFormula.cxx:2377
 TFormula.cxx:2378
 TFormula.cxx:2379
 TFormula.cxx:2380
 TFormula.cxx:2381
 TFormula.cxx:2382
 TFormula.cxx:2383
 TFormula.cxx:2384
 TFormula.cxx:2385
 TFormula.cxx:2386
 TFormula.cxx:2387
 TFormula.cxx:2388
 TFormula.cxx:2389
 TFormula.cxx:2390
 TFormula.cxx:2391
 TFormula.cxx:2392
 TFormula.cxx:2393
 TFormula.cxx:2394
 TFormula.cxx:2395
 TFormula.cxx:2396
 TFormula.cxx:2397
 TFormula.cxx:2398
 TFormula.cxx:2399
 TFormula.cxx:2400
 TFormula.cxx:2401
 TFormula.cxx:2402
 TFormula.cxx:2403
 TFormula.cxx:2404
 TFormula.cxx:2405
 TFormula.cxx:2406
 TFormula.cxx:2407
 TFormula.cxx:2408
 TFormula.cxx:2409
 TFormula.cxx:2410
 TFormula.cxx:2411
 TFormula.cxx:2412
 TFormula.cxx:2413
 TFormula.cxx:2414
 TFormula.cxx:2415
 TFormula.cxx:2416
 TFormula.cxx:2417
 TFormula.cxx:2418
 TFormula.cxx:2419
 TFormula.cxx:2420
 TFormula.cxx:2421
 TFormula.cxx:2422
 TFormula.cxx:2423
 TFormula.cxx:2424
 TFormula.cxx:2425
 TFormula.cxx:2426
 TFormula.cxx:2427
 TFormula.cxx:2428
 TFormula.cxx:2429
 TFormula.cxx:2430
 TFormula.cxx:2431
 TFormula.cxx:2432
 TFormula.cxx:2433
 TFormula.cxx:2434
 TFormula.cxx:2435
 TFormula.cxx:2436
 TFormula.cxx:2437
 TFormula.cxx:2438
 TFormula.cxx:2439
 TFormula.cxx:2440
 TFormula.cxx:2441
 TFormula.cxx:2442
 TFormula.cxx:2443
 TFormula.cxx:2444
 TFormula.cxx:2445
 TFormula.cxx:2446
 TFormula.cxx:2447
 TFormula.cxx:2448
 TFormula.cxx:2449
 TFormula.cxx:2450
 TFormula.cxx:2451
 TFormula.cxx:2452
 TFormula.cxx:2453
 TFormula.cxx:2454
 TFormula.cxx:2455
 TFormula.cxx:2456
 TFormula.cxx:2457
 TFormula.cxx:2458
 TFormula.cxx:2459
 TFormula.cxx:2460
 TFormula.cxx:2461
 TFormula.cxx:2462
 TFormula.cxx:2463
 TFormula.cxx:2464
 TFormula.cxx:2465
 TFormula.cxx:2466
 TFormula.cxx:2467
 TFormula.cxx:2468
 TFormula.cxx:2469
 TFormula.cxx:2470
 TFormula.cxx:2471
 TFormula.cxx:2472
 TFormula.cxx:2473
 TFormula.cxx:2474
 TFormula.cxx:2475
 TFormula.cxx:2476
 TFormula.cxx:2477
 TFormula.cxx:2478
 TFormula.cxx:2479
 TFormula.cxx:2480
 TFormula.cxx:2481
 TFormula.cxx:2482
 TFormula.cxx:2483
 TFormula.cxx:2484
 TFormula.cxx:2485
 TFormula.cxx:2486
 TFormula.cxx:2487
 TFormula.cxx:2488
 TFormula.cxx:2489
 TFormula.cxx:2490
 TFormula.cxx:2491
 TFormula.cxx:2492
 TFormula.cxx:2493
 TFormula.cxx:2494
 TFormula.cxx:2495
 TFormula.cxx:2496
 TFormula.cxx:2497
 TFormula.cxx:2498
 TFormula.cxx:2499
 TFormula.cxx:2500
 TFormula.cxx:2501
 TFormula.cxx:2502
 TFormula.cxx:2503
 TFormula.cxx:2504
 TFormula.cxx:2505
 TFormula.cxx:2506
 TFormula.cxx:2507
 TFormula.cxx:2508
 TFormula.cxx:2509
 TFormula.cxx:2510
 TFormula.cxx:2511
 TFormula.cxx:2512
 TFormula.cxx:2513
 TFormula.cxx:2514
 TFormula.cxx:2515
 TFormula.cxx:2516
 TFormula.cxx:2517
 TFormula.cxx:2518
 TFormula.cxx:2519
 TFormula.cxx:2520
 TFormula.cxx:2521
 TFormula.cxx:2522
 TFormula.cxx:2523
 TFormula.cxx:2524
 TFormula.cxx:2525
 TFormula.cxx:2526
 TFormula.cxx:2527
 TFormula.cxx:2528
 TFormula.cxx:2529
 TFormula.cxx:2530
 TFormula.cxx:2531
 TFormula.cxx:2532
 TFormula.cxx:2533
 TFormula.cxx:2534
 TFormula.cxx:2535
 TFormula.cxx:2536
 TFormula.cxx:2537
 TFormula.cxx:2538
 TFormula.cxx:2539
 TFormula.cxx:2540
 TFormula.cxx:2541
 TFormula.cxx:2542
 TFormula.cxx:2543
 TFormula.cxx:2544
 TFormula.cxx:2545
 TFormula.cxx:2546
 TFormula.cxx:2547
 TFormula.cxx:2548
 TFormula.cxx:2549
 TFormula.cxx:2550
 TFormula.cxx:2551
 TFormula.cxx:2552
 TFormula.cxx:2553
 TFormula.cxx:2554
 TFormula.cxx:2555
 TFormula.cxx:2556
 TFormula.cxx:2557
 TFormula.cxx:2558
 TFormula.cxx:2559
 TFormula.cxx:2560
 TFormula.cxx:2561
 TFormula.cxx:2562
 TFormula.cxx:2563
 TFormula.cxx:2564
 TFormula.cxx:2565
 TFormula.cxx:2566
 TFormula.cxx:2567
 TFormula.cxx:2568
 TFormula.cxx:2569
 TFormula.cxx:2570
 TFormula.cxx:2571
 TFormula.cxx:2572
 TFormula.cxx:2573
 TFormula.cxx:2574
 TFormula.cxx:2575
 TFormula.cxx:2576
 TFormula.cxx:2577
 TFormula.cxx:2578
 TFormula.cxx:2579
 TFormula.cxx:2580
 TFormula.cxx:2581
 TFormula.cxx:2582
 TFormula.cxx:2583
 TFormula.cxx:2584
 TFormula.cxx:2585
 TFormula.cxx:2586
 TFormula.cxx:2587
 TFormula.cxx:2588
 TFormula.cxx:2589
 TFormula.cxx:2590
 TFormula.cxx:2591
 TFormula.cxx:2592
 TFormula.cxx:2593
 TFormula.cxx:2594
 TFormula.cxx:2595
 TFormula.cxx:2596
 TFormula.cxx:2597
 TFormula.cxx:2598
 TFormula.cxx:2599
 TFormula.cxx:2600
 TFormula.cxx:2601
 TFormula.cxx:2602
 TFormula.cxx:2603
 TFormula.cxx:2604
 TFormula.cxx:2605
 TFormula.cxx:2606
 TFormula.cxx:2607
 TFormula.cxx:2608
 TFormula.cxx:2609
 TFormula.cxx:2610
 TFormula.cxx:2611
 TFormula.cxx:2612
 TFormula.cxx:2613
 TFormula.cxx:2614
 TFormula.cxx:2615
 TFormula.cxx:2616
 TFormula.cxx:2617
 TFormula.cxx:2618
 TFormula.cxx:2619