MINT2
MintFcn.h
Go to the documentation of this file.
1 #ifndef MINTFCN_HH
2 #define MINTFCN_HH
3 
4 #include <iomanip>
5 
6 #include "Minuit2/FCNBase.h"
7 
8 #include "Mint/IMinimisable.h"
9 
10 namespace MINT
11 {
12  class MintFcn : public ROOT::Minuit2::FCNBase
13  {
14  public:
18  MintFcn( IMinimisable* theFunction )
19  :_theFunction(theFunction)
20  {}
21 
25  virtual double operator()( const std::vector<double>& par ) const
26  {
27  for( unsigned int i=0; i<par.size(); ++i )
30 
31  const double negll = _theFunction->getVal()-_best_min;
32 
33  std::cout << std::setprecision(std::numeric_limits<double>::digits10);
34  std::cout << "-2logL = " << negll << std::endl;
35 
36  return negll;
37  }
38 
43  void SetBestMin( const double& best_min )
44  { _best_min += best_min; }
45 
46  private:
50  virtual double Up() const
51  { return _error_def; }
52 
54 
55  const double _error_def = 1.0;
56 
57  double _best_min = 0.0;
58  };
59 } //namespace MINT
60 
61 #endif //MINTFCN_HH
double _best_min
Definition: MintFcn.h:57
virtual double operator()(const std::vector< double > &par) const
Definition: MintFcn.h:25
IMinuitParameter * getParPtr(unsigned int i)
void SetBestMin(const double &best_min)
Definition: MintFcn.h:43
virtual double Up() const
Definition: MintFcn.h:50
IMinimisable * _theFunction
Definition: MintFcn.h:53
const double _error_def
Definition: MintFcn.h:55
virtual double getVal()=0
virtual MinuitParameterSet * getParSet()=0
virtual void parametersChanged()=0
virtual void setCurrentFitVal(double pval)=0
MintFcn(IMinimisable *theFunction)
Definition: MintFcn.h:18