Logo ROOT  
Reference Guide
RooMinimizerFcn.h
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 #ifndef ROO_MINIMIZER_FCN
17 #define ROO_MINIMIZER_FCN
18 
19 #include "Math/IFunction.h"
20 #include "Fit/ParameterSettings.h"
21 #include "Fit/FitResult.h"
22 
23 #include "TMatrixDSym.h"
24 
25 #include "RooAbsReal.h"
26 #include "RooArgList.h"
27 
28 #include <iostream>
29 #include <fstream>
30 #include <vector>
31 
32 class RooMinimizer;
33 
35 
36  public:
37 
38  RooMinimizerFcn(RooAbsReal *funct, RooMinimizer *context,
39  bool verbose = false);
40  RooMinimizerFcn(const RooMinimizerFcn& other);
41  virtual ~RooMinimizerFcn();
42 
44  virtual unsigned int NDim() const { return _nDim; }
45 
50 
51  void SetEvalErrorWall(Bool_t flag) { _doEvalErrorWall = flag ; }
52  void SetPrintEvalErrors(Int_t numEvalErrors) { _printEvalErrors = numEvalErrors ; }
53  Bool_t SetLogFile(const char* inLogfile);
54  std::ofstream* GetLogFile() { return _logfile; }
55  void SetVerbose(Bool_t flag=kTRUE) { _verbose = flag ; }
56 
57  Double_t& GetMaxFCN() { return _maxFCN; }
59 
60  Bool_t Synchronize(std::vector<ROOT::Fit::ParameterSettings>& parameters,
61  Bool_t optConst, Bool_t verbose);
62  void BackProp(const ROOT::Fit::FitResult &results);
64 
65  Int_t evalCounter() const { return _evalCounter ; }
66  void zeroEvalCount() { _evalCounter = 0 ; }
67 
68 
69  private:
70 
73  void SetPdfParamErr(Int_t index, Double_t value);
74  void ClearPdfParamAsymErr(Int_t index);
75  void SetPdfParamErr(Int_t index, Double_t loVal, Double_t hiVal);
76 
77  inline Bool_t SetPdfParamVal(const Int_t &index, const Double_t &value) const;
78 
79 
80  virtual double DoEval(const double * x) const;
81  void updateFloatVec() ;
82 
83 private:
84 
85  mutable Int_t _evalCounter ;
86 
89 
90  mutable double _maxFCN;
91  mutable int _numBadNLL;
92  mutable int _printEvalErrors;
94 
95  int _nDim;
96  std::ofstream *_logfile;
97  bool _verbose;
98 
100  std::vector<RooAbsArg*> _floatParamVec ;
104 
105 };
106 
107 #endif
108 #endif
RooMinimizerFcn::SetPrintEvalErrors
void SetPrintEvalErrors(Int_t numEvalErrors)
Definition: RooMinimizerFcn.h:52
RooMinimizerFcn::_constParamList
RooArgList * _constParamList
Definition: RooMinimizerFcn.h:101
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
RooAbsReal.h
RooMinimizerFcn::RooMinimizerFcn
RooMinimizerFcn(RooAbsReal *funct, RooMinimizer *context, bool verbose=false)
Definition: RooMinimizerFcn.cxx:43
IFunction.h
RooMinimizerFcn::SetLogFile
Bool_t SetLogFile(const char *inLogfile)
Definition: RooMinimizerFcn.cxx:444
RooMinimizerFcn::GetLogFile
std::ofstream * GetLogFile()
Definition: RooMinimizerFcn.h:54
RooArgList
Definition: RooArgList.h:21
RooMinimizerFcn::GetFloatParamList
RooArgList * GetFloatParamList()
Definition: RooMinimizerFcn.h:46
RooMinimizerFcn::SetPdfParamErr
void SetPdfParamErr(Int_t index, Double_t value)
Definition: RooMinimizerFcn.cxx:393
x
Double_t x[n]
Definition: legend1.C:17
RooMinimizerFcn::_numBadNLL
int _numBadNLL
Definition: RooMinimizerFcn.h:91
RooAbsReal
Definition: RooAbsReal.h:61
RooMinimizerFcn::_initFloatParamList
RooArgList * _initFloatParamList
Definition: RooMinimizerFcn.h:102
RooMinimizerFcn::GetNumInvalidNLL
Int_t GetNumInvalidNLL()
Definition: RooMinimizerFcn.h:58
TMatrixTSym
Definition: TMatrixDSymfwd.h:22
RooMinimizerFcn::_nDim
int _nDim
Definition: RooMinimizerFcn.h:95
RooMinimizerFcn::~RooMinimizerFcn
virtual ~RooMinimizerFcn()
Definition: RooMinimizerFcn.cxx:117
RooMinimizerFcn::GetMaxFCN
Double_t & GetMaxFCN()
Definition: RooMinimizerFcn.h:57
RooMinimizerFcn::BackProp
void BackProp(const ROOT::Fit::FitResult &results)
Definition: RooMinimizerFcn.cxx:418
RooMinimizerFcn::GetPdfParamVal
Double_t GetPdfParamVal(Int_t index)
Definition: RooMinimizerFcn.cxx:379
RooMinimizerFcn::_maxFCN
double _maxFCN
Definition: RooMinimizerFcn.h:90
bool
RooMinimizerFcn::GetInitFloatParamList
RooArgList * GetInitFloatParamList()
Definition: RooMinimizerFcn.h:48
TMatrixDSym.h
RooMinimizerFcn
Definition: RooMinimizerFcn.h:34
RooMinimizerFcn::ApplyCovarianceMatrix
void ApplyCovarianceMatrix(TMatrixDSym &V)
Definition: RooMinimizerFcn.cxx:469
RooMinimizerFcn::Clone
virtual ROOT::Math::IBaseFunctionMultiDim * Clone() const
Definition: RooMinimizerFcn.cxx:126
RooMinimizerFcn::_floatParamList
RooArgList * _floatParamList
Definition: RooMinimizerFcn.h:99
RooMinimizerFcn::_doEvalErrorWall
Bool_t _doEvalErrorWall
Definition: RooMinimizerFcn.h:93
RooMinimizerFcn::_logfile
std::ofstream * _logfile
Definition: RooMinimizerFcn.h:96
RooMinimizerFcn::_funct
RooAbsReal * _funct
Definition: RooMinimizerFcn.h:87
RooMinimizerFcn::evalCounter
Int_t evalCounter() const
Definition: RooMinimizerFcn.h:65
RooMinimizerFcn::SetPdfParamVal
Bool_t SetPdfParamVal(const Int_t &index, const Double_t &value) const
Definition: RooMinimizerFcn.cxx:486
ROOT::Fit::FitResult
class containg the result of the fit and all the related information (fitted parameter values,...
Definition: FitResult.h:52
RooMinimizerFcn::_initConstParamList
RooArgList * _initConstParamList
Definition: RooMinimizerFcn.h:103
RooMinimizerFcn::SetEvalErrorWall
void SetEvalErrorWall(Bool_t flag)
Definition: RooMinimizerFcn.h:51
RooMinimizerFcn::GetInitConstParamList
RooArgList * GetInitConstParamList()
Definition: RooMinimizerFcn.h:49
RooMinimizerFcn::ClearPdfParamAsymErr
void ClearPdfParamAsymErr(Int_t index)
Definition: RooMinimizerFcn.cxx:402
RooMinimizerFcn::zeroEvalCount
void zeroEvalCount()
Definition: RooMinimizerFcn.h:66
RooMinimizerFcn::_verbose
bool _verbose
Definition: RooMinimizerFcn.h:97
RooMinimizerFcn::GetConstParamList
RooArgList * GetConstParamList()
Definition: RooMinimizerFcn.h:47
Double_t
double Double_t
Definition: RtypesCore.h:59
RooMinimizerFcn::updateFloatVec
void updateFloatVec()
Definition: RooMinimizerFcn.cxx:505
RooMinimizerFcn::Synchronize
Bool_t Synchronize(std::vector< ROOT::Fit::ParameterSettings > &parameters, Bool_t optConst, Bool_t verbose)
Definition: RooMinimizerFcn.cxx:132
RooMinimizerFcn::DoEval
virtual double DoEval(const double *x) const
Implementation of the evaluation function.
Definition: RooMinimizerFcn.cxx:519
RooMinimizerFcn::_evalCounter
Int_t _evalCounter
Definition: RooMinimizerFcn.h:85
RooMinimizerFcn::_context
RooMinimizer * _context
Definition: RooMinimizerFcn.h:88
RooMinimizerFcn::NDim
virtual unsigned int NDim() const
Definition: RooMinimizerFcn.h:44
genreflex::verbose
bool verbose
Definition: rootcling_impl.cxx:133
ParameterSettings.h
FitResult.h
ROOT::Math::IBaseFunctionMultiDimTempl< double >
RooMinimizerFcn::_floatParamVec
std::vector< RooAbsArg * > _floatParamVec
Definition: RooMinimizerFcn.h:100
RooArgList.h
RooMinimizer
Definition: RooMinimizer.h:40
RooMinimizerFcn::GetPdfParamErr
Double_t GetPdfParamErr(Int_t index)
Definition: RooMinimizerFcn.cxx:386
RooMinimizerFcn::_printEvalErrors
int _printEvalErrors
Definition: RooMinimizerFcn.h:92
int
RooMinimizerFcn::SetVerbose
void SetVerbose(Bool_t flag=kTRUE)
Definition: RooMinimizerFcn.h:55