Logo ROOT   6.14/05
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 
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;
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
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
Class describing a symmetric matrix of size n.
Definition: LASymMatrix.h:51
Internal Class containing the error information on the estimated minimum : Error matrix + dcovar + ad...
const MnAlgebraicSymMatrix & InvHessian() const
BasicMinimumError(const BasicMinimumError &e)
BasicMinimumError(const MnAlgebraicSymMatrix &mat, MnNotPosDef)
void * Allocate(size_t nBytes)
BasicMinimumError(const MnAlgebraicSymMatrix &mat, MnHesseFailed)
BasicMinimumError & operator=(const BasicMinimumError &err)
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
Definition: TRolke.cxx:630
MnAlgebraicSymMatrix Hessian() const
BasicMinimumError(const MnAlgebraicSymMatrix &mat, double dcov)
MnAlgebraicSymMatrix Matrix() const
BasicMinimumError(const MnAlgebraicSymMatrix &mat, MnInvertFailed)
static StackAllocator & Get()
const Int_t n
Definition: legend1.C:16
BasicMinimumError(const MnAlgebraicSymMatrix &mat, MnMadePosDef)