CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes
fit::RootMinuit< Function > Class Template Reference

#include <RootMinuit.h>

Public Member Functions

void addParameter (const std::string &name, std::shared_ptr< double > val, double err, double min, double max)
 
void addParameter (const funct::Parameter &par, double err, double min, double max)
 
void fixParameter (const std::string &name)
 
template<unsigned int N>
void getErrorMatrix (ROOT::Math::SMatrix< double, N, N, ROOT::Math::MatRepSym< double, N > > &err)
 
double getParameter (const std::string &name, double &err)
 
double getParameter (const std::string &name)
 
double getParameterError (const std::string &name, double &val)
 
double getParameterError (const std::string &name)
 
double migrad ()
 
double minimize ()
 
double minValue ()
 
int numberOfFreeParameters ()
 
int numberOfParameters ()
 
void printFitResults (std::ostream &cout=std::cout)
 
void printParameters (std::ostream &cout=std::cout)
 
void releaseParameter (const std::string &name)
 
 RootMinuit (const Function &f, bool verbose=false)
 
void setParameter (const std::string &name, double val)
 
void setParameters ()
 

Private Member Functions

void init ()
 
size_t parameterIndex (const std::string &name) const
 

Static Private Member Functions

static void fcn_ (int &, double *, double &f, double *par, int)
 

Private Attributes

bool initialized_
 
std::unique_ptr< TMinuit > minuit_
 
double minValue_
 
std::map< std::string, size_t > parIndices_
 
parameterVector_t parMap_
 
std::vector< std::shared_ptr< double > > pars_
 
bool verbose_
 

Static Private Attributes

static Function f_
 
static std::vector< std::shared_ptr< double > > * fPars_ = nullptr
 

Detailed Description

template<class Function>
class fit::RootMinuit< Function >

Definition at line 21 of file RootMinuit.h.

Constructor & Destructor Documentation

◆ RootMinuit()

template<class Function>
fit::RootMinuit< Function >::RootMinuit ( const Function &  f,
bool  verbose = false 
)
inline

Definition at line 23 of file RootMinuit.h.

References f, and fit::RootMinuit< Function >::f_.

23  : initialized_(false), minValue_(0), verbose_(verbose) {
24  f_ = f;
25  }
double minValue_
Definition: RootMinuit.h:186
bool verbose
double f[11][100]
static Function f_
Definition: RootMinuit.h:191

Member Function Documentation

◆ addParameter() [1/2]

template<class Function>
void fit::RootMinuit< Function >::addParameter ( const std::string &  name,
std::shared_ptr< double >  val,
double  err,
double  min,
double  max 
)
inline

Definition at line 26 of file RootMinuit.h.

References edm::errors::Configuration, fit::parameter_t::err, submitPVResolutionJobs::err, Exception, fit::parameter_t::fixed, fit::RootMinuit< Function >::initialized_, fit::parameter_t::max, SiStripPI::max, fit::parameter_t::min, SiStripPI::min, Skims_PA_cff::name, fit::RootMinuit< Function >::parIndices_, fit::RootMinuit< Function >::parMap_, fit::RootMinuit< Function >::pars_, alignCSCRings::s, fit::parameter_t::val, and heppy_batch::val.

Referenced by metTools.AddMETCollection::__init__(), trackTools.MakeAODTrackCandidates::__init__(), coreTools.RunOnData::__init__(), runJetUncertainties.RunJetUncertainties::__init__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::__init__(), cmsswVersionTools.PickRelValInputFiles::__init__(), coreTools.RemoveMCMatching::__init__(), trackTools.MakePATTrackCandidates::__init__(), trigTools.SwitchOnTrigger::__init__(), trigTools.SwitchOnTriggerStandAlone::__init__(), tauTools.AddTauCollection::__init__(), trackTools.MakeTrackCandidates::__init__(), trigTools.SwitchOnTriggerMatching::__init__(), trigTools.SwitchOnTriggerMatchingStandAlone::__init__(), trigTools.SwitchOnTriggerMatchEmbedding::__init__(), jetTools.AddJetCollection::__init__(), jetTools.SwitchJetCollection::__init__(), jetTools.UpdateJetCollection::__init__(), jetTools.AddJetID::__init__(), jetTools.SetTagInfos::__init__(), fit::RootMinuitCommands< Function >::add(), and fit::RootMinuit< Function >::addParameter().

26  {
27  if (initialized_)
29  << "RootMinuit: can't add parameter " << name << " after minuit initialization\n";
30  pars_.push_back(val);
31  parameter_t par;
32  par.val = *val;
33  par.err = err;
34  par.min = min;
35  par.max = max;
36  par.fixed = false;
37  parMap_.push_back(std::make_pair(name, par));
38  size_t s = parIndices_.size();
39  parIndices_[name] = s;
40  }
std::vector< std::shared_ptr< double > > pars_
Definition: RootMinuit.h:188
std::map< std::string, size_t > parIndices_
Definition: RootMinuit.h:184
parameterVector_t parMap_
Definition: RootMinuit.h:183

◆ addParameter() [2/2]

template<class Function>
void fit::RootMinuit< Function >::addParameter ( const funct::Parameter par,
double  err,
double  min,
double  max 
)
inline

Definition at line 41 of file RootMinuit.h.

References fit::RootMinuit< Function >::addParameter(), submitPVResolutionJobs::err, SiStripPI::max, SiStripPI::min, and funct::Parameter::name().

Referenced by metTools.AddMETCollection::__init__(), trackTools.MakeAODTrackCandidates::__init__(), coreTools.RunOnData::__init__(), runJetUncertainties.RunJetUncertainties::__init__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::__init__(), cmsswVersionTools.PickRelValInputFiles::__init__(), coreTools.RemoveMCMatching::__init__(), trackTools.MakePATTrackCandidates::__init__(), trigTools.SwitchOnTrigger::__init__(), trigTools.SwitchOnTriggerStandAlone::__init__(), tauTools.AddTauCollection::__init__(), trackTools.MakeTrackCandidates::__init__(), trigTools.SwitchOnTriggerMatching::__init__(), trigTools.SwitchOnTriggerMatchingStandAlone::__init__(), trigTools.SwitchOnTriggerMatchEmbedding::__init__(), jetTools.AddJetCollection::__init__(), jetTools.SwitchJetCollection::__init__(), jetTools.UpdateJetCollection::__init__(), jetTools.AddJetID::__init__(), and jetTools.SetTagInfos::__init__().

41  {
42  return addParameter(par.name(), par, err, min, max);
43  }
const std::string & name() const
Definition: Parameter.h:12
void addParameter(const std::string &name, std::shared_ptr< double > val, double err, double min, double max)
Definition: RootMinuit.h:26

◆ fcn_()

template<class Function>
static void fit::RootMinuit< Function >::fcn_ ( int &  ,
double *  ,
double &  f,
double *  par,
int   
)
inlinestaticprivate

Definition at line 192 of file RootMinuit.h.

References fit::RootMinuitFuncEvaluator< Function >::evaluate(), f, fit::RootMinuit< Function >::f_, fit::RootMinuit< Function >::fPars_, mps_fire::i, and findQualityFiles::size.

Referenced by fit::RootMinuit< Function >::init().

192  {
193  size_t size = fPars_->size();
194  for (size_t i = 0; i < size; ++i)
195  *((*fPars_)[i]) = par[i];
197  }
size
Write out results.
double f[11][100]
static Function f_
Definition: RootMinuit.h:191
static std::vector< std::shared_ptr< double > > * fPars_
Definition: RootMinuit.h:189
static double evaluate(const Function &f)

◆ fixParameter()

template<class Function>
void fit::RootMinuit< Function >::fixParameter ( const std::string &  name)
inline

Definition at line 85 of file RootMinuit.h.

References mps_fire::i, fit::RootMinuit< Function >::initialized_, fit::RootMinuit< Function >::minuit_, Skims_PA_cff::name, fit::RootMinuit< Function >::parameterIndex(), and fit::RootMinuit< Function >::parMap_.

Referenced by fit::RootMinuitCommands< Function >::add(), and fit::RootMinuitCommands< Function >::run().

85  {
86  size_t i = parameterIndex(name);
87  parMap_[i].second.fixed = true;
88  if (initialized_) {
89  minuit_->FixParameter(i);
90  }
91  }
size_t parameterIndex(const std::string &name) const
Definition: RootMinuit.h:198
std::unique_ptr< TMinuit > minuit_
Definition: RootMinuit.h:187
parameterVector_t parMap_
Definition: RootMinuit.h:183

◆ getErrorMatrix()

template<class Function>
template<unsigned int N>
void fit::RootMinuit< Function >::getErrorMatrix ( ROOT::Math::SMatrix< double, N, N, ROOT::Math::MatRepSym< double, N > > &  err)
inline

Definition at line 69 of file RootMinuit.h.

References edm::errors::Configuration, MillePedeFileConverter_cfg::e, submitPVResolutionJobs::err, Exception, mps_fire::i, fit::RootMinuit< Function >::init(), dqmiolumiharvest::j, fit::RootMinuit< Function >::minuit_, N, fit::RootMinuit< Function >::numberOfParameters(), and fit::RootMinuit< Function >::setParameters().

69  {
70  init();
71  if (N != numberOfParameters())
73  << "RootMinuit: can't call getErrorMatrix passing an SMatrix of dimension " << N
74  << " while the number of parameters is " << numberOfParameters() << "\n";
75  double *e = new double[N * N];
76  minuit_->mnemat(e, numberOfParameters());
77  for (size_t i = 0; i < N; ++i) {
78  for (size_t j = 0; j <= i; ++j) {
79  err(i, j) = e[i + N * j];
80  }
81  }
82  delete[] e;
83  setParameters();
84  }
void setParameters()
Definition: RootMinuit.h:112
#define N
Definition: blowfish.cc:9
int numberOfParameters()
Definition: RootMinuit.h:121
std::unique_ptr< TMinuit > minuit_
Definition: RootMinuit.h:187

◆ getParameter() [1/2]

template<class Function>
double fit::RootMinuit< Function >::getParameter ( const std::string &  name,
double &  err 
)
inline

Definition at line 44 of file RootMinuit.h.

References submitPVResolutionJobs::err, fit::RootMinuit< Function >::init(), fit::RootMinuit< Function >::minuit_, Skims_PA_cff::name, fit::RootMinuit< Function >::parameterIndex(), and heppy_batch::val.

44  {
45  double val;
46  init();
47  minuit_->GetParameter(parameterIndex(name), val, err);
48  return val;
49  }
size_t parameterIndex(const std::string &name) const
Definition: RootMinuit.h:198
std::unique_ptr< TMinuit > minuit_
Definition: RootMinuit.h:187

◆ getParameter() [2/2]

template<class Function>
double fit::RootMinuit< Function >::getParameter ( const std::string &  name)
inline

Definition at line 50 of file RootMinuit.h.

References submitPVResolutionJobs::err, fit::RootMinuit< Function >::init(), fit::RootMinuit< Function >::minuit_, Skims_PA_cff::name, fit::RootMinuit< Function >::parameterIndex(), and heppy_batch::val.

50  {
51  double val, err;
52  init();
53  minuit_->GetParameter(parameterIndex(name), val, err);
54  return val;
55  }
size_t parameterIndex(const std::string &name) const
Definition: RootMinuit.h:198
std::unique_ptr< TMinuit > minuit_
Definition: RootMinuit.h:187

◆ getParameterError() [1/2]

template<class Function>
double fit::RootMinuit< Function >::getParameterError ( const std::string &  name,
double &  val 
)
inline

◆ getParameterError() [2/2]

template<class Function>
double fit::RootMinuit< Function >::getParameterError ( const std::string &  name)
inline

Definition at line 62 of file RootMinuit.h.

References submitPVResolutionJobs::err, fit::RootMinuit< Function >::init(), fit::RootMinuit< Function >::minuit_, Skims_PA_cff::name, fit::RootMinuit< Function >::parameterIndex(), and heppy_batch::val.

62  {
63  double val, err;
64  init();
65  minuit_->GetParameter(parameterIndex(name), val, err);
66  return err;
67  }
size_t parameterIndex(const std::string &name) const
Definition: RootMinuit.h:198
std::unique_ptr< TMinuit > minuit_
Definition: RootMinuit.h:187

◆ init()

template<class Function>
void fit::RootMinuit< Function >::init ( void  )
inlineprivate

Definition at line 204 of file RootMinuit.h.

References edm::errors::Configuration, mps_fire::end, fit::parameter_t::err, Exception, fit::RootMinuit< Function >::fcn_(), fit::RootMinuit< Function >::fPars_, mps_fire::i, fit::RootMinuit< Function >::initialized_, fit::parameter_t::max, fit::parameter_t::min, fit::RootMinuit< Function >::minuit_, Skims_PA_cff::name, AlCaHLTBitMon_ParallelJobs::p, fit::RootMinuit< Function >::parMap_, fit::RootMinuit< Function >::pars_, AlCaHLTBitMon_QueryRunRegistry::string, fit::parameter_t::val, and fit::RootMinuit< Function >::verbose_.

Referenced by fit::RootMinuit< Function >::getErrorMatrix(), fit::RootMinuit< Function >::getParameter(), fit::RootMinuit< Function >::getParameterError(), fit::RootMinuit< Function >::migrad(), fit::RootMinuit< Function >::minimize(), fit::RootMinuit< Function >::minValue(), fit::RootMinuit< Function >::numberOfFreeParameters(), and fit::RootMinuit< Function >::numberOfParameters().

204  {
205  if (initialized_)
206  return;
207  minuit_.reset(new TMinuit(parMap_.size()));
208  double arglist[10];
209  int ierflg = 0;
210  if (!verbose_) {
211  arglist[0] = -1;
212  minuit_->mnexcm("SET PRINT", arglist, 1, ierflg);
213  if (ierflg != 0)
214  throw edm::Exception(edm::errors::Configuration) << "RootMinuit: error in calling SET PRINT\n";
215  }
216  arglist[0] = 1;
217  minuit_->mnexcm("SET ERR", arglist, 1, ierflg);
218  if (ierflg != 0)
219  throw edm::Exception(edm::errors::Configuration) << "RootMinuit: error in calling SET ERR\n";
220 
221  size_t i = 0;
222  typename parameterVector_t::const_iterator p = parMap_.begin(), end = parMap_.end();
223  for (; p != end; ++p, ++i) {
224  const std::string &name = p->first;
225  const parameter_t &par = p->second;
226  minuit_->mnparm(i, name, par.val, par.err, par.min, par.max, ierflg);
227  if (ierflg != 0)
229  << "RootMinuit: error in setting parameter " << i << " value = " << par.val << " error = " << par.err
230  << " range = [" << par.min << ", " << par.max << "]\n";
231  }
232  initialized_ = true;
233  for (i = 0, p = parMap_.begin(); p != end; ++p, ++i)
234  if (p->second.fixed)
235  minuit_->FixParameter(i);
236  fPars_ = &pars_;
237  minuit_->SetFCN(fcn_);
238  }
std::vector< std::shared_ptr< double > > pars_
Definition: RootMinuit.h:188
std::unique_ptr< TMinuit > minuit_
Definition: RootMinuit.h:187
static void fcn_(int &, double *, double &f, double *par, int)
Definition: RootMinuit.h:192
parameterVector_t parMap_
Definition: RootMinuit.h:183
static std::vector< std::shared_ptr< double > > * fPars_
Definition: RootMinuit.h:189

◆ migrad()

template<class Function>
double fit::RootMinuit< Function >::migrad ( )
inline

Definition at line 146 of file RootMinuit.h.

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, fit::RootMinuit< Function >::init(), visualization-live-secondInstance_cfg::m, fit::RootMinuit< Function >::minuit_, fit::RootMinuit< Function >::minValue(), fit::RootMinuit< Function >::setParameters(), and fit::RootMinuit< Function >::verbose_.

Referenced by fit::RootMinuitCommands< Function >::run().

146  {
147  init();
148  double arglist[10];
149  arglist[0] = 5000;
150  arglist[1] = 0.1;
151  int ierflag;
152  minuit_->mnexcm("MIGRAD", arglist, 2, ierflag);
153  if (ierflag != 0)
154  std::cerr << "ERROR in migrad!!" << std::endl;
155  if (verbose_)
156  minuit_->mnmatu(1); //Prints the covariance matrix
157  double m = minValue();
158  if (verbose_)
159  minuit_->mnprin(3, m);
160  setParameters();
161  return m;
162  }
void setParameters()
Definition: RootMinuit.h:112
std::unique_ptr< TMinuit > minuit_
Definition: RootMinuit.h:187
double minValue()
Definition: RootMinuit.h:163

◆ minimize()

template<class Function>
double fit::RootMinuit< Function >::minimize ( )
inline

Definition at line 129 of file RootMinuit.h.

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, fit::RootMinuit< Function >::init(), visualization-live-secondInstance_cfg::m, fit::RootMinuit< Function >::minuit_, fit::RootMinuit< Function >::minValue(), fit::RootMinuit< Function >::setParameters(), and fit::RootMinuit< Function >::verbose_.

Referenced by fit::RootMinuitCommands< Function >::run().

129  {
130  init();
131  double arglist[10];
132  arglist[0] = 5000;
133  arglist[1] = 0.1;
134  int ierflag;
135  minuit_->mnexcm("MINIMIZE", arglist, 2, ierflag);
136  if (ierflag != 0)
137  std::cerr << "ERROR in minimize!!" << std::endl;
138  if (verbose_)
139  minuit_->mnmatu(1); //Prints the covariance matrix
140  double m = minValue();
141  if (verbose_)
142  minuit_->mnprin(3, m);
143  setParameters();
144  return m;
145  }
void setParameters()
Definition: RootMinuit.h:112
std::unique_ptr< TMinuit > minuit_
Definition: RootMinuit.h:187
double minValue()
Definition: RootMinuit.h:163

◆ minValue()

template<class Function>
double fit::RootMinuit< Function >::minValue ( )
inline

Definition at line 163 of file RootMinuit.h.

References fit::RootMinuit< Function >::init(), fit::RootMinuit< Function >::minuit_, and fit::RootMinuit< Function >::minValue_.

Referenced by fit::RootMinuit< Function >::migrad(), fit::RootMinuit< Function >::minimize(), and fit::RootMinuit< Function >::printFitResults().

163  {
164  init();
165  int ierflag;
166  double edm, errdef;
167  int nvpar, nparx;
168  minuit_->mnstat(minValue_, edm, errdef, nvpar, nparx, ierflag);
169  return minValue_;
170  }
double minValue_
Definition: RootMinuit.h:186
std::unique_ptr< TMinuit > minuit_
Definition: RootMinuit.h:187
HLT enums.

◆ numberOfFreeParameters()

template<class Function>
int fit::RootMinuit< Function >::numberOfFreeParameters ( )
inline

Definition at line 125 of file RootMinuit.h.

References fit::RootMinuit< Function >::init(), and fit::RootMinuit< Function >::minuit_.

Referenced by fit::RootMinuit< Function >::printFitResults().

125  {
126  init();
127  return minuit_->GetNumFreePars();
128  }
std::unique_ptr< TMinuit > minuit_
Definition: RootMinuit.h:187

◆ numberOfParameters()

template<class Function>
int fit::RootMinuit< Function >::numberOfParameters ( )
inline

Definition at line 121 of file RootMinuit.h.

References fit::RootMinuit< Function >::init(), and fit::RootMinuit< Function >::minuit_.

Referenced by fit::RootMinuit< Function >::getErrorMatrix().

121  {
122  init();
123  return minuit_->GetNumPars();
124  }
std::unique_ptr< TMinuit > minuit_
Definition: RootMinuit.h:187

◆ parameterIndex()

template<class Function>
size_t fit::RootMinuit< Function >::parameterIndex ( const std::string &  name) const
inlineprivate

◆ printFitResults()

template<class Function>
void fit::RootMinuit< Function >::printFitResults ( std::ostream &  cout = std::cout)
inline

◆ printParameters()

template<class Function>
void fit::RootMinuit< Function >::printParameters ( std::ostream &  cout = std::cout)
inline

Definition at line 171 of file RootMinuit.h.

References gather_cfg::cout, mps_fire::end, fit::RootMinuit< Function >::getParameterError(), mps_fire::i, fit::RootMinuit< Function >::parIndices_, and fit::RootMinuit< Function >::pars_.

Referenced by fit::RootMinuit< Function >::printFitResults().

171  {
172  std::map<std::string, size_t>::const_iterator i = parIndices_.begin(), end = parIndices_.end();
173  for (; i != end; ++i) {
174  cout << i->first << " = " << *pars_[i->second] << " +/- " << getParameterError(i->first) << std::endl;
175  }
176  }
std::vector< std::shared_ptr< double > > pars_
Definition: RootMinuit.h:188
std::map< std::string, size_t > parIndices_
Definition: RootMinuit.h:184
double getParameterError(const std::string &name, double &val)
Definition: RootMinuit.h:56

◆ releaseParameter()

template<class Function>
void fit::RootMinuit< Function >::releaseParameter ( const std::string &  name)
inline

Definition at line 92 of file RootMinuit.h.

References mps_fire::i, fit::RootMinuit< Function >::initialized_, fit::RootMinuit< Function >::minuit_, Skims_PA_cff::name, fit::RootMinuit< Function >::parameterIndex(), and fit::RootMinuit< Function >::parMap_.

Referenced by fit::RootMinuitCommands< Function >::run().

92  {
93  size_t i = parameterIndex(name);
94  parMap_[i].second.fixed = false;
95  if (initialized_) {
96  minuit_->Release(i);
97  }
98  }
size_t parameterIndex(const std::string &name) const
Definition: RootMinuit.h:198
std::unique_ptr< TMinuit > minuit_
Definition: RootMinuit.h:187
parameterVector_t parMap_
Definition: RootMinuit.h:183

◆ setParameter()

template<class Function>
void fit::RootMinuit< Function >::setParameter ( const std::string &  name,
double  val 
)
inline

Definition at line 99 of file RootMinuit.h.

References edm::errors::Configuration, fit::parameter_t::err, Exception, mps_fire::i, fit::RootMinuit< Function >::initialized_, fit::parameter_t::max, fit::parameter_t::min, fit::RootMinuit< Function >::minuit_, Skims_PA_cff::name, fit::RootMinuit< Function >::parameterIndex(), fit::RootMinuit< Function >::parMap_, fit::parameter_t::val, and heppy_batch::val.

Referenced by coreTools.RunOnData::__call__(), trackTools.MakeAODTrackCandidates::__call__(), runJetUncertainties.RunJetUncertainties::__call__(), metTools.AddMETCollection::__call__(), cmsswVersionTools.PickRelValInputFiles::__call__(), coreTools.RemoveMCMatching::__call__(), trackTools.MakePATTrackCandidates::__call__(), trigTools.SwitchOnTrigger::__call__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::__call__(), trigTools.SwitchOnTriggerStandAlone::__call__(), tauTools.AddTauCollection::__call__(), trackTools.MakeTrackCandidates::__call__(), trigTools.SwitchOnTriggerMatching::__call__(), trigTools.SwitchOnTriggerMatchingStandAlone::__call__(), trigTools.SwitchOnTriggerMatchEmbedding::__call__(), jetTools.AddJetCollection::__call__(), jetTools.SwitchJetCollection::__call__(), jetTools.UpdateJetCollection::__call__(), jetTools.AddJetID::__call__(), jetTools.SetTagInfos::__call__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::jetConfiguration(), and fit::RootMinuitCommands< Function >::run().

99  {
100  size_t i = parameterIndex(name);
101  parameter_t &par = parMap_[i].second;
102  par.val = val;
103  if (initialized_) {
104  int ierflg = 0;
105  minuit_->mnparm(i, name, par.val, par.err, par.min, par.max, ierflg);
106  if (ierflg != 0)
108  << "RootMinuit: error in setting parameter " << i << " value = " << par.val << " error = " << par.err
109  << " range = [" << par.min << ", " << par.max << "]\n";
110  }
111  }
size_t parameterIndex(const std::string &name) const
Definition: RootMinuit.h:198
std::unique_ptr< TMinuit > minuit_
Definition: RootMinuit.h:187
parameterVector_t parMap_
Definition: RootMinuit.h:183

◆ setParameters()

template<class Function>
void fit::RootMinuit< Function >::setParameters ( )
inline

Definition at line 112 of file RootMinuit.h.

References mps_fire::end, submitPVResolutionJobs::err, mps_fire::i, fit::RootMinuit< Function >::minuit_, fit::RootMinuit< Function >::parIndices_, fit::RootMinuit< Function >::pars_, and heppy_batch::val.

Referenced by fit::RootMinuit< Function >::getErrorMatrix(), fit::RootMinuit< Function >::migrad(), and fit::RootMinuit< Function >::minimize().

112  {
113  std::map<std::string, size_t>::const_iterator i = parIndices_.begin(), end = parIndices_.end();
114  double val, err;
115  for (; i != end; ++i) {
116  size_t index = i->second;
117  minuit_->GetParameter(index, val, err);
118  *pars_[index] = val;
119  }
120  }
std::vector< std::shared_ptr< double > > pars_
Definition: RootMinuit.h:188
std::map< std::string, size_t > parIndices_
Definition: RootMinuit.h:184
std::unique_ptr< TMinuit > minuit_
Definition: RootMinuit.h:187

Member Data Documentation

◆ f_

template<class Function>
Function fit::RootMinuit< Function >::f_
staticprivate

◆ fPars_

template<class Function>
std::vector< std::shared_ptr< double > > * fit::RootMinuit< Function >::fPars_ = nullptr
staticprivate

◆ initialized_

template<class Function>
bool fit::RootMinuit< Function >::initialized_
private

◆ minuit_

template<class Function>
std::unique_ptr<TMinuit> fit::RootMinuit< Function >::minuit_
private

◆ minValue_

template<class Function>
double fit::RootMinuit< Function >::minValue_
private

Definition at line 186 of file RootMinuit.h.

Referenced by fit::RootMinuit< Function >::minValue().

◆ parIndices_

template<class Function>
std::map<std::string, size_t> fit::RootMinuit< Function >::parIndices_
private

◆ parMap_

template<class Function>
parameterVector_t fit::RootMinuit< Function >::parMap_
private

◆ pars_

template<class Function>
std::vector<std::shared_ptr<double> > fit::RootMinuit< Function >::pars_
private

◆ verbose_

template<class Function>
bool fit::RootMinuit< Function >::verbose_
private