GooFit  v2.1.3
Public Member Functions | List of all members
GooFit::FitManagerMinuit1 Class Reference

#include <FitManagerMinuit1.h>

Public Member Functions

 FitManagerMinuit1 (PdfBase *dat)
 
void setMaxCalls (double mxc)
 
void useHesseBefore (bool use=true)
 
void useHesse (bool use=true)
 
void useMinos (bool use=true)
 
void useImprove (bool use=true)
 
void setVerbosity (int v)
 
 operator bool () const
 
 operator int () const
 
void fit ()
 
Minuit1getMinuitObject ()
 
void getMinuitStatus (double &fmin, double &fedm, double &errdef, int &npari, int &nparx, int &istat)
 

Detailed Description

Definition at line 30 of file FitManagerMinuit1.h.

Constructor & Destructor Documentation

◆ FitManagerMinuit1()

GooFit::FitManagerMinuit1::FitManagerMinuit1 ( PdfBase dat)
inline

Definition at line 32 of file FitManagerMinuit1.h.

33  : minuit_(dat) {}

Member Function Documentation

◆ fit()

void GooFit::FitManagerMinuit1::fit ( )

Definition at line 65 of file FitManagerMinuit1.cpp.

References GooFit::bold, GooFit::gray, GooFit::host_callnumber, and GooFit::reset.

Referenced by main(), make1BinSigmaMap(), make4BinSigmaMap(), makeOverallSignal(), makeSigmaMap(), runBackgroundDalitzFit(), runBackgroundSigmaFit(), runCanonicalFit(), runEfficiencyFit(), runGeneratedMCFit(), runSigmaFit(), runToyFit(), and runTruthMCFit().

65  {
66  host_callnumber = 0;
67 
68  for(Variable &var : minuit_.getVaraibles())
69  var.setChanged(true);
70 
71  std::cout << GooFit::gray << GooFit::bold;
72 
73  if(0 < overrideCallLimit) {
74  std::cout << "Calling MIGRAD with call limit " << overrideCallLimit << std::endl;
75  double plist[1] = {overrideCallLimit};
76  int err = 0;
77 
78  if(_useHesseBefore)
79  minuit_.mnexcm("HESSE", plist, 1, err);
80 
81  minuit_.mnexcm("MIGRAD", plist, 1, err);
82 
83  if(_useHesse)
84  minuit_.mnexcm("HESSE", plist, 1, err);
85 
86  if(_useMinos)
87  minuit_.mnexcm("MINOS", plist, 1, err);
88 
89  if(_useImprove)
90  minuit_.mnexcm("IMPROVE", plist, 1, err);
91  } else
92  minuit_.Migrad();
93 
94  std::cout << GooFit::reset;
95 
96  double tmp_value, tmp_error;
97  for(Variable &var : minuit_.getVaraibles()) {
98  minuit_.GetParameter(var.getFitterIndex(), tmp_value, tmp_error);
99  var.setValue(tmp_value);
100  var.setError(tmp_error);
101  }
102 }
constexpr rang::style const bold
Definition: Color.h:17
constexpr rang::style const reset
Definition: Color.h:16
std::vector< Variable > getVaraibles() const
constexpr rang::fg const gray
Definition: Color.h:15
int host_callnumber
Definition: PdfBase.cpp:33

◆ getMinuitObject()

Minuit1* GooFit::FitManagerMinuit1::getMinuitObject ( )
inline

Definition at line 48 of file FitManagerMinuit1.h.

48 { return &minuit_; }

◆ getMinuitStatus()

void GooFit::FitManagerMinuit1::getMinuitStatus ( double &  fmin,
double &  fedm,
double &  errdef,
int &  npari,
int &  nparx,
int &  istat 
)

Definition at line 104 of file FitManagerMinuit1.cpp.

105  {
106  minuit_.mnstat(fmin, fedm, errdef, npari, nparx, istat);
107  std::cout << "mnstat(fmin = " << fmin << ", fedm = " << fedm << ", errdef = " << errdef << ", npari = " << npari
108  << ", nparx = " << nparx << ", istat = " << istat << ")" << std::endl;
109 }

◆ operator bool()

GooFit::FitManagerMinuit1::operator bool ( ) const
inline

Definition at line 42 of file FitManagerMinuit1.h.

42 { return minuit_.GetStatus() == 0; }

◆ operator int()

GooFit::FitManagerMinuit1::operator int ( ) const
inline

Definition at line 43 of file FitManagerMinuit1.h.

43 { return minuit_.GetStatus(); }

◆ setMaxCalls()

void GooFit::FitManagerMinuit1::setMaxCalls ( double  mxc)
inline

Definition at line 35 of file FitManagerMinuit1.h.

Referenced by runBackgroundDalitzFit(), runBackgroundSigmaFit(), runCanonicalFit(), runGeneratedMCFit(), and runToyFit().

35 { overrideCallLimit = mxc; }

◆ setVerbosity()

void GooFit::FitManagerMinuit1::setVerbosity ( int  v)
inline

Definition at line 40 of file FitManagerMinuit1.h.

40 { minuit_.SetPrintLevel(v - 1); }

◆ useHesse()

void GooFit::FitManagerMinuit1::useHesse ( bool  use = true)
inline

Definition at line 37 of file FitManagerMinuit1.h.

37 { _useHesse = use; }

◆ useHesseBefore()

void GooFit::FitManagerMinuit1::useHesseBefore ( bool  use = true)
inline

Definition at line 36 of file FitManagerMinuit1.h.

36 { _useHesseBefore = use; }

◆ useImprove()

void GooFit::FitManagerMinuit1::useImprove ( bool  use = true)
inline

Definition at line 39 of file FitManagerMinuit1.h.

39 { _useImprove = use; }

◆ useMinos()

void GooFit::FitManagerMinuit1::useMinos ( bool  use = true)
inline

Definition at line 38 of file FitManagerMinuit1.h.

38 { _useMinos = use; }

The documentation for this class was generated from the following files: