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 <vector>
18#include <string>
19
20namespace ROOT {
21
22namespace Minuit2 {
23
24class MinimumState;
25
26//_____________________________________________________________________________
27/**
28 class which holds the external user and/or internal Minuit representation
29 of the parameters and errors;
30 transformation internal <-> external on demand;
31 */
32
34
35public:
36 /// default constructor (invalid state)
38 : fValid(false), fCovarianceValid(false), fGCCValid(false), fCovStatus(-1), fFVal(0), fEDM(0), fNFcn(0),
41 {
42 }
43
44 /// construct from user parameters (before minimization)
45 MnUserParameterState(const std::vector<double> &, const std::vector<double> &);
46
48
49 /// construct from user parameters + covariance (before minimization)
50 MnUserParameterState(const std::vector<double> &, const std::vector<double> &, unsigned int);
51
52 MnUserParameterState(const std::vector<double> &, const MnUserCovariance &);
53
55
56 /// construct from internal parameters (after minimization)
58
59 // user external representation
60 const MnUserParameters &Parameters() const { return fParameters; }
61 const MnUserCovariance &Covariance() const { return fCovariance; }
62 const MnGlobalCorrelationCoeff &GlobalCC() const { return fGlobalCC; }
63
64 // hessian (inverse of covariance matrix)
66
67 // Minuit internal representation
68 const std::vector<double> &IntParameters() const { return fIntParameters; }
70
71 // covariance matrix status (0 = not valid, 1 approximate, 2, full but made pos def, 3 accurate and not pos def
72 int CovarianceStatus() const { return fCovStatus; }
73
74 // transformation internal <-> external
75 const MnUserTransformation &Trafo() const { return fParameters.Trafo(); }
76
77 bool IsValid() const { return fValid; }
78 bool HasCovariance() const { return fCovarianceValid; }
79 bool HasGlobalCC() const { return fGCCValid; }
80
81 double Fval() const { return fFVal; }
82 double Edm() const { return fEDM; }
83 unsigned int NFcn() const { return fNFcn; }
84
85public:
86 /** facade: forward interface of MnUserParameters and MnUserTransformation */
87
88 // access to parameters (row-wise)
89 const std::vector<ROOT::Minuit2::MinuitParameter> &MinuitParameters() const;
90 // access to parameters and errors in column-wise representation
91 std::vector<double> Params() const;
92 std::vector<double> Errors() const;
93
94 // access to single Parameter
95 const MinuitParameter &Parameter(unsigned int i) const;
96
97 // add free Parameter
98 void Add(const std::string &name, double val, double err);
99 // add limited Parameter
100 void Add(const std::string &name, double val, double err, double, double);
101 // add const Parameter
102 void Add(const std::string &, double);
103
104 // interaction via external number of Parameter
105 void Fix(unsigned int);
106 void Release(unsigned int);
107 void RemoveLimits(unsigned int);
108 void SetValue(unsigned int, double);
109 void SetError(unsigned int, double);
110 void SetLimits(unsigned int, double, double);
111 void SetUpperLimit(unsigned int, double);
112 void SetLowerLimit(unsigned int, double);
113 void SetName(unsigned int iext, const std::string &name) { fParameters.SetName(iext, name); }
114
115 double Value(unsigned int) const;
116 double Error(unsigned int) const;
117
118 // interaction via Name of Parameter
119 void Fix(const std::string &);
120 void Release(const std::string &);
121 void SetValue(const std::string &, double);
122 void SetError(const std::string &, double);
123 void SetLimits(const std::string &, double, double);
124 void SetUpperLimit(const std::string &, double);
125 void SetLowerLimit(const std::string &, double);
126 void RemoveLimits(const std::string &);
127
128 double Value(const std::string &) const;
129 double Error(const std::string &) const;
130
131 // convert Name into external number of Parameter
132 unsigned int Index(const std::string &) const;
133 // convert external number into Name of Parameter
134 const std::string &GetName(unsigned int) const;
135 // maintain interface with const char * for backward compatibility
136 const char *Name(unsigned int) const;
137
138 // transformation internal <-> external
139 double Int2ext(unsigned int, double) const;
140 double Ext2int(unsigned int, double) const;
141 unsigned int IntOfExt(unsigned int) const;
142 unsigned int ExtOfInt(unsigned int) const;
143 unsigned int VariableParameters() const;
144 const MnMachinePrecision &Precision() const;
145 void SetPrecision(double eps);
146
147private:
148 bool fValid;
151 int fCovStatus; // covariance matrix status
152 double fFVal;
153 double fEDM;
154 unsigned int fNFcn;
155
159
160 std::vector<double> fIntParameters;
162};
163
164} // namespace Minuit2
165
166} // namespace ROOT
167
168#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
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
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.