28#include <unordered_map>
33using std::map, std::pair, std::make_pair, std::list, std::max, std::string;
36#pragma optimize("",off)
263static std::unordered_map<std::string, void *>
gClingFunctions = std::unordered_map<std::string, void * >();
270 for (
int i = 0; i <
nobjects; ++i) {
288 const static std::set<char>
ops {
'+',
'^',
'-',
'/',
'*',
'<',
'>',
'|',
'&',
'!',
'=',
'?',
'%'};
296 char brackets[] = {
')',
'(',
'{',
'}'};
320 if ( (formula[i] ==
'e' || formula[i] ==
'E') && (i > 0 && i < formula.
Length()-1) ) {
322 if ( (
isdigit(formula[i-1]) || formula[i-1] ==
'.') && (
isdigit(formula[i+1]) || formula[i+1] ==
'+' || formula[i+1] ==
'-' ) )
332 if ( (formula[i] ==
'x' || formula[i] ==
'X') && (i > 0 && i < formula.
Length()-1) && formula[i-1] ==
'0') {
335 static char hex_values[12] = {
'a',
'A',
'b',
'B',
'c',
'C',
'd',
'D',
'e',
'E',
'f',
'F'};
355 if (pos == 0 || pos == formula.
Length()-1)
return false;
356 for (
int i = pos-1; i >=0; i--) {
357 if (formula[i] ==
']' )
return false;
358 if (formula[i] ==
'[' ) {
366 for (
int i = pos+1; i < formula.
Length(); i++) {
367 if (formula[i] ==
']' )
return true;
408 for (
int i = 0; i < formula.
Length(); i++) {
411 if (
isalpha(formula[i]) || formula[i] ==
'{' || formula[i] ==
'[') {
415 || (formula[i] ==
'{' && formula[
j] ==
'}'));
427 }
else if (
isalpha(formula[i])) {
430 i +=
name.Length() - 1;
457 for (
auto const &
specialName : {
"x",
"y",
"z",
"t"}){
471 gROOT->GetListOfFunctions()->Remove(
this);
483 fClingInput(formula),fFormula(formula)
492#ifndef R__HAS_VECCORE
513 gROOT->GetListOfFunctions()->Remove(old);
515 Error(
"TFormula",
"The name %s is reserved as a TFormula variable name.\n",
name);
517 gROOT->GetListOfFunctions()->Add(
this);
529 fClingInput(formula),fFormula(formula)
542 for (
int i = 0; i <
npar; ++i) {
561 gROOT->GetListOfFunctions()->Remove(old);
563 Error(
"TFormula",
"The name %s is reserved as a TFormula variable name.\n",
name);
565 gROOT->GetListOfFunctions()->Add(
this);
570 Error(
"TFormula",
"Syntax error in building the lambda expression %s", formula );
575 TNamed(formula.GetName(),formula.GetTitle())
577 formula.TFormula::Copy(*
this);
583 gROOT->GetListOfFunctions()->Remove(old);
586 Error(
"TFormula",
"The name %s is reserved as a TFormula variable name.\n",formula.
GetName());
588 gROOT->GetListOfFunctions()->Add(
this);
599 rhs.TFormula::Copy(*
this);
657 if (formula.
IsNull() )
return -1;
669 return (
ret) ? 0 : 1;
679 return (
ret) ? 0 : 1;
708 for (
int i = 0; i <
nLinParts; ++i)
delete fnew.fLinearParts[i];
709 fnew.fLinearParts.clear();
738 bool ret =
fnew.InitLambdaExpression(
fnew.fFormula);
741 fnew.fReadyToExecute =
true;
744 Error(
"TFormula",
"Syntax error in building the lambda expression %s",
fFormula.
Data() );
745 fnew.fReadyToExecute =
false;
752 fnew.fMethod.reset(
m);
797static std::unique_ptr<TMethodCall>
800 std::unique_ptr<TMethodCall>
801 Method = std::make_unique<TMethodCall>();
826 if (!Method->IsValid()) {
827 Error(
"prepareMethod",
828 "Can't compile function %s prototype with arguments %s",
FuncName,
837 if (!
method)
return nullptr;
841 Error(
"prepareFuncPtr",
"Callfunc retuned from Cling is not valid");
848 Error(
"prepareFuncPtr",
"Compiled function pointer is null");
923 { {
"sin",
"TMath::Sin" },
924 {
"cos",
"TMath::Cos" }, {
"exp",
"TMath::Exp"}, {
"log",
"TMath::Log"}, {
"log10",
"TMath::Log10"},
925 {
"tan",
"TMath::Tan"}, {
"sinh",
"TMath::SinH"}, {
"cosh",
"TMath::CosH"},
926 {
"tanh",
"TMath::TanH"}, {
"asin",
"TMath::ASin"}, {
"acos",
"TMath::ACos"},
927 {
"atan",
"TMath::ATan"}, {
"atan2",
"TMath::ATan2"}, {
"sqrt",
"TMath::Sqrt"},
928 {
"ceil",
"TMath::Ceil"}, {
"floor",
"TMath::Floor"}, {
"pow",
"TMath::Power"},
929 {
"binomial",
"TMath::Binomial"},{
"abs",
"TMath::Abs"},
930 {
"min",
"TMath::Min"},{
"max",
"TMath::Max"},{
"sign",
"TMath::Sign" },
935 for (
int i = 0; i < 9; ++i)
938 for (
const auto &var :
defvars) {
939 int pos =
fVars.size();
972 { {
"sin",
"vecCore::math::Sin" },
973 {
"cos",
"vecCore::math::Cos" }, {
"exp",
"vecCore::math::Exp"}, {
"log",
"vecCore::math::Log"}, {
"log10",
"vecCore::math::Log10"},
974 {
"tan",
"vecCore::math::Tan"},
976 {
"asin",
"vecCore::math::ASin"},
977 {
"acos",
"TMath::Pi()/2-vecCore::math::ASin"},
978 {
"atan",
"vecCore::math::ATan"},
979 {
"atan2",
"vecCore::math::ATan2"}, {
"sqrt",
"vecCore::math::Sqrt"},
980 {
"ceil",
"vecCore::math::Ceil"}, {
"floor",
"vecCore::math::Floor"}, {
"pow",
"vecCore::math::Pow"},
981 {
"cbrt",
"vecCore::math::Cbrt"},{
"abs",
"vecCore::math::Abs"},
982 {
"min",
"vecCore::math::Min"},{
"max",
"vecCore::math::Max"},{
"sign",
"vecCore::math::Sign" }
1021 Int_t degree = 1, counter = 0;
1036 std::vector<TString>
tokens;
1037 std::stringstream
ss(args.
Data());
1039 while (std::getline(
ss,
token,
',')) {
1057 for (
size_t i = 1; i <
tokens.size(); i++) {
1102 variable = formula(tmp + 1,
polPos - (tmp + 1));
1112 }
else if (i == 1) {
1120 for (
Int_t i = 1; i <= degree; i++) {
1147 Error(
"HandlePolN",
"Error handling polynomial function - expression is %s - trying to replace %s with %s ",
1152 if (formula == pattern) {
1203 formula.
ReplaceAll(
"xylandau",
"landau[x,y]");
1257 std::vector<TString> variables;
1267 variables.resize(dim);
1275 dim =
varList.CountChar(
',') + 1;
1276 variables.resize(dim);
1299 Error(
"PreProcessFormula",
"Dimension of function %s is detected to be of dimension %d and is not "
1300 "compatible with existing pre-defined function which has dim %d",
1337 Error(
"PreprocessFormula",
"%d dimension function %s has no normalized form.", it->first.second,
1341 for (
int i = 0; i <
body.Length(); ++i) {
1342 if (
body[i] ==
'{') {
1346 TString variable = variables[num];
1350 i += variable.
Length() - 1;
1351 }
else if (
body[i] ==
'[') {
1354 while (tmp <
body.Length() &&
body[tmp] !=
']') {
1410 Error(
"HandleParamRanges",
"End parameter (%d) <= start parameter (%d) in parameter range",
endCnt,
startCnt);
1434 std::map<std::pair<TString, Int_t>, std::pair<TString, TString>>
parFunctions;
1442 if (formula[i] ==
'[') {
1443 while (formula[i] !=
']')
1448 if (formula[i] ==
'\"') {
1451 while (formula[i] !=
'\"');
1481 for (k =
j + 1;
depth >= 1 && k < formula.
Length(); k++) {
1482 if (formula[k] ==
',' &&
depth == 1) {
1485 }
else if (formula[k] ==
'(')
1487 else if (formula[k] ==
')')
1501 TF1 *
f1 =
dynamic_cast<TF1 *
>(obj);
1516 ndim =
f->GetNdim();
1517 npar =
f->GetNpar();
1546 Error(
"HandleFunctionArguments",
"Square brackets not matching in formula %s",
1561 Error(
"HandleFunctionArguments",
"Number of dimensions %d greater than 4. Cannot parse formula.", ndim);
1626 Warning(
"HandleFunctionArguments",
1627 "Argument %d is not a parameter. Cannot assume variables are implicit.",
argNr);
1634 for (
int dim = 0; dim < ndim; dim++) {
1694 Warning(
"HandleFunctionArguments",
"Unable to make replacement. Number of parameters doesn't work : "
1695 "%d arguments, %d dimensions, %d parameters",
1722 if (formula[temp] ==
')') {
1725 while (
depth != 0 && temp > 0) {
1726 if (formula[temp] ==
')')
1728 if (formula[temp] ==
'(')
1751 if (temp >= formula.
Length()) {
1752 Error(
"HandleExponentiation",
"Invalid position of operator ^");
1755 if (formula[temp] ==
'(') {
1759 if (formula[temp] ==
')')
1761 if (formula[temp] ==
'(')
1768 if (formula[temp] ==
'-' || formula[temp] ==
'+')
1780 if (temp < formula.
Length() && formula[temp] ==
'(')
1782 if (temp < formula.
Length() && formula[temp] ==
')') {
1815 if(formula.
Length() == 0)
return;
1817 if(terms.size() <= 1)
return;
1832 auto termName = std::string(
"__linear") + std::to_string(
iTerm+1);
1834 std::stringstream
ss;
1921 if (formula[i] ==
'[') {
1925 while (i < formula.
Length() && formula[i] !=
']') {
1926 param.
Append(formula[i++]);
1937 for (
int idx = 0; idx <=
paramIndex; ++idx) {
1967 if (formula[i] ==
'\"') {
1971 }
while (formula[i] !=
'\"');
1997 if (formula[i] ==
':' && ((i + 1) < formula.
Length())) {
1998 if (formula[i + 1] ==
':') {
2007 name.Append(formula[i++]);
2010 if (formula[i] ==
'(') {
2012 if (formula[i] ==
')') {
2020 switch (formula[i]) {
2021 case '(':
depth++;
break;
2022 case ')':
depth--;
break;
2030 body.Append(formula[i++]);
2054 TF1 *
f1 =
dynamic_cast<TF1 *
>(obj);
2166 if (
fun.IsFuncCall()) {
2184 if (
i2 < formula.
Length() && formula[
i2] !=
'(') {
2198#ifdef TFORMULA_CHECK_FUNCTIONS
2200 if (
fun.fName.Contains(
"::"))
2203 std::string
name(
fun.fName.Data());
2217 (
fun.GetNargs() <=
p->GetNargs() &&
fun.GetNargs() >=
p->GetNargs() -
p->GetNargsOpt())) {
2231 if (
f &&
fun.GetNargs() <=
f->GetNargs() &&
fun.GetNargs() >=
f->GetNargs() -
f->GetNargsOpt()) {
2239 Info(
"TFormula",
"Could not find %s function with %d argument(s)",
fun.GetName(),
fun.GetNargs());
2262 map<TString, TFormulaVariable>::iterator
varsIt =
fVars.find(
fun.GetName());
2272 int varDim = (*varsIt).second.fArrayPos;
2278 if (
v.second.fArrayPos <
varDim && !
v.second.fFound) {
2280 v.second.fFound =
true;
2462 for (list<TFormulaFunction>::iterator it =
fFuncs.begin(); it !=
fFuncs.end(); ++it) {
2464 if (!it->fFound && !it->IsFuncCall()) {
2466 if (it->GetNargs() == 0)
2467 Error(
"ProcessFormula",
"\"%s\" has not been matched in the formula expression", it->GetName());
2469 Error(
"ProcessFormula",
"Could not find %s function with %d argument(s)", it->GetName(), it->GetNargs());
2483 if (!
itvar->second.fFound) {
2499 make_pair(make_pair(
"gaus", 1), make_pair(
"[0]*exp(-0.5*(({V0}-[1])/[2])*(({V0}-[1])/[2]))",
2500 "[0]*exp(-0.5*(({V0}-[1])/[2])*(({V0}-[1])/[2]))/(sqrt(2*pi)*[2])")));
2501 functions.insert(make_pair(make_pair(
"landau", 1), make_pair(
"[0]*TMath::Landau({V0},[1],[2],false)",
2502 "[0]*TMath::Landau({V0},[1],[2],true)")));
2503 functions.insert(make_pair(make_pair(
"expo", 1), make_pair(
"exp([0]+[1]*{V0})",
"")));
2505 make_pair(make_pair(
"crystalball", 1), make_pair(
"[0]*ROOT::Math::crystalball_function({V0},[3],[4],[2],[1])",
2506 "[0]*ROOT::Math::crystalball_pdf({V0},[3],[4],[2],[1])")));
2508 make_pair(make_pair(
"breitwigner", 1), make_pair(
"[0]*ROOT::Math::breitwigner_pdf({V0},[2],[1])",
2509 "[0]*ROOT::Math::breitwigner_pdf({V0},[2],[4],[1])")));
2511 functions.insert(make_pair(make_pair(
"cheb0", 1), make_pair(
"ROOT::Math::Chebyshev0({V0},[0])",
"")));
2512 functions.insert(make_pair(make_pair(
"cheb1", 1), make_pair(
"ROOT::Math::Chebyshev1({V0},[0],[1])",
"")));
2513 functions.insert(make_pair(make_pair(
"cheb2", 1), make_pair(
"ROOT::Math::Chebyshev2({V0},[0],[1],[2])",
"")));
2514 functions.insert(make_pair(make_pair(
"cheb3", 1), make_pair(
"ROOT::Math::Chebyshev3({V0},[0],[1],[2],[3])",
"")));
2516 make_pair(make_pair(
"cheb4", 1), make_pair(
"ROOT::Math::Chebyshev4({V0},[0],[1],[2],[3],[4])",
"")));
2518 make_pair(make_pair(
"cheb5", 1), make_pair(
"ROOT::Math::Chebyshev5({V0},[0],[1],[2],[3],[4],[5])",
"")));
2520 make_pair(make_pair(
"cheb6", 1), make_pair(
"ROOT::Math::Chebyshev6({V0},[0],[1],[2],[3],[4],[5],[6])",
"")));
2522 make_pair(make_pair(
"cheb7", 1), make_pair(
"ROOT::Math::Chebyshev7({V0},[0],[1],[2],[3],[4],[5],[6],[7])",
"")));
2523 functions.insert(make_pair(make_pair(
"cheb8", 1),
2524 make_pair(
"ROOT::Math::Chebyshev8({V0},[0],[1],[2],[3],[4],[5],[6],[7],[8])",
"")));
2525 functions.insert(make_pair(make_pair(
"cheb9", 1),
2526 make_pair(
"ROOT::Math::Chebyshev9({V0},[0],[1],[2],[3],[4],[5],[6],[7],[8],[9])",
"")));
2528 make_pair(make_pair(
"cheb10", 1),
2529 make_pair(
"ROOT::Math::Chebyshev10({V0},[0],[1],[2],[3],[4],[5],[6],[7],[8],[9],[10])",
"")));
2532 make_pair(make_pair(
"gaus", 2), make_pair(
"[0]*exp(-0.5*(({V0}-[1])/[2])^2 - 0.5*(({V1}-[3])/[4])^2)",
"")));
2534 make_pair(make_pair(
"landau", 2),
2535 make_pair(
"[0]*TMath::Landau({V0},[1],[2],false)*TMath::Landau({V1},[3],[4],false)",
"")));
2536 functions.insert(make_pair(make_pair(
"expo", 2), make_pair(
"exp([0]+[1]*{V0})",
"exp([0]+[1]*{V0}+[2]*{V1})")));
2539 make_pair(make_pair(
"gaus", 3), make_pair(
"[0]*exp(-0.5*(({V0}-[1])/[2])^2 - 0.5*(({V1}-[3])/[4])^2 - 0.5*(({V2}-[5])/[6])^2)",
"")));
2542 make_pair(make_pair(
"bigaus", 2), make_pair(
"[0]*ROOT::Math::bigaussian_pdf({V0},{V1},[2],[4],[5],[1],[3])",
2543 "[0]*ROOT::Math::bigaussian_pdf({V0},{V1},[2],[4],[5],[1],[3])")));
2636 Error(
"GetLinearPart",
"Formula %s has only %d linear parts - requested %d",
GetName(),
n,i);
2696 if (
fFuncs.size() > 100) {
2721 Error(
"SetName",
"The name \'%s\' is reserved as a TFormula variable name.\n"
2722 "\tThis function will not be renamed.",
2753 fVars[
v.first].fValue =
v.second;
2756 Error(
"SetVariables",
"Variable %s is not defined.",
v.first.Data());
2768 Error(
"GetVariable",
"Variable %s is not defined.",
name);
2771 return nameIt->second.fValue;
2781 Error(
"GetVarNumber",
"Variable %s is not defined.",
name);
2784 return nameIt->second.fArrayPos;
2795 for (
auto &
v :
fVars) {
2796 if (
v.second.fArrayPos ==
ivar)
return v.first;
2798 Error(
"GetVarName",
"Variable with index %d not found !!",
ivar);
2809 Error(
"SetVariable",
"Variable %s is not defined.",
name.Data());
2867 Warning(
"inserting parameter %s at pos %d when vector size is %d \n",
name.Data(), pos,
2877 for (
auto it =
ret.first; it !=
fParams.end(); ++it) {
2915 Error(
"GetParameter",
"Parameter %s is not defined.",
name);
2930 Error(
"GetParameter",
"wrong index used - use GetParameter(name)");
2943 if (
p.second == ipar)
return p.first.Data();
2945 Error(
"GetParName",
"Parameter with index %d not found !!",ipar);
2978 Error(
"SetParameter",
"Parameter %s is not defined.",
name.Data());
2985 for (map<TString, TFormulaVariable>::iterator it =
fParams.begin(); it !=
fParams.end(); ++it) {
2986 if (!it->second.fFound) {
3009 Error(
"SetParameters",
"Parameter %s is not defined",
p.first.Data());
3017 for (map<TString, TFormulaVariable>::iterator it =
fParams.begin(); it !=
fParams.end(); ++it) {
3018 if (!it->second.fFound) {
3072 Error(
"SetParName",
"Wrong Parameter index %d ",ipar);
3078 if (it.second == ipar) {
3086 Error(
"SetParName",
"Parameter %d is not existing.",ipar);
3099 if (!formula.
IsNull() ) {
3101 for(list<TFormulaFunction>::iterator it =
fFuncs.begin(); it !=
fFuncs.end(); ++it)
3103 if (
oldName == it->GetName()) {
3110 Error(
"SetParName",
"Parameter %s is not defined.",
oldName.Data());
3115 newName.ReplaceAll(
" ",
"\\s");
3126#ifdef R__HAS_VECCORE
3128 Info(
"SetVectorized",
"Cannot vectorized a function of zero dimension");
3133 Error(
"SetVectorized",
"Cannot set vectorized to %d -- Formula is missing",
vectorized);
3151 Warning(
"SetVectorized",
"Cannot set vectorized -- try building with option -Dbuiltin_veccore=On");
3161#ifdef R__HAS_VECCORE
3165 return vecCore::Get(
ret, 0 );
3172 Info(
"EvalPar",
"Function is vectorized - converting Double_t into ROOT::Double_v and back");
3176 std::array<ROOT::Double_v, maxDim> xvec;
3177 for (
int i = 0; i <
fNdim; i++)
3181 return vecCore::Get(
ans, 0);
3184 std::vector<ROOT::Double_v> xvec(
fNdim);
3185 for (
int i = 0; i <
fNdim; i++)
3189 return vecCore::Get(
ans, 0);
3194 Error(
"EvalPar",
"Formula is vectorized (even though VECCORE is disabled!)");
3202 return gInterpreter->GetFunction(
nullptr, Name.c_str());
3206#ifdef ROOT_SUPPORT_CLAD
3209 gInterpreter->Declare(
"#include <Math/CladDerivator.h>\n#pragma clad OFF");
3222 "#pragma clad ON\n" +
3235 std::unique_ptr<TMethodCall>
3258 (*FuncPtr)(
nullptr, 2, args,
nullptr);
3269 (*FuncPtr)(
nullptr, 3, args,
nullptr);
3290 (
"clad::gradient(" + std::string(
fClingName.
Data()) +
", \"p\");");
3310 Error(
"GradientPar",
"Could not initialize the formula!");
3315 Error(
"GradientPar",
"Could not generate a gradient for the formula %s!",
3322 "The size of gradient result is %zu but %d is required. Resizing.",
3354 std::string
indexes = (
fNpar - 1 == 0) ?
"0" : std::string(
"0:")
3355 + std::to_string(
fNpar - 1);
3374 Error(
"HessianPar",
"Could not initialize the formula!");
3379 Error(
"HessianPar",
"Could not generate a hessian for the formula %s!",
3386 "The size of hessian result is %zu but %d is required. Resizing.",
3400#ifdef R__HAS_VECCORE
3410 return DoEvalVec(
x, params);
3413 return DoEval(
nullptr, params);
3418 Info(
"EvalPar",
"Function is not vectorized - converting ROOT::Double_v into Double_t and back");
3420 const int vecSize = vecCore::VectorSize<ROOT::Double_v>();
3423 for (
int i = 0; i <
vecSize; i++)
3428 for (
int i = 0; i <
vecSize; i++)
3445 Error(
"Eval",
"Formula is invalid and not ready to execute ");
3446 for (
auto it =
fFuncs.begin(); it !=
fFuncs.end(); ++it) {
3449 printf(
"%s is unknown.\n",
fun.GetName());
3465 Error(
"DoEval",
"Formula has error and it is not properly initialized ");
3474 double *
v =
const_cast<double*
>(
x);
3475 double *
p = (params) ?
const_cast<double*
>(params) :
const_cast<double*
>(
fClingParameters.data());
3482 double * vars = (
x) ?
const_cast<double*
>(
x) :
const_cast<double*
>(
fClingVariables.data());
3485 (*fFuncPtr)(
nullptr, 1, args, &
result);
3487 double *pars = (params) ?
const_cast<double *
>(params) :
const_cast<double *
>(
fClingParameters.data());
3489 (*fFuncPtr)(
nullptr, 2, args, &
result);
3496#ifdef R__HAS_VECCORE
3500 Error(
"Eval",
"Formula is invalid and not ready to execute ");
3501 for (
auto it =
fFuncs.begin(); it !=
fFuncs.end(); ++it) {
3504 printf(
"%s is unknown.\n",
fun.GetName());
3520 Error(
"DoEval",
"Formula has error and it is not properly initialized ");
3532 (*fFuncPtr)(0, 1, args, &
result);
3534 double *pars = (params) ?
const_cast<double *
>(params) :
const_cast<double *
>(
fClingParameters.data());
3536 (*fFuncPtr)(0, 2, args, &
result);
3553 Info(
"ReInitializeEvalMethod",
"compile now lambda expression function using Cling");
3560 if (!
fLazyInitialization)
Warning(
"ReInitializeEvalMethod",
"Formula is NOT properly initialized - try calling again TFormula::PrepareEvalMethod");
3623 std::size_t found =
clingFunc.find(
"return");
3625 if (found == std::string::npos ||
found2 == std::string::npos) {
3626 Error(
"GetExpFormula",
"Invalid Cling expression - return default formula expression");
3640 Error(
"GetExpFormula",
"Parameters not found - invalid expression - return default cling formula");
3664 Error(
"GetExpFormula",
"Parameter names not found - invalid expression - return default formula");
3676 Warning(
"GetExpFormula",
"Invalid option - return default formula expression");
3681 std::unique_ptr<TInterpreterValue>
v =
gInterpreter->MakeInterpreterValue();
3682 std::string s(
"(void (&)(Double_t const *, Double_t *, Double_t *)) ");
3685 return v->ToString();
3689 std::unique_ptr<TInterpreterValue>
v =
gInterpreter->MakeInterpreterValue();
3691 return v->ToString();
3700 printf(
" Formula expression: \n");
3709 printf(
"List of Variables: \n");
3716 printf(
"List of Parameters: \n");
3721 for (
int ipar = 0; ipar <
fNpar ; ++ipar) {
3725 printf(
"Expression passed to Cling:\n");
3728 printf(
"Generated Gradient:\n");
3733 printf(
"Generated Hessian:\n");
3740 Warning(
"Print",
"Formula is not ready to execute. Missing parameters/variables");
3741 for (list<TFormulaFunction>::const_iterator it =
fFuncs.begin(); it !=
fFuncs.end(); ++it) {
3744 printf(
"%s is unknown.\n",
fun.GetName());
3767 if (
b.IsReading() ) {
3784 Error(
"Streamer",
"Old formula read from file is NOT valid");
3838 Error(
"Streamer",
"number of parameters computed (%d) is not same as the stored parameters (%d)",
fNpar,
int(
parValues.size()) );
3841 if (
v > 11 &&
fNdim != ndim) {
3842 Error(
"Streamer",
"number of dimension computed (%d) is not same as the stored value (%d)",
fNdim, ndim );
3861 Warning(
"Streamer",
"number of parameters list found (%zu) is not same as the stored one (%zu) - use re-created list",
fParams.size(),
paramMap.size()) ;
3877 gROOT->GetListOfFunctions()->Add(
this);
3880 Error(
"Streamer",
"Formula read from file is NOT ready to execute");
3888 Error(
"Streamer",
"Reading version %d is not supported",
v);
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
void GetParameters(TFitEditor::FuncParams_t &pars, TF1 *func)
Stores the parameters of the given function into pars.
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t target
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
R__EXTERN TInterpreter * gCling
R__EXTERN TVirtualMutex * gROOTMutex
#define R__LOCKGUARD(mutex)
const_iterator begin() const
const_iterator end() const
Buffer base class used for serializing objects.
TClass instances represent classes, structs and namespaces in the ROOT type system.
const TList * GetListOfAllPublicMethods(Bool_t load=kTRUE)
Returns a list of all public methods of this class and its base classes.
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
virtual TFormula * GetFormula()
Global functions class (global functions are obtained from CINT).
virtual Longptr_t ProcessLine(const char *line, EErrorCode *error=nullptr)=0
virtual Bool_t Declare(const char *code)=0
virtual Bool_t CallFunc_IsValid(CallFunc_t *) const
virtual CallFuncIFacePtr_t CallFunc_IFacePtr(CallFunc_t *) const
Method or function calling interface.
Each ROOT class (see TClass) has a linked list of methods.
The TNamed class is the base class for all named ROOT classes.
void Copy(TObject &named) const override
Copy this to obj.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
virtual void SetName(const char *name)
Set the name of the TNamed.
Mother of all ROOT objects.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual TObject * FindObject(const char *name) const
Must be redefined in derived classes.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Regular expression class.
TString & Insert(Ssiz_t pos, const char *s)
Int_t Atoi() const
Return integer value of string.
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
TString & Replace(Ssiz_t pos, Ssiz_t n, const char *s)
const char * Data() const
Bool_t IsDigit() const
Returns true if all characters in string are digits (0-9) or white spaces, i.e.
TString & ReplaceAll(const TString &s1, const TString &s2)
Ssiz_t Last(char c) const
Find last occurrence of a character c.
void ToUpper()
Change string to upper case.
TString & Append(const char *cs)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
std::vector< std::string > Split(std::string_view str, std::string_view delims, bool skipEmpty=false)
Splits a string at each character in delims.
constexpr Double_t G()
Gravitational constant in: .
constexpr Double_t C()
Velocity of light in .
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Double_t QuietNaN()
Returns a quiet NaN as defined by IEEE 754.
Double_t Floor(Double_t x)
Rounds x downward, returning the largest integral value that is not greater than x.
constexpr Double_t K()
Boltzmann's constant in : .
constexpr Double_t Sqrt2()
constexpr Double_t E()
Base of natural log: .
constexpr Double_t Sigma()
Stefan-Boltzmann constant in : .
constexpr Double_t H()
Planck's constant in : .
constexpr Double_t LogE()
Base-10 log of e (to convert ln to log)
constexpr Double_t Ln10()
Natural log of 10 (to convert log to ln)
constexpr Double_t EulerGamma()
Euler-Mascheroni Constant.
constexpr Double_t R()
Universal gas constant ( ) in
Double_t Log10(Double_t x)
Returns the common (base-10) logarithm of x.
Double_t Infinity()
Returns an infinity as defined by the IEEE standard.
void(* Generic_t)(void *, int, void **, void *)