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, boost::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::auto_ptr< TMinuit > minuit_
 
double minValue_
 
std::map< std::string, size_t > parIndices_
 
parameterVector_t parMap_
 
std::vector< boost::shared_ptr< double > > pars_
 
bool verbose_
 

Static Private Attributes

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

Detailed Description

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

Definition at line 21 of file RootMinuit.h.

Constructor & Destructor Documentation

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  :
24  initialized_(false), minValue_(0), verbose_(verbose) {
25  f_ = f;
26  }
double minValue_
Definition: RootMinuit.h:183
double f[11][100]
static Function f_
Definition: RootMinuit.h:188

Member Function Documentation

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

Definition at line 27 of file RootMinuit.h.

References edm::errors::Configuration, fit::parameter_t::err, Exception, fit::parameter_t::fixed, fit::RootMinuit< Function >::initialized_, hpstanc_transforms::max, fit::parameter_t::max, fit::parameter_t::min, min(), dataset::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 editorTools.UserCodeTool::__init__(), metTools.AddMETCollection::__init__(), trackTools.MakeAODTrackCandidates::__init__(), coreTools.RunOnData::__init__(), HiCoreTools.RestrictInputToAOD::__init__(), runJetUncertainties.RunJetUncertainties::__init__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::__init__(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool::__init__(), editorTools.ChangeSource::__init__(), cmsswVersionTools.PickRelValInputFiles::__init__(), HiCoreTools.RemoveMCMatching::__init__(), coreTools.RemoveMCMatching::__init__(), trackTools.MakePATTrackCandidates::__init__(), trigTools.SwitchOnTrigger::__init__(), HiCoreTools.RemoveAllPATObjectsBut::__init__(), HiCoreTools.RemoveSpecificPATObjects::__init__(), trigTools.SwitchOnTriggerStandAlone::__init__(), trackTools.MakeTrackCandidates::__init__(), tauTools.AddTauCollection::__init__(), trigTools.SwitchOnTriggerMatching::__init__(), HiCoreTools.RemoveCleaning::__init__(), HiCoreTools.AddCleaning::__init__(), trigTools.SwitchOnTriggerMatchingStandAlone::__init__(), jetTools.AddJetCollection::__init__(), trigTools.SwitchOnTriggerMatchEmbedding::__init__(), jetTools.SwitchJetCollection::__init__(), jetTools.UpdateJetCollection::__init__(), jetTools.AddJetID::__init__(), jetTools.SetTagInfos::__init__(), fit::RootMinuitCommands< Function >::add(), and fit::RootMinuit< Function >::addParameter().

27  {
28  if(initialized_)
30  << "RootMinuit: can't add parameter " << name
31  << " after minuit initialization\n";
32  pars_.push_back(val);
33  parameter_t par;
34  par.val = *val;
35  par.err = err;
36  par.min = min;
37  par.max = max;
38  par.fixed = false;
39  parMap_.push_back(std::make_pair(name, par));
40  size_t s = parIndices_.size();
41  parIndices_[name] = s;
42  }
std::vector< boost::shared_ptr< double > > pars_
Definition: RootMinuit.h:185
std::map< std::string, size_t > parIndices_
Definition: RootMinuit.h:181
T min(T a, T b)
Definition: MathUtil.h:58
parameterVector_t parMap_
Definition: RootMinuit.h:180
template<class Function>
void fit::RootMinuit< Function >::addParameter ( const funct::Parameter par,
double  err,
double  min,
double  max 
)
inline

Definition at line 43 of file RootMinuit.h.

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

Referenced by editorTools.UserCodeTool::__init__(), metTools.AddMETCollection::__init__(), trackTools.MakeAODTrackCandidates::__init__(), coreTools.RunOnData::__init__(), HiCoreTools.RestrictInputToAOD::__init__(), runJetUncertainties.RunJetUncertainties::__init__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::__init__(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool::__init__(), editorTools.ChangeSource::__init__(), cmsswVersionTools.PickRelValInputFiles::__init__(), HiCoreTools.RemoveMCMatching::__init__(), coreTools.RemoveMCMatching::__init__(), trackTools.MakePATTrackCandidates::__init__(), trigTools.SwitchOnTrigger::__init__(), HiCoreTools.RemoveAllPATObjectsBut::__init__(), HiCoreTools.RemoveSpecificPATObjects::__init__(), trigTools.SwitchOnTriggerStandAlone::__init__(), trackTools.MakeTrackCandidates::__init__(), tauTools.AddTauCollection::__init__(), trigTools.SwitchOnTriggerMatching::__init__(), HiCoreTools.RemoveCleaning::__init__(), HiCoreTools.AddCleaning::__init__(), trigTools.SwitchOnTriggerMatchingStandAlone::__init__(), jetTools.AddJetCollection::__init__(), trigTools.SwitchOnTriggerMatchEmbedding::__init__(), jetTools.SwitchJetCollection::__init__(), jetTools.UpdateJetCollection::__init__(), jetTools.AddJetID::__init__(), and jetTools.SetTagInfos::__init__().

43  {
44  return addParameter(par.name(), par, err, min, max);
45  }
const std::string & name() const
Definition: Parameter.h:13
void addParameter(const std::string &name, boost::shared_ptr< double > val, double err, double min, double max)
Definition: RootMinuit.h:27
T min(T a, T b)
Definition: MathUtil.h:58
template<class Function>
static void fit::RootMinuit< Function >::fcn_ ( int &  ,
double *  ,
double &  f,
double *  par,
int   
)
inlinestaticprivate

Definition at line 189 of file RootMinuit.h.

References fit::RootMinuitFuncEvaluator< Function >::evaluate(), i, and findQualityFiles::size.

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

189  {
190  size_t size = fPars_->size();
191  for(size_t i = 0; i < size; ++i)
192  *((*fPars_)[i]) = par[i];
194  }
size
Write out results.
int i
Definition: DBlmapReader.cc:9
static std::vector< boost::shared_ptr< double > > * fPars_
Definition: RootMinuit.h:186
double f[11][100]
static Function f_
Definition: RootMinuit.h:188
static double evaluate(const Function &f)
template<class Function>
void fit::RootMinuit< Function >::fixParameter ( const std::string &  name)
inline

Definition at line 87 of file RootMinuit.h.

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

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

87  {
88  size_t i = parameterIndex(name);
89  parMap_[i].second.fixed = true;
90  if(initialized_) {
91  minuit_->FixParameter(i);
92  }
93  }
int i
Definition: DBlmapReader.cc:9
size_t parameterIndex(const std::string &name) const
Definition: RootMinuit.h:195
parameterVector_t parMap_
Definition: RootMinuit.h:180
std::auto_ptr< TMinuit > minuit_
Definition: RootMinuit.h:184
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 71 of file RootMinuit.h.

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

71  {
72  init();
73  if(N != numberOfParameters())
75  << "RootMinuit: can't call getErrorMatrix passing an SMatrix of dimension " << N
76  << " while the number of parameters is " << numberOfParameters() << "\n";
77  double * e = new double[N*N];
78  minuit_->mnemat(e, numberOfParameters());
79  for(size_t i = 0; i < N; ++i) {
80  for(size_t j = 0; j <= i; ++j) {
81  err(i, j) = e[i + N*j];
82  }
83  }
84  delete [] e;
85  setParameters();
86  }
int i
Definition: DBlmapReader.cc:9
void setParameters()
Definition: RootMinuit.h:115
int j
Definition: DBlmapReader.cc:9
#define N
Definition: blowfish.cc:9
int numberOfParameters()
Definition: RootMinuit.h:124
std::auto_ptr< TMinuit > minuit_
Definition: RootMinuit.h:184
template<class Function>
double fit::RootMinuit< Function >::getParameter ( const std::string &  name,
double &  err 
)
inline

Definition at line 46 of file RootMinuit.h.

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

46  {
47  double val;
48  init();
49  minuit_->GetParameter(parameterIndex(name), val, err);
50  return val;
51  }
size_t parameterIndex(const std::string &name) const
Definition: RootMinuit.h:195
std::auto_ptr< TMinuit > minuit_
Definition: RootMinuit.h:184
template<class Function>
double fit::RootMinuit< Function >::getParameter ( const std::string &  name)
inline

Definition at line 52 of file RootMinuit.h.

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

52  {
53  double val, err;
54  init();
55  minuit_->GetParameter(parameterIndex(name), val, err);
56  return val;
57  }
size_t parameterIndex(const std::string &name) const
Definition: RootMinuit.h:195
std::auto_ptr< TMinuit > minuit_
Definition: RootMinuit.h:184
template<class Function>
double fit::RootMinuit< Function >::getParameterError ( const std::string &  name,
double &  val 
)
inline

Definition at line 58 of file RootMinuit.h.

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

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

58  {
59  double err;
60  init();
61  minuit_->GetParameter(parameterIndex(name), val, err);
62  return err;
63  }
size_t parameterIndex(const std::string &name) const
Definition: RootMinuit.h:195
std::auto_ptr< TMinuit > minuit_
Definition: RootMinuit.h:184
template<class Function>
double fit::RootMinuit< Function >::getParameterError ( const std::string &  name)
inline

Definition at line 64 of file RootMinuit.h.

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

64  {
65  double val, err;
66  init();
67  minuit_->GetParameter(parameterIndex(name), val, err);
68  return err;
69  }
size_t parameterIndex(const std::string &name) const
Definition: RootMinuit.h:195
std::auto_ptr< TMinuit > minuit_
Definition: RootMinuit.h:184
template<class Function>
void fit::RootMinuit< Function >::init ( void  )
inlineprivate

Definition at line 202 of file RootMinuit.h.

References edm::errors::Configuration, end, fit::parameter_t::err, Exception, fit::RootMinuit< Function >::fcn_(), i, fit::parameter_t::max, fit::parameter_t::min, dataset::name, AlCaHLTBitMon_ParallelJobs::p, fit::RootMinuit< Function >::pars_, AlCaHLTBitMon_QueryRunRegistry::string, and fit::parameter_t::val.

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().

202  {
203  if(initialized_) return;
204  minuit_.reset(new TMinuit(parMap_.size()));
205  double arglist[10];
206  int ierflg = 0;
207  if (! verbose_) {
208  arglist[0] = -1;
209  minuit_->mnexcm("SET PRINT", arglist, 1, ierflg);
210  if (ierflg != 0)
212  << "RootMinuit: error in calling SET PRINT\n";
213  }
214  arglist[0] = 1;
215  minuit_->mnexcm("SET ERR", arglist, 1, ierflg);
216  if (ierflg != 0)
218  << "RootMinuit: error in calling SET ERR\n";
219 
220  size_t i = 0;
221  typename parameterVector_t::const_iterator p = parMap_.begin(), end = parMap_.end();
222  for(; p != end; ++p, ++i) {
223  const std::string & name = p->first;
224  const parameter_t & par = p->second;
225  minuit_->mnparm(i, name, par.val, par.err, par.min, par.max, ierflg);
226  if(ierflg != 0)
228  << "RootMinuit: error in setting parameter " << i
229  << " 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  }
int i
Definition: DBlmapReader.cc:9
std::vector< boost::shared_ptr< double > > pars_
Definition: RootMinuit.h:185
static std::vector< boost::shared_ptr< double > > * fPars_
Definition: RootMinuit.h:186
#define end
Definition: vmac.h:37
static void fcn_(int &, double *, double &f, double *par, int)
Definition: RootMinuit.h:189
parameterVector_t parMap_
Definition: RootMinuit.h:180
std::auto_ptr< TMinuit > minuit_
Definition: RootMinuit.h:184
template<class Function>
double fit::RootMinuit< Function >::migrad ( )
inline

Definition at line 146 of file RootMinuit.h.

References MessageLogger_cfi::cerr, fit::RootMinuit< Function >::init(), funct::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 ) std::cerr << "ERROR in migrad!!" << std::endl;
154  if(verbose_) minuit_->mnmatu(1); //Prints the covariance matrix
155  double m = minValue();
156  if(verbose_) minuit_->mnprin(3, m);
157  setParameters();
158  return m;
159  }
void setParameters()
Definition: RootMinuit.h:115
std::auto_ptr< TMinuit > minuit_
Definition: RootMinuit.h:184
double minValue()
Definition: RootMinuit.h:160
template<class Function>
double fit::RootMinuit< Function >::minimize ( )
inline

Definition at line 132 of file RootMinuit.h.

References MessageLogger_cfi::cerr, fit::RootMinuit< Function >::init(), funct::m, fit::RootMinuit< Function >::minuit_, fit::RootMinuit< Function >::minValue(), fit::RootMinuit< Function >::setParameters(), and fit::RootMinuit< Function >::verbose_.

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

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

Definition at line 160 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().

160  {
161  init();
162  int ierflag;
163  double edm, errdef;
164  int nvpar, nparx;
165  minuit_->mnstat(minValue_, edm, errdef, nvpar, nparx, ierflag);
166  return minValue_;
167  }
double minValue_
Definition: RootMinuit.h:183
HLT enums.
std::auto_ptr< TMinuit > minuit_
Definition: RootMinuit.h:184
template<class Function>
int fit::RootMinuit< Function >::numberOfFreeParameters ( )
inline

Definition at line 128 of file RootMinuit.h.

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

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

128  {
129  init();
130  return minuit_->GetNumFreePars();
131  }
std::auto_ptr< TMinuit > minuit_
Definition: RootMinuit.h:184
template<class Function>
int fit::RootMinuit< Function >::numberOfParameters ( )
inline

Definition at line 124 of file RootMinuit.h.

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

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

124  {
125  init();
126  return minuit_->GetNumPars();
127  }
std::auto_ptr< TMinuit > minuit_
Definition: RootMinuit.h:184
template<class Function>
size_t fit::RootMinuit< Function >::parameterIndex ( const std::string &  name) const
inlineprivate

Definition at line 195 of file RootMinuit.h.

References edm::errors::Configuration, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by fit::RootMinuit< Function >::fixParameter(), fit::RootMinuit< Function >::getParameter(), fit::RootMinuit< Function >::getParameterError(), fit::RootMinuit< Function >::releaseParameter(), and fit::RootMinuit< Function >::setParameter().

195  {
196  typename std::map<std::string, size_t>::const_iterator p = parIndices_.find(name);
197  if(p == parIndices_.end())
199  << "RootMinuit: can't find parameter " << name << "\n";
200  return p->second;
201  }
std::map< std::string, size_t > parIndices_
Definition: RootMinuit.h:181
template<class Function>
void fit::RootMinuit< Function >::printFitResults ( std::ostream &  cout = std::cout)
inline
template<class Function>
void fit::RootMinuit< Function >::printParameters ( std::ostream &  cout = std::cout)
inline

Definition at line 168 of file RootMinuit.h.

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

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

168  {
169  std::map<std::string, size_t>::const_iterator i = parIndices_.begin(), end = parIndices_.end();
170  for(; i != end; ++i) {
171  cout << i->first << " = " << *pars_[i->second]
172  << " +/- " << getParameterError(i->first) << std::endl;
173  }
174  }
int i
Definition: DBlmapReader.cc:9
std::vector< boost::shared_ptr< double > > pars_
Definition: RootMinuit.h:185
std::map< std::string, size_t > parIndices_
Definition: RootMinuit.h:181
double getParameterError(const std::string &name, double &val)
Definition: RootMinuit.h:58
#define end
Definition: vmac.h:37
template<class Function>
void fit::RootMinuit< Function >::releaseParameter ( const std::string &  name)
inline

Definition at line 94 of file RootMinuit.h.

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

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

94  {
95  size_t i = parameterIndex(name);
96  parMap_[i].second.fixed = false;
97  if(initialized_) {
98  minuit_->Release(i);
99  }
100  }
int i
Definition: DBlmapReader.cc:9
size_t parameterIndex(const std::string &name) const
Definition: RootMinuit.h:195
parameterVector_t parMap_
Definition: RootMinuit.h:180
std::auto_ptr< TMinuit > minuit_
Definition: RootMinuit.h:184
template<class Function>
void fit::RootMinuit< Function >::setParameter ( const std::string &  name,
double  val 
)
inline

Definition at line 101 of file RootMinuit.h.

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

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

101  {
102  size_t i = parameterIndex(name);
103  parameter_t & par = parMap_[i].second;
104  par.val = val;
105  if(initialized_) {
106  int ierflg = 0;
107  minuit_->mnparm(i, name, par.val, par.err, par.min, par.max, ierflg);
108  if(ierflg != 0)
110  << "RootMinuit: error in setting parameter " << i
111  << " value = " << par.val << " error = " << par.err
112  << " range = [" << par.min << ", " << par.max << "]\n";
113  }
114  }
int i
Definition: DBlmapReader.cc:9
size_t parameterIndex(const std::string &name) const
Definition: RootMinuit.h:195
parameterVector_t parMap_
Definition: RootMinuit.h:180
std::auto_ptr< TMinuit > minuit_
Definition: RootMinuit.h:184
template<class Function>
void fit::RootMinuit< Function >::setParameters ( )
inline

Definition at line 115 of file RootMinuit.h.

References end, i, diffTreeTool::index, 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().

115  {
116  std::map<std::string, size_t>::const_iterator i = parIndices_.begin(), end = parIndices_.end();
117  double val, err;
118  for(; i != end; ++i) {
119  size_t index = i->second;
120  minuit_->GetParameter(index, val, err);
121  *pars_[index] = val;
122  }
123  }
int i
Definition: DBlmapReader.cc:9
std::vector< boost::shared_ptr< double > > pars_
Definition: RootMinuit.h:185
std::map< std::string, size_t > parIndices_
Definition: RootMinuit.h:181
#define end
Definition: vmac.h:37
std::auto_ptr< TMinuit > minuit_
Definition: RootMinuit.h:184

Member Data Documentation

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

Definition at line 186 of file RootMinuit.h.

template<class Function>
bool fit::RootMinuit< Function >::initialized_
private
template<class Function>
std::auto_ptr<TMinuit> fit::RootMinuit< Function >::minuit_
private
template<class Function>
double fit::RootMinuit< Function >::minValue_
private

Definition at line 183 of file RootMinuit.h.

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

template<class Function>
std::map<std::string, size_t> fit::RootMinuit< Function >::parIndices_
private
template<class Function>
parameterVector_t fit::RootMinuit< Function >::parMap_
private
template<class Function>
std::vector<boost::shared_ptr<double> > fit::RootMinuit< Function >::pars_
private
template<class Function>
bool fit::RootMinuit< Function >::verbose_
private