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);
289 if ( !status && !quiet)
290 Warning(
"Fit",
"Abnormal termination of minimization.");
309 Info(
"Fit",
"Successful Result from Binomial Efficiency fitter of function %s",
f1->
GetName());
310 fitResult.
Print(std::cout);
335 int ylowbin = 0, yhighbin = 0, zlowbin = 0, zhighbin = 0;
357 }
else if (nDim == 2) {
363 }
else if (nDim == 3) {
381 for (
int xbin = xlowbin; xbin <= xhighbin; ++xbin) {
387 for (
int ybin = ylowbin; ybin <= yhighbin; ++ybin) {
393 for (
int zbin = zlowbin; zbin <= zhighbin; ++zbin) {
405 if (nDen> nmax) nmax = nDen;
406 if (nDen <= 0.)
continue;
426 / ((xup-xlow)*(yup-ylow)) :
435 / ((xup-xlow)*(yup-ylow)*(zup-zlow)) :
449 if (nDen - nNum != 0.) {
451 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 containing 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 Chi2() const
Return the Chi2 value after fitting In case of unbinned fits (or not defined one, see the documentati...
void Print(std::ostream &os, bool covmat=false) const
print the result and optionally covariance matrix and correlations
int Status() const
minimizer status code
Fitter class, entry point for performing all type of fits.
void SetNumberOfFitPoints(unsigned int npoints)
Set number of fit points when using an external FCN function This function can be called after Fit to...
void SetFitType(int type)
Set the type of fit when using an external FCN possible types are : 1 (least-square),...
const FitResult & Result() const
get fit result
bool FitFCN(unsigned int npar, Function &fcn, const double *params=nullptr, unsigned int dataSize=0, int fitType=0)
Fit using the a generic FCN function as a C++ callable object implementing double () (const double *)...
const FitConfig & Config() const
access to the fit configuration (const method)
bool SetFCN(unsigned int npar, Function &fcn, const double *params=nullptr, unsigned int dataSize=0, int fitType=0)
Set a generic FCN function as a C++ callable object implementing double () (const double *) Note that...
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.
Double_t fEpsilon
Precision required for function integration (option "I")
void Set(const TH1 *numerator, const TH1 *denominator)
Initialize with a new set of inputs.
ROOT::Fit::Fitter * fFitter
pointer to the real fitter
TH1 * fDenominator
Denominator histogram.
Bool_t fRange
True if the fit range must be taken from the function range.
Bool_t fAverage
True if the fit function must be averaged over the bin.
~TBinomialEfficiencyFitter() override
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()
Bool_t fFitDone
Set to kTRUE when the fit has been done.
void ComputeFCN(Double_t &f, const Double_t *par)
Compute the likelihood.
TF1 * fFunction
Function to fit.
TFitResultPtr Fit(TF1 *f1, Option_t *option="")
Carry out the fit of the given function to the given histograms.
TH1 * fNumerator
Numerator histogram.
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.
TH1 is the base class of all histogram classes in ROOT.
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
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.
const char * GetName() const override
Returns name of object.
virtual void SetName(const char *name)
Set the name of the TNamed.
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
Double_t Log(Double_t x)
Returns the natural logarithm of x.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.