39#ifndef __ROOFIT_NOROOMINIMIZER
73#if (__GNUC__==3&&__GNUC_MINOR__==2&&__GNUC_PATCHLEVEL__==3)
454 else if (minosParamList.
getSize()>0) {
465 std::vector<unsigned int> paramInd;
470 paramInd.push_back(index);
475 if (paramInd.size()) {
656 saveFloatFinalList.
remove(*par) ;
657 saveConstList.
add(*par) ;
660 saveConstList.
sort() ;
672 std::vector<double> globalCC;
722 <<
") ERROR: " << var1.
GetName()
723 <<
" is not a floating parameter of "
731 <<
") ERROR: " << var2.
GetName()
732 <<
" is not a floating parameter of PDF "
747 coutW(
Minimization) <<
"RooMinimizer::contour: Error, run Migrad before contours!"
757 n[0] = n1 ;
n[1] = n2 ;
n[2] = n3 ;
n[3] = n4 ;
n[4] = n5 ;
n[5] = n6 ;
759 for (
Int_t ic = 0 ; ic<6 ; ic++) {
773 <<
") ERROR: MINUIT did not return a contour graph for n="
776 xcoor[npoints] = xcoor[0];
777 ycoor[npoints] = ycoor[0];
781 graph->SetLineStyle(ic+1) ;
782 graph->SetLineWidth(2) ;
797 *params = *paramSave ;
863 <<
"RooMinimizer::lastMinuitFit: ERROR: supplied variable list must be either empty " << endl
864 <<
" or match the number of variables of the last fit ("
876 << arg->
GetName() <<
"' is not of type RooRealVar" << endl ;
903 if ((xlo<xhi) && !isConst) {
904 var =
new RooRealVar(varName,varName,xval,xlo,xhi) ;
919 oocoutI((
TObject*)0,
Eval) <<
"RooMinimizer::lastMinuitFit: fit parameter '" << varName
920 <<
"' stored in variable '" << var->
GetName() <<
"'" << endl ;
940 std::vector<double> globalCC;
char * Form(const char *fmt,...)
TString operator+(const TString &s1, const TString &s2)
Use the special concatenation constructor.
void SetMinosErrors(bool on=true)
set Minos erros computation to be performed after fitting
void SetMinimizer(const char *type, const char *algo=0)
set minimizer type
const std::vector< ROOT::Fit::ParameterSettings > & ParamsSettings() const
get the vector of parameter settings (const method)
const ParameterSettings & ParSettings(unsigned int i) const
get the parameter settings for the i-th parameter (const method)
ROOT::Math::MinimizerOptions & MinimizerOptions()
access to the minimizer control parameter (non const method)
bool IsParameterFixed(unsigned int ipar) const
query if a parameter is fixed
double Error(unsigned int i) const
parameter error by index
double CovMatrix(unsigned int i, unsigned int j) const
retrieve covariance matrix element
double Value(unsigned int i) const
parameter value by index
const std::vector< double > & Parameters() const
parameter values (return std::vector)
std::string GetParameterName(unsigned int ipar) const
get name of parameter (deprecated)
double MinFcnValue() const
Return value of the objective function (chi2 or likelihood) used in the fit.
double Edm() const
Expected distance from minimum.
double Correlation(unsigned int i, unsigned int j) const
retrieve correlation elements
unsigned int NTotalParameters() const
get total number of parameters
int Status() const
minimizer status code
double GlobalCC(unsigned int i) const
parameter global correlation coefficient
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 *)...
ROOT::Math::Minimizer * GetMinimizer() const
return pointer to last used minimizer (is NULL in case fit is not yet done) This pointer is guranteed...
const FitResult & Result() const
get fit result
const FitConfig & Config() const
access to the fit configuration (const method)
bool CalculateMinosErrors()
perform an error analysis on the result using MINOS To be called only after fitting and when a minimi...
bool CalculateHessErrors()
perform an error analysis on the result using the Hessian Errors are obtaied from the inverse of the ...
double LowerLimit() const
return lower limit value
double UpperLimit() const
return upper limit value
void SetMaxFunctionCalls(unsigned int maxfcn)
set maximum of function calls
void SetStrategy(int stra)
set the strategy
void SetMaxIterations(unsigned int maxiter)
set maximum iterations (one iteration can have many function calls)
void SetErrorDef(double err)
set error def
void SetPrintLevel(int level)
set print level
void SetTolerance(double tol)
set the tolerance
void SetErrorDef(double up)
set scale for calculating the errors
virtual int CovMatrixStatus() const
return status of covariance matrix using Minuit convention {0 not calculated 1 approximated 2 made po...
double ErrorDef() const
return the statistical scale used for calculate the error is typically 1 for Chi2 and 0....
virtual bool Contour(unsigned int ivar, unsigned int jvar, unsigned int &npoints, double *xi, double *xj)
find the contour points (xi, xj) of the function for parameter ivar and jvar around the minimum The c...
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
virtual TObject * Clone(const char *newname=0) const
Make a clone of an object using the Streamer facility.
virtual void constOptimizeTestStatistic(ConstOpCode opcode, Bool_t doAlsoTrackingOpt=kTRUE)
Interface function signaling a request to perform constant term optimization.
Bool_t isConstant() const
void sort(Bool_t reverse=false)
Sort collection using std::sort and name comparison.
RooAbsCollection * snapshot(Bool_t deepCopy=kTRUE) const
Take a snap shot of current collection contents: An owning collection is returned containing clones o...
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
TIterator * createIterator(Bool_t dir=kIterForward) const R__SUGGEST_ALTERNATIVE("begin()
TIterator-style iteration over contained elements.
virtual Bool_t remove(const RooAbsArg &var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
Remove the specified argument from our list.
RooAbsArg * find(const char *name) const
Find object with given name in list.
void setConstant(Bool_t value=kTRUE)
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
virtual Double_t defaultErrorLevel() const
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
virtual void enableOffsetting(Bool_t)
static void setEvalErrorLoggingMode(ErrorLoggingMode m)
Set evaluation error logging mode.
static void clearEvalErrorLog()
Clear the stack of evaluation error messages.
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooAbsArg * at(Int_t idx) const
Return object at given index, or nullptr if index is out of range.
Int_t index(const RooAbsArg *arg) const
Returns index of given arg, or -1 if arg is not in list.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooFitResult is a container class to hold the input and output of a PDF fit to a dataset.
void fillCorrMatrix()
Internal utility method to extract the correlation matrix and the global correlation coefficients fro...
void setCovQual(Int_t val)
void setMinNLL(Double_t val)
void setNumInvalidNLL(Int_t val)
void setStatus(Int_t val)
void setConstParList(const RooArgList &list)
Fill the list of constant parameters.
void setCovarianceMatrix(TMatrixDSym &V)
Store externally provided correlation matrix in this RooFitResult ;.
void setEDM(Double_t val)
void setStatusHistory(std::vector< std::pair< std::string, int > > &hist)
void setInitParList(const RooArgList &list)
Fill the list of initial values of the floating parameters.
void setFinalParList(const RooArgList &list)
Fill the list of final values of the floating parameters.
RooArgList * GetInitFloatParamList()
void ApplyCovarianceMatrix(TMatrixDSym &V)
virtual unsigned int NDim() const
Retrieve the dimension of the function.
Bool_t Synchronize(std::vector< ROOT::Fit::ParameterSettings > ¶meters, Bool_t optConst, Bool_t verbose)
void BackProp(const ROOT::Fit::FitResult &results)
RooArgList * GetFloatParamList()
RooArgList * GetConstParamList()
RooMinimizer is a wrapper class around ROOT::Fit:Fitter that provides a seamless interface between th...
std::vector< std::pair< std::string, int > > _statusHistory
RooMinimizer(RooAbsReal &function)
Construct MINUIT interface to given function.
Int_t hesse()
Execute HESSE.
void setMaxIterations(Int_t n)
Change maximum number of MINUIT iterations (RooMinimizer default 500 * #parameters)
RooFitResult * save(const char *name=0, const char *title=0)
Save and return a RooFitResult snaphot of current minimizer status.
void setMinimizerType(const char *type)
Choose the minimzer algorithm.
void saveStatus(const char *label, Int_t status)
Int_t improve()
Execute IMPROVE.
void profileStart()
Start profiling timer.
RooPlot * contour(RooRealVar &var1, RooRealVar &var2, Double_t n1=1, Double_t n2=2, Double_t n3=0, Double_t n4=0, Double_t n5=0, Double_t n6=0, unsigned int npoints=50)
Create and draw a TH2 with the error contours in the parameters var1 and var2.
Int_t migrad()
Execute MIGRAD.
Int_t minimize(const char *type, const char *alg=0)
void profileStop()
Stop profiling timer and report results of last session.
static RooFitResult * lastMinuitFit(const RooArgList &varList=RooArgList())
RooFitResult * fit(const char *options)
Parse traditional RooAbsPdf::fitTo driver options.
void setOffsetting(Bool_t flag)
Enable internal likelihood offsetting for enhanced numeric precision.
Int_t seek()
Execute SEEK.
Bool_t setLogFile(const char *logf=0)
void setProfile(Bool_t flag=kTRUE)
void setEps(Double_t eps)
Change MINUIT epsilon.
void setErrorLevel(Double_t level)
Set the level for MINUIT error analysis to the given value.
static ROOT::Fit::Fitter * _theFitter
static void cleanup()
Cleanup method called by atexit handler installed by RooSentinel to delete all global heap objects wh...
Int_t setPrintLevel(Int_t newLevel)
Change the MINUIT internal printing level.
void setMaxFunctionCalls(Int_t n)
Change maximum number of likelihood function calss from MINUIT (RooMinimizer default 500 * #parameter...
Int_t minos()
Execute MINOS.
void applyCovarianceMatrix(TMatrixDSym &V)
Apply results of given external covariance matrix.
void optimizeConst(Int_t flag)
If flag is true, perform constant term optimization on function being minimized.
Int_t simplex()
Execute SIMPLEX.
ROOT::Fit::Fitter * fitter()
Return underlying ROOT fitter object.
void setStrategy(Int_t strat)
Change MINUIT strategy to istrat.
std::string _minimizerType
void setVerbose(Bool_t flag=kTRUE)
virtual ~RooMinimizer()
Destructor.
static RooMsgService & instance()
Return reference to singleton instance.
A RooPlot is a plot frame and a container for graphics objects within that frame.
void addObject(TObject *obj, Option_t *drawOptions="", Bool_t invisible=kFALSE)
Add a generic object to this plot.
RooRealVar represents a fundamental (non-derived) real valued object.
void setError(Double_t value)
void setRange(const char *name, Double_t min, Double_t max)
Set range named 'name to [min,max].
virtual void setVal(Double_t value)
Set value of variable to 'value'.
static void activate()
Install atexit handler that calls CleanupRooFitAtExit() on program termination.
A Graph is a graphics object made of two arrays X and Y with npoints each.
Iterator abstract base class.
virtual TObject * Next()=0
virtual const char * GetTitle() const
Returns title of object.
virtual const char * GetName() const
Returns name of object.
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
void Stop()
Stop the stopwatch.
void Print(Option_t *option="") const
Print the real and cpu time passed between the start and stop events.
void ToLower()
Change string to lower-case.
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
void function(const Char_t *name_, T fun, const Char_t *docstring=0)
RooCmdArg Parameters(const RooArgSet ¶ms)