Logo ROOT   6.08/07
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 #ifndef ROOT_Minuit2_MnConfig
14 #include "Minuit2/MnConfig.h"
15 #endif
16 #ifndef ROOT_Minuit2_MnMatrix
17 #include "Minuit2/MnMatrix.h"
18 #endif
19 #ifndef ROOT_Minuit2_LaSum
20 #include "Minuit2/LaSum.h"
21 #endif
22 #ifndef ROOT_Minuit2_StackAllocator
23 #include "Minuit2/StackAllocator.h"
24 #endif
25 
26 namespace ROOT {
27 
28  namespace Minuit2 {
29 
30 //extern StackAllocator gStackAllocator;
31 
32 /**
33  Internal Class containing the error information on the
34  estimated minimum :
35  Error matrix + dcovar + additional flags for quality and validity checks
36  */
37 
39 
40 public:
41 
42  class MnNotPosDef {};
43  class MnMadePosDef {};
44  class MnHesseFailed {};
45  class MnInvertFailed {};
46 
47 public:
48 
49  BasicMinimumError(unsigned int n) :
50  fMatrix(MnAlgebraicSymMatrix(n)), fDCovar(1.), fValid(false), fPosDef(false), fMadePosDef(false), fHesseFailed(false), fInvertFailed(false), fAvailable(false) {}
51 
52  BasicMinimumError(const MnAlgebraicSymMatrix& mat, double dcov) :
53  fMatrix(mat), fDCovar(dcov), fValid(true), fPosDef(true), fMadePosDef(false), fHesseFailed(false), fInvertFailed(false), fAvailable(true) {}
54 
56  fMatrix(mat), fDCovar(1.), fValid(false), fPosDef(false), fMadePosDef(false), fHesseFailed(true), fInvertFailed(false), fAvailable(true) {}
57 
59  fMatrix(mat), fDCovar(1.), fValid(true), fPosDef(false), fMadePosDef(true), fHesseFailed(false), fInvertFailed(false), fAvailable(true) {}
60 
62  fMatrix(mat), fDCovar(1.), fValid(false), fPosDef(true), fMadePosDef(false), fHesseFailed(false), fInvertFailed(true), fAvailable(true) {}
63 
65  fMatrix(mat), fDCovar(1.), fValid(false), fPosDef(false), fMadePosDef(false), fHesseFailed(false), fInvertFailed(false), fAvailable(true) {}
66 
68 
70 
72  fMatrix = err.fMatrix;
73  fDCovar = err.fDCovar;
74  fValid = err.fValid;
75  fPosDef = err.fPosDef;
79  fAvailable = err.fAvailable;
80  return *this;
81  }
82 
83  void* operator new(size_t nbytes) {
84  return StackAllocatorHolder::Get().Allocate(nbytes);
85  }
86 
87  void operator delete(void* p, size_t /*nbytes */) {
89  }
90 
91  MnAlgebraicSymMatrix Matrix() const {return 2.*fMatrix;}
92 
93  const MnAlgebraicSymMatrix& InvHessian() const {return fMatrix;}
94 
96 
97  double Dcovar() const {return fDCovar;}
98  bool IsAccurate() const {return fDCovar < 0.1;}
99  bool IsValid() const {return fValid;}
100  bool IsPosDef() const {return fPosDef;}
101  bool IsMadePosDef() const {return fMadePosDef;}
102  bool HesseFailed() const {return fHesseFailed;}
103  bool InvertFailed() const {return fInvertFailed;}
104  bool IsAvailable() const {return fAvailable;}
105 
106 private:
107 
109  double fDCovar;
110  bool fValid;
111  bool fPosDef;
116 };
117 
118  } // namespace Minuit2
119 
120 } // namespace ROOT
121 
122 #endif // ROOT_Minuit2_BasicMinimumError
This namespace contains pre-defined functions to be used in conjuction with TExecutor::Map and TExecu...
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)