Logo ROOT  
Reference Guide
MnUserParameters.h
Go to the documentation of this file.
1 // @(#)root/minuit2:$Id$
2 // Authors: M. Winkler, F. James, L. Moneta, A. Zsenei 2003-2005
3 
4 /**********************************************************************
5  * *
6  * Copyright (c) 2005 LCG ROOT Math team, CERN/PH-SFT *
7  * *
8  **********************************************************************/
9 
10 #ifndef ROOT_Minuit2_MnUserParameters
11 #define ROOT_Minuit2_MnUserParameters
12 
14 
15 #include <vector>
16 #include <string>
17 
18 namespace ROOT {
19 
20 namespace Minuit2 {
21 
22 class MnMachinePrecision;
23 
24 /** API class for the user interaction with the parameters;
25  serves as input to the minimizer as well as output from it;
26  users can interact: Fix/release parameters, set values and errors, etc.;
27  parameters can be accessed via their Parameter number (determined
28  internally by Minuit and followed the order how the parameters are created)
29  or via their user-specified Name (10 character string).
30  Minuit has also an internal parameter number which is used during the minimization
31  (the fix parameter are skipped). The parameter number used in this class is the external
32  one. The class ROOT::Minuit2::MnUserTransformation is used to keep the
33  internal <-> external transformation
34  */
35 
37 
38 public:
40 
41  MnUserParameters(const std::vector<double> &, const std::vector<double> &);
42 
44 
46 
48  {
50  return *this;
51  }
52 
53  const MnUserTransformation &Trafo() const { return fTransformation; }
54 
55  unsigned int VariableParameters() const { return fTransformation.VariableParameters(); }
56 
57  /// access to parameters (row-wise)
58  const std::vector<ROOT::Minuit2::MinuitParameter> &Parameters() const;
59 
60  /// access to parameters and errors in column-wise representation
61  std::vector<double> Params() const;
62  std::vector<double> Errors() const;
63 
64  /// access to single Parameter
65  const MinuitParameter &Parameter(unsigned int) const;
66 
67  /// Add free Parameter Name, Value, Error
68  bool Add(const std::string &, double, double);
69  /// Add limited Parameter Name, Value, Lower bound, Upper bound
70  bool Add(const std::string &, double, double, double, double);
71  /// Add const Parameter Name, vale
72  bool Add(const std::string &, double);
73 
74  /// interaction via external number of Parameter
75  void Fix(unsigned int);
76  void Release(unsigned int);
77  void RemoveLimits(unsigned int);
78  void SetValue(unsigned int, double);
79  void SetError(unsigned int, double);
80  void SetLimits(unsigned int, double, double);
81  void SetUpperLimit(unsigned int, double);
82  void SetLowerLimit(unsigned int, double);
83  void SetName(unsigned int, const std::string &);
84 
85  double Value(unsigned int) const;
86  double Error(unsigned int) const;
87 
88  /// interaction via Name of Parameter
89  void Fix(const std::string &);
90  void Release(const std::string &);
91  void SetValue(const std::string &, double);
92  void SetError(const std::string &, double);
93  void SetLimits(const std::string &, double, double);
94  void SetUpperLimit(const std::string &, double);
95  void SetLowerLimit(const std::string &, double);
96  void RemoveLimits(const std::string &);
97 
98  double Value(const std::string &) const;
99  double Error(const std::string &) const;
100 
101  // convert Name into external number of Parameter
102  unsigned int Index(const std::string &) const;
103  // convert external number into Name of Parameter
104  const std::string &GetName(unsigned int) const;
105  // mantain interface with const char * for backward compatibility
106  const char *Name(unsigned int) const;
107 
108  const MnMachinePrecision &Precision() const;
109  void SetPrecision(double eps) { fTransformation.SetPrecision(eps); }
110 
111 private:
113 };
114 
115 } // namespace Minuit2
116 
117 } // namespace ROOT
118 
119 #endif // ROOT_Minuit2_MnUserParameters
ROOT::Minuit2::MinuitParameter
class for the individual Minuit Parameter with Name and number; contains the input numbers for the mi...
Definition: MinuitParameter.h:33
ROOT::Minuit2::MnUserParameters::Release
void Release(unsigned int)
Definition: MnUserParameters.cxx:74
ROOT::Minuit2::MnUserParameters::Name
const char * Name(unsigned int) const
Definition: MnUserParameters.cxx:207
ROOT::Minuit2::MnUserParameters::Index
unsigned int Index(const std::string &) const
Definition: MnUserParameters.cxx:196
ROOT::Minuit2::MnUserParameters::Fix
void Fix(unsigned int)
interaction via external number of Parameter
Definition: MnUserParameters.cxx:68
ROOT::Minuit2::MnUserTransformation::SetPrecision
void SetPrecision(double eps)
Definition: MnUserTransformation.h:118
ROOT::Minuit2::MnUserParameters::Add
bool Add(const std::string &, double, double)
Add free Parameter Name, Value, Error.
Definition: MnUserParameters.cxx:47
MnUserTransformation.h
ROOT::Minuit2::MnUserParameters::MnUserParameters
MnUserParameters()
Definition: MnUserParameters.h:39
ROOT::Minuit2::MnUserParameters::fTransformation
MnUserTransformation fTransformation
Definition: MnUserParameters.h:112
ROOT::Minuit2::MnUserParameters::Parameters
const std::vector< ROOT::Minuit2::MinuitParameter > & Parameters() const
access to parameters (row-wise)
Definition: MnUserParameters.cxx:23
ROOT::Minuit2::MnUserParameters::SetError
void SetError(unsigned int, double)
Definition: MnUserParameters.cxx:92
ROOT::Minuit2::MnUserParameters::SetName
void SetName(unsigned int, const std::string &)
Definition: MnUserParameters.cxx:116
ROOT::Minuit2::MnUserParameters::~MnUserParameters
~MnUserParameters()
Definition: MnUserParameters.h:43
ROOT::Minuit2::MnUserParameters::SetValue
void SetValue(unsigned int, double)
Definition: MnUserParameters.cxx:86
ROOT::Minuit2::MnUserParameters::Value
double Value(unsigned int) const
Definition: MnUserParameters.cxx:122
ROOT::Minuit2::MnUserParameters::SetLimits
void SetLimits(unsigned int, double, double)
Definition: MnUserParameters.cxx:98
ROOT::Minuit2::MnUserParameters
API class for the user interaction with the parameters; serves as input to the minimizer as well as o...
Definition: MnUserParameters.h:36
ROOT::Minuit2::MnUserParameters::Error
double Error(unsigned int) const
Definition: MnUserParameters.cxx:128
ROOT::Minuit2::MnUserTransformation::VariableParameters
unsigned int VariableParameters() const
Definition: MnUserTransformation.h:110
ROOT::Minuit2::MnMachinePrecision
Sets the relative floating point (double) arithmetic precision.
Definition: MnMachinePrecision.h:32
ROOT::Minuit2::MnUserParameters::MnUserParameters
MnUserParameters(const MnUserParameters &par)
Definition: MnUserParameters.h:45
ROOT::Minuit2::MnUserParameters::Trafo
const MnUserTransformation & Trafo() const
Definition: MnUserParameters.h:53
ROOT::Minuit2::MnUserParameters::Errors
std::vector< double > Errors() const
Definition: MnUserParameters.cxx:35
ROOT::Minuit2::MnUserParameters::GetName
const std::string & GetName(unsigned int) const
Definition: MnUserParameters.cxx:202
ROOT::Minuit2::MnUserParameters::operator=
MnUserParameters & operator=(const MnUserParameters &par)
Definition: MnUserParameters.h:47
ROOT::Minuit2::MnUserTransformation
class dealing with the transformation between user specified parameters (external) and internal param...
Definition: MnUserTransformation.h:38
ROOT::Minuit2::MnUserParameters::VariableParameters
unsigned int VariableParameters() const
Definition: MnUserParameters.h:55
ROOT::Minuit2::MnUserParameters::SetUpperLimit
void SetUpperLimit(unsigned int, double)
Definition: MnUserParameters.cxx:104
ROOT::Minuit2::MnUserParameters::Params
std::vector< double > Params() const
access to parameters and errors in column-wise representation
Definition: MnUserParameters.cxx:29
ROOT::Minuit2::MnUserParameters::Parameter
const MinuitParameter & Parameter(unsigned int) const
access to single Parameter
Definition: MnUserParameters.cxx:41
ROOT::Minuit2::MnUserParameters::Precision
const MnMachinePrecision & Precision() const
Definition: MnUserParameters.cxx:213
ROOT::Minuit2::MnUserParameters::RemoveLimits
void RemoveLimits(unsigned int)
Definition: MnUserParameters.cxx:80
ROOT::Minuit2::MnUserParameters::SetPrecision
void SetPrecision(double eps)
Definition: MnUserParameters.h:109
ROOT
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Definition: EExecutionPolicy.hxx:4
ROOT::Minuit2::MnUserParameters::SetLowerLimit
void SetLowerLimit(unsigned int, double)
Definition: MnUserParameters.cxx:110