Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
18namespace ROOT {
19
20namespace Minuit2 {
21
22class 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
38public:
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
111private:
113};
114
115} // namespace Minuit2
116
117} // namespace ROOT
118
119#endif // ROOT_Minuit2_MnUserParameters
class for the individual Minuit Parameter with Name and number; contains the input numbers for the mi...
Sets the relative floating point (double) arithmetic precision.
API class for the user interaction with the parameters; serves as input to the minimizer as well as o...
double Error(unsigned int) const
std::vector< double > Params() const
access to parameters and errors in column-wise representation
const char * Name(unsigned int) const
MnUserTransformation fTransformation
const MnMachinePrecision & Precision() const
void Fix(unsigned int)
interaction via external number of Parameter
void SetName(unsigned int, const std::string &)
void SetLowerLimit(unsigned int, double)
void SetError(unsigned int, double)
void SetValue(unsigned int, double)
const std::vector< ROOT::Minuit2::MinuitParameter > & Parameters() const
access to parameters (row-wise)
const MnUserTransformation & Trafo() const
std::vector< double > Errors() const
const std::string & GetName(unsigned int) const
MnUserParameters & operator=(const MnUserParameters &par)
void SetUpperLimit(unsigned int, double)
bool Add(const std::string &, double, double)
Add free Parameter Name, Value, Error.
MnUserParameters(const MnUserParameters &par)
unsigned int VariableParameters() const
void SetLimits(unsigned int, double, double)
class dealing with the transformation between user specified parameters (external) and internal param...
CPyCppyy::Parameter Parameter
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.