Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
MnUserParameterState.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_MnUserParameterState
11#define ROOT_Minuit2_MnUserParameterState
12
16
17#include <ROOT/RSpan.hxx>
18
19#include <vector>
20#include <string>
21
22namespace ROOT {
23
24namespace Minuit2 {
25
26class MinimumState;
27
28//_____________________________________________________________________________
29/**
30 class which holds the external user and/or internal Minuit representation
31 of the parameters and errors;
32 transformation internal <-> external on demand;
33 */
34
36
37public:
38 /// default constructor (invalid state)
40 : fValid(false), fCovarianceValid(false), fGCCValid(false), fCovStatus(-1), fFVal(0), fEDM(0), fNFcn(0),
43 {
44 }
45
46 /// construct from user parameters (before minimization)
47 MnUserParameterState(std::span<const double>, std::span<const double>);
48
50
51 /// construct from user parameters + covariance (before minimization)
52 MnUserParameterState(std::span<const double>, std::span<const double>, unsigned int);
53
54 MnUserParameterState(std::span<const double>, const MnUserCovariance &);
55
57
58 /// construct from internal parameters (after minimization)
60
61 // user external representation
62 const MnUserParameters &Parameters() const { return fParameters; }
63 const MnUserCovariance &Covariance() const { return fCovariance; }
64 const MnGlobalCorrelationCoeff &GlobalCC() const { return fGlobalCC; }
65
66 // hessian (inverse of covariance matrix)
68
69 // Minuit internal representation
70 const std::vector<double> &IntParameters() const { return fIntParameters; }
72
73 // covariance matrix status (0 = not valid, 1 approximate, 2, full but made pos def, 3 accurate and not pos def
74 int CovarianceStatus() const { return fCovStatus; }
75
76 // transformation internal <-> external
77 const MnUserTransformation &Trafo() const { return fParameters.Trafo(); }
78
79 bool IsValid() const { return fValid; }
80 bool HasCovariance() const { return fCovarianceValid; }
81 bool HasGlobalCC() const { return fGCCValid; }
82
83 double Fval() const { return fFVal; }
84 double Edm() const { return fEDM; }
85 unsigned int NFcn() const { return fNFcn; }
86
87public:
88 /** facade: forward interface of MnUserParameters and MnUserTransformation */
89
90 // access to parameters (row-wise)
91 const std::vector<ROOT::Minuit2::MinuitParameter> &MinuitParameters() const;
92 // access to parameters and errors in column-wise representation
93 std::vector<double> Params() const;
94 std::vector<double> Errors() const;
95
96 // access to single Parameter
97 const MinuitParameter &Parameter(unsigned int i) const;
98
99 // add free Parameter
100 void Add(const std::string &name, double val, double err);
101 // add limited Parameter
102 void Add(const std::string &name, double val, double err, double, double);
103 // add const Parameter
104 void Add(const std::string &, double);
105
106 // add covariance matrix
107 void AddCovariance(const MnUserCovariance &);
108
109 // interaction via external number of Parameter
110 void Fix(unsigned int);
111 void Release(unsigned int);
112 void RemoveLimits(unsigned int);
113 void SetValue(unsigned int, double);
114 void SetError(unsigned int, double);
115 void SetLimits(unsigned int, double, double);
116 void SetUpperLimit(unsigned int, double);
117 void SetLowerLimit(unsigned int, double);
118 void SetName(unsigned int iext, const std::string &name) { fParameters.SetName(iext, name); }
119
120 double Value(unsigned int) const;
121 double Error(unsigned int) const;
122
123 // interaction via Name of Parameter
124 void Fix(const std::string &);
125 void Release(const std::string &);
126 void SetValue(const std::string &, double);
127 void SetError(const std::string &, double);
128 void SetLimits(const std::string &, double, double);
129 void SetUpperLimit(const std::string &, double);
130 void SetLowerLimit(const std::string &, double);
131 void RemoveLimits(const std::string &);
132
133 double Value(const std::string &) const;
134 double Error(const std::string &) const;
135
136 // convert Name into external number of Parameter
137 unsigned int Index(const std::string &) const;
138 // convert external number into Name of Parameter
139 const std::string &GetName(unsigned int) const;
140 // maintain interface with const char * for backward compatibility
141 const char *Name(unsigned int) const;
142
143 // transformation internal <-> external
144 double Int2ext(unsigned int, double) const;
145 double Ext2int(unsigned int, double) const;
146 unsigned int IntOfExt(unsigned int) const;
147 unsigned int ExtOfInt(unsigned int) const;
148 unsigned int VariableParameters() const;
149 const MnMachinePrecision &Precision() const;
150 void SetPrecision(double eps);
151
152private:
153 bool fValid;
156 int fCovStatus; // covariance matrix status
157 double fFVal;
158 double fEDM;
159 unsigned int fNFcn;
160
164
165 std::vector<double> fIntParameters;
167};
168
169} // namespace Minuit2
170
171} // namespace ROOT
172
173#endif // ROOT_Minuit2_MnUserParameterState
char name[80]
Definition TGX11.cxx:110
MinimumState keeps the information (position, Gradient, 2nd deriv, etc) after one minimization step (...
class for the individual Minuit Parameter with Name and number; contains the input numbers for the mi...
class for global correlation coefficient
Sets the relative floating point (double) arithmetic precision.
Class containing the covariance matrix data represented as a vector of size n*(n+1)/2 Used to hide in...
class which holds the external user and/or internal Minuit representation of the parameters and error...
const MnMachinePrecision & Precision() const
void SetLimits(unsigned int, double, double)
const MnUserParameters & Parameters() const
const std::string & GetName(unsigned int) const
double Int2ext(unsigned int, double) const
void SetName(unsigned int iext, const std::string &name)
const MnGlobalCorrelationCoeff & GlobalCC() const
double Ext2int(unsigned int, double) const
const std::vector< double > & IntParameters() const
void Add(const std::string &name, double val, double err)
unsigned int ExtOfInt(unsigned int) const
const char * Name(unsigned int) const
void AddCovariance(const MnUserCovariance &)
MnUserParameterState()
default constructor (invalid state)
const std::vector< ROOT::Minuit2::MinuitParameter > & MinuitParameters() const
facade: forward interface of MnUserParameters and MnUserTransformation
unsigned int IntOfExt(unsigned int) const
const MnUserTransformation & Trafo() const
const MnUserCovariance & IntCovariance() const
const MnUserCovariance & Covariance() const
API class for the user interaction with the parameters; serves as input to the minimizer as well as o...
void SetName(unsigned int, const std::string &)
const MnUserTransformation & Trafo() const
class dealing with the transformation between user specified parameters (external) and internal param...
CPyCppyy::Parameter Parameter
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...