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"
16 #include "Minuit2/StackAllocator.h"
17 
18 namespace 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 
30 class BasicMinimumError {
31 
32 public:
33 
34  class MnNotPosDef {};
35  class MnMadePosDef {};
36  class MnHesseFailed {};
37  class MnInvertFailed {};
38 
39 public:
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;
68  fMadePosDef = err.fMadePosDef;
69  fHesseFailed = err.fHesseFailed;
70  fInvertFailed = err.fInvertFailed;
71  fAvailable = err.fAvailable;
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 
98 private:
99 
101  double fDCovar;
102  bool fValid;
103  bool fPosDef;
108 };
109 
110  } // namespace Minuit2
111 
112 } // namespace ROOT
113 
114 #endif // ROOT_Minuit2_BasicMinimumError
n
const Int_t n
Definition: legend1.C:16
ROOT::Minuit2::BasicMinimumError::MnMadePosDef
Definition: BasicMinimumError.h:47
ROOT::Minuit2::BasicMinimumError::IsAccurate
bool IsAccurate() const
Definition: BasicMinimumError.h:102
e
#define e(i)
Definition: RSha256.hxx:121
ROOT::Minuit2::LASymMatrix
Class describing a symmetric matrix of size n.
Definition: LASymMatrix.h:59
ROOT::Minuit2::StackAllocator::Deallocate
void Deallocate(void *p)
Definition: StackAllocator.h:112
ROOT::Minuit2::MnAlgebraicSymMatrix
LASymMatrix MnAlgebraicSymMatrix
Definition: MnMatrix.h:36
MnMatrix.h
ROOT::Minuit2::BasicMinimumError::BasicMinimumError
BasicMinimumError(unsigned int n)
Definition: BasicMinimumError.h:53
ROOT::Minuit2::BasicMinimumError::fInvertFailed
bool fInvertFailed
Definition: BasicMinimumError.h:118
ROOT::Minuit2::BasicMinimumError::IsValid
bool IsValid() const
Definition: BasicMinimumError.h:103
ROOT::Minuit2::BasicMinimumError::IsPosDef
bool IsPosDef() const
Definition: BasicMinimumError.h:104
ROOT::Minuit2::BasicMinimumError::MnNotPosDef
Definition: BasicMinimumError.h:46
ROOT::Minuit2::BasicMinimumError::fPosDef
bool fPosDef
Definition: BasicMinimumError.h:115
ROOT::Minuit2::BasicMinimumError::Hessian
MnAlgebraicSymMatrix Hessian() const
Definition: BasicMinimumError.cxx:33
ROOT::Minuit2::BasicMinimumError::Dcovar
double Dcovar() const
Definition: BasicMinimumError.h:101
ROOT::Minuit2::BasicMinimumError::fDCovar
double fDCovar
Definition: BasicMinimumError.h:113
ROOT::Minuit2::BasicMinimumError::HesseFailed
bool HesseFailed() const
Definition: BasicMinimumError.h:106
ROOT::Minuit2::BasicMinimumError::fValid
bool fValid
Definition: BasicMinimumError.h:114
ROOT::Minuit2::BasicMinimumError::Matrix
MnAlgebraicSymMatrix Matrix() const
Definition: BasicMinimumError.h:95
StackAllocator.h
ROOT::Minuit2::StackAllocator::Allocate
void * Allocate(size_t nBytes)
Definition: StackAllocator.h:83
ROOT::Minuit2::BasicMinimumError::IsAvailable
bool IsAvailable() const
Definition: BasicMinimumError.h:108
ROOT::Minuit2::StackAllocatorHolder::Get
static StackAllocator & Get()
Definition: StackAllocator.h:232
ROOT::Minuit2::BasicMinimumError::IsMadePosDef
bool IsMadePosDef() const
Definition: BasicMinimumError.h:105
ROOT::Minuit2::BasicMinimumError::operator=
BasicMinimumError & operator=(const BasicMinimumError &err)
Definition: BasicMinimumError.h:75
ROOT::Minuit2::BasicMinimumError::InvertFailed
bool InvertFailed() const
Definition: BasicMinimumError.h:107
ROOT::Minuit2::BasicMinimumError::fAvailable
bool fAvailable
Definition: BasicMinimumError.h:119
ROOT::Minuit2::BasicMinimumError::BasicMinimumError
BasicMinimumError(const MnAlgebraicSymMatrix &mat, double dcov)
Definition: BasicMinimumError.h:56
ROOT::Minuit2::BasicMinimumError::MnHesseFailed
Definition: BasicMinimumError.h:48
ROOT::Minuit2::BasicMinimumError::MnInvertFailed
Definition: BasicMinimumError.h:49
LaSum.h
ROOT::Minuit2::BasicMinimumError::fHesseFailed
bool fHesseFailed
Definition: BasicMinimumError.h:117
ROOT::Minuit2::BasicMinimumError::fMadePosDef
bool fMadePosDef
Definition: BasicMinimumError.h:116
ROOT::Minuit2::BasicMinimumError::InvHessian
const MnAlgebraicSymMatrix & InvHessian() const
Definition: BasicMinimumError.h:97
ROOT::Minuit2::BasicMinimumError::~BasicMinimumError
~BasicMinimumError()
Definition: BasicMinimumError.h:71
ROOT
VSD Structures.
Definition: StringConv.hxx:21
ROOT::Minuit2::BasicMinimumError::fMatrix
MnAlgebraicSymMatrix fMatrix
Definition: BasicMinimumError.h:112
MnConfig.h
ROOT::Minuit2::BasicMinimumError
Internal Class containing the error information on the estimated minimum : Error matrix + dcovar + ad...
Definition: BasicMinimumError.h:38