125 Set(numerator,denominator);
209 Error(
"Fit",
"function %s has illegal number of parameters = %d",
216 Error(
"Fit",
"No numerator or denominator histograms set");
220 Error(
"Fit",
"function %s dimension, %d, does not match histogram dimension, %d",
228 Error(
"Fit",
"numerator and denominator histograms do not have identical numbers of bins");
240 parameters.reserve(npar);
241 for (i = 0; i < npar; i++) {
246 if (we == 0) we = 0.01;
256 parameters.back().Fix();
258 }
else if (plow < pup) {
259 parameters.back().SetLimits(plow,pup);
260 Info(
"Fit",
"Setting limits for parameter %s to [%f,%f]",
f1->
GetParName(i), plow,pup);
287 if ( !status && !quiet)
288 Warning(
"Fit",
"Abnormal termination of minimization.");
330 int ylowbin = 0, yhighbin = 0, zlowbin = 0, zhighbin = 0;
352 }
else if (nDim == 2) {
358 }
else if (nDim == 3) {
376 for (
int xbin = xlowbin; xbin <= xhighbin; ++xbin) {
382 for (
int ybin = ylowbin; ybin <= yhighbin; ++ybin) {
388 for (
int zbin = zlowbin; zbin <= zhighbin; ++zbin) {
400 if (nDen> nmax) nmax = nDen;
401 if (nDen <= 0.)
continue;
421 / ((xup-xlow)*(yup-ylow)) :
430 / ((xup-xlow)*(yup-ylow)*(zup-zlow)) :
444 if (nDen - nNum != 0.) {
446 f -= (nDen - nNum) *
TMath::Log((1. - mu)*nDen/(nDen-nNum));
const Double_t kDefaultEpsilon
const std::vector< ROOT::Fit::ParameterSettings > & ParamsSettings() const
get the vector of parameter settings (const method)
ROOT::Math::MinimizerOptions & MinimizerOptions()
access to the minimizer control parameter (non const method)
class containg the result of the fit and all the related information (fitted parameter values,...
bool IsEmpty() const
True if a fit result does not exist (even invalid) with parameter values.
const std::vector< double > & Errors() const
parameter errors (return st::vector)
const std::vector< double > & Parameters() const
parameter values (return std::vector)
unsigned int Ndf() const
Number of degree of freedom.
double MinFcnValue() const
Return value of the objective function (chi2 or likelihood) used in the fit.
unsigned int NFreeParameters() const
get total number of free parameters
int Status() const
minimizer status code
Fitter class, entry point for performing all type of fits.
bool FitFCN(unsigned int npar, Function &fcn, const double *params=0, unsigned int dataSize=0, bool chi2fit=false)
Fit using the a generic FCN function as a C++ callable object implementing double () (const double *)...
bool SetFCN(unsigned int npar, Function &fcn, const double *params=0, unsigned int dataSize=0, bool chi2fit=false)
Set a generic FCN function as a C++ callable object implementing double () (const double *) Note that...
const FitResult & Result() const
get fit result
const FitConfig & Config() const
access to the fit configuration (const method)
Class, describing value, limits and step size of the parameters Provides functionality also to set/re...
Documentation for class Functor class.
Documentation for the abstract class IBaseFunctionMultiDim.
double ErrorDef() const
error definition
void SetErrorDef(double err)
set error def
void SetPrintLevel(int level)
set print level
Class to Wrap a ROOT Function class (like TF1) in a IParamMultiFunction interface of multi-dimensions...
virtual Double_t GetBinCenter(Int_t bin) const
Return center of bin.
virtual Int_t FindBin(Double_t x)
Find bin number corresponding to abscissa x.
virtual Double_t GetBinLowEdge(Int_t bin) const
Return low edge 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.
Binomial fitter for the division of two histograms.
void Set(const TH1 *numerator, const TH1 *denominator)
Initialize with a new set of inputs.
ROOT::Fit::Fitter * fFitter
virtual ~TBinomialEfficiencyFitter()
destructor
TBinomialEfficiencyFitter()
default constructor
ROOT::Fit::Fitter * GetFitter()
Provide access to the underlying fitter object.
Double_t EvaluateFCN(const Double_t *par)
void SetPrecision(Double_t epsilon)
Set the required integration precision, see TF1::Integral()
void ComputeFCN(Double_t &f, const Double_t *par)
Compute the likelihood.
TFitResultPtr Fit(TF1 *f1, Option_t *option="")
Carry out the fit of the given function to the given histograms.
virtual void GetParLimits(Int_t ipar, Double_t &parmin, Double_t &parmax) const
Return limits for parameter ipar.
virtual void SetNDF(Int_t ndf)
Set the number of degrees of freedom ndf should be the number of points used in a fit - the number of...
virtual Double_t GetParError(Int_t ipar) const
Return value of parameter number ipar.
virtual void SetChisquare(Double_t chi2)
virtual Int_t GetNpar() const
virtual void SetParErrors(const Double_t *errors)
Set errors for all active parameters when calling this function, the array errors must have at least ...
virtual Double_t Integral(Double_t a, Double_t b, Double_t epsrel=1.e-12)
IntegralOneDim or analytical integral.
virtual Int_t GetNumberFitPoints() const
virtual void SetNumberFitPoints(Int_t npfits)
virtual void GetRange(Double_t *xmin, Double_t *xmax) const
Return range of a generic N-D function.
virtual const char * GetParName(Int_t ipar) const
virtual void SetParameters(const Double_t *params)
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
Evaluate this function.
virtual Int_t GetNdim() const
virtual Double_t GetParameter(Int_t ipar) const
A 2-Dim function with parameters.
A 3-Dim function with parameters.
Provides an indirection to the TFitResult class and with a semantics identical to a TFitResult pointe...
Extends the ROOT::Fit::Result class with a TNamed inheritance providing easy possibility for I/O.
virtual Double_t GetBinCenter(Int_t bin) const
Return bin center for 1D histogram.
virtual Int_t GetNbinsY() const
virtual Int_t GetNbinsZ() const
virtual Int_t GetDimension() const
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...
virtual Int_t GetBin(Int_t binx, Int_t biny=0, Int_t binz=0) const
Return Global bin number corresponding to binx,y,z.
virtual Int_t GetNbinsX() const
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual const char * GetName() const
Returns name of object.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
void ToUpper()
Change string to upper case.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
constexpr Double_t E()
Base of natural log: