Logo ROOT   6.12/07
Reference Guide
MnUserParameters.cxx
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 
11 
12 namespace ROOT {
13 
14  namespace Minuit2 {
15 
16 
17 MnUserParameters::MnUserParameters(const std::vector<double>& par, const std::vector<double>& err) : fTransformation(par, err) {}
18 
19 // all implemented forwarding to MnUserTransformation class
20 
21 const std::vector<MinuitParameter>& MnUserParameters::Parameters() const {
22  // return vector of MinuitParameter objects
23  return fTransformation.Parameters();
24 }
25 
26 std::vector<double> MnUserParameters::Params() const {
27  // return std::vector of double with parameter values
28  return fTransformation.Params();
29 }
30 
31 std::vector<double> MnUserParameters::Errors() const {
32  // return std::vector of double with parameter errors
33  return fTransformation.Errors();
34 }
35 
36 const MinuitParameter& MnUserParameters::Parameter(unsigned int n) const {
37  // return the MinuitParameter object for index n (external)
38  return fTransformation.Parameter(n);
39 }
40 
41 bool MnUserParameters::Add(const std::string & name, double val, double err) {
42  // add a new unlimited parameter giving name, value and err (step size)
43  // return false if parameter already exists
44  return fTransformation.Add(name, val, err);
45 }
46 
47 bool MnUserParameters::Add(const std::string & name, double val, double err, double low, double up) {
48  // add a new limited parameter giving name, value, err (step size) and lower/upper limits
49  // return false if parameter already exists
50  return fTransformation.Add(name, val, err, low, up);
51 }
52 
53 bool MnUserParameters::Add(const std::string & name, double val) {
54  // add a new unlimited parameter giving name and value
55  // return false if parameter already exists
56  return fTransformation.Add(name, val);
57 }
58 
59 void MnUserParameters::Fix(unsigned int n) {
60  // fix parameter n
62 }
63 
64 void MnUserParameters::Release(unsigned int n) {
65  // release parameter n
67 }
68 
69 void MnUserParameters::RemoveLimits(unsigned int n) {
70  // remove limits for parameter n
72 }
73 
74 void MnUserParameters::SetValue(unsigned int n, double val) {
75  // set value for parameter n
76  fTransformation.SetValue(n, val);
77 }
78 
79 void MnUserParameters::SetError(unsigned int n, double err) {
80  // set error for parameter n
81  fTransformation.SetError(n, err);
82 }
83 
84 void MnUserParameters::SetLimits(unsigned int n, double low, double up) {
85  // set limits (lower/upper) for parameter n
86  fTransformation.SetLimits(n, low, up);
87 }
88 
89 void MnUserParameters::SetUpperLimit(unsigned int n, double up) {
90  // set upper limit for parameter n
92 }
93 
94 void MnUserParameters::SetLowerLimit(unsigned int n, double low) {
95  // set lower limit for parameter n
97 }
98 
99 void MnUserParameters::SetName(unsigned int n, const std::string & name) {
100  // set name for parameter n
101  fTransformation.SetName(n, name);
102 }
103 
104 
105 double MnUserParameters::Value(unsigned int n) const {
106  // get value for parameter n
107  return fTransformation.Value(n);
108 }
109 
110 double MnUserParameters::Error(unsigned int n) const {
111  // get error for parameter n
112  return fTransformation.Error(n);
113 }
114 
115 // interface using parameter name
116 
117 void MnUserParameters::Fix(const std::string & name) {
118  // fix parameter
119  Fix(Index(name));
120 }
121 
122 void MnUserParameters::Release(const std::string & name) {
123  // release parameter
124  Release(Index(name));
125 }
126 
127 void MnUserParameters::SetValue(const std::string & name, double val) {
128  // set value for parameter
129  SetValue(Index(name), val);
130 }
131 
132 void MnUserParameters::SetError(const std::string & name, double err) {
133  // set error
134  SetError(Index(name), err);
135 }
136 
137 void MnUserParameters::SetLimits(const std::string & name, double low, double up) {
138  // set lower/upper limits
139  SetLimits(Index(name), low, up);
140 }
141 
142 void MnUserParameters::SetUpperLimit(const std::string & name, double up) {
143  // set upper limit
145 }
146 
147 void MnUserParameters::SetLowerLimit(const std::string & name, double low) {
148  // set lower limit
149  fTransformation.SetLowerLimit(Index(name), low);
150 }
151 
152 void MnUserParameters::RemoveLimits(const std::string & name) {
153  // remove limits
154  RemoveLimits(Index(name));
155 }
156 
157 double MnUserParameters::Value(const std::string & name) const {
158  // get parameter value
159  return Value(Index(name));
160 }
161 
162 double MnUserParameters::Error(const std::string & name) const {
163  // get parameter error
164  return Error(Index(name));
165 }
166 
167 unsigned int MnUserParameters::Index(const std::string & name) const {
168  // get index (external) corresponding to name
169  return fTransformation.Index(name);
170 }
171 
172 const std::string & MnUserParameters::GetName(unsigned int n) const {
173  // get name corresponding to index (external)
174  return fTransformation.GetName(n);
175 }
176 const char* MnUserParameters::Name(unsigned int n) const {
177  // get name corresponding to index (external)
178  return fTransformation.Name(n);
179 }
180 
182  // get global paramter precision
183  return fTransformation.Precision();
184 }
185 
186  } // namespace Minuit2
187 
188 } // namespace ROOT
void SetLowerLimit(unsigned int, double)
void SetLowerLimit(unsigned int, double)
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
MnUserTransformation fTransformation
const std::string & GetName(unsigned int) const
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)
std::vector< double > Params() const
access to parameters and errors in column-wise representation
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 SetUpperLimit(unsigned int, double)
const MnMachinePrecision & Precision() const
forwarded interface
std::vector< double > Errors() const
void SetValue(unsigned int, double)
const char * Name(unsigned int) const
void SetName(unsigned int, const std::string &)
const std::string & GetName(unsigned int) const
double Value(unsigned int) const
double Error(unsigned int) const
const std::vector< MinuitParameter > & Parameters() const
std::vector< double > Errors() const
const MinuitParameter & Parameter(unsigned int) const
void SetUpperLimit(unsigned int, double)
const MinuitParameter & Parameter(unsigned int) const
access to single Parameter
void SetLimits(unsigned int, double, double)
bool Add(const std::string &, double, double)
unsigned int Index(const std::string &) const
const Int_t n
Definition: legend1.C:16
std::vector< double > Params() const
access to parameters and errors in column-wise representation
char name[80]
Definition: TGX11.cxx:109
const MnMachinePrecision & Precision() const