66 Error(
"Chisquare",
"This function is deprecated - use ROOT::Fit::Chisquare class");
122 Int_t npar =
f->GetNumberFreeParameters();
123 Int_t npar_real =
f->GetNpar();
128 if (npar_real != npar){
129 fixed =
new Bool_t[npar_real];
130 memset(fixed,0,npar_real*
sizeof(
Bool_t));
132 for (
Int_t ipar=0; ipar<npar_real; ipar++){
134 f->GetParLimits(ipar,al,bl);
135 if (al*bl != 0 && al >= bl) {
146 delete [] sum_vector;
154 Int_t igrad, ifree=0;
155 for (
Int_t ipoint=0; ipoint<
n; ipoint++){
157 f->GradientPar(
x+ndim*ipoint, grad);
159 for (
Int_t irow=0; irow<npar; irow++){
162 for (
Int_t icol=0; icol<npar; icol++){
167 while (ifree<icol+1){
168 if (fixed[igrad]==0) ifree++;
176 sum_vector[irow]+=matr[irow*npar_real+icol]*grad[igrad];
180 for (
Int_t i=0; i<npar; i++){
185 if (fixed[igrad]==0) ifree++;
192 c+=grad[igrad]*sum_vector[i];
196 ci[ipoint]=
c*t*chidf;
200 delete [] sum_vector;
234 Error(
"GetConfidenceIntervals",
"A TGraphErrors should be passed instead of a graph");
238 Error(
"GetConfidenceIntervals",
"A TGraph2DErrors should be passed instead of a graph");
243 Error(
"GetConfidenceIntervals",
"A TGraph2DErrors or a TH23 should be passed instead of a graph");
256 Error(
"GetConfidenceIntervals",
"A TGraph2DErrors should be passed instead of a TGraph2D");
260 Error(
"GetConfidenceIntervals",
"A TGraphErrors should be passed instead of a TGraph2D");
265 Error(
"GetConfidenceIntervals",
"A TGraphErrors or a TH1 should be passed instead of a graph");
272 Int_t npar =
f->GetNpar();
281 for (
Int_t ipoint=0; ipoint<np; ipoint++){
284 f->GradientPar(
xy, grad);
285 for (
Int_t irow=0; irow<
f->GetNpar(); irow++){
287 for (
Int_t icol=0; icol<npar; icol++)
288 sum_vector[irow]+=matr[irow*npar+icol]*grad[icol];
291 for (
Int_t i=0; i<npar; i++)
292 c+=grad[i]*sum_vector[i];
295 gr2->
GetEZ()[ipoint]=
c*t*chidf;
299 delete [] sum_vector;
305 if (((
TH1*)obj)->GetDimension()>1){
306 Error(
"GetConfidenceIntervals",
"Fitted graph and passed histogram have different number of dimensions");
311 if (((
TH1*)obj)->GetDimension()!=2){
312 Error(
"GetConfidenceIntervals",
"Fitted graph and passed histogram have different number of dimensions");
318 Error(
"GetConfidenceIntervals",
"Fitted and passed histograms have different number of dimensions");
326 Int_t npar =
f->GetNpar();
345 for (
Int_t binz=hzfirst; binz<=hzlast; binz++){
347 for (
Int_t biny=hyfirst; biny<=hylast; biny++) {
349 for (
Int_t binx=hxfirst; binx<=hxlast; binx++) {
351 f->GradientPar(
x, grad);
352 for (
Int_t irow=0; irow<npar; irow++){
354 for (
Int_t icol=0; icol<npar; icol++)
355 sum_vector[irow]+=matr[irow*npar+icol]*grad[icol];
358 for (
Int_t i=0; i<npar; i++)
359 c+=grad[i]*sum_vector[i];
367 delete [] sum_vector;
370 Error(
"GetConfidenceIntervals",
"This object type is not supported");
395 if (i < 0 || i >= npars || j < 0 || j >= npars) {
396 Error(
"GetCovarianceMatrixElement",
"Illegal arguments i=%d, j=%d",i,j);
480 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.
<div class="legacybox"><h2>Legacy Code</h2> TFitter is a legacy interface: it is not recommended to u...
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 log-likelihood)
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 otherwise)
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
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 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,...