Logo ROOT  
Reference Guide
MinosError.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_MinosError
11 #define ROOT_Minuit2_MinosError
12 
13 #include "Minuit2/MnCross.h"
14 #include <iostream>
15 #include <utility>
16 
17 namespace ROOT {
18 
19  namespace Minuit2 {
20 
21 //____________________________________________________________________________________
22 /**
23  Class holding the result of Minos (lower and upper values) for a specific parameter
24  */
25 
26 class MinosError {
27 
28 public:
29 
30  MinosError() : fParameter(0), fMinParValue(0.), fUpper(MnCross()), fLower(MnCross()) {}
31 
32  MinosError(unsigned int par, double value, const MnCross& low, const MnCross& up) : fParameter(par), fMinParValue(value), fUpper(up), fLower(low) {}
33 
35 
37 
38  MinosError& operator=(const MinosError& ) = default;
39 
40  MinosError& operator()(const MinosError& err) {
41  fParameter = err.fParameter;
42  fMinParValue = err.fMinParValue;
43  fUpper = err.fUpper;
44  fLower = err.fLower;
45  return *this;
46  }
47 
48  std::pair<double,double> operator()() const {
49  return std::pair<double,double>(Lower(), Upper());
50  }
51  double Lower() const {
52  if (AtLowerLimit())
54  if (LowerValid() )
55  return -1. * LowerState().Error(Parameter()) * (1. + fLower.Value());
56  // return Hessian Error in case is invalid
57  return - LowerState().Error(Parameter());
58  }
59  double Upper() const {
60  if (AtUpperLimit())
62  if (UpperValid())
63  return UpperState().Error(Parameter()) * (1. + fUpper.Value());
64  // return Hessian Error in case is invalid
65  return UpperState().Error(Parameter());
66  }
67  unsigned int Parameter() const {return fParameter;}
68  const MnUserParameterState& LowerState() const {return fLower.State();}
69  const MnUserParameterState& UpperState() const {return fUpper.State();}
70  bool IsValid() const {return fLower.IsValid() && fUpper.IsValid();}
71  bool LowerValid() const {return fLower.IsValid();}
72  bool UpperValid() const {return fUpper.IsValid();}
73  bool AtLowerLimit() const {return fLower.AtLimit();}
74  bool AtUpperLimit() const {return fUpper.AtLimit();}
75  bool AtLowerMaxFcn() const {return fLower.AtMaxFcn();}
76  bool AtUpperMaxFcn() const {return fUpper.AtMaxFcn();}
77  bool LowerNewMin() const {return fLower.NewMinimum();}
78  bool UpperNewMin() const {return fUpper.NewMinimum();}
79  unsigned int NFcn() const {return fUpper.NFcn() + fLower.NFcn();}
80  // return parameter value at the minimum
81  double Min() const {return fMinParValue;}
82 
83 private:
84 
85  unsigned int fParameter;
86  double fMinParValue;
89 };
90 
91  } // namespace Minuit2
92 
93 } // namespace ROOT
94 
95 #endif // ROOT_Minuit2_MinosError
ROOT::Minuit2::MinosError::Min
double Min() const
Definition: MinosError.h:93
ROOT::Minuit2::MnCross::Value
double Value() const
Definition: MnCross.h:73
ROOT::Minuit2::MinosError::AtLowerMaxFcn
bool AtLowerMaxFcn() const
Definition: MinosError.h:87
ROOT::Minuit2::MinosError::operator=
MinosError & operator=(const MinosError &)=default
ROOT::Minuit2::MnUserParameterState::Error
double Error(unsigned int) const
Definition: MnUserParameterState.cxx:373
ROOT::Minuit2::MinosError::UpperNewMin
bool UpperNewMin() const
Definition: MinosError.h:90
ROOT::Minuit2::MinuitParameter::UpperLimit
double UpperLimit() const
Definition: MinuitParameter.h:169
ROOT::Minuit2::MinosError::fLower
MnCross fLower
Definition: MinosError.h:100
ROOT::Minuit2::MinosError::LowerValid
bool LowerValid() const
Definition: MinosError.h:83
ROOT::Minuit2::MinosError::~MinosError
~MinosError()
Definition: MinosError.h:46
ROOT::Minuit2::MnCross::NewMinimum
bool NewMinimum() const
Definition: MnCross.h:78
ROOT::Minuit2::MinosError::fParameter
unsigned int fParameter
Definition: MinosError.h:97
ROOT::Minuit2::MnCross::NFcn
unsigned int NFcn() const
Definition: MnCross.h:79
ROOT::Minuit2::MinosError::UpperValid
bool UpperValid() const
Definition: MinosError.h:84
MnCross.h
ROOT::Minuit2::MinosError::Parameter
unsigned int Parameter() const
Definition: MinosError.h:79
ROOT::Minuit2::MinosError::AtUpperLimit
bool AtUpperLimit() const
Definition: MinosError.h:86
ROOT::Minuit2::MinosError::AtLowerLimit
bool AtLowerLimit() const
Definition: MinosError.h:85
ROOT::Minuit2::MnCross::State
const MnUserParameterState & State() const
Definition: MnCross.h:74
ROOT::Minuit2::MnCross
Definition: MnCross.h:28
ROOT::Minuit2::MinosError::Lower
double Lower() const
Definition: MinosError.h:63
ROOT::Minuit2::MinosError::AtUpperMaxFcn
bool AtUpperMaxFcn() const
Definition: MinosError.h:88
ROOT::Minuit2::MinosError
Class holding the result of Minos (lower and upper values) for a specific parameter.
Definition: MinosError.h:34
ROOT::Minuit2::MnCross::IsValid
bool IsValid() const
Definition: MnCross.h:75
ROOT::Minuit2::MinosError::operator()
std::pair< double, double > operator()() const
Definition: MinosError.h:60
ROOT::Minuit2::MinosError::UpperState
const MnUserParameterState & UpperState() const
Definition: MinosError.h:81
ROOT::Minuit2::MinosError::fUpper
MnCross fUpper
Definition: MinosError.h:99
ROOT::Minuit2::MinosError::LowerState
const MnUserParameterState & LowerState() const
Definition: MinosError.h:80
ROOT::Minuit2::MnUserParameterState::Parameter
const MinuitParameter & Parameter(unsigned int i) const
Definition: MnUserParameterState.cxx:207
ROOT::Minuit2::MinosError::LowerNewMin
bool LowerNewMin() const
Definition: MinosError.h:89
ROOT::Minuit2::MinosError::MinosError
MinosError()
Definition: MinosError.h:42
ROOT::Minuit2::MinosError::Upper
double Upper() const
Definition: MinosError.h:71
ROOT::Minuit2::MinuitParameter::LowerLimit
double LowerLimit() const
Definition: MinuitParameter.h:168
ROOT::Minuit2::MinosError::NFcn
unsigned int NFcn() const
Definition: MinosError.h:91
ROOT::Minuit2::MnCross::AtLimit
bool AtLimit() const
Definition: MnCross.h:76
ROOT
VSD Structures.
Definition: StringConv.hxx:21
ROOT::Minuit2::MinosError::fMinParValue
double fMinParValue
Definition: MinosError.h:98
ROOT::Minuit2::MinosError::IsValid
bool IsValid() const
Definition: MinosError.h:82
ROOT::Minuit2::MnCross::AtMaxFcn
bool AtMaxFcn() const
Definition: MnCross.h:77