30 struct FitterGlobals {
31 FitterGlobals() : fFitter(
nullptr),fMaxPar(0) {}
37 static FitterGlobals &GetGlobals() {
38 TTHREAD_TLS_DECL(FitterGlobals,globals);
42 return GetGlobals().fFitter;
44 static Int_t &GetGlobalMaxPar() {
45 return GetGlobals().fMaxPar;
47 static TString &GetGlobalDefault() {
48 return GetGlobals().fDefault;
59 #ifdef R__COMPLETE_MEM_TERMINATION
61 struct TVirtualFitterCleanup {
62 ~TVirtualFitterCleanup() {
101 fZfirst(tvf.fZfirst),
103 fNpoints(tvf.fNpoints),
104 fPointSize(tvf.fPointSize),
105 fCacheSize(tvf.fCacheSize),
107 fObjectFit(tvf.fObjectFit),
108 fUserFunc(tvf.fUserFunc),
109 fMethodCall(tvf.fMethodCall),
147 if ( GetGlobalFitter() ==
this ) {
148 GetGlobalFitter() = 0;
149 GetGlobalMaxPar() = 0;
162 if (GetGlobalFitter() && maxpar > GetGlobalMaxPar()) {
163 delete GetGlobalFitter();
164 GetGlobalFitter() = 0;
167 if (!GetGlobalFitter()) {
169 if (GetGlobalDefault().Length() == 0) GetGlobalDefault() =
gEnv->
GetValue(
"Root.Fitter",
"Minuit");
170 if ((h =
gROOT->GetPluginManager()->FindHandler(
"TVirtualFitter",GetGlobalDefault()))) {
174 GetGlobalMaxPar() = maxpar;
178 if (GetGlobalFitter()) GetGlobalFitter()->SetObjectFit(obj);
179 return GetGlobalFitter();
212 return GetGlobalFitter();
249 if (GetGlobalDefault() == name)
return;
250 delete GetGlobalFitter();
251 GetGlobalFitter() = 0;
252 GetGlobalDefault() =
name;
260 GetGlobalFitter() = fitter;
261 GetGlobalMaxPar() = maxpar;
350 if (!GetGlobalFitter())
return;
353 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
ClassImp(TVirtualFitter) 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 void SetFCN(void *fcn)
To set the address of the minimization objective function.
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...
Long_t ExecPlugin(int nargs, const T &...params)
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)
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()
virtual Int_t GetValue(const char *name, Int_t dflt)
Returns the integer value for a resource.
static double DefaultErrorDef()
static TVirtualFitter * GetFitter()
static: return the current Fitter
void InitWithPrototype(TClass *cl, const char *method, const char *proto, Bool_t objectIsConst=kFALSE, ROOT::EFunctionMatchMode mode=ROOT::kConversionMatch)
Initialize the method invocation environment.
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.
TMethodCall * GetMethodCall() const
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.
virtual const char * Getp2f2funcname(void *) const
R__EXTERN TInterpreter * gCling
static void SetDefaultMinimizer(const char *type, const char *algo=0)
static double DefaultTolerance()
TMethodCall * fMethodCall