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 
31 
32 public:
33  class MnNotPosDef {
34  };
35  class MnMadePosDef {
36  };
37  class MnHesseFailed {
38  };
40  };
41 
42 public:
43  BasicMinimumError(unsigned int n)
44  : fMatrix(MnAlgebraicSymMatrix(n)), fDCovar(1.), fValid(false), fPosDef(false), fMadePosDef(false),
45  fHesseFailed(false), fInvertFailed(false), fAvailable(false)
46  {
47  }
48 
49  BasicMinimumError(const MnAlgebraicSymMatrix &mat, double dcov)
50  : fMatrix(mat), fDCovar(dcov), fValid(true), fPosDef(true), fMadePosDef(false), fHesseFailed(false),
51  fInvertFailed(false), fAvailable(true)
52  {
53  }
54 
56  : fMatrix(mat), fDCovar(1.), fValid(false), fPosDef(false), fMadePosDef(false), fHesseFailed(true),
57  fInvertFailed(false), fAvailable(true)
58  {
59  }
60 
62  : fMatrix(mat), fDCovar(1.), fValid(true), fPosDef(false), fMadePosDef(true), fHesseFailed(false),
63  fInvertFailed(false), fAvailable(true)
64  {
65  }
66 
68  : fMatrix(mat), fDCovar(1.), fValid(false), fPosDef(true), fMadePosDef(false), fHesseFailed(false),
69  fInvertFailed(true), fAvailable(true)
70  {
71  }
72 
74  : fMatrix(mat), fDCovar(1.), fValid(false), fPosDef(false), fMadePosDef(false), fHesseFailed(false),
75  fInvertFailed(false), fAvailable(true)
76  {
77  }
78 
80 
84  {
85  }
86 
88  {
89  fMatrix = err.fMatrix;
90  fDCovar = err.fDCovar;
91  fValid = err.fValid;
92  fPosDef = err.fPosDef;
96  fAvailable = err.fAvailable;
97  return *this;
98  }
99 
100  void *operator new(size_t nbytes) { return StackAllocatorHolder::Get().Allocate(nbytes); }
101 
102  void operator delete(void *p, size_t /*nbytes */) { StackAllocatorHolder::Get().Deallocate(p); }
103 
104  MnAlgebraicSymMatrix Matrix() const { return 2. * fMatrix; }
105 
106  const MnAlgebraicSymMatrix &InvHessian() const { return fMatrix; }
107 
109 
110  double Dcovar() const { return fDCovar; }
111  bool IsAccurate() const { return fDCovar < 0.1; }
112  bool IsValid() const { return fValid; }
113  bool IsPosDef() const { return fPosDef; }
114  bool IsMadePosDef() const { return fMadePosDef; }
115  bool HesseFailed() const { return fHesseFailed; }
116  bool InvertFailed() const { return fInvertFailed; }
117  bool IsAvailable() const { return fAvailable; }
118 
119 private:
121  double fDCovar;
122  bool fValid;
123  bool fPosDef;
128 };
129 
130 } // namespace Minuit2
131 
132 } // namespace ROOT
133 
134 #endif // ROOT_Minuit2_BasicMinimumError
n
const Int_t n
Definition: legend1.C:16
ROOT::Minuit2::BasicMinimumError::MnMadePosDef
Definition: BasicMinimumError.h:35
ROOT::Minuit2::BasicMinimumError::IsAccurate
bool IsAccurate() const
Definition: BasicMinimumError.h:111
e
#define e(i)
Definition: RSha256.hxx:103
ROOT::Minuit2::LASymMatrix
Class describing a symmetric matrix of size n.
Definition: LASymMatrix.h:45
ROOT::Minuit2::StackAllocator::Deallocate
void Deallocate(void *p)
Definition: StackAllocator.h:103
MnMatrix.h
ROOT::Minuit2::BasicMinimumError::BasicMinimumError
BasicMinimumError(unsigned int n)
Definition: BasicMinimumError.h:43
ROOT::Minuit2::BasicMinimumError::fInvertFailed
bool fInvertFailed
Definition: BasicMinimumError.h:126
ROOT::Minuit2::BasicMinimumError::IsValid
bool IsValid() const
Definition: BasicMinimumError.h:112
ROOT::Minuit2::BasicMinimumError::IsPosDef
bool IsPosDef() const
Definition: BasicMinimumError.h:113
ROOT::Minuit2::BasicMinimumError::MnNotPosDef
Definition: BasicMinimumError.h:33
ROOT::Minuit2::BasicMinimumError::BasicMinimumError
BasicMinimumError(const MnAlgebraicSymMatrix &mat, MnHesseFailed)
Definition: BasicMinimumError.h:55
ROOT::Minuit2::BasicMinimumError::fPosDef
bool fPosDef
Definition: BasicMinimumError.h:123
ROOT::Minuit2::BasicMinimumError::Hessian
MnAlgebraicSymMatrix Hessian() const
Definition: BasicMinimumError.cxx:20
ROOT::Minuit2::BasicMinimumError::BasicMinimumError
BasicMinimumError(const MnAlgebraicSymMatrix &mat, MnInvertFailed)
Definition: BasicMinimumError.h:67
ROOT::Minuit2::BasicMinimumError::Dcovar
double Dcovar() const
Definition: BasicMinimumError.h:110
ROOT::Minuit2::BasicMinimumError::fDCovar
double fDCovar
Definition: BasicMinimumError.h:121
ROOT::Minuit2::BasicMinimumError::HesseFailed
bool HesseFailed() const
Definition: BasicMinimumError.h:115
ROOT::Minuit2::BasicMinimumError::fValid
bool fValid
Definition: BasicMinimumError.h:122
ROOT::Minuit2::BasicMinimumError::Matrix
MnAlgebraicSymMatrix Matrix() const
Definition: BasicMinimumError.h:104
StackAllocator.h
ROOT::Minuit2::StackAllocator::Allocate
void * Allocate(size_t nBytes)
Definition: StackAllocator.h:71
ROOT::Minuit2::BasicMinimumError::IsAvailable
bool IsAvailable() const
Definition: BasicMinimumError.h:117
ROOT::Minuit2::BasicMinimumError::BasicMinimumError
BasicMinimumError(const BasicMinimumError &e)
Definition: BasicMinimumError.h:81
ROOT::Minuit2::StackAllocatorHolder::Get
static StackAllocator & Get()
Definition: StackAllocator.h:223
ROOT::Minuit2::BasicMinimumError::BasicMinimumError
BasicMinimumError(const MnAlgebraicSymMatrix &mat, MnNotPosDef)
Definition: BasicMinimumError.h:73
ROOT::Minuit2::BasicMinimumError::IsMadePosDef
bool IsMadePosDef() const
Definition: BasicMinimumError.h:114
ROOT::Minuit2::BasicMinimumError::operator=
BasicMinimumError & operator=(const BasicMinimumError &err)
Definition: BasicMinimumError.h:87
ROOT::Minuit2::BasicMinimumError::InvertFailed
bool InvertFailed() const
Definition: BasicMinimumError.h:116
ROOT::Minuit2::BasicMinimumError::fAvailable
bool fAvailable
Definition: BasicMinimumError.h:127
ROOT::Minuit2::BasicMinimumError::BasicMinimumError
BasicMinimumError(const MnAlgebraicSymMatrix &mat, double dcov)
Definition: BasicMinimumError.h:49
ROOT::Minuit2::BasicMinimumError::MnHesseFailed
Definition: BasicMinimumError.h:37
ROOT::Minuit2::BasicMinimumError::MnInvertFailed
Definition: BasicMinimumError.h:39
LaSum.h
ROOT::Minuit2::BasicMinimumError::fHesseFailed
bool fHesseFailed
Definition: BasicMinimumError.h:125
ROOT::Minuit2::BasicMinimumError::fMadePosDef
bool fMadePosDef
Definition: BasicMinimumError.h:124
ROOT::Minuit2::BasicMinimumError::InvHessian
const MnAlgebraicSymMatrix & InvHessian() const
Definition: BasicMinimumError.h:106
ROOT::Minuit2::BasicMinimumError::BasicMinimumError
BasicMinimumError(const MnAlgebraicSymMatrix &mat, MnMadePosDef)
Definition: BasicMinimumError.h:61
ROOT::Minuit2::BasicMinimumError::~BasicMinimumError
~BasicMinimumError()
Definition: BasicMinimumError.h:79
ROOT
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Definition: EExecutionPolicy.hxx:4
ROOT::Minuit2::BasicMinimumError::fMatrix
MnAlgebraicSymMatrix fMatrix
Definition: BasicMinimumError.h:120
MnConfig.h
ROOT::Minuit2::BasicMinimumError
Internal Class containing the error information on the estimated minimum : Error matrix + dcovar + ad...
Definition: BasicMinimumError.h:30