Logo ROOT  
Reference Guide
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
60
63 fCovStatus(state.fCovStatus), fFVal(state.fFVal), fEDM(state.fEDM), fNFcn(state.fNFcn),
66 {
67 }
68
70 {
71 if (this != &state) {
72 fValid = state.fValid;
74 fGCCValid = state.fGCCValid;
75 fCovStatus = state.fCovStatus;
76 fFVal = state.fFVal;
77 fEDM = state.fEDM;
78 fNFcn = state.fNFcn;
81 fGlobalCC = state.fGlobalCC;
84 }
85 return *this;
86 }
87
88 // user external representation
89 const MnUserParameters &Parameters() const { return fParameters; }
90 const MnUserCovariance &Covariance() const { return fCovariance; }
91 const MnGlobalCorrelationCoeff &GlobalCC() const { return fGlobalCC; }
92
93 // hessian (inverse of covariance matrix)
95
96 // Minuit internal representation
97 const std::vector<double> &IntParameters() const { return fIntParameters; }
99
100 // covariance matrix status (0 = not valid, 1 approximate, 2, full but made pos def, 3 accurate and not pos def
101 int CovarianceStatus() const { return fCovStatus; }
102
103 // transformation internal <-> external
104 const MnUserTransformation &Trafo() const { return fParameters.Trafo(); }
105
106 bool IsValid() const { return fValid; }
107 bool HasCovariance() const { return fCovarianceValid; }
108 bool HasGlobalCC() const { return fGCCValid; }
109
110 double Fval() const { return fFVal; }
111 double Edm() const { return fEDM; }
112 unsigned int NFcn() const { return fNFcn; }
113
114public:
115 /** facade: forward interface of MnUserParameters and MnUserTransformation */
116
117 // access to parameters (row-wise)
118 const std::vector<ROOT::Minuit2::MinuitParameter> &MinuitParameters() const;
119 // access to parameters and errors in column-wise representation
120 std::vector<double> Params() const;
121 std::vector<double> Errors() const;
122
123 // access to single Parameter
124 const MinuitParameter &Parameter(unsigned int i) const;
125
126 // add free Parameter
127 void Add(const std::string &name, double val, double err);
128 // add limited Parameter
129 void Add(const std::string &name, double val, double err, double, double);
130 // add const Parameter
131 void Add(const std::string &, double);
132
133 // interaction via external number of Parameter
134 void Fix(unsigned int);
135 void Release(unsigned int);
136 void RemoveLimits(unsigned int);
137 void SetValue(unsigned int, double);
138 void SetError(unsigned int, double);
139 void SetLimits(unsigned int, double, double);
140 void SetUpperLimit(unsigned int, double);
141 void SetLowerLimit(unsigned int, double);
142 void SetName(unsigned int iext, const std::string &name) { fParameters.SetName(iext, name); }
143
144 double Value(unsigned int) const;
145 double Error(unsigned int) const;
146
147 // interaction via Name of Parameter
148 void Fix(const std::string &);
149 void Release(const std::string &);
150 void SetValue(const std::string &, double);
151 void SetError(const std::string &, double);
152 void SetLimits(const std::string &, double, double);
153 void SetUpperLimit(const std::string &, double);
154 void SetLowerLimit(const std::string &, double);
155 void RemoveLimits(const std::string &);
156
157 double Value(const std::string &) const;
158 double Error(const std::string &) const;
159
160 // convert Name into external number of Parameter
161 unsigned int Index(const std::string &) const;
162 // convert external number into Name of Parameter
163 const std::string &GetName(unsigned int) const;
164 // mantain interface with const char * for backward compatibility
165 const char *Name(unsigned int) const;
166
167 // transformation internal <-> external
168 double Int2ext(unsigned int, double) const;
169 double Ext2int(unsigned int, double) const;
170 unsigned int IntOfExt(unsigned int) const;
171 unsigned int ExtOfInt(unsigned int) const;
172 unsigned int VariableParameters() const;
173 const MnMachinePrecision &Precision() const;
174 void SetPrecision(double eps);
175
176private:
177 bool fValid;
180 int fCovStatus; // covariance matrix status
181 double fFVal;
182 double fEDM;
183 unsigned int fNFcn;
184
188
189 std::vector<double> fIntParameters;
191};
192
193} // namespace Minuit2
194
195} // namespace ROOT
196
197#endif // ROOT_Minuit2_MnUserParameterState
double
Definition: Converters.cxx:939
char name[80]
Definition: TGX11.cxx:110
MinimumState keeps the information (position, Gradient, 2nd deriv, etc) after one minimization step (...
Definition: MinimumState.h:27
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
unsigned int Index(const std::string &) 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
MnUserParameterState & operator=(const MnUserParameterState &state)
const MinuitParameter & Parameter(unsigned int i) 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
void SetUpperLimit(unsigned int, double)
const MnUserCovariance & IntCovariance() const
const MnUserCovariance & Covariance() const
std::vector< double > Errors() const
void SetLowerLimit(unsigned int, double)
MnUserParameterState(const MnUserParameterState &state)
std::vector< double > Params() 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...
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...