Logo ROOT   6.10/09
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 
31 class RooMinimizer;
32 
34 
35  public:
36 
37  RooMinimizerFcn(RooAbsReal *funct, RooMinimizer *context,
38  bool verbose = false);
39  RooMinimizerFcn(const RooMinimizerFcn& other);
40  virtual ~RooMinimizerFcn();
41 
43  virtual unsigned int NDim() const { return _nDim; }
44 
49 
50  void SetEvalErrorWall(Bool_t flag) { _doEvalErrorWall = flag ; }
51  void SetPrintEvalErrors(Int_t numEvalErrors) { _printEvalErrors = numEvalErrors ; }
52  Bool_t SetLogFile(const char* inLogfile);
53  std::ofstream* GetLogFile() { return _logfile; }
54  void SetVerbose(Bool_t flag=kTRUE) { _verbose = flag ; }
55 
56  Double_t& GetMaxFCN() { return _maxFCN; }
58 
59  Bool_t Synchronize(std::vector<ROOT::Fit::ParameterSettings>& parameters,
60  Bool_t optConst, Bool_t verbose);
61  void BackProp(const ROOT::Fit::FitResult &results);
63 
64  Int_t evalCounter() const { return _evalCounter ; }
65  void zeroEvalCount() { _evalCounter = 0 ; }
66 
67 
68  private:
69 
72  void SetPdfParamErr(Int_t index, Double_t value);
73  void ClearPdfParamAsymErr(Int_t index);
74  void SetPdfParamErr(Int_t index, Double_t loVal, Double_t hiVal);
75 
76  inline Bool_t SetPdfParamVal(const Int_t &index, const Double_t &value) const;
77 
78 
79  virtual double DoEval(const double * x) const;
80  void updateFloatVec() ;
81 
82 private:
83 
84  mutable Int_t _evalCounter ;
85 
88 
89  mutable double _maxFCN;
90  mutable int _numBadNLL;
91  mutable int _printEvalErrors;
93 
94  int _nDim;
95  std::ofstream *_logfile;
96  bool _verbose;
97 
99  std::vector<RooAbsArg*> _floatParamVec ;
103 
104 };
105 
106 #endif
107 #endif
RooMinimizerFcn(RooAbsReal *funct, RooMinimizer *context, bool verbose=false)
Int_t GetNumInvalidNLL()
std::ofstream * GetLogFile()
Bool_t SetLogFile(const char *inLogfile)
std::ofstream * _logfile
void BackProp(const ROOT::Fit::FitResult &results)
RooAbsReal * _funct
RooArgList * _initConstParamList
virtual double DoEval(const double *x) const
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual ROOT::Math::IBaseFunctionMultiDim * Clone() const
Clone a function.
RooArgList * GetInitConstParamList()
void SetPdfParamErr(Int_t index, Double_t value)
virtual unsigned int NDim() const
Retrieve the dimension of the function.
RooArgList * _floatParamList
RooArgList * _initFloatParamList
Double_t x[n]
Definition: legend1.C:17
void SetVerbose(Bool_t flag=kTRUE)
RooArgList * _constParamList
void ApplyCovarianceMatrix(TMatrixDSym &V)
void SetEvalErrorWall(Bool_t flag)
Double_t GetPdfParamErr(Int_t index)
Documentation for the abstract class IBaseFunctionMultiDim.
Definition: IFunction.h:62
RooArgList * GetConstParamList()
Bool_t Synchronize(std::vector< ROOT::Fit::ParameterSettings > &parameters, Bool_t optConst, Bool_t verbose)
bool verbose
RooMinimizer * _context
void SetPrintEvalErrors(Int_t numEvalErrors)
void ClearPdfParamAsymErr(Int_t index)
class containg the result of the fit and all the related information (fitted parameter values...
Definition: FitResult.h:48
double Double_t
Definition: RtypesCore.h:55
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:53
RooArgList * GetInitFloatParamList()
Int_t evalCounter() const
Double_t & GetMaxFCN()
RooArgList * GetFloatParamList()
Double_t GetPdfParamVal(Int_t index)
virtual ~RooMinimizerFcn()
RooMinimizer is a wrapper class around ROOT::Fit:Fitter that provides a seamless interface between th...
Definition: RooMinimizer.h:38
std::vector< RooAbsArg * > _floatParamVec
const Bool_t kTRUE
Definition: RtypesCore.h:91
Bool_t SetPdfParamVal(const Int_t &index, const Double_t &value) const