67 Error(
"Chisquare",
"This function is deprecated - use ROOT::Fit::Chisquare class");
125 Int_t npar =
f->GetNumberFreeParameters();
126 Int_t npar_real =
f->GetNpar();
131 if (npar_real != npar){
132 fixed =
new Bool_t[npar_real];
133 memset(fixed,0,npar_real*
sizeof(
Bool_t));
135 for (
Int_t ipar=0; ipar<npar_real; ipar++){
137 f->GetParLimits(ipar,al,bl);
138 if (al*bl != 0 && al >= bl) {
149 delete [] sum_vector;
157 Int_t igrad, ifree=0;
158 for (
Int_t ipoint=0; ipoint<
n; ipoint++){
160 f->GradientPar(
x+ndim*ipoint, grad);
162 for (
Int_t irow=0; irow<npar; irow++){
165 for (
Int_t icol=0; icol<npar; icol++){
170 while (ifree<icol+1){
171 if (fixed[igrad]==0) ifree++;
179 sum_vector[irow]+=matr[irow*npar_real+icol]*grad[igrad];
183 for (
Int_t i=0; i<npar; i++){
188 if (fixed[igrad]==0) ifree++;
195 c+=grad[igrad]*sum_vector[i];
199 ci[ipoint]=
c*t*chidf;
203 delete [] sum_vector;
237 Error(
"GetConfidenceIntervals",
"A TGraphErrors should be passed instead of a graph");
241 Error(
"GetConfidenceIntervals",
"A TGraph2DErrors should be passed instead of a graph");
246 Error(
"GetConfidenceIntervals",
"A TGraph2DErrors or a TH23 should be passed instead of a graph");
259 Error(
"GetConfidenceIntervals",
"A TGraph2DErrors should be passed instead of a TGraph2D");
263 Error(
"GetConfidenceIntervals",
"A TGraphErrors should be passed instead of a TGraph2D");
268 Error(
"GetConfidenceIntervals",
"A TGraphErrors or a TH1 should be passed instead of a graph");
275 Int_t npar =
f->GetNpar();
284 for (
Int_t ipoint=0; ipoint<np; ipoint++){
287 f->GradientPar(
xy, grad);
288 for (
Int_t irow=0; irow<
f->GetNpar(); irow++){
290 for (
Int_t icol=0; icol<npar; icol++)
291 sum_vector[irow]+=matr[irow*npar+icol]*grad[icol];
294 for (
Int_t i=0; i<npar; i++)
295 c+=grad[i]*sum_vector[i];
298 gr2->
GetEZ()[ipoint]=
c*t*chidf;
302 delete [] sum_vector;
308 if (((
TH1*)obj)->GetDimension()>1){
309 Error(
"GetConfidenceIntervals",
"Fitted graph and passed histogram have different number of dimensions");
314 if (((
TH1*)obj)->GetDimension()!=2){
315 Error(
"GetConfidenceIntervals",
"Fitted graph and passed histogram have different number of dimensions");
321 Error(
"GetConfidenceIntervals",
"Fitted and passed histograms have different number of dimensions");
329 Int_t npar =
f->GetNpar();
348 for (
Int_t binz=hzfirst; binz<=hzlast; binz++){
350 for (
Int_t biny=hyfirst; biny<=hylast; biny++) {
352 for (
Int_t binx=hxfirst; binx<=hxlast; binx++) {
354 f->GradientPar(
x, grad);
355 for (
Int_t irow=0; irow<npar; irow++){
357 for (
Int_t icol=0; icol<npar; icol++)
358 sum_vector[irow]+=matr[irow*npar+icol]*grad[icol];
361 for (
Int_t i=0; i<npar; i++)
362 c+=grad[i]*sum_vector[i];
370 delete [] sum_vector;
373 Error(
"GetConfidenceIntervals",
"This object type is not supported");
398 if (i < 0 || i >= npars || j < 0 || j >= npars) {
399 Error(
"GetCovarianceMatrixElement",
"Illegal arguments i=%d, j=%d",i,j);
483 strcpy(parname,pname.
Data());
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 Double_t * GetParameters() const
virtual Double_t EvalPar(const Double_t *x, const Double_t *params=0)
Evaluate function with given coordinates and parameters.
virtual void InitArgs(const Double_t *x, const Double_t *params)
Initialize parameters addresses.
A 2-Dim function with parameters.
A 3-Dim function with parameters.
The ROOT standard fitter based on TMinuit.
virtual void ReleaseParameter(Int_t ipar)
Release parameter ipar.
virtual Double_t GetCovarianceMatrixElement(Int_t i, Int_t j) const
return element i,j from the covariance matrix
virtual void SetFitMethod(const char *name)
ret fit method (chisquare or loglikelihood)
virtual Double_t GetParameter(Int_t ipar) const
return current value of parameter ipar
virtual Int_t GetErrors(Int_t ipar, Double_t &eplus, Double_t &eminus, Double_t &eparab, Double_t &globcc) const
return current errors for a parameter ipar : parameter number eplus : upper error eminus : lower erro...
virtual Int_t GetNumberTotalParameters() const
return the total number of parameters (free + fixed)
virtual Int_t SetParameter(Int_t ipar, const char *parname, Double_t value, Double_t verr, Double_t vlow, Double_t vhigh)
set initial values for a parameter
virtual void FixParameter(Int_t ipar)
Fix parameter ipar.
virtual void GetConfidenceIntervals(Int_t n, Int_t ndim, const Double_t *x, Double_t *ci, Double_t cl=0.95)
Computes point-by-point confidence intervals for the fitted function.
virtual Int_t GetStats(Double_t &amin, Double_t &edm, Double_t &errdef, Int_t &nvpar, Int_t &nparx) const
return global fit parameters
virtual Int_t ExecuteCommand(const char *command, Double_t *args, Int_t nargs)
Execute a fitter command; command : command string args : list of nargs command arguments.
virtual Bool_t IsFixed(Int_t ipar) const
return kTRUE if parameter ipar is fixed, kFALSE othersise)
virtual Double_t * GetCovarianceMatrix() const
return a pointer to the covariance matrix
virtual void PrintResults(Int_t level, Double_t amin) const
Print fit results.
virtual const char * GetParName(Int_t ipar) const
return name of parameter ipar
virtual void Clear(Option_t *option="")
reset the fitter environment
virtual Double_t Chisquare(Int_t npar, Double_t *params) const
virtual Int_t GetNumberFreeParameters() const
return the number of free parameters
virtual Double_t GetParError(Int_t ipar) const
return error of parameter ipar
virtual Double_t GetSumLog(Int_t i)
return Sum(log(i) i=0,n used by log likelihood fits
virtual void SetFCN(void(*fcn)(Int_t &, Double_t *, Double_t &f, Double_t *, Int_t))
Specify the address of the fitting algorithm.
virtual ~TFitter()
Default destructor.
Graphics object made of three arrays X, Y and Z with the same number of points each.
virtual Double_t * GetEZ() const
virtual void SetPoint(Int_t point, Double_t x, Double_t y, Double_t z)
Sets point number n.
A TGraph is an object made of two arrays X and Y with npoints each.
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
Set x and y values for point number i.
TH1 is the base class of all histogram classes in ROOT.
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...
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...
Implementation in C++ of the Minuit package written by Fred James.
virtual Int_t FixParameter(Int_t parNo)
fix a parameter
virtual Int_t GetNumPars() const
returns the total number of parameters that have been defined as fixed or free.
virtual Int_t Release(Int_t parNo)
release a parameter
virtual void mncler()
Resets the parameter list to UNDEFINED.
TString * fCpnam
Character to be plotted at the X,Y contour positions.
virtual void SetFCN(void(*fcn)(Int_t &, Double_t *, Double_t &f, Double_t *, Int_t))
To set the address of the minimization function.
virtual void mnpout(Int_t iuext, TString &chnam, Double_t &val, Double_t &err, Double_t &xlolim, Double_t &xuplim, Int_t &iuint) const
Provides the user with information concerning the current status.
virtual void mnemat(Double_t *emat, Int_t ndim)
Calculates the external error matrix from the internal matrix.
virtual void mnrn15(Double_t &val, Int_t &inseed)
This is a super-portable random number generator.
virtual void mnerrs(Int_t number, Double_t &eplus, Double_t &eminus, Double_t &eparab, Double_t &gcc)
Utility routine to get MINOS errors.
virtual void mnexcm(const char *comand, Double_t *plist, Int_t llist, Int_t &ierflg)
Interprets a command and takes appropriate action.
virtual void mnstat(Double_t &fmin, Double_t &fedm, Double_t &errdef, Int_t &npari, Int_t &nparx, Int_t &istat)
Returns concerning the current status of the minimization.
virtual void mnprin(Int_t inkode, Double_t fval)
Prints the values of the parameters at the time of the call.
virtual void mnparm(Int_t k, TString cnamj, Double_t uk, Double_t wk, Double_t a, Double_t b, Int_t &ierflg)
Implements one parameter definition.
virtual void SetName(const char *name)
Set the name of the TNamed.
Mother of all ROOT objects.
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.
const char * Data() const
Abstract Base Class for Fitting.
virtual TObject * GetObjectFit() const
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...
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 Sqrt(Double_t x)
Double_t StudentQuantile(Double_t p, Double_t ndf, Bool_t lower_tail=kTRUE)
Computes quantiles of the Student's t-distribution 1st argument is the probability,...