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)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t np
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint xy
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 void InitArgs(const Double_t *x, const Double_t *params)
Initialize parameters addresses.
virtual Double_t EvalPar(const Double_t *x, const Double_t *params=nullptr)
Evaluate function with given coordinates and parameters.
A 2-Dim function with parameters.
A 3-Dim function with parameters.
<div class="legacybox"><h2>Legacy Code</h2> TFitter is a legacy interface: there will be no bug fixes...
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
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.
Double_t * GetEY() const override
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.
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 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 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)
Computes quantiles of the Student's t-distribution 1st argument is the probability,...