I keep having mistakes
I have just done:
TF1 *func = new TF1(“fit”,fitf,0.0,2500.0,3);
func->SetParameters(0,1);
func->SetParNames("constant","coefficient");
func->Draw();
for (int i=0; i<Events; i++)
{
gr.Fit(func);
gr.DrawClone("SAME");
}
And the error is:
/Users/root_install/include/TF1.h:726:104: error: type ‘double (double *, double *, double )’ cannot be used prior to ‘::’
because it has no members
…ROOT::Internal::GetFunctorType<decltype(ROOT::Internal::GetTheRightOp(&F…
^
/Users/root_install/include/TF1.h:370:41: note: in instantiation of member function 'ROOT::Internal::TF1Builder<double
()(double *, double *, double )>::Build’ requested here
ROOT::Internal::TF1Builder::Build(this, f);
^
/Users/root_install/macros/signal.C:62:21: note: in instantiation of function template specialization 'TF1::TF1<double ()(double
*, double *, double )>’ requested here
TF1 func = new TF1(“fit”,fitf,0.0,2500.0,3);
^
In module ‘MathCore’:
/Users/root_install/include/Math/ParamFunctor.h:125:39: error: too few arguments to function call, expected 3, have 2
return (f)((T)x, (double)p);
~~~~ ^
/Users/root_install/include/Math/ParamFunctor.h:95:45: note: in instantiation of member function
'ROOT::Math::ParamFunctorHandler<ROOT::Math::ParamFunctorTempl,
double ()(double *, double *, double )>::FuncEvaluator<double ()(double
*, double *, double ), int>::EvalConst’ requested here
return FuncEvaluator<Func, EvalType>::EvalConst(fFunc,x,p);
^
/Users/root_install/include/Math/ParamFunctor.h:73:4: note: in instantiation of member function
'ROOT::Math::ParamFunctorHandler<ROOT::Math::ParamFunctorTempl,
double ()(double *, double *, double )>::operator()’ requested here
ParamFunctorHandler(const Func & fun) : fFunc(fun) {}
^
/Users/root_install/include/Math/ParamFunctor.h:304:17: note: in instantiation of member function
'ROOT::Math::ParamFunctorHandler<ROOT::Math::ParamFunctorTempl,
double ()(double *, double *, double )>::ParamFunctorHandler’ requested
here
fImpl(new ParamFunctorHandler<ParamFunctorTempl,Func>(f) )
^
/Users/root_install/include/TF1.h:728:66: note: in instantiation of function template specialization
'ROOT::Math::ParamFunctorTempl::ParamFunctorTempl<double ()(double
*, double *, double )>’ requested here
f->fFunctor.reset(new TF1::TF1FunctorPointerImpl<Fnc_t>(ROOT::M…
^
/Users/root_install/include/TF1.h:370:41: note: in instantiation of member function 'ROOT::Internal::TF1Builder<double
()(double *, double *, double )>::Build’ requested here
ROOT::Internal::TF1Builder::Build(this, f);
^
/Users/root_install/macros/signal.C:62:21: note: in instantiation of function template specialization 'TF1::TF1<double ()(double
*, double *, double *)>’ requested here
TF1 func = new TF1(“fit”,fitf,0.0,2500.0,3);
^
In module ‘MathCore’:
/Users/root_install/include/Math/ParamFunctor.h:121:26: error: too few arguments to function call, expected 3, have 2
return (*f)(x, p);
~~~~ ^
/Users/root_install/include/Math/ParamFunctor.h:91:45: note: in instantiation of member function
'ROOT::Math::ParamFunctorHandler<ROOT::Math::ParamFunctorTempl,
double ()(double *, double *, double )>::FuncEvaluator<double ()(double
*, double *, double ), int>::Eval’ requested here
return FuncEvaluator<Func, EvalType>::Eval(fFunc,x,p);
^
/Users/root_install/include/Math/ParamFunctor.h:73:4: note: in instantiation of member function
'ROOT::Math::ParamFunctorHandler<ROOT::Math::ParamFunctorTempl,
double ()(double *, double *, double )>::operator()’ requested here
ParamFunctorHandler(const Func & fun) : fFunc(fun) {}
^
/Users/root_install/include/Math/ParamFunctor.h:304:17: note: in instantiation of member function
'ROOT::Math::ParamFunctorHandler<ROOT::Math::ParamFunctorTempl,
double ()(double *, double *, double )>::ParamFunctorHandler’ requested
here
fImpl(new ParamFunctorHandler<ParamFunctorTempl,Func>(f) )
^
/Users/root_install/include/TF1.h:728:66: note: in instantiation of function template specialization
'ROOT::Math::ParamFunctorTempl::ParamFunctorTempl<double ()(double
*, double *, double )>’ requested here
f->fFunctor.reset(new TF1::TF1FunctorPointerImpl<Fnc_t>(ROOT::M…
^
/Users/root_install/include/TF1.h:370:41: note: in instantiation of member function 'ROOT::Internal::TF1Builder<double
()(double *, double *, double )>::Build’ requested here
ROOT::Internal::TF1Builder::Build(this, f);
^
/Users/root_install/macros/signal.C:62:21: note: in instantiation of function template specialization 'TF1::TF1<double ()(double
*, double *, double *)>’ requested here
TF1 *func = new TF1(“fit”,fitf,0.0,2500.0,3);