29 struct FitterGlobals {
30 FitterGlobals() : fFitter(
nullptr),fMaxPar(0) {}
36 static FitterGlobals &GetGlobals() {
37 TTHREAD_TLS_DECL(FitterGlobals,globals);
41 return GetGlobals().fFitter;
43 static Int_t &GetGlobalMaxPar() {
44 return GetGlobals().fMaxPar;
46 static TString &GetGlobalDefault() {
47 return GetGlobals().fDefault;
58 #ifdef R__COMPLETE_MEM_TERMINATION 60 struct TVirtualFitterCleanup {
61 ~TVirtualFitterCleanup() {
65 TVirtualFitterCleanup cleanup;
146 if ( GetGlobalFitter() ==
this ) {
147 GetGlobalFitter() = 0;
148 GetGlobalMaxPar() = 0;
161 if (GetGlobalFitter() && maxpar > GetGlobalMaxPar()) {
162 delete GetGlobalFitter();
163 GetGlobalFitter() = 0;
166 if (!GetGlobalFitter()) {
168 if (GetGlobalDefault().Length() == 0) GetGlobalDefault() =
gEnv->
GetValue(
"Root.Fitter",
"Minuit");
169 if ((h =
gROOT->GetPluginManager()->FindHandler(
"TVirtualFitter",GetGlobalDefault()))) {
173 GetGlobalMaxPar() = maxpar;
177 if (GetGlobalFitter()) GetGlobalFitter()->SetObjectFit(obj);
178 return GetGlobalFitter();
211 return GetGlobalFitter();
248 if (GetGlobalDefault() == name)
return;
249 delete GetGlobalFitter();
250 GetGlobalFitter() = 0;
251 GetGlobalDefault() =
name;
259 GetGlobalFitter() = fitter;
260 GetGlobalMaxPar() = maxpar;
321 Error(
"SetFCN",
"Not used anymore.");
345 if (!GetGlobalFitter())
return;
348 GetGlobalFitter()->ExecuteCommand(
"SET ERRORDEF", arglist, 1);
static Double_t GetErrorDef()
static: Return the Error Definition
static void SetErrorDef(Double_t errdef=1)
static: Set the Error Definition (default=1) For Minuit this is the value passed with the "SET ERR" c...
static int DefaultMaxFunctionCalls()
static Double_t GetPrecision()
static: Return the fit relative precision
TVirtualFitter()
Default constructor.
virtual void GetConfidenceIntervals(Int_t n, Int_t ndim, const Double_t *x, Double_t *ci, Double_t cl=0.95)
return confidence intervals in array x of dimension ndim implemented in TFitter and TLinearFitter ...
static Int_t GetMaxIterations()
static: Return the maximum number of iterations actually max number of function calls ...
static void SetDefaultFitter(const char *name="")
static: set name of default fitter
Int_t LoadPlugin()
Load the plugin library for this handler.
virtual Double_t * SetCache(Int_t npoints, Int_t psize)
Initialize the cache array npoints is the number of points to be stored (or already stored) in the ca...
TMethodCall * GetMethodCall() const
static const char * GetDefaultFitter()
static: return the name of the default fitter
void SetParamPtrs(void *paramArr, Int_t nparam=-1)
ParamArr is an array containing the function argument values.
The TNamed class is the base class for all named ROOT classes.
TVirtualFitter & operator=(const TVirtualFitter &tvf)
assignment operator
static void SetMaxIterations(Int_t niter=5000)
static: Set the maximum number of function calls for the minimization algorithm For example for MIGRA...
static void SetDefaultErrorDef(double up)
virtual void SetFCN(void *fcn) R__DEPRECATED(6
To set the address of the minimization objective function.
Method or function calling interface.
static void SetFitter(TVirtualFitter *fitter, Int_t maxpar=25)
Static function to set an alternative fitter.
virtual ~TVirtualFitter()
Cleanup virtual fitter.
static void SetDefaultMaxFunctionCalls(int maxcall)
TNamed & operator=(const TNamed &rhs)
TNamed assignment operator.
static const std::string & DefaultMinimizerType()
Long_t ExecPlugin(int nargs, const T &... params)
virtual Int_t GetValue(const char *name, Int_t dflt)
Returns the integer value for a resource.
static double DefaultErrorDef()
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
static TVirtualFitter * GetFitter()
static: return the current Fitter
static void SetDefaultTolerance(double tol)
static void SetPrecision(Double_t prec=1e-6)
static: Set the tolerance used in the minimization algorithm For example for MIGRAD this is tolerance...
Abstract Base Class for Fitting.
Mother of all ROOT objects.
static TVirtualFitter * Fitter(TObject *obj, Int_t maxpar=25)
Static function returning a pointer to the current fitter.
void Execute(const char *, const char *, int *=0)
Execute method on this object with the given parameter string, e.g.
void(* fFCN)(Int_t &npar, Double_t *gin, Double_t &f, Double_t *u, Int_t flag)
void InteractiveFCN(Int_t &npar, Double_t *gin, Double_t &f, Double_t *u, Int_t flag)
Static function called when SetFCN is called in interactive mode.
static void SetDefaultMinimizer(const char *type, const char *algo=0)
static double DefaultTolerance()
TMethodCall * fMethodCall