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