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 
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
77 }
78 
79 void MnUserParameters::SetError(unsigned int n, double err) {
80  // set error for parameter n
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
102 }
103 
104 
105 double MnUserParameters::Value(unsigned int n) const {
106  // get value for parameter 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
150 }
151 
152 void MnUserParameters::RemoveLimits(const std::string & name) {
153  // remove limits
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
ROOT::Minuit2::MinuitParameter
class for the individual Minuit Parameter with Name and number; contains the input numbers for the mi...
Definition: MinuitParameter.h:41
n
const Int_t n
Definition: legend1.C:16
ROOT::Minuit2::MnUserTransformation::Fix
void Fix(unsigned int)
Definition: MnUserTransformation.cxx:305
ROOT::Minuit2::MnUserParameters::Release
void Release(unsigned int)
Definition: MnUserParameters.cxx:72
ROOT::Minuit2::MnUserParameters::Name
const char * Name(unsigned int) const
Definition: MnUserParameters.cxx:184
ROOT::Minuit2::MnUserParameters::Index
unsigned int Index(const std::string &) const
Definition: MnUserParameters.cxx:175
ROOT::Minuit2::MnUserParameters::Fix
void Fix(unsigned int)
interaction via external number of Parameter
Definition: MnUserParameters.cxx:67
ROOT::Minuit2::MnUserTransformation::RemoveLimits
void RemoveLimits(unsigned int)
Definition: MnUserTransformation.cxx:357
ROOT::Minuit2::MnUserTransformation::Params
std::vector< double > Params() const
access to parameters and errors in column-wise representation
Definition: MnUserTransformation.cxx:232
ROOT::Minuit2::MnUserTransformation::SetUpperLimit
void SetUpperLimit(unsigned int, double)
Definition: MnUserTransformation.cxx:345
ROOT::Minuit2::MnUserTransformation::Parameters
const std::vector< MinuitParameter > & Parameters() const
Definition: MnUserTransformation.h:117
ROOT::Minuit2::MnUserTransformation::Precision
const MnMachinePrecision & Precision() const
forwarded interface
Definition: MnUserTransformation.h:131
ROOT::Minuit2::MnUserParameters::Add
bool Add(const std::string &, double, double)
Add free Parameter Name, Value, Error.
Definition: MnUserParameters.cxx:49
ROOT::Minuit2::MnUserTransformation::Error
double Error(unsigned int) const
Definition: MnUserTransformation.cxx:376
ROOT::Minuit2::MnUserTransformation::Add
bool Add(const std::string &, double, double)
Definition: MnUserTransformation.cxx:272
ROOT::Minuit2::MnUserParameters::MnUserParameters
MnUserParameters()
Definition: MnUserParameters.h:49
ROOT::Minuit2::MnUserTransformation::SetValue
void SetValue(unsigned int, double)
Definition: MnUserTransformation.cxx:325
ROOT::Minuit2::MnUserParameters::fTransformation
MnUserTransformation fTransformation
Definition: MnUserParameters.h:125
ROOT::Minuit2::MnUserTransformation::Errors
std::vector< double > Errors() const
Definition: MnUserTransformation.cxx:242
ROOT::Minuit2::MnUserParameters::Parameters
const std::vector< ROOT::Minuit2::MinuitParameter > & Parameters() const
access to parameters (row-wise)
Definition: MnUserParameters.cxx:29
ROOT::Minuit2::MnUserParameters::SetError
void SetError(unsigned int, double)
Definition: MnUserParameters.cxx:87
MnUserParameters.h
ROOT::Minuit2::MnUserParameters::SetName
void SetName(unsigned int, const std::string &)
Definition: MnUserParameters.cxx:107
ROOT::Minuit2::MnUserTransformation::Name
const char * Name(unsigned int) const
Definition: MnUserTransformation.cxx:458
ROOT::Minuit2::MnUserParameters::SetValue
void SetValue(unsigned int, double)
Definition: MnUserParameters.cxx:82
ROOT::Minuit2::MnUserParameters::Value
double Value(unsigned int) const
Definition: MnUserParameters.cxx:113
ROOT::Minuit2::MnUserParameters::SetLimits
void SetLimits(unsigned int, double, double)
Definition: MnUserParameters.cxx:92
ROOT::Minuit2::MnUserParameters::Error
double Error(unsigned int) const
Definition: MnUserParameters.cxx:118
ROOT::Minuit2::MnUserTransformation::Index
unsigned int Index(const std::string &) const
Definition: MnUserTransformation.cxx:434
ROOT::Minuit2::MnMachinePrecision
Sets the relative floating point (double) arithmetic precision.
Definition: MnMachinePrecision.h:41
ROOT::Minuit2::MnUserTransformation::Parameter
const MinuitParameter & Parameter(unsigned int) const
Definition: MnUserTransformation.cxx:252
ROOT::Minuit2::MnUserParameters::Errors
std::vector< double > Errors() const
Definition: MnUserParameters.cxx:39
ROOT::Minuit2::MnUserTransformation::Value
double Value(unsigned int) const
Definition: MnUserTransformation.cxx:370
ROOT::Minuit2::MnUserParameters::GetName
const std::string & GetName(unsigned int) const
Definition: MnUserParameters.cxx:180
ROOT::Minuit2::MnUserTransformation::SetLimits
void SetLimits(unsigned int, double, double)
Definition: MnUserTransformation.cxx:338
ROOT::Minuit2::MnUserParameters::SetUpperLimit
void SetUpperLimit(unsigned int, double)
Definition: MnUserParameters.cxx:97
ROOT::Minuit2::MnUserParameters::Params
std::vector< double > Params() const
access to parameters and errors in column-wise representation
Definition: MnUserParameters.cxx:34
ROOT::Minuit2::MnUserParameters::Parameter
const MinuitParameter & Parameter(unsigned int) const
access to single Parameter
Definition: MnUserParameters.cxx:44
ROOT::Minuit2::MnUserTransformation::SetLowerLimit
void SetLowerLimit(unsigned int, double)
Definition: MnUserTransformation.cxx:351
name
char name[80]
Definition: TGX11.cxx:110
ROOT::Minuit2::MnUserTransformation::SetName
void SetName(unsigned int, const std::string &)
Definition: MnUserTransformation.cxx:363
ROOT::Minuit2::MnUserParameters::Precision
const MnMachinePrecision & Precision() const
Definition: MnUserParameters.cxx:189
ROOT::Minuit2::MnUserTransformation::GetName
const std::string & GetName(unsigned int) const
Definition: MnUserTransformation.cxx:452
ROOT::Minuit2::MnUserParameters::RemoveLimits
void RemoveLimits(unsigned int)
Definition: MnUserParameters.cxx:77
ROOT::Minuit2::MnUserTransformation::SetError
void SetError(unsigned int, double)
Definition: MnUserTransformation.cxx:332
ROOT::Minuit2::MnUserTransformation::Release
void Release(unsigned int)
Definition: MnUserTransformation.cxx:314
ROOT
VSD Structures.
Definition: StringConv.hxx:21
ROOT::Minuit2::MnUserParameters::SetLowerLimit
void SetLowerLimit(unsigned int, double)
Definition: MnUserParameters.cxx:102