Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
16namespace ROOT {
17
18namespace Minuit2 {
19
20//____________________________________________________________________________________
21/**
22 Class holding the result of Minos (lower and upper values) for a specific parameter
23 */
24
26
27public:
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
39 {
40 }
41
42 MinosError &operator=(const MinosError &) = default;
43
45 {
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
88private:
89 unsigned int fParameter;
93};
94
95} // namespace Minuit2
96
97} // namespace ROOT
98
99#endif // ROOT_Minuit2_MinosError
Class holding the result of Minos (lower and upper values) for a specific parameter.
Definition MinosError.h:25
MinosError(unsigned int par, double value, const MnCross &low, const MnCross &up)
Definition MinosError.h:30
MinosError & operator()(const MinosError &err)
Definition MinosError.h:44
unsigned int NFcn() const
Definition MinosError.h:84
unsigned int Parameter() const
Definition MinosError.h:72
const MnUserParameterState & UpperState() const
Definition MinosError.h:74
bool AtUpperLimit() const
Definition MinosError.h:79
bool AtLowerMaxFcn() const
Definition MinosError.h:80
std::pair< double, double > operator()() const
Definition MinosError.h:53
const MnUserParameterState & LowerState() const
Definition MinosError.h:73
bool AtUpperMaxFcn() const
Definition MinosError.h:81
MinosError(const MinosError &err)
Definition MinosError.h:37
bool AtLowerLimit() const
Definition MinosError.h:78
MinosError & operator=(const MinosError &)=default
bool AtLimit() const
Definition MnCross.h:92
const MnUserParameterState & State() const
Definition MnCross.h:90
unsigned int NFcn() const
Definition MnCross.h:95
bool AtMaxFcn() const
Definition MnCross.h:93
bool IsValid() const
Definition MnCross.h:91
bool NewMinimum() const
Definition MnCross.h:94
double Value() const
Definition MnCross.h:89
class which holds the external user and/or internal Minuit representation of the parameters and error...
const MinuitParameter & Parameter(unsigned int i) const
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...