Logo ROOT  
Reference Guide
BasicMinimumError.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_BasicMinimumError
11#define ROOT_Minuit2_BasicMinimumError
12
13#include "Minuit2/MnConfig.h"
14#include "Minuit2/MnMatrix.h"
15#include "Minuit2/LaSum.h"
17
18namespace ROOT {
19
20 namespace Minuit2 {
21
22//extern StackAllocator gStackAllocator;
23
24/**
25 Internal Class containing the error information on the
26 estimated minimum :
27 Error matrix + dcovar + additional flags for quality and validity checks
28 */
29
31
32public:
33
34 class MnNotPosDef {};
35 class MnMadePosDef {};
36 class MnHesseFailed {};
38
39public:
40
41 BasicMinimumError(unsigned int n) :
42 fMatrix(MnAlgebraicSymMatrix(n)), fDCovar(1.), fValid(false), fPosDef(false), fMadePosDef(false), fHesseFailed(false), fInvertFailed(false), fAvailable(false) {}
43
44 BasicMinimumError(const MnAlgebraicSymMatrix& mat, double dcov) :
45 fMatrix(mat), fDCovar(dcov), fValid(true), fPosDef(true), fMadePosDef(false), fHesseFailed(false), fInvertFailed(false), fAvailable(true) {}
46
48 fMatrix(mat), fDCovar(1.), fValid(false), fPosDef(false), fMadePosDef(false), fHesseFailed(true), fInvertFailed(false), fAvailable(true) {}
49
51 fMatrix(mat), fDCovar(1.), fValid(true), fPosDef(false), fMadePosDef(true), fHesseFailed(false), fInvertFailed(false), fAvailable(true) {}
52
54 fMatrix(mat), fDCovar(1.), fValid(false), fPosDef(true), fMadePosDef(false), fHesseFailed(false), fInvertFailed(true), fAvailable(true) {}
55
57 fMatrix(mat), fDCovar(1.), fValid(false), fPosDef(false), fMadePosDef(false), fHesseFailed(false), fInvertFailed(false), fAvailable(true) {}
58
60
62
64 fMatrix = err.fMatrix;
65 fDCovar = err.fDCovar;
66 fValid = err.fValid;
67 fPosDef = err.fPosDef;
72 return *this;
73 }
74
75 void* operator new(size_t nbytes) {
76 return StackAllocatorHolder::Get().Allocate(nbytes);
77 }
78
79 void operator delete(void* p, size_t /*nbytes */) {
81 }
82
83 MnAlgebraicSymMatrix Matrix() const {return 2.*fMatrix;}
84
85 const MnAlgebraicSymMatrix& InvHessian() const {return fMatrix;}
86
88
89 double Dcovar() const {return fDCovar;}
90 bool IsAccurate() const {return fDCovar < 0.1;}
91 bool IsValid() const {return fValid;}
92 bool IsPosDef() const {return fPosDef;}
93 bool IsMadePosDef() const {return fMadePosDef;}
94 bool HesseFailed() const {return fHesseFailed;}
95 bool InvertFailed() const {return fInvertFailed;}
96 bool IsAvailable() const {return fAvailable;}
97
98private:
99
101 double fDCovar;
102 bool fValid;
108};
109
110 } // namespace Minuit2
111
112} // namespace ROOT
113
114#endif // ROOT_Minuit2_BasicMinimumError
#define e(i)
Definition: RSha256.hxx:103
Internal Class containing the error information on the estimated minimum : Error matrix + dcovar + ad...
BasicMinimumError(const MnAlgebraicSymMatrix &mat, double dcov)
BasicMinimumError(const MnAlgebraicSymMatrix &mat, MnMadePosDef)
BasicMinimumError(const BasicMinimumError &e)
BasicMinimumError & operator=(const BasicMinimumError &err)
BasicMinimumError(const MnAlgebraicSymMatrix &mat, MnHesseFailed)
MnAlgebraicSymMatrix Hessian() const
const MnAlgebraicSymMatrix & InvHessian() const
BasicMinimumError(const MnAlgebraicSymMatrix &mat, MnNotPosDef)
BasicMinimumError(const MnAlgebraicSymMatrix &mat, MnInvertFailed)
MnAlgebraicSymMatrix Matrix() const
Class describing a symmetric matrix of size n.
Definition: LASymMatrix.h:51
static StackAllocator & Get()
void * Allocate(size_t nBytes)
const Int_t n
Definition: legend1.C:16
VSD Structures.
Definition: StringConv.hxx:21