GooFit  v2.1.3
FitManagerMinuit2.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <Minuit2/FunctionMinimum.h>
4 
5 #include <memory>
6 
8 #include <goofit/fitting/FCN.h>
9 
10 namespace GooFit {
11 
12 class PdfBase;
13 
14 enum class FitErrors : int { Valid = 0, NotRun = 50, InValid };
15 
17  public:
19 
21  ROOT::Minuit2::FunctionMinimum fit();
22 
24  void setMaxCalls(unsigned int max_calls = 0) { maxfcn_ = max_calls; }
25 
27  Params *getParams() { return &upar_; }
28 
30  FCN *getFCN() { return &fcn_; }
31 
33  operator bool() const { return retval_ == FitErrors::Valid; }
34 
36  operator int() const { return static_cast<int>(retval_); }
37 
39  void setVerbosity(int value) { verbosity = value; }
40 
42  int getVerbosity() const { return verbosity; }
43 
44  private:
45  Params upar_;
46  FCN fcn_;
47  unsigned int maxfcn_{0};
49  int verbosity{3};
50 };
51 } // namespace GooFit
Params * getParams()
Get a pointer to the params.
FCN * getFCN()
Get a pointer to the fcn.
int getVerbosity() const
Get the fitting verbosity.
void setVerbosity(int value)
Set the fitting verbosity.
void setMaxCalls(unsigned int max_calls=0)
Set the maximum number of calls. 0 for Minuit2 default.