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:
39 MnUserParameters() = default;
40
41 MnUserParameters(std::span<const double>, std::span<const double>);
42
43 MnUserParameters(const MnUserParameters &par) = default;
44
46
47 const MnUserTransformation &Trafo() const { return fTransformation; }
48
49 unsigned int VariableParameters() const { return fTransformation.VariableParameters(); }
50
51 /// access to parameters (row-wise)
52 const std::vector<ROOT::Minuit2::MinuitParameter> &Parameters() const;
53
54 /// access to parameters and errors in column-wise representation
55 std::vector<double> Params() const;
56 std::vector<double> Errors() const;
57
58 /// access to single Parameter
59 const MinuitParameter &Parameter(unsigned int) const;
60
61 /// Add free Parameter Name, Value, Error
62 bool Add(const std::string &, double, double);
63 /// Add limited Parameter Name, Value, Lower bound, Upper bound
64 bool Add(const std::string &, double, double, double, double);
65 /// Add const Parameter Name, vale
66 bool Add(const std::string &, double);
67
68 /// interaction via external number of Parameter
69 void Fix(unsigned int);
70 void Release(unsigned int);
71 void RemoveLimits(unsigned int);
72 void SetValue(unsigned int, double);
73 void SetError(unsigned int, double);
74 void SetLimits(unsigned int, double, double);
75 void SetUpperLimit(unsigned int, double);
76 void SetLowerLimit(unsigned int, double);
77 void SetName(unsigned int, const std::string &);
78
79 double Value(unsigned int) const;
80 double Error(unsigned int) const;
81
82 /// interaction via Name of Parameter
83 void Fix(const std::string &);
84 void Release(const std::string &);
85 void SetValue(const std::string &, double);
86 void SetError(const std::string &, double);
87 void SetLimits(const std::string &, double, double);
88 void SetUpperLimit(const std::string &, double);
89 void SetLowerLimit(const std::string &, double);
90 void RemoveLimits(const std::string &);
91
92 double Value(const std::string &) const;
93 double Error(const std::string &) const;
94
95 // convert Name into external number of Parameter
96 unsigned int Index(const std::string &) const;
97 // convert external number into Name of Parameter
98 const std::string &GetName(unsigned int) const;
99 // maintain interface with const char * for backward compatibility
100 const char *Name(unsigned int) const;
101
102 const MnMachinePrecision &Precision() const;
103 void SetPrecision(double eps) { fTransformation.SetPrecision(eps); }
104
105private:
107};
108
109} // namespace Minuit2
110
111} // namespace ROOT
112
113#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
unsigned int Index(const std::string &) const
MnUserParameters & operator=(const MnUserParameters &par)=default
MnUserParameters(const MnUserParameters &par)=default
double Value(unsigned int) const
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
void SetUpperLimit(unsigned int, double)
bool Add(const std::string &, double, double)
Add free Parameter Name, Value, Error.
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