65 Error(
"Chisquare",
"This function is deprecated - use ROOT::Fit::Chisquare class");
92 fMinuit->mnexcm(command,args,nargs,ierr);
121 Int_t npar =
f->GetNumberFreeParameters();
122 Int_t npar_real =
f->GetNpar();
127 if (npar_real != npar){
128 fixed =
new Bool_t[npar_real];
129 memset(fixed,0,npar_real*
sizeof(
Bool_t));
131 for (
Int_t ipar=0; ipar<npar_real; ipar++){
133 f->GetParLimits(ipar,al,bl);
134 if (al*bl != 0 && al >= bl) {
145 delete [] sum_vector;
153 Int_t igrad, ifree=0;
154 for (
Int_t ipoint=0; ipoint<
n; ipoint++){
156 f->GradientPar(
x+ndim*ipoint, grad);
158 for (
Int_t irow=0; irow<npar; irow++){
161 for (
Int_t icol=0; icol<npar; icol++){
166 while (ifree<icol+1){
167 if (fixed[igrad]==0) ifree++;
175 sum_vector[irow]+=matr[irow*npar_real+icol]*grad[igrad];
179 for (
Int_t i=0; i<npar; i++){
184 if (fixed[igrad]==0) ifree++;
191 c+=grad[igrad]*sum_vector[i];
195 ci[ipoint]=
c*t*chidf;
199 delete [] sum_vector;
233 Error(
"GetConfidenceIntervals",
"A TGraphErrors should be passed instead of a graph");
237 Error(
"GetConfidenceIntervals",
"A TGraph2DErrors should be passed instead of a graph");
242 Error(
"GetConfidenceIntervals",
"A TGraph2DErrors or a TH23 should be passed instead of a graph");
247 for (
Int_t i=0; i<
gr->GetN(); i++)
255 Error(
"GetConfidenceIntervals",
"A TGraph2DErrors should be passed instead of a TGraph2D");
259 Error(
"GetConfidenceIntervals",
"A TGraphErrors should be passed instead of a TGraph2D");
264 Error(
"GetConfidenceIntervals",
"A TGraphErrors or a TH1 should be passed instead of a graph");
271 Int_t npar =
f->GetNpar();
280 for (
Int_t ipoint=0; ipoint<np; ipoint++){
283 f->GradientPar(xy, grad);
284 for (
Int_t irow=0; irow<
f->GetNpar(); irow++){
286 for (
Int_t icol=0; icol<npar; icol++)
287 sum_vector[irow]+=matr[irow*npar+icol]*grad[icol];
290 for (
Int_t i=0; i<npar; i++)
291 c+=grad[i]*sum_vector[i];
293 gr2->
SetPoint(ipoint, xy[0], xy[1],
f->EvalPar(xy));
294 gr2->
GetEZ()[ipoint]=
c*t*chidf;
298 delete [] sum_vector;
304 if (((
TH1*)obj)->GetDimension()>1){
305 Error(
"GetConfidenceIntervals",
"Fitted graph and passed histogram have different number of dimensions");
310 if (((
TH1*)obj)->GetDimension()!=2){
311 Error(
"GetConfidenceIntervals",
"Fitted graph and passed histogram have different number of dimensions");
317 Error(
"GetConfidenceIntervals",
"Fitted and passed histograms have different number of dimensions");
325 Int_t npar =
f->GetNpar();
344 for (
Int_t binz=hzfirst; binz<=hzlast; binz++){
346 for (
Int_t biny=hyfirst; biny<=hylast; biny++) {
348 for (
Int_t binx=hxfirst; binx<=hxlast; binx++) {
350 f->GradientPar(
x, grad);
351 for (
Int_t irow=0; irow<npar; irow++){
353 for (
Int_t icol=0; icol<npar; icol++)
354 sum_vector[irow]+=matr[irow*npar+icol]*grad[icol];
357 for (
Int_t i=0; i<npar; i++)
358 c+=grad[i]*sum_vector[i];
366 delete [] sum_vector;
369 Error(
"GetConfidenceIntervals",
"This object type is not supported");
394 if (i < 0 || i >= npars || j < 0 || j >= npars) {
395 Error(
"GetCovarianceMatrixElement",
"Illegal arguments i=%d, j=%d",i,j);
413 fMinuit->mnerrs(ipar, eplus,eminus,eparab,globcc);
444 fMinuit->mnpout(ipar, pname,value,verr,vlow,vhigh,ierr);
458 fMinuit->mnpout(ipar, pname,value,verr,vlow,vhigh,ierr);
478 fMinuit->mnpout(ipar, pname,value,verr,vlow,vhigh,ierr);
479 strcpy(parname,pname.
Data());
504 fMinuit->mnstat(amin,edm,errdef,nvpar,nparx,ierr);
591 fMinuit->mnparm(ipar,parname,value,verr,vlow,vhigh,ierr);
int Int_t
Signed integer 4 bytes (int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
const char Option_t
Option string (const char).
void F3Fit(Int_t &npar, Double_t *gin, Double_t &f, Double_t *u, Int_t flag)
void F2Fit(Int_t &npar, Double_t *gin, Double_t &f, Double_t *u, Int_t flag)
Class to manage histogram axis.
virtual Double_t GetBinCenter(Int_t bin) const
Return center of bin.
Int_t GetLast() const
Return last bin on the axis i.e.
Int_t GetFirst() const
Return first bin on the axis i.e.
virtual void InitArgs(const Double_t *x, const Double_t *params)
virtual Double_t * GetParameters() const
virtual Double_t EvalPar(const Double_t *x, const Double_t *params=nullptr)
TFitter(const TFitter &)=delete
Int_t GetNumberTotalParameters() const override
return the total number of parameters (free + fixed)
~TFitter() override
Default destructor.
const char * GetParName(Int_t ipar) const override
return name of parameter ipar
void SetFCN(void(*fcn)(Int_t &, Double_t *, Double_t &f, Double_t *, Int_t)) override
Specify the address of the fitting algorithm.
void ReleaseParameter(Int_t ipar) override
Release parameter ipar.
Double_t * GetCovarianceMatrix() const override
return a pointer to the covariance matrix
Double_t GetParError(Int_t ipar) const override
return error of parameter ipar
Bool_t IsFixed(Int_t ipar) const override
return kTRUE if parameter ipar is fixed, kFALSE otherwise)
Double_t GetSumLog(Int_t i) override
return Sum(log(i) i=0,n used by log likelihood fits
void Clear(Option_t *option="") override
reset the fitter environment
void PrintResults(Int_t level, Double_t amin) const override
Print fit results.
Double_t GetParameter(Int_t ipar) const override
return current value of parameter ipar
void GetConfidenceIntervals(Int_t n, Int_t ndim, const Double_t *x, Double_t *ci, Double_t cl=0.95) override
Computes point-by-point confidence intervals for the fitted function.
Int_t GetErrors(Int_t ipar, Double_t &eplus, Double_t &eminus, Double_t &eparab, Double_t &globcc) const override
return current errors for a parameter ipar : parameter number eplus : upper error eminus : lower erro...
Int_t ExecuteCommand(const char *command, Double_t *args, Int_t nargs) override
Execute a fitter command; command : command string args : list of nargs command arguments.
void SetFitMethod(const char *name) override
ret fit method (chisquare or log-likelihood)
Int_t GetStats(Double_t &amin, Double_t &edm, Double_t &errdef, Int_t &nvpar, Int_t &nparx) const override
return global fit parameters
Double_t Chisquare(Int_t npar, Double_t *params) const override
void FixParameter(Int_t ipar) override
Fix parameter ipar.
Double_t GetCovarianceMatrixElement(Int_t i, Int_t j) const override
return element i,j from the covariance matrix
Int_t SetParameter(Int_t ipar, const char *parname, Double_t value, Double_t verr, Double_t vlow, Double_t vhigh) override
set initial values for a parameter
Int_t GetNumberFreeParameters() const override
return the number of free parameters
virtual void SetPoint(Int_t point, Double_t x, Double_t y, Double_t z)
virtual Double_t * GetEZ() const
TH1 is the base class of all histogram classes in ROOT.
virtual void SetBinError(Int_t bin, Double_t error)
Set the bin Error Note that this resets the bin eror option to be of Normal Type and for the non-empt...
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content see convention for numbering bins in TH1::GetBin In case the bin number is greater th...
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
TObject()
TObject constructor.
const char * Data() const
Abstract Base Class for Fitting.
virtual TObject * GetObjectFit() const
TObject * fUserFunc
Pointer to user theoretical function (a TF1*).
virtual void SetFCN(void(*fcn)(Int_t &, Double_t *, Double_t &f, Double_t *, Int_t))
To set the address of the minimization objective function called by the native compiler (see function...
TObject * fObjectFit
Pointer to object being fitted.
static TVirtualFitter * GetFitter()
static: return the current Fitter
virtual TObject * GetUserFunc() const
Double_t QuietNaN()
Returns a quiet NaN as defined by IEEE 754.
Double_t Log(Double_t x)
Returns the natural logarithm of x.
Double_t Sqrt(Double_t x)
Returns the square root of x.
Double_t StudentQuantile(Double_t p, Double_t ndf, Bool_t lower_tail=kTRUE)