Logo ROOT  
Reference Guide
RooMinimizer Class Reference

RooMinimizer is a wrapper class around ROOT::Fit:Fitter that provides a seamless interface between the minimizer functionality and the native RooFit interface.

By default the Minimizer is MINUIT for classic FcnMode and MINUIT2 for gradient FcnMode. RooMinimizer can minimize any RooAbsReal function with respect to its parameters. Usual choices for minimization are RooNLLVar and RooChi2Var RooMinimizer has methods corresponding to MINUIT functions like hesse(), migrad(), minos() etc. In each of these function calls the state of the MINUIT engine is synchronized with the state of the RooFit variables: any change in variables, change in the constant status etc is forwarded to MINUIT prior to execution of the MINUIT call. Afterwards the RooFit objects are resynchronized with the output state of MINUIT: changes parameter values, errors are propagated. Various methods are available to control verbosity, profiling, automatic PDF optimization.

Definition at line 43 of file RooMinimizer.h.

Public Types

enum class  FcnMode { classic , gradient , generic_wrapper }
 
enum  PrintLevel {
  None =-1 , Reduced =0 , Normal =1 , ExtraForProblem =2 ,
  Maximum =3
}
 
enum  Strategy { Speed =0 , Balance =1 , Robustness =2 }
 
- Public Types inherited from TObject
enum  {
  kIsOnHeap = 0x01000000 , kNotDeleted = 0x02000000 , kZombie = 0x04000000 , kInconsistent = 0x08000000 ,
  kBitMask = 0x00ffffff
}
 
enum  { kSingleKey = (1ULL << ( 0 )) , kOverwrite = (1ULL << ( 1 )) , kWriteDelete = (1ULL << ( 2 )) }
 
enum  EDeprecatedStatusBits { kObjInCanvas = (1ULL << ( 3 )) }
 
enum  EStatusBits {
  kCanDelete = (1ULL << ( 0 )) , kMustCleanup = (1ULL << ( 3 )) , kIsReferenced = (1ULL << ( 4 )) , kHasUUID = (1ULL << ( 5 )) ,
  kCannotPick = (1ULL << ( 6 )) , kNoContextMenu = (1ULL << ( 8 )) , kInvalidObject = (1ULL << ( 13 ))
}
 

Public Member Functions

 RooMinimizer (RooAbsReal &function, FcnMode fcnMode=FcnMode::classic)
 Construct MINUIT interface to given function. More...
 
 RooMinimizer (std::shared_ptr< RooFit::TestStatistics::RooAbsL > likelihood, RooFit::TestStatistics::LikelihoodMode likelihoodMode=RooFit::TestStatistics::LikelihoodMode::serial, RooFit::TestStatistics::LikelihoodGradientMode likelihoodGradientMode=RooFit::TestStatistics::LikelihoodGradientMode::multiprocess)
 
 ~RooMinimizer () override
 Destructor. More...
 
void applyCovarianceMatrix (TMatrixDSym const &V)
 Apply results of given external covariance matrix. More...
 
RooPlotcontour (RooRealVar &var1, RooRealVar &var2, double n1=1, double n2=2, double n3=0, double n4=0, double n5=0, double n6=0, unsigned int npoints=50)
 Create and draw a TH2 with the error contours in the parameters var1 and var2. More...
 
int evalCounter () const
 
ROOT::Fit::Fitterfitter ()
 Return underlying ROOT fitter object. More...
 
const ROOT::Fit::Fitterfitter () const
 Return underlying ROOT fitter object. More...
 
RooDataSetgetLogDataSet () const
 If logging of function evaluations to a RooDataSet is enabled, returns a pointer to a dataset with one row per evaluation of the RooAbsReal passed to the minimizer. More...
 
ROOT::Math::IMultiGenFunctiongetMultiGenFcn () const
 
int getNPar () const
 
int getPrintLevel () const
 
int hesse ()
 Execute HESSE. More...
 
int improve ()
 Execute IMPROVE. More...
 
TClassIsA () const override
 
int migrad ()
 Execute MIGRAD. More...
 
int minimize (const char *type, const char *alg=nullptr)
 Minimise the function passed in the constructor. More...
 
std::string const & minimizerType () const
 
int minos ()
 Execute MINOS. More...
 
int minos (const RooArgSet &minosParamList)
 Execute MINOS for given list of parameters. More...
 
void optimizeConst (int flag)
 If flag is true, perform constant term optimization on function being minimized. More...
 
RooFitResultsave (const char *name=0, const char *title=0)
 Save and return a RooFitResult snapshot of current minimizer status. More...
 
void saveStatus (const char *label, int status)
 
int seek ()
 Execute SEEK. More...
 
void setEps (double eps)
 Change MINUIT epsilon. More...
 
void setErrorLevel (double level)
 Set the level for MINUIT error analysis to the given value. More...
 
void setEvalErrorWall (bool flag)
 
bool setLogFile (const char *logf=nullptr)
 
void setLoggingToDataSet (bool flag=true)
 Enable or disable the logging of function evaluations to a RooDataSet. More...
 
void setMaxFunctionCalls (int n)
 Change maximum number of likelihood function calss from MINUIT (RooMinimizer default 500 * #parameters) More...
 
void setMaxIterations (int n)
 Change maximum number of MINUIT iterations (RooMinimizer default 500 * #parameters) More...
 
void setMinimizerType (std::string const &type)
 Choose the minimizer algorithm. More...
 
void setOffsetting (bool flag)
 Enable internal likelihood offsetting for enhanced numeric precision. More...
 
void setPrintEvalErrors (int numEvalErrors)
 
int setPrintLevel (int newLevel)
 Change the MINUIT internal printing level. More...
 
void setProfile (bool flag=true)
 
void setRecoverFromNaNStrength (double strength)
 Try to recover from invalid function values. More...
 
void setStrategy (int strat)
 Change MINUIT strategy to istrat. More...
 
void setVerbose (bool flag=true)
 
int simplex ()
 Execute SIMPLEX. More...
 
void Streamer (TBuffer &) override
 Stream an object of class TObject. More...
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
void zeroEvalCount ()
 
- Public Member Functions inherited from TObject
 TObject ()
 TObject constructor. More...
 
 TObject (const TObject &object)
 TObject copy ctor. More...
 
virtual ~TObject ()
 TObject destructor. More...
 
void AbstractMethod (const char *method) const
 Use this method to implement an "abstract" method that you don't want to leave purely abstract. More...
 
virtual void AppendPad (Option_t *option="")
 Append graphics object to current pad. More...
 
virtual void Browse (TBrowser *b)
 Browse object. May be overridden for another default action. More...
 
ULong_t CheckedHash ()
 Check and record whether this class has a consistent Hash/RecursiveRemove setup (*) and then return the regular Hash value for this object. More...
 
virtual const char * ClassName () const
 Returns name of class to which the object belongs. More...
 
virtual void Clear (Option_t *="")
 
virtual TObjectClone (const char *newname="") const
 Make a clone of an object using the Streamer facility. More...
 
virtual Int_t Compare (const TObject *obj) const
 Compare abstract method. More...
 
virtual void Copy (TObject &object) const
 Copy this to obj. More...
 
virtual void Delete (Option_t *option="")
 Delete this object. More...
 
virtual Int_t DistancetoPrimitive (Int_t px, Int_t py)
 Computes distance from point (px,py) to the object. More...
 
virtual void Draw (Option_t *option="")
 Default Draw method for all objects. More...
 
virtual void DrawClass () const
 Draw class inheritance tree of the class to which this object belongs. More...
 
virtual TObjectDrawClone (Option_t *option="") const
 Draw a clone of this object in the current selected pad for instance with: gROOT->SetSelectedPad(gPad). More...
 
virtual void Dump () const
 Dump contents of object on stdout. More...
 
virtual void Error (const char *method, const char *msgfmt,...) const
 Issue error message. More...
 
virtual void Execute (const char *method, const char *params, Int_t *error=0)
 Execute method on this object with the given parameter string, e.g. More...
 
virtual void Execute (TMethod *method, TObjArray *params, Int_t *error=0)
 Execute method on this object with parameters stored in the TObjArray. More...
 
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
 Execute action corresponding to an event at (px,py). More...
 
virtual void Fatal (const char *method, const char *msgfmt,...) const
 Issue fatal error message. More...
 
virtual TObjectFindObject (const char *name) const
 Must be redefined in derived classes. More...
 
virtual TObjectFindObject (const TObject *obj) const
 Must be redefined in derived classes. More...
 
virtual Option_tGetDrawOption () const
 Get option used by the graphics system to draw this object. More...
 
virtual const char * GetIconName () const
 Returns mime type name of object. More...
 
virtual const char * GetName () const
 Returns name of object. More...
 
virtual char * GetObjectInfo (Int_t px, Int_t py) const
 Returns string containing info about the object at position (px,py). More...
 
virtual Option_tGetOption () const
 
virtual const char * GetTitle () const
 Returns title of object. More...
 
virtual UInt_t GetUniqueID () const
 Return the unique object id. More...
 
virtual Bool_t HandleTimer (TTimer *timer)
 Execute action in response of a timer timing out. More...
 
virtual ULong_t Hash () const
 Return hash value for this object. More...
 
Bool_t HasInconsistentHash () const
 Return true is the type of this object is known to have an inconsistent setup for Hash and RecursiveRemove (i.e. More...
 
virtual void Info (const char *method, const char *msgfmt,...) const
 Issue info message. More...
 
virtual Bool_t InheritsFrom (const char *classname) const
 Returns kTRUE if object inherits from class "classname". More...
 
virtual Bool_t InheritsFrom (const TClass *cl) const
 Returns kTRUE if object inherits from TClass cl. More...
 
virtual void Inspect () const
 Dump contents of this object in a graphics canvas. More...
 
void InvertBit (UInt_t f)
 
virtual TClassIsA () const
 
virtual Bool_t IsEqual (const TObject *obj) const
 Default equal comparison (objects are equal if they have the same address in memory). More...
 
virtual Bool_t IsFolder () const
 Returns kTRUE in case object contains browsable objects (like containers or lists of other objects). More...
 
R__ALWAYS_INLINE Bool_t IsOnHeap () const
 
virtual Bool_t IsSortable () const
 
R__ALWAYS_INLINE Bool_t IsZombie () const
 
virtual void ls (Option_t *option="") const
 The ls function lists the contents of a class on stdout. More...
 
void MayNotUse (const char *method) const
 Use this method to signal that a method (defined in a base class) may not be called in a derived class (in principle against good design since a child class should not provide less functionality than its parent, however, sometimes it is necessary). More...
 
virtual Bool_t Notify ()
 This method must be overridden to handle object notification. More...
 
void Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const
 Use this method to declare a method obsolete. More...
 
void operator delete (void *ptr)
 Operator delete. More...
 
void operator delete[] (void *ptr)
 Operator delete []. More...
 
void * operator new (size_t sz)
 
void * operator new (size_t sz, void *vp)
 
void * operator new[] (size_t sz)
 
void * operator new[] (size_t sz, void *vp)
 
TObjectoperator= (const TObject &rhs)
 TObject assignment operator. More...
 
virtual void Paint (Option_t *option="")
 This method must be overridden if a class wants to paint itself. More...
 
virtual void Pop ()
 Pop on object drawn in a pad to the top of the display list. More...
 
virtual void Print (Option_t *option="") const
 This method must be overridden when a class wants to print itself. More...
 
virtual Int_t Read (const char *name)
 Read contents of object with specified name from the current directory. More...
 
virtual void RecursiveRemove (TObject *obj)
 Recursively remove this object from a list. More...
 
void ResetBit (UInt_t f)
 
virtual void SaveAs (const char *filename="", Option_t *option="") const
 Save this object in the file specified by filename. More...
 
virtual void SavePrimitive (std::ostream &out, Option_t *option="")
 Save a primitive as a C++ statement(s) on output stream "out". More...
 
void SetBit (UInt_t f)
 
void SetBit (UInt_t f, Bool_t set)
 Set or unset the user status bits as specified in f. More...
 
virtual void SetDrawOption (Option_t *option="")
 Set drawing option for object. More...
 
virtual void SetUniqueID (UInt_t uid)
 Set the unique object id. More...
 
virtual void Streamer (TBuffer &)
 Stream an object of class TObject. More...
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
virtual void SysError (const char *method, const char *msgfmt,...) const
 Issue system error message. More...
 
R__ALWAYS_INLINE Bool_t TestBit (UInt_t f) const
 
Int_t TestBits (UInt_t f) const
 
virtual void UseCurrentStyle ()
 Set current style settings in this object This function is called when either TCanvas::UseCurrentStyle or TROOT::ForceStyle have been invoked. More...
 
virtual void Warning (const char *method, const char *msgfmt,...) const
 Issue warning message. More...
 
virtual Int_t Write (const char *name=0, Int_t option=0, Int_t bufsize=0)
 Write this object to the current directory. More...
 
virtual Int_t Write (const char *name=0, Int_t option=0, Int_t bufsize=0) const
 Write this object to the current directory. More...
 

Static Public Member Functions

static TClassClass ()
 
static const char * Class_Name ()
 
static Version_t Class_Version ()
 
static void cleanup ()
 Cleanup method called by atexit handler installed by RooSentinel to delete all global heap objects when the program is terminated. More...
 
static const char * DeclFileName ()
 
static RooFitResultlastMinuitFit ()
 
static RooFitResultlastMinuitFit (const RooArgList &varList)
 
- Static Public Member Functions inherited from TObject
static TClassClass ()
 
static const char * Class_Name ()
 
static Version_t Class_Version ()
 
static const char * DeclFileName ()
 
static Longptr_t GetDtorOnly ()
 Return destructor only flag. More...
 
static Bool_t GetObjectStat ()
 Get status of object stat flag. More...
 
static void SetDtorOnly (void *obj)
 Set destructor only flag. More...
 
static void SetObjectStat (Bool_t stat)
 Turn on/off tracking of objects in the TObjectTable. More...
 

Private Member Functions

bool fitFcn () const
 
void initMinimizerFcnDependentPart (double defaultErrorLevel)
 Initialize the part of the minimizer that is dependent on the function to be minimized. More...
 
void initMinimizerFirstPart ()
 Initialize the part of the minimizer that is independent of the function to be minimized. More...
 
std::ofstream * logfile ()
 
doublemaxFCN ()
 
void profileStart ()
 Start profiling timer. More...
 
void profileStop ()
 Stop profiling timer and report results of last session. More...
 

Private Attributes

TStopwatch _cumulTimer
 
std::unique_ptr< TMatrixDSym_extV
 
RooAbsMinimizerFcn_fcn
 
FcnMode _fcnMode
 
std::unique_ptr< RooDataSet_logDataSet
 
bool _loggingToDataSet = false
 
std::string _minimizerType
 
int _printLevel = 1
 
bool _profile = false
 
bool _profileStart = false
 
int _status = -99
 
std::vector< std::pair< std::string, int > > _statusHistory
 
TStopwatch _timer
 
bool _verbose = false
 

Static Private Attributes

static std::unique_ptr< ROOT::Fit::Fitter_theFitter = {}
 

Friends

class RooAbsMinimizerFcn
 

Additional Inherited Members

- Protected Types inherited from TObject
enum  { kOnlyPrepStep = (1ULL << ( 3 )) }
 
- Protected Member Functions inherited from TObject
virtual void DoError (int level, const char *location, const char *fmt, va_list va) const
 Interface to ErrorHandler (protected). More...
 
void MakeZombie ()
 

#include <RooMinimizer.h>

Inheritance diagram for RooMinimizer:
[legend]

Member Enumeration Documentation

◆ FcnMode

enum class RooMinimizer::FcnMode
strong
Enumerator
classic 
gradient 
generic_wrapper 

Definition at line 45 of file RooMinimizer.h.

◆ PrintLevel

Enumerator
None 
Reduced 
Normal 
ExtraForProblem 
Maximum 

Definition at line 57 of file RooMinimizer.h.

◆ Strategy

Enumerator
Speed 
Balance 
Robustness 

Definition at line 56 of file RooMinimizer.h.

Constructor & Destructor Documentation

◆ RooMinimizer() [1/2]

RooMinimizer::RooMinimizer ( RooAbsReal function,
FcnMode  fcnMode = FcnMode::classic 
)
explicit

Construct MINUIT interface to given function.

Function can be anything, but is typically a -log(likelihood) implemented by RooNLLVar or a chi^2 (implemented by RooChi2Var). Other frequent use cases are a RooAddition of a RooNLLVar plus a penalty or constraint term. This class propagates all RooFit information (floating parameters, their values and errors) to MINUIT before each MINUIT call and propagates all MINUIT information back to the RooFit object at the end of each call (updated parameter values, their (asymmetric errors) etc. The default MINUIT error level for HESSE and MINOS error analysis is taken from the defaultErrorLevel() value of the input function.

Definition at line 101 of file RooMinimizer.cxx.

◆ RooMinimizer() [2/2]

◆ ~RooMinimizer()

RooMinimizer::~RooMinimizer ( )
override

Destructor.

Definition at line 178 of file RooMinimizer.cxx.

Member Function Documentation

◆ applyCovarianceMatrix()

void RooMinimizer::applyCovarianceMatrix ( TMatrixDSym const &  V)

Apply results of given external covariance matrix.

i.e. propagate its errors to all RRV parameter representations and give this matrix instead of the HESSE matrix at the next save() call

Definition at line 826 of file RooMinimizer.cxx.

◆ Class()

static TClass * RooMinimizer::Class ( )
static
Returns
TClass describing this class

◆ Class_Name()

static const char * RooMinimizer::Class_Name ( )
static
Returns
Name of this class

◆ Class_Version()

static Version_t RooMinimizer::Class_Version ( )
inlinestatic
Returns
Version of this class

Definition at line 163 of file RooMinimizer.h.

◆ cleanup()

void RooMinimizer::cleanup ( )
static

Cleanup method called by atexit handler installed by RooSentinel to delete all global heap objects when the program is terminated.

Definition at line 82 of file RooMinimizer.cxx.

◆ contour()

RooPlot * RooMinimizer::contour ( RooRealVar var1,
RooRealVar var2,
double  n1 = 1,
double  n2 = 2,
double  n3 = 0,
double  n4 = 0,
double  n5 = 0,
double  n6 = 0,
unsigned int  npoints = 50 
)

Create and draw a TH2 with the error contours in the parameters var1 and var2.

Parameters
[in]var1The first parameter (x axis).
[in]var2The second parameter (y axis).
[in]n1First contour.
[in]n2Optional contour. 0 means don't draw.
[in]n3Optional contour. 0 means don't draw.
[in]n4Optional contour. 0 means don't draw.
[in]n5Optional contour. 0 means don't draw.
[in]n6Optional contour. 0 means don't draw.
[in]npointsNumber of points for evaluating the contour.

Up to six contours can be drawn using the arguments n1 to n6 to request the desired coverage in units of \( \sigma = n^2 \cdot \mathrm{ErrorDef} \). See ROOT::Math::Minimizer::ErrorDef().

Definition at line 697 of file RooMinimizer.cxx.

◆ DeclFileName()

static const char * RooMinimizer::DeclFileName ( )
inlinestatic
Returns
Name of the file containing the class declaration

Definition at line 163 of file RooMinimizer.h.

◆ evalCounter()

int RooMinimizer::evalCounter ( ) const

Definition at line 948 of file RooMinimizer.cxx.

◆ fitFcn()

bool RooMinimizer::fitFcn ( ) const
private

Definition at line 300 of file RooMinimizer.cxx.

◆ fitter() [1/2]

ROOT::Fit::Fitter * RooMinimizer::fitter ( )

Return underlying ROOT fitter object.

Definition at line 285 of file RooMinimizer.cxx.

◆ fitter() [2/2]

const ROOT::Fit::Fitter * RooMinimizer::fitter ( ) const

Return underlying ROOT fitter object.

Definition at line 294 of file RooMinimizer.cxx.

◆ getLogDataSet()

RooDataSet * RooMinimizer::getLogDataSet ( ) const
inline

If logging of function evaluations to a RooDataSet is enabled, returns a pointer to a dataset with one row per evaluation of the RooAbsReal passed to the minimizer.

As columns, there are all floating parameters and the values they had for that evaluation.

See also
RooMinimizer::setLoggingToDataSet(bool).

Definition at line 99 of file RooMinimizer.h.

◆ getMultiGenFcn()

ROOT::Math::IMultiGenFunction * RooMinimizer::getMultiGenFcn ( ) const

Definition at line 814 of file RooMinimizer.cxx.

◆ getNPar()

int RooMinimizer::getNPar ( ) const

Definition at line 951 of file RooMinimizer.cxx.

◆ getPrintLevel()

int RooMinimizer::getPrintLevel ( ) const
inline

Definition at line 101 of file RooMinimizer.h.

◆ hesse()

int RooMinimizer::hesse ( )

Execute HESSE.

Changes in parameter values and calculated errors are automatically propagated back the RooRealVars representing the floating parameters in the MINUIT operation.

Definition at line 374 of file RooMinimizer.cxx.

◆ improve()

int RooMinimizer::improve ( )

Execute IMPROVE.

Changes in parameter values and calculated errors are automatically propagated back the RooRealVars representing the floating parameters in the MINUIT operation.

Definition at line 563 of file RooMinimizer.cxx.

◆ initMinimizerFcnDependentPart()

void RooMinimizer::initMinimizerFcnDependentPart ( double  defaultErrorLevel)
private

Initialize the part of the minimizer that is dependent on the function to be minimized.

Definition at line 151 of file RooMinimizer.cxx.

◆ initMinimizerFirstPart()

void RooMinimizer::initMinimizerFirstPart ( )
private

Initialize the part of the minimizer that is independent of the function to be minimized.

Definition at line 140 of file RooMinimizer.cxx.

◆ IsA()

TClass * RooMinimizer::IsA ( ) const
inlineoverridevirtual
Returns
TClass describing current object

Reimplemented from TObject.

Definition at line 163 of file RooMinimizer.h.

◆ lastMinuitFit() [1/2]

RooFitResult * RooMinimizer::lastMinuitFit ( )
static

Definition at line 833 of file RooMinimizer.cxx.

◆ lastMinuitFit() [2/2]

RooFitResult * RooMinimizer::lastMinuitFit ( const RooArgList varList)
static

Definition at line 836 of file RooMinimizer.cxx.

◆ logfile()

std::ofstream * RooMinimizer::logfile ( )
private

Definition at line 953 of file RooMinimizer.cxx.

◆ maxFCN()

double & RooMinimizer::maxFCN ( )
private

Definition at line 954 of file RooMinimizer.cxx.

◆ migrad()

int RooMinimizer::migrad ( )

Execute MIGRAD.

Changes in parameter values and calculated errors are automatically propagated back the RooRealVars representing the floating parameters in the MINUIT operation.

Definition at line 345 of file RooMinimizer.cxx.

◆ minimize()

int RooMinimizer::minimize ( const char *  type,
const char *  alg = nullptr 
)

Minimise the function passed in the constructor.

Parameters
[in]typeType of fitter to use, e.g. "Minuit" "Minuit2". Passing an empty string will select the default minimizer type of the RooMinimizer, as returned by ROOT::Math::MinimizerOptions::DefaultMinimizerType().
Attention
This overrides the default fitter of this RooMinimizer.
Parameters
[in]algFit algorithm to use. (Optional)

Definition at line 313 of file RooMinimizer.cxx.

◆ minimizerType()

std::string const & RooMinimizer::minimizerType ( ) const
inline

Definition at line 104 of file RooMinimizer.h.

◆ minos() [1/2]

int RooMinimizer::minos ( )

Execute MINOS.

Changes in parameter values and calculated errors are automatically propagated back the RooRealVars representing the floating parameters in the MINUIT operation.

Definition at line 411 of file RooMinimizer.cxx.

◆ minos() [2/2]

int RooMinimizer::minos ( const RooArgSet minosParamList)

Execute MINOS for given list of parameters.

Changes in parameter values and calculated errors are automatically propagated back the RooRealVars representing the floating parameters in the MINUIT operation.

Definition at line 449 of file RooMinimizer.cxx.

◆ optimizeConst()

void RooMinimizer::optimizeConst ( int  flag)

If flag is true, perform constant term optimization on function being minimized.

Definition at line 601 of file RooMinimizer.cxx.

◆ profileStart()

void RooMinimizer::profileStart ( )
private

Start profiling timer.

Definition at line 790 of file RooMinimizer.cxx.

◆ profileStop()

void RooMinimizer::profileStop ( )
private

Stop profiling timer and report results of last session.

Definition at line 803 of file RooMinimizer.cxx.

◆ save()

RooFitResult * RooMinimizer::save ( const char *  userName = 0,
const char *  userTitle = 0 
)

Save and return a RooFitResult snapshot of current minimizer status.

This snapshot contains the values of all constant parameters, the value of all floating parameters at RooMinimizer construction and after the last MINUIT operation, the MINUIT status, variance quality, EDM setting, number of calls with evaluation problems, the minimized function value and the full correlation matrix.

Definition at line 616 of file RooMinimizer.cxx.

◆ saveStatus()

void RooMinimizer::saveStatus ( const char *  label,
int  status 
)
inline

Definition at line 110 of file RooMinimizer.h.

◆ seek()

int RooMinimizer::seek ( )

Execute SEEK.

Changes in parameter values and calculated errors are automatically propagated back the RooRealVars representing the floating parameters in the MINUIT operation.

Definition at line 505 of file RooMinimizer.cxx.

◆ setEps()

void RooMinimizer::setEps ( double  eps)

Change MINUIT epsilon.

Definition at line 243 of file RooMinimizer.cxx.

◆ setErrorLevel()

void RooMinimizer::setErrorLevel ( double  level)

Set the level for MINUIT error analysis to the given value.

This function overrides the default value that is taken in the RooMinimizer constructor from the defaultErrorLevel() method of the input function

Definition at line 232 of file RooMinimizer.cxx.

◆ setEvalErrorWall()

void RooMinimizer::setEvalErrorWall ( bool  flag)

Definition at line 940 of file RooMinimizer.cxx.

◆ setLogFile()

bool RooMinimizer::setLogFile ( const char *  logf = nullptr)

Definition at line 946 of file RooMinimizer.cxx.

◆ setLoggingToDataSet()

void RooMinimizer::setLoggingToDataSet ( bool  flag = true)
inline

Enable or disable the logging of function evaluations to a RooDataSet.

See also
RooMinimizer::getLogDataSet(). param[in] flag Boolean flag to disable or enable the functionality.

Definition at line 92 of file RooMinimizer.h.

◆ setMaxFunctionCalls()

void RooMinimizer::setMaxFunctionCalls ( int  n)

Change maximum number of likelihood function calss from MINUIT (RooMinimizer default 500 * #parameters)

Definition at line 218 of file RooMinimizer.cxx.

◆ setMaxIterations()

void RooMinimizer::setMaxIterations ( int  n)

Change maximum number of MINUIT iterations (RooMinimizer default 500 * #parameters)

Definition at line 206 of file RooMinimizer.cxx.

◆ setMinimizerType()

void RooMinimizer::setMinimizerType ( std::string const &  type)

Choose the minimizer algorithm.

Passing an empty string selects the default minimizer type returned by ROOT::Math::MinimizerOptions::DefaultMinimizerType().

Definition at line 265 of file RooMinimizer.cxx.

◆ setOffsetting()

void RooMinimizer::setOffsetting ( bool  flag)

Enable internal likelihood offsetting for enhanced numeric precision.

Definition at line 253 of file RooMinimizer.cxx.

◆ setPrintEvalErrors()

void RooMinimizer::setPrintEvalErrors ( int  numEvalErrors)

Definition at line 944 of file RooMinimizer.cxx.

◆ setPrintLevel()

int RooMinimizer::setPrintLevel ( int  newLevel)

Change the MINUIT internal printing level.

Definition at line 589 of file RooMinimizer.cxx.

◆ setProfile()

void RooMinimizer::setProfile ( bool  flag = true)
inline

Definition at line 86 of file RooMinimizer.h.

◆ setRecoverFromNaNStrength()

void RooMinimizer::setRecoverFromNaNStrength ( double  strength)

Try to recover from invalid function values.

When invalid function values are encountered, a penalty term is returned to the minimiser to make it back off. This sets the strength of this penalty.

Note
A strength of zero is equivalent to a constant penalty (= the gradient vanishes, ROOT < 6.24). Positive values lead to a gradient pointing away from the undefined regions. Use ~10 to force the minimiser away from invalid function values.

Definition at line 943 of file RooMinimizer.cxx.

◆ setStrategy()

void RooMinimizer::setStrategy ( int  istrat)

Change MINUIT strategy to istrat.

Accepted codes are 0,1,2 and represent MINUIT strategies for dealing most efficiently with fast FCNs (0), expensive FCNs (2) and 'intermediate' FCNs (1)

Definition at line 194 of file RooMinimizer.cxx.

◆ setVerbose()

void RooMinimizer::setVerbose ( bool  flag = true)

Definition at line 945 of file RooMinimizer.cxx.

◆ simplex()

int RooMinimizer::simplex ( )

Execute SIMPLEX.

Changes in parameter values and calculated errors are automatically propagated back the RooRealVars representing the floating parameters in the MINUIT operation.

Definition at line 534 of file RooMinimizer.cxx.

◆ Streamer()

void RooMinimizer::Streamer ( TBuffer R__b)
overridevirtual

Stream an object of class TObject.

Reimplemented from TObject.

◆ StreamerNVirtual()

void RooMinimizer::StreamerNVirtual ( TBuffer ClassDef_StreamerNVirtual_b)
inline

Definition at line 163 of file RooMinimizer.h.

◆ zeroEvalCount()

void RooMinimizer::zeroEvalCount ( )

Definition at line 949 of file RooMinimizer.cxx.

Friends And Related Function Documentation

◆ RooAbsMinimizerFcn

friend class RooAbsMinimizerFcn
friend

Definition at line 126 of file RooMinimizer.h.

Member Data Documentation

◆ _cumulTimer

TStopwatch RooMinimizer::_cumulTimer
private

Definition at line 148 of file RooMinimizer.h.

◆ _extV

std::unique_ptr<TMatrixDSym> RooMinimizer::_extV
private

Definition at line 150 of file RooMinimizer.h.

◆ _fcn

RooAbsMinimizerFcn* RooMinimizer::_fcn
private

Definition at line 152 of file RooMinimizer.h.

◆ _fcnMode

FcnMode RooMinimizer::_fcnMode
private

Definition at line 155 of file RooMinimizer.h.

◆ _logDataSet

std::unique_ptr<RooDataSet> RooMinimizer::_logDataSet
private

Definition at line 161 of file RooMinimizer.h.

◆ _loggingToDataSet

bool RooMinimizer::_loggingToDataSet = false
private

Definition at line 143 of file RooMinimizer.h.

◆ _minimizerType

std::string RooMinimizer::_minimizerType
private

Definition at line 154 of file RooMinimizer.h.

◆ _printLevel

int RooMinimizer::_printLevel = 1
private

Definition at line 140 of file RooMinimizer.h.

◆ _profile

bool RooMinimizer::_profile = false
private

Definition at line 142 of file RooMinimizer.h.

◆ _profileStart

bool RooMinimizer::_profileStart = false
private

Definition at line 145 of file RooMinimizer.h.

◆ _status

int RooMinimizer::_status = -99
private

Definition at line 141 of file RooMinimizer.h.

◆ _statusHistory

std::vector<std::pair<std::string,int> > RooMinimizer::_statusHistory
private

Definition at line 159 of file RooMinimizer.h.

◆ _theFitter

std::unique_ptr< ROOT::Fit::Fitter > RooMinimizer::_theFitter = {}
staticprivate

Definition at line 157 of file RooMinimizer.h.

◆ _timer

TStopwatch RooMinimizer::_timer
private

Definition at line 147 of file RooMinimizer.h.

◆ _verbose

bool RooMinimizer::_verbose = false
private

Definition at line 144 of file RooMinimizer.h.

Libraries for RooMinimizer:
[legend]

The documentation for this class was generated from the following files: