Logo ROOT   6.08/07
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 
16 #include <vector>
17 
18 namespace ROOT {
19 
20  namespace Minuit2 {
21 
22 
23 class MnMachinePrecision;
24 
25 /** API class for the user interaction with the parameters;
26  serves as input to the minimizer as well as output from it;
27  users can interact: Fix/release parameters, set values and errors, etc.;
28  parameters can be accessed via their Parameter number (determined
29  internally by Minuit and followed the order how the parameters are created)
30  or via their user-specified Name (10 character string).
31  Minuit has also an internal parameter number which is used during the minimization
32  (the fix parameter are skipped). The parameter number used in this class is the external
33  one. The class ROOT::Minuit2::MnUserTransformation is used to keep the
34  internal <-> external transformation
35  */
36 
38 
39 public:
40 
42 
43  MnUserParameters(const std::vector<double>&, const std::vector<double>&);
44 
46 
49 
52  return *this;
53  }
54 
55  const MnUserTransformation& Trafo() const {return fTransformation;}
56 
57  unsigned int VariableParameters() const {
59  }
60 
61  /// access to parameters (row-wise)
62  const std::vector<ROOT::Minuit2::MinuitParameter>& Parameters() const;
63 
64  /// access to parameters and errors in column-wise representation
65  std::vector<double> Params() const;
66  std::vector<double> Errors() const;
67 
68  /// access to single Parameter
69  const MinuitParameter& Parameter(unsigned int) const;
70 
71  /// Add free Parameter Name, Value, Error
72  bool Add(const std::string &, double, double);
73  /// Add limited Parameter Name, Value, Lower bound, Upper bound
74  bool Add(const std::string &, double, double, double, double);
75  /// Add const Parameter Name, vale
76  bool Add(const std::string &, double);
77 
78  /// interaction via external number of Parameter
79  void Fix(unsigned int);
80  void Release(unsigned int);
81  void RemoveLimits(unsigned int);
82  void SetValue(unsigned int, double);
83  void SetError(unsigned int, double);
84  void SetLimits(unsigned int, double, double);
85  void SetUpperLimit(unsigned int, double);
86  void SetLowerLimit(unsigned int, double);
87  void SetName(unsigned int, const std::string &);
88 
89  double Value(unsigned int) const;
90  double Error(unsigned int) const;
91 
92  /// interaction via Name of Parameter
93  void Fix(const std::string &);
94  void Release(const std::string &);
95  void SetValue(const std::string &, double);
96  void SetError(const std::string &, double);
97  void SetLimits(const std::string &, double, double);
98  void SetUpperLimit(const std::string &, double);
99  void SetLowerLimit(const std::string &, double);
100  void RemoveLimits(const std::string &);
101 
102  double Value(const std::string &) const;
103  double Error(const std::string &) const;
104 
105  //convert Name into external number of Parameter
106  unsigned int Index(const std::string &) const;
107  //convert external number into Name of Parameter
108  const std::string & GetName(unsigned int) const;
109  // mantain interface with const char * for backward compatibility
110  const char* Name(unsigned int) const;
111 
112  const MnMachinePrecision& Precision() const;
113  void SetPrecision(double eps) {fTransformation.SetPrecision(eps);}
114 
115 private:
116 
118 };
119 
120  } // namespace Minuit2
121 
122 } // namespace ROOT
123 
124 #endif // ROOT_Minuit2_MnUserParameters
double par[1]
Definition: unuranDistr.cxx:38
void SetLowerLimit(unsigned int, double)
This namespace contains pre-defined functions to be used in conjuction with TExecutor::Map and TExecu...
Definition: StringConv.hxx:21
MnUserTransformation fTransformation
const char * Name(unsigned int) const
unsigned int Index(const std::string &) const
const std::vector< ROOT::Minuit2::MinuitParameter > & Parameters() const
access to parameters (row-wise)
void SetName(unsigned int, const std::string &)
void Fix(unsigned int)
interaction via external number of Parameter
class for the individual Minuit Parameter with Name and number; contains the input numbers for the mi...
determines the relative floating point arithmetic precision.
void SetError(unsigned int, double)
bool Add(const std::string &, double, double)
Add free Parameter Name, Value, Error.
void SetLimits(unsigned int, double, double)
void SetValue(unsigned int, double)
const std::string & GetName(unsigned int) const
double Value(unsigned int) const
MnUserParameters(const MnUserParameters &par)
class dealing with the transformation between user specified parameters (external) and internal param...
API class for the user interaction with the parameters; serves as input to the minimizer as well as o...
double Error(unsigned int) const
const MnUserTransformation & Trafo() const
std::vector< double > Errors() const
MnUserParameters & operator=(const MnUserParameters &par)
void SetUpperLimit(unsigned int, double)
const MinuitParameter & Parameter(unsigned int) const
access to single Parameter
unsigned int VariableParameters() const
std::vector< double > Params() const
access to parameters and errors in column-wise representation
const MnMachinePrecision & Precision() const