Logo ROOT  
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 MnUserParameters::MnUserParameters(const std::vector<double> &par, const std::vector<double> &err)
17  : fTransformation(par, err)
18 {
19 }
20 
21 // all implemented forwarding to MnUserTransformation class
22 
23 const std::vector<MinuitParameter> &MnUserParameters::Parameters() const
24 {
25  // return vector of MinuitParameter objects
26  return fTransformation.Parameters();
27 }
28 
29 std::vector<double> MnUserParameters::Params() const
30 {
31  // return std::vector of double with parameter values
32  return fTransformation.Params();
33 }
34 
35 std::vector<double> MnUserParameters::Errors() const
36 {
37  // return std::vector of double with parameter errors
38  return fTransformation.Errors();
39 }
40 
41 const MinuitParameter &MnUserParameters::Parameter(unsigned int n) const
42 {
43  // return the MinuitParameter object for index n (external)
44  return fTransformation.Parameter(n);
45 }
46 
47 bool MnUserParameters::Add(const std::string &name, double val, double err)
48 {
49  // add a new unlimited parameter giving name, value and err (step size)
50  // return false if parameter already exists
51  return fTransformation.Add(name, val, err);
52 }
53 
54 bool MnUserParameters::Add(const std::string &name, double val, double err, double low, double up)
55 {
56  // add a new limited parameter giving name, value, err (step size) and lower/upper limits
57  // return false if parameter already exists
58  return fTransformation.Add(name, val, err, low, up);
59 }
60 
61 bool MnUserParameters::Add(const std::string &name, double val)
62 {
63  // add a new unlimited parameter giving name and value
64  // return false if parameter already exists
65  return fTransformation.Add(name, val);
66 }
67 
68 void MnUserParameters::Fix(unsigned int n)
69 {
70  // fix parameter n
72 }
73 
74 void MnUserParameters::Release(unsigned int n)
75 {
76  // release parameter n
78 }
79 
81 {
82  // remove limits for parameter n
84 }
85 
86 void MnUserParameters::SetValue(unsigned int n, double val)
87 {
88  // set value for parameter n
90 }
91 
92 void MnUserParameters::SetError(unsigned int n, double err)
93 {
94  // set error for parameter n
96 }
97 
98 void MnUserParameters::SetLimits(unsigned int n, double low, double up)
99 {
100  // set limits (lower/upper) for parameter n
101  fTransformation.SetLimits(n, low, up);
102 }
103 
104 void MnUserParameters::SetUpperLimit(unsigned int n, double up)
105 {
106  // set upper limit for parameter n
108 }
109 
110 void MnUserParameters::SetLowerLimit(unsigned int n, double low)
111 {
112  // set lower limit for parameter n
114 }
115 
116 void MnUserParameters::SetName(unsigned int n, const std::string &name)
117 {
118  // set name for parameter n
120 }
121 
122 double MnUserParameters::Value(unsigned int n) const
123 {
124  // get value for parameter n
125  return fTransformation.Value(n);
126 }
127 
128 double MnUserParameters::Error(unsigned int n) const
129 {
130  // get error for parameter n
131  return fTransformation.Error(n);
132 }
133 
134 // interface using parameter name
135 
136 void MnUserParameters::Fix(const std::string &name)
137 {
138  // fix parameter
139  Fix(Index(name));
140 }
141 
142 void MnUserParameters::Release(const std::string &name)
143 {
144  // release parameter
145  Release(Index(name));
146 }
147 
148 void MnUserParameters::SetValue(const std::string &name, double val)
149 {
150  // set value for parameter
151  SetValue(Index(name), val);
152 }
153 
154 void MnUserParameters::SetError(const std::string &name, double err)
155 {
156  // set error
157  SetError(Index(name), err);
158 }
159 
160 void MnUserParameters::SetLimits(const std::string &name, double low, double up)
161 {
162  // set lower/upper limits
163  SetLimits(Index(name), low, up);
164 }
165 
166 void MnUserParameters::SetUpperLimit(const std::string &name, double up)
167 {
168  // set upper limit
170 }
171 
172 void MnUserParameters::SetLowerLimit(const std::string &name, double low)
173 {
174  // set lower limit
176 }
177 
178 void MnUserParameters::RemoveLimits(const std::string &name)
179 {
180  // remove limits
182 }
183 
184 double MnUserParameters::Value(const std::string &name) const
185 {
186  // get parameter value
187  return Value(Index(name));
188 }
189 
190 double MnUserParameters::Error(const std::string &name) const
191 {
192  // get parameter error
193  return Error(Index(name));
194 }
195 
196 unsigned int MnUserParameters::Index(const std::string &name) const
197 {
198  // get index (external) corresponding to name
199  return fTransformation.Index(name);
200 }
201 
202 const std::string &MnUserParameters::GetName(unsigned int n) const
203 {
204  // get name corresponding to index (external)
205  return fTransformation.GetName(n);
206 }
207 const char *MnUserParameters::Name(unsigned int n) const
208 {
209  // get name corresponding to index (external)
210  return fTransformation.Name(n);
211 }
212 
214 {
215  // get global paramter precision
216  return fTransformation.Precision();
217 }
218 
219 } // namespace Minuit2
220 
221 } // namespace ROOT
ROOT::Minuit2::MinuitParameter
class for the individual Minuit Parameter with Name and number; contains the input numbers for the mi...
Definition: MinuitParameter.h:33
n
const Int_t n
Definition: legend1.C:16
ROOT::Minuit2::MnUserTransformation::Fix
void Fix(unsigned int)
Definition: MnUserTransformation.cxx:317
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::RemoveLimits
void RemoveLimits(unsigned int)
Definition: MnUserTransformation.cxx:376
ROOT::Minuit2::MnUserTransformation::Params
std::vector< double > Params() const
access to parameters and errors in column-wise representation
Definition: MnUserTransformation.cxx:241
ROOT::Minuit2::MnUserTransformation::SetUpperLimit
void SetUpperLimit(unsigned int, double)
Definition: MnUserTransformation.cxx:362
ROOT::Minuit2::MnUserTransformation::Parameters
const std::vector< MinuitParameter > & Parameters() const
Definition: MnUserTransformation.h:108
ROOT::Minuit2::MnUserTransformation::Precision
const MnMachinePrecision & Precision() const
forwarded interface
Definition: MnUserTransformation.h:117
ROOT::Minuit2::MnUserParameters::Add
bool Add(const std::string &, double, double)
Add free Parameter Name, Value, Error.
Definition: MnUserParameters.cxx:47
ROOT::Minuit2::MnUserTransformation::Error
double Error(unsigned int) const
Definition: MnUserTransformation.cxx:397
ROOT::Minuit2::MnUserTransformation::Add
bool Add(const std::string &, double, double)
Definition: MnUserTransformation.cxx:281
ROOT::Minuit2::MnUserParameters::MnUserParameters
MnUserParameters()
Definition: MnUserParameters.h:39
ROOT::Minuit2::MnUserTransformation::SetValue
void SetValue(unsigned int, double)
Definition: MnUserTransformation.cxx:339
ROOT::Minuit2::MnUserParameters::fTransformation
MnUserTransformation fTransformation
Definition: MnUserParameters.h:112
ROOT::Minuit2::MnUserTransformation::Errors
std::vector< double > Errors() const
Definition: MnUserTransformation.cxx:252
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
MnUserParameters.h
ROOT::Minuit2::MnUserParameters::SetName
void SetName(unsigned int, const std::string &)
Definition: MnUserParameters.cxx:116
ROOT::Minuit2::MnUserTransformation::Name
const char * Name(unsigned int) const
Definition: MnUserTransformation.cxx:493
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::Error
double Error(unsigned int) const
Definition: MnUserParameters.cxx:128
ROOT::Minuit2::MnUserTransformation::Index
unsigned int Index(const std::string &) const
Definition: MnUserTransformation.cxx:466
ROOT::Minuit2::MnMachinePrecision
Sets the relative floating point (double) arithmetic precision.
Definition: MnMachinePrecision.h:32
ROOT::Minuit2::MnUserTransformation::Parameter
const MinuitParameter & Parameter(unsigned int) const
Definition: MnUserTransformation.cxx:263
ROOT::Minuit2::MnUserParameters::Errors
std::vector< double > Errors() const
Definition: MnUserParameters.cxx:35
ROOT::Minuit2::MnUserTransformation::Value
double Value(unsigned int) const
Definition: MnUserTransformation.cxx:390
ROOT::Minuit2::MnUserParameters::GetName
const std::string & GetName(unsigned int) const
Definition: MnUserParameters.cxx:202
ROOT::Minuit2::MnUserTransformation::SetLimits
void SetLimits(unsigned int, double, double)
Definition: MnUserTransformation.cxx:354
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::MnUserTransformation::SetLowerLimit
void SetLowerLimit(unsigned int, double)
Definition: MnUserTransformation.cxx:369
name
char name[80]
Definition: TGX11.cxx:110
ROOT::Minuit2::MnUserTransformation::SetName
void SetName(unsigned int, const std::string &)
Definition: MnUserTransformation.cxx:383
ROOT::Minuit2::MnUserParameters::Precision
const MnMachinePrecision & Precision() const
Definition: MnUserParameters.cxx:213
ROOT::Minuit2::MnUserTransformation::GetName
const std::string & GetName(unsigned int) const
Definition: MnUserTransformation.cxx:486
ROOT::Minuit2::MnUserParameters::RemoveLimits
void RemoveLimits(unsigned int)
Definition: MnUserParameters.cxx:80
ROOT::Minuit2::MnUserTransformation::SetError
void SetError(unsigned int, double)
Definition: MnUserTransformation.cxx:347
ROOT::Minuit2::MnUserTransformation::Release
void Release(unsigned int)
Definition: MnUserTransformation.cxx:327
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