Logo ROOT  
Reference Guide
RooMinimizerFcn.cxx
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * @(#)root/roofitcore:$Id$
5  * Authors: *
6  * AL, Alfio Lazzaro, INFN Milan, alfio.lazzaro@mi.infn.it *
7  * *
8  * *
9  * Redistribution and use in source and binary forms, *
10  * with or without modification, are permitted according to the terms *
11  * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
12  *****************************************************************************/
13 
14 #ifndef __ROOFIT_NOROOMINIMIZER
15 
16 //////////////////////////////////////////////////////////////////////////////
17 /// \class RooMinimizerFcn
18 /// RooMinimizerFcn is an interface to the ROOT::Math::IBaseFunctionMultiDim,
19 /// a function that ROOT's minimisers use to carry out minimisations.
20 ///
21 
22 #include "RooMinimizerFcn.h"
23 
24 #include "RooAbsArg.h"
25 #include "RooAbsPdf.h"
26 #include "RooArgSet.h"
27 #include "RooRealVar.h"
28 #include "RooAbsRealLValue.h"
29 #include "RooMsgService.h"
30 #include "RooMinimizer.h"
31 #include "RooNaNPacker.h"
32 
33 #include "TClass.h"
34 #include "TMatrixDSym.h"
35 
36 #include <fstream>
37 #include <iomanip>
38 
39 using namespace std;
40 
42  bool verbose) :
43  _funct(funct), _context(context),
44  // Reset the *largest* negative log-likelihood value we have seen so far
45  _maxFCN(-std::numeric_limits<double>::infinity()), _numBadNLL(0),
46  _printEvalErrors(10),
47  _nDim(0), _logfile(0),
48  _verbose(verbose)
49 {
50 
51  // Examine parameter list
52  RooArgSet* paramSet = _funct->getParameters(RooArgSet());
53  RooArgList paramList(*paramSet);
54  delete paramSet;
55 
56  _floatParamList = (RooArgList*) paramList.selectByAttrib("Constant",kFALSE);
57  if (_floatParamList->getSize()>1) {
59  }
60  _floatParamList->setName("floatParamList");
61 
62  _constParamList = (RooArgList*) paramList.selectByAttrib("Constant",kTRUE);
63  if (_constParamList->getSize()>1) {
65  }
66  _constParamList->setName("constParamList");
67 
68  // Remove all non-RooRealVar parameters from list (MINUIT cannot handle them)
69  for (unsigned int i = 0; i < _floatParamList->size(); ) { // Note: Counting loop, since removing from collection!
70  const RooAbsArg* arg = (*_floatParamList).at(i);
71  if (!arg->IsA()->InheritsFrom(RooAbsRealLValue::Class())) {
72  oocoutW(_context,Minimization) << "RooMinimizerFcn::RooMinimizerFcn: removing parameter "
73  << arg->GetName() << " from list because it is not of type RooRealVar" << endl;
74  _floatParamList->remove(*arg);
75  } else {
76  ++i;
77  }
78  }
79 
81 
82  // Save snapshot of initial lists
85 
86 }
87 
88 
89 
91  _funct(other._funct),
92  _context(other._context),
93  _maxFCN(other._maxFCN),
94  _funcOffset(other._funcOffset),
95  _recoverFromNaNStrength(other._recoverFromNaNStrength),
96  _numBadNLL(other._numBadNLL),
97  _printEvalErrors(other._printEvalErrors),
98  _evalCounter(other._evalCounter),
99  _nDim(other._nDim),
100  _logfile(other._logfile),
101  _doEvalErrorWall(other._doEvalErrorWall),
102  _verbose(other._verbose)
103 {
108 }
109 
110 
112 {
113  delete _floatParamList;
114  delete _initFloatParamList;
115  delete _constParamList;
116  delete _initConstParamList;
117 }
118 
119 
121 {
122  return new RooMinimizerFcn(*this) ;
123 }
124 
125 
126 /// Internal function to synchronize TMinimizer with current
127 /// information in RooAbsReal function parameters
128 Bool_t RooMinimizerFcn::Synchronize(std::vector<ROOT::Fit::ParameterSettings>& parameters,
129  Bool_t optConst, Bool_t verbose)
130 {
131  Bool_t constValChange(kFALSE) ;
132  Bool_t constStatChange(kFALSE) ;
133 
134  Int_t index(0) ;
135 
136  // Handle eventual migrations from constParamList -> floatParamList
137  for(index= 0; index < _constParamList->getSize() ; index++) {
138 
139  RooRealVar *par= dynamic_cast<RooRealVar*>(_constParamList->at(index)) ;
140  if (!par) continue ;
141 
142  RooRealVar *oldpar= dynamic_cast<RooRealVar*>(_initConstParamList->at(index)) ;
143  if (!oldpar) continue ;
144 
145  // Test if constness changed
146  if (!par->isConstant()) {
147 
148  // Remove from constList, add to floatList
149  _constParamList->remove(*par) ;
150  _floatParamList->add(*par) ;
151  _initFloatParamList->addClone(*oldpar) ;
152  _initConstParamList->remove(*oldpar) ;
153  constStatChange=kTRUE ;
154  _nDim++ ;
155 
156  if (verbose) {
157  oocoutI(_context,Minimization) << "RooMinimizerFcn::synchronize: parameter "
158  << par->GetName() << " is now floating." << endl ;
159  }
160  }
161 
162  // Test if value changed
163  if (par->getVal()!= oldpar->getVal()) {
164  constValChange=kTRUE ;
165  if (verbose) {
166  oocoutI(_context,Minimization) << "RooMinimizerFcn::synchronize: value of constant parameter "
167  << par->GetName()
168  << " changed from " << oldpar->getVal() << " to "
169  << par->getVal() << endl ;
170  }
171  }
172 
173  }
174 
175  // Update reference list
177 
178  // Synchronize MINUIT with function state
179  // Handle floatParamList
180  for(index= 0; index < _floatParamList->getSize(); index++) {
181  RooRealVar *par= dynamic_cast<RooRealVar*>(_floatParamList->at(index)) ;
182 
183  if (!par) continue ;
184 
185  Double_t pstep(0) ;
186  Double_t pmin(0) ;
187  Double_t pmax(0) ;
188 
189  if(!par->isConstant()) {
190 
191  // Verify that floating parameter is indeed of type RooRealVar
192  if (!par->IsA()->InheritsFrom(RooRealVar::Class())) {
193  oocoutW(_context,Minimization) << "RooMinimizerFcn::fit: Error, non-constant parameter "
194  << par->GetName()
195  << " is not of type RooRealVar, skipping" << endl ;
196  _floatParamList->remove(*par);
197  index--;
198  _nDim--;
199  continue ;
200  }
201  // make sure the parameter are in dirty state to enable
202  // a real NLL computation when the minimizer calls the function the first time
203  // (see issue #7659)
204  par->setValueDirty();
205 
206  // Set the limits, if not infinite
207  if (par->hasMin() )
208  pmin = par->getMin();
209  if (par->hasMax() )
210  pmax = par->getMax();
211 
212  // Calculate step size
213  pstep = par->getError();
214  if(pstep <= 0) {
215  // Floating parameter without error estitimate
216  if (par->hasMin() && par->hasMax()) {
217  pstep= 0.1*(pmax-pmin);
218 
219  // Trim default choice of error if within 2 sigma of limit
220  if (pmax - par->getVal() < 2*pstep) {
221  pstep = (pmax - par->getVal())/2 ;
222  } else if (par->getVal() - pmin < 2*pstep) {
223  pstep = (par->getVal() - pmin )/2 ;
224  }
225 
226  // If trimming results in zero error, restore default
227  if (pstep==0) {
228  pstep= 0.1*(pmax-pmin);
229  }
230 
231  } else {
232  pstep=1 ;
233  }
234  if(verbose) {
235  oocoutW(_context,Minimization) << "RooMinimizerFcn::synchronize: WARNING: no initial error estimate available for "
236  << par->GetName() << ": using " << pstep << endl;
237  }
238  }
239  } else {
240  pmin = par->getVal() ;
241  pmax = par->getVal() ;
242  }
243 
244  // new parameter
245  if (index>=Int_t(parameters.size())) {
246 
247  if (par->hasMin() && par->hasMax()) {
248  parameters.push_back(ROOT::Fit::ParameterSettings(par->GetName(),
249  par->getVal(),
250  pstep,
251  pmin,pmax));
252  }
253  else {
254  parameters.push_back(ROOT::Fit::ParameterSettings(par->GetName(),
255  par->getVal(),
256  pstep));
257  if (par->hasMin() )
258  parameters.back().SetLowerLimit(pmin);
259  else if (par->hasMax() )
260  parameters.back().SetUpperLimit(pmax);
261  }
262 
263  continue;
264 
265  }
266 
267  Bool_t oldFixed = parameters[index].IsFixed();
268  Double_t oldVar = parameters[index].Value();
269  Double_t oldVerr = parameters[index].StepSize();
270  Double_t oldVlo = parameters[index].LowerLimit();
271  Double_t oldVhi = parameters[index].UpperLimit();
272 
273  if (par->isConstant() && !oldFixed) {
274 
275  // Parameter changes floating -> constant : update only value if necessary
276  if (oldVar!=par->getVal()) {
277  parameters[index].SetValue(par->getVal());
278  if (verbose) {
279  oocoutI(_context,Minimization) << "RooMinimizerFcn::synchronize: value of parameter "
280  << par->GetName() << " changed from " << oldVar
281  << " to " << par->getVal() << endl ;
282  }
283  }
284  parameters[index].Fix();
285  constStatChange=kTRUE ;
286  if (verbose) {
287  oocoutI(_context,Minimization) << "RooMinimizerFcn::synchronize: parameter "
288  << par->GetName() << " is now fixed." << endl ;
289  }
290 
291  } else if (par->isConstant() && oldFixed) {
292 
293  // Parameter changes constant -> constant : update only value if necessary
294  if (oldVar!=par->getVal()) {
295  parameters[index].SetValue(par->getVal());
296  constValChange=kTRUE ;
297 
298  if (verbose) {
299  oocoutI(_context,Minimization) << "RooMinimizerFcn::synchronize: value of fixed parameter "
300  << par->GetName() << " changed from " << oldVar
301  << " to " << par->getVal() << endl ;
302  }
303  }
304 
305  } else {
306  // Parameter changes constant -> floating
307  if (!par->isConstant() && oldFixed) {
308  parameters[index].Release();
309  constStatChange=kTRUE ;
310 
311  if (verbose) {
312  oocoutI(_context,Minimization) << "RooMinimizerFcn::synchronize: parameter "
313  << par->GetName() << " is now floating." << endl ;
314  }
315  }
316 
317  // Parameter changes constant -> floating : update all if necessary
318  if (oldVar!=par->getVal() || oldVlo!=pmin || oldVhi != pmax || oldVerr!=pstep) {
319  parameters[index].SetValue(par->getVal());
320  parameters[index].SetStepSize(pstep);
321  if (par->hasMin() && par->hasMax() )
322  parameters[index].SetLimits(pmin,pmax);
323  else if (par->hasMin() )
324  parameters[index].SetLowerLimit(pmin);
325  else if (par->hasMax() )
326  parameters[index].SetUpperLimit(pmax);
327  }
328 
329  // Inform user about changes in verbose mode
330  if (verbose) {
331  // if ierr<0, par was moved from the const list and a message was already printed
332 
333  if (oldVar!=par->getVal()) {
334  oocoutI(_context,Minimization) << "RooMinimizerFcn::synchronize: value of parameter "
335  << par->GetName() << " changed from " << oldVar << " to "
336  << par->getVal() << endl ;
337  }
338  if (oldVlo!=pmin || oldVhi!=pmax) {
339  oocoutI(_context,Minimization) << "RooMinimizerFcn::synchronize: limits of parameter "
340  << par->GetName() << " changed from [" << oldVlo << "," << oldVhi
341  << "] to [" << pmin << "," << pmax << "]" << endl ;
342  }
343 
344  // If oldVerr=0, then parameter was previously fixed
345  if (oldVerr!=pstep && oldVerr!=0) {
346  oocoutI(_context,Minimization) << "RooMinimizerFcn::synchronize: error/step size of parameter "
347  << par->GetName() << " changed from " << oldVerr << " to " << pstep << endl ;
348  }
349  }
350  }
351  }
352 
353  if (optConst) {
354  if (constStatChange) {
355 
357 
358  oocoutI(_context,Minimization) << "RooMinimizerFcn::synchronize: set of constant parameters changed, rerunning const optimizer" << endl ;
360  } else if (constValChange) {
361  oocoutI(_context,Minimization) << "RooMinimizerFcn::synchronize: constant parameter values changed, rerunning const optimizer" << endl ;
363  }
364 
366 
367  }
368 
369  return 0 ;
370 
371 }
372 
373 /// Modify PDF parameter error by ordinal index (needed by MINUIT)
375 {
376  static_cast<RooRealVar*>(_floatParamList->at(index))->setError(value);
377 }
378 
379 /// Modify PDF parameter error by ordinal index (needed by MINUIT)
381 {
382  static_cast<RooRealVar*>(_floatParamList->at(index))->removeAsymError();
383 }
384 
385 /// Modify PDF parameter error by ordinal index (needed by MINUIT)
387 {
388  static_cast<RooRealVar*>(_floatParamList->at(index))->setAsymError(loVal,hiVal);
389 }
390 
391 /// Transfer MINUIT fit results back into RooFit objects.
393 {
394  for (Int_t index= 0; index < _nDim; index++) {
395  Double_t value = results.Value(index);
396  SetPdfParamVal(index, value);
397 
398  // Set the parabolic error
399  Double_t err = results.Error(index);
400  SetPdfParamErr(index, err);
401 
402  Double_t eminus = results.LowerError(index);
403  Double_t eplus = results.UpperError(index);
404 
405  if(eplus > 0 || eminus < 0) {
406  // Store the asymmetric error, if it is available
407  SetPdfParamErr(index, eminus,eplus);
408  } else {
409  // Clear the asymmetric error
410  ClearPdfParamAsymErr(index) ;
411  }
412  }
413 }
414 
415 /// Change the file name for logging of a RooMinimizer of all MINUIT steppings
416 /// through the parameter space. If inLogfile is null, the current log file
417 /// is closed and logging is stopped.
418 Bool_t RooMinimizerFcn::SetLogFile(const char* inLogfile)
419 {
420  if (_logfile) {
421  oocoutI(_context,Minimization) << "RooMinimizerFcn::setLogFile: closing previous log file" << endl ;
422  _logfile->close() ;
423  delete _logfile ;
424  _logfile = 0 ;
425  }
426  _logfile = new ofstream(inLogfile) ;
427  if (!_logfile->good()) {
428  oocoutI(_context,Minimization) << "RooMinimizerFcn::setLogFile: cannot open file " << inLogfile << endl ;
429  _logfile->close() ;
430  delete _logfile ;
431  _logfile= 0;
432  }
433 
434  return kFALSE ;
435 }
436 
437 /// Apply results of given external covariance matrix. i.e. propagate its errors
438 /// to all RRV parameter representations and give this matrix instead of the
439 /// HESSE matrix at the next save() call
441 {
442  for (Int_t i=0 ; i<_nDim ; i++) {
443  // Skip fixed parameters
444  if (_floatParamList->at(i)->isConstant()) {
445  continue ;
446  }
447  SetPdfParamErr(i, sqrt(V(i,i))) ;
448  }
449 
450 }
451 
452 /// Set value of parameter i.
453 Bool_t RooMinimizerFcn::SetPdfParamVal(int index, double value) const
454 {
455  auto par = static_cast<RooRealVar*>(&(*_floatParamList)[index]);
456 
457  if (par->getVal()!=value) {
458  if (_verbose) cout << par->GetName() << "=" << value << ", " ;
459 
460  par->setVal(value);
461  return kTRUE;
462  }
463 
464  return kFALSE;
465 }
466 
467 
468 /// Print information about why evaluation failed.
469 /// Using _printEvalErrors, the number of errors printed can be steered.
470 /// Negative values disable printing.
472  if (_printEvalErrors < 0)
473  return;
474 
475  std::ostringstream msg;
476  if (_doEvalErrorWall) {
477  msg << "RooMinimizerFcn: Minimized function has error status." << endl
478  << "Returning maximum FCN so far (" << _maxFCN
479  << ") to force MIGRAD to back out of this region. Error log follows.\n";
480  } else {
481  msg << "RooMinimizerFcn: Minimized function has error status but is ignored.\n";
482  }
483 
484  msg << "Parameter values: " ;
485  for (const auto par : *_floatParamList) {
486  auto var = static_cast<const RooRealVar*>(par);
487  msg << "\t" << var->GetName() << "=" << var->getVal() ;
488  }
489  msg << std::endl;
490 
492  ooccoutW(_context,Minimization) << msg.str() << endl;
493 }
494 
495 
496 /// Evaluate function given the parameters in `x`.
497 double RooMinimizerFcn::DoEval(const double *x) const {
498 
499  // Set the parameter values for this iteration
500  for (int index = 0; index < _nDim; index++) {
501  if (_logfile) (*_logfile) << x[index] << " " ;
502  SetPdfParamVal(index,x[index]);
503  }
504 
505  // Calculate the function for these parameters
507  double fvalue = _funct->getVal();
509 
510  if (!std::isfinite(fvalue) || RooAbsReal::numEvalErrors() > 0 || fvalue > 1e30) {
511  printEvalErrors();
513  _numBadNLL++ ;
514 
515  if (_doEvalErrorWall) {
516  const double badness = RooNaNPacker::unpackNaN(fvalue);
517  fvalue = (std::isfinite(_maxFCN) ? _maxFCN : 0.) + _recoverFromNaNStrength * badness;
518  }
519  } else {
520  if (_evalCounter > 0 && _evalCounter == _numBadNLL) {
521  // This is the first time we get a valid function value; while before, the
522  // function was always invalid. For invalid cases, we returned values > 0.
523  // Now, we offset valid values such that they are < 0.
524  _funcOffset = -fvalue;
525  }
526  fvalue += _funcOffset;
527  _maxFCN = std::max(fvalue, _maxFCN);
528  }
529 
530  // Optional logging
531  if (_logfile)
532  (*_logfile) << setprecision(15) << fvalue << setprecision(4) << endl;
533  if (_verbose) {
534  cout << "\nprevFCN" << (_funct->isOffsetting()?"-offset":"") << " = " << setprecision(10)
535  << fvalue << setprecision(4) << " " ;
536  cout.flush() ;
537  }
538 
539  _evalCounter++ ;
540 
541  return fvalue;
542 }
543 
544 #endif
TGeant4Unit::eplus
static constexpr double eplus
Definition: TGeant4SystemOfUnits.h:170
RooFit::Minimization
@ Minimization
Definition: RooGlobalFunc.h:60
RooMinimizerFcn::_constParamList
RooArgList * _constParamList
Definition: RooMinimizerFcn.h:98
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:100
RooAbsReal::printEvalErrors
static void printEvalErrors(std::ostream &os=std::cout, Int_t maxPerNode=10000000)
Print all outstanding logged evaluation error on the given ostream.
Definition: RooAbsReal.cxx:3835
RooAbsReal::setEvalErrorLoggingMode
static void setEvalErrorLoggingMode(ErrorLoggingMode m)
Set evaluation error logging mode.
Definition: RooAbsReal.cxx:4848
RooAbsArg::ValueChange
@ ValueChange
Definition: RooAbsArg.h:388
RooMinimizerFcn::_doEvalErrorWall
bool _doEvalErrorWall
Definition: RooMinimizerFcn.h:103
RooMinimizerFcn::RooMinimizerFcn
RooMinimizerFcn(RooAbsReal *funct, RooMinimizer *context, bool verbose=false)
Definition: RooMinimizerFcn.cxx:41
RooMsgService.h
RooMinimizerFcn::_evalCounter
int _evalCounter
Definition: RooMinimizerFcn.h:94
RooAbsArg::ConfigChange
@ ConfigChange
Definition: RooAbsArg.h:388
RooAbsRealLValue::getMax
virtual Double_t getMax(const char *name=0) const
Get maximum of currently defined range.
Definition: RooAbsRealLValue.h:89
RooMinimizerFcn::_recoverFromNaNStrength
double _recoverFromNaNStrength
Definition: RooMinimizerFcn.h:91
oocoutI
#define oocoutI(o, a)
Definition: RooMsgService.h:45
RooAbsArg::getParameters
RooArgSet * getParameters(const RooAbsData *data, bool stripDisconnected=true) const
Create a list of leaf nodes in the arg tree starting with ourself as top node that don't match any of...
Definition: RooAbsArg.cxx:578
ooccoutW
#define ooccoutW(o, a)
Definition: RooMsgService.h:55
RooArgSet.h
RooMinimizerFcn::SetLogFile
Bool_t SetLogFile(const char *inLogfile)
Change the file name for logging of a RooMinimizer of all MINUIT steppings through the parameter spac...
Definition: RooMinimizerFcn.cxx:418
RooMinimizerFcn::printEvalErrors
void printEvalErrors() const
Print information about why evaluation failed.
Definition: RooMinimizerFcn.cxx:471
RooAbsReal::CollectErrors
@ CollectErrors
Definition: RooAbsReal.h:325
RooArgList
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgList.h:21
RooMinimizerFcn::SetPdfParamErr
void SetPdfParamErr(Int_t index, Double_t value)
Modify PDF parameter error by ordinal index (needed by MINUIT)
Definition: RooMinimizerFcn.cxx:374
RooMinimizerFcn::_context
const RooMinimizer * _context
Definition: RooMinimizerFcn.h:87
RooAbsReal::getVal
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
Definition: RooAbsReal.h:91
RooAbsArg.h
Int_t
int Int_t
Definition: RtypesCore.h:45
RooAbsCollection::remove
virtual Bool_t remove(const RooAbsArg &var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
Remove the specified argument from our list.
Definition: RooAbsCollection.cxx:585
x
Double_t x[n]
Definition: legend1.C:17
RooMinimizerFcn::_numBadNLL
int _numBadNLL
Definition: RooMinimizerFcn.h:92
TClass.h
RooAbsReal
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:61
RooMinimizerFcn::_initFloatParamList
RooArgList * _initFloatParamList
Definition: RooMinimizerFcn.h:99
TMatrixTSym< Double_t >
RooArgList::at
RooAbsArg * at(Int_t idx) const
Return object at given index, or nullptr if index is out of range.
Definition: RooArgList.h:72
RooAbsReal::isOffsetting
virtual Bool_t isOffsetting() const
Definition: RooAbsReal.h:368
RooAbsRealLValue::hasMax
Bool_t hasMax(const char *name=0) const
Check if variable has an upper bound.
Definition: RooAbsRealLValue.h:100
RooMinimizerFcn::_nDim
int _nDim
Definition: RooMinimizerFcn.h:95
RooMinimizerFcn::~RooMinimizerFcn
virtual ~RooMinimizerFcn()
Definition: RooMinimizerFcn.cxx:111
RooMinimizerFcn::SetPdfParamVal
Bool_t SetPdfParamVal(int index, double value) const
Set value of parameter i.
Definition: RooMinimizerFcn.cxx:453
RooMinimizerFcn::BackProp
void BackProp(const ROOT::Fit::FitResult &results)
Transfer MINUIT fit results back into RooFit objects.
Definition: RooMinimizerFcn.cxx:392
TObject::InheritsFrom
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition: TObject.cxx:445
RooMinimizerFcn::_maxFCN
double _maxFCN
Definition: RooMinimizerFcn.h:89
RooAbsReal::clearEvalErrorLog
static void clearEvalErrorLog()
Clear the stack of evaluation error messages.
Definition: RooAbsReal.cxx:3795
RooMinimizerFcn::_funcOffset
double _funcOffset
Definition: RooMinimizerFcn.h:90
bool
RooAbsRealLValue::getMin
virtual Double_t getMin(const char *name=0) const
Get miniminum of currently defined range.
Definition: RooAbsRealLValue.h:86
TMatrixDSym.h
RooMinimizerFcn
RooMinimizerFcn is an interface to the ROOT::Math::IBaseFunctionMultiDim, a function that ROOT's mini...
Definition: RooMinimizerFcn.h:33
RooMinimizerFcn::ApplyCovarianceMatrix
void ApplyCovarianceMatrix(TMatrixDSym &V)
Apply results of given external covariance matrix.
Definition: RooMinimizerFcn.cxx:440
RooAbsCollection::setName
void setName(const char *name)
Definition: RooAbsCollection.h:282
RooMinimizerFcn::Clone
virtual ROOT::Math::IBaseFunctionMultiDim * Clone() const
Clone a function.
Definition: RooMinimizerFcn.cxx:120
RooMinimizerFcn::_floatParamList
RooArgList * _floatParamList
Definition: RooMinimizerFcn.h:97
RooRealVar::getError
Double_t getError() const
Definition: RooRealVar.h:60
RooMinimizerFcn::_logfile
std::ofstream * _logfile
Definition: RooMinimizerFcn.h:102
RooNaNPacker.h
RooMinimizerFcn::_funct
RooAbsReal * _funct
Definition: RooMinimizerFcn.h:86
RooAbsPdf.h
Double_t
RooAbsReal::setHideOffset
static void setHideOffset(Bool_t flag)
Definition: RooAbsReal.cxx:122
RooAbsCollection::addClone
virtual RooAbsArg * addClone(const RooAbsArg &var, Bool_t silent=kFALSE)
Add a clone of the specified argument to list.
Definition: RooAbsCollection.cxx:428
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:101
ROOT::Fit::FitResult::LowerError
double LowerError(unsigned int i) const
lower Minos error. If Minos has not run for parameter i return the parabolic error
Definition: FitResult.cxx:376
ROOT::Fit::FitResult
class containg the result of the fit and all the related information (fitted parameter values,...
Definition: FitResult.h:47
RooMinimizerFcn::_initConstParamList
RooArgList * _initConstParamList
Definition: RooMinimizerFcn.h:100
RooAbsCollection::add
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
Definition: RooAbsCollection.cxx:455
RooAbsCollection::size
Storage_t::size_type size() const
Definition: RooAbsCollection.h:214
double
double
Definition: Converters.cxx:939
sqrt
double sqrt(double)
RooAbsArg::constOptimizeTestStatistic
virtual void constOptimizeTestStatistic(ConstOpCode opcode, Bool_t doAlsoTrackingOpt=kTRUE)
Interface function signaling a request to perform constant term optimization.
Definition: RooAbsArg.cxx:1804
oocoutW
#define oocoutW(o, a)
Definition: RooMsgService.h:47
RooRealVar.h
ROOT::Math::IBaseFunctionMultiDim
IBaseFunctionMultiDimTempl< double > IBaseFunctionMultiDim
Definition: IFunctionfwd.h:31
RooMinimizerFcn::ClearPdfParamAsymErr
void ClearPdfParamAsymErr(Int_t index)
Modify PDF parameter error by ordinal index (needed by MINUIT)
Definition: RooMinimizerFcn.cxx:380
RooMinimizerFcn.h
RooNaNPacker::unpackNaN
static float unpackNaN(double val)
If val is NaN and a this NaN has been tagged as containing a payload, unpack the float from the manti...
Definition: RooNaNPacker.h:122
ROOT::Fit::ParameterSettings
Class, describing value, limits and step size of the parameters Provides functionality also to set/re...
Definition: ParameterSettings.h:36
RooMinimizerFcn::_verbose
bool _verbose
Definition: RooMinimizerFcn.h:104
RooAbsRealLValue::hasMin
Bool_t hasMin(const char *name=0) const
Check if variable has a lower bound.
Definition: RooAbsRealLValue.h:98
RooMinimizer.h
RooMinimizerFcn::Synchronize
Bool_t Synchronize(std::vector< ROOT::Fit::ParameterSettings > &parameters, Bool_t optConst, Bool_t verbose)
Internal function to synchronize TMinimizer with current information in RooAbsReal function parameter...
Definition: RooMinimizerFcn.cxx:128
ROOT::Fit::FitResult::UpperError
double UpperError(unsigned int i) const
upper Minos error. If Minos has not run for parameter i return the parabolic error
Definition: FitResult.cxx:383
RooMinimizerFcn::DoEval
virtual double DoEval(const double *x) const
Evaluate function given the parameters in x.
Definition: RooMinimizerFcn.cxx:497
genreflex::verbose
bool verbose
Definition: rootcling_impl.cxx:133
RooAbsArg
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
Definition: RooAbsArg.h:72
RooAbsArg::setValueDirty
void setValueDirty()
Mark the element dirty. This forces a re-evaluation when a value is requested.
Definition: RooAbsArg.h:490
TNamed::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
ROOT::Math::IBaseFunctionMultiDimTempl< double >
RooAbsReal::numEvalErrors
static Int_t numEvalErrors()
Return the number of logged evaluation errors since the last clearing.
Definition: RooAbsReal.cxx:3877
ROOT::Fit::FitResult::Error
double Error(unsigned int i) const
parameter error by index
Definition: FitResult.h:186
RooAbsReal::PrintErrors
@ PrintErrors
Definition: RooAbsReal.h:325
Class
void Class()
Definition: Class.C:29
RooRealVar
RooRealVar represents a variable that can be changed from the outside.
Definition: RooRealVar.h:39
RooAbsRealLValue.h
RooAbsCollection::selectByAttrib
RooAbsCollection * selectByAttrib(const char *name, Bool_t value) const
Create a subset of the current collection, consisting only of those elements with the specified attri...
Definition: RooAbsCollection.cxx:678
RooMinimizer
RooMinimizer is a wrapper class around ROOT::Fit:Fitter that provides a seamless interface between th...
Definition: RooMinimizer.h:40
ROOT::Fit::FitResult::Value
double Value(unsigned int i) const
parameter value by index
Definition: FitResult.h:179
ROOT
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Definition: EExecutionPolicy.hxx:4
RooAbsArg::isConstant
Bool_t isConstant() const
Check if the "Constant" attribute is set.
Definition: RooAbsArg.h:362
RooAbsCollection::sort
void sort(Bool_t reverse=false)
Sort collection using std::sort and name comparison.
Definition: RooAbsCollection.cxx:1435
Math
Namespace for new Math classes and functions.
RooAbsCollection::getSize
Int_t getSize() const
Definition: RooAbsCollection.h:231
RooArgSet
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:33
RooAbsCollection::snapshot
RooAbsCollection * snapshot(Bool_t deepCopy=kTRUE) const
Take a snap shot of current collection contents.
Definition: RooAbsCollection.cxx:215
RooMinimizerFcn::_printEvalErrors
int _printEvalErrors
Definition: RooMinimizerFcn.h:93
int