Logo ROOT  
Reference Guide
FunctionMinimum.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_FunctionMinimum
11 #define ROOT_Minuit2_FunctionMinimum
12 
14 
15 #include <vector>
16 #include <memory>
17 
18 #ifdef G__DICTIONARY
19 typedef ROOT::Minuit2::MinimumState MinimumState;
20 #endif
21 
22 namespace ROOT {
23 
24 namespace Minuit2 {
25 
26 //______________________________________________________________________________________________
27 /**
28  class holding the full result of the minimization;
29  both internal and external (MnUserParameterState) representation available
30  for the parameters at the Minimum
31  */
32 
34 
35 public:
38 
39 public:
40  /// constructor from only MinimumSeed. Minimum is only from seed result not full minimization
41  FunctionMinimum(const MinimumSeed &seed, double up) : fData(std::make_shared<BasicFunctionMinimum>(seed, up)) {}
42 
43  /// constructor at the end of a successfull minimization from seed and vector of states
44  FunctionMinimum(const MinimumSeed &seed, const std::vector<MinimumState> &states, double up)
45  : fData(std::make_shared<BasicFunctionMinimum>(seed, states, up))
46  {
47  }
48 
49  /// constructor at the end of a failed minimization due to exceeding function call limit
50  FunctionMinimum(const MinimumSeed &seed, const std::vector<MinimumState> &states, double up, MnReachedCallLimit)
51  : fData(std::make_shared<BasicFunctionMinimum>(seed, states, up, MnReachedCallLimit{}))
52  {
53  }
54 
55  /// constructor at the end of a failed minimization due to edm above maximum value
56  FunctionMinimum(const MinimumSeed &seed, const std::vector<MinimumState> &states, double up, MnAboveMaxEdm)
57  : fData(std::make_shared<BasicFunctionMinimum>(seed, states, up, MnAboveMaxEdm{}))
58  {
59  }
60 
61  // add new state
62  void Add(const MinimumState &state) { fData->Add(state); }
63 
64  // add new state
65  void Add(const MinimumState &state, MnAboveMaxEdm) { fData->Add(state, MnAboveMaxEdm{}); }
66 
67  const MinimumSeed &Seed() const { return fData->Seed(); }
68  const std::vector<ROOT::Minuit2::MinimumState> &States() const { return fData->States(); }
69 
70  // user representation of state at Minimum
71  const MnUserParameterState &UserState() const { return fData->UserState(); }
72  const MnUserParameters &UserParameters() const { return fData->UserParameters(); }
73  const MnUserCovariance &UserCovariance() const { return fData->UserCovariance(); }
74 
75  // forward interface of last state
76  const MinimumState &State() const { return fData->State(); }
77  const MinimumParameters &Parameters() const { return fData->Parameters(); }
78  const MinimumError &Error() const { return fData->Error(); }
79  const FunctionGradient &Grad() const { return fData->Grad(); }
80  double Fval() const { return fData->Fval(); }
81  double Edm() const { return fData->Edm(); }
82  int NFcn() const { return fData->NFcn(); }
83 
84  double Up() const { return fData->Up(); }
85  bool IsValid() const { return fData->IsValid(); }
86  bool HasValidParameters() const { return fData->HasValidParameters(); }
87  bool HasValidCovariance() const { return fData->HasValidCovariance(); }
88  bool HasAccurateCovar() const { return fData->HasAccurateCovar(); }
89  bool HasPosDefCovar() const { return fData->HasPosDefCovar(); }
90  bool HasMadePosDefCovar() const { return fData->HasMadePosDefCovar(); }
91  bool HesseFailed() const { return fData->HesseFailed(); }
92  bool HasCovariance() const { return fData->HasCovariance(); }
93  bool IsAboveMaxEdm() const { return fData->IsAboveMaxEdm(); }
94  bool HasReachedCallLimit() const { return fData->HasReachedCallLimit(); }
95 
96  void SetErrorDef(double up) { return fData->SetErrorDef(up); }
97 
98 private:
99  std::shared_ptr<BasicFunctionMinimum> fData;
100 };
101 
102 } // namespace Minuit2
103 
104 } // namespace ROOT
105 
106 #endif // ROOT_Minuit2_FunctionMinimum
ROOT::Minuit2::FunctionMinimum::fData
std::shared_ptr< BasicFunctionMinimum > fData
Definition: FunctionMinimum.h:99
ROOT::Minuit2::FunctionMinimum::Up
double Up() const
Definition: FunctionMinimum.h:84
ROOT::Minuit2::MinimumState
MinimumState keeps the information (position, Gradient, 2nd deriv, etc) after one minimization step (...
Definition: MinimumState.h:29
ROOT::Minuit2::FunctionMinimum::HesseFailed
bool HesseFailed() const
Definition: FunctionMinimum.h:91
ROOT::Minuit2::FunctionMinimum::IsValid
bool IsValid() const
Definition: FunctionMinimum.h:85
ROOT::Minuit2::FunctionMinimum::Seed
const MinimumSeed & Seed() const
Definition: FunctionMinimum.h:67
ROOT::Minuit2::FunctionMinimum::HasAccurateCovar
bool HasAccurateCovar() const
Definition: FunctionMinimum.h:88
ROOT::Minuit2::FunctionMinimum::HasReachedCallLimit
bool HasReachedCallLimit() const
Definition: FunctionMinimum.h:94
ROOT::Minuit2::FunctionMinimum::SetErrorDef
void SetErrorDef(double up)
Definition: FunctionMinimum.h:96
ROOT::Minuit2::FunctionGradient
Definition: FunctionGradient.h:21
ROOT::Minuit2::MnUserCovariance
Class containing the covariance matrix data represented as a vector of size n*(n+1)/2 Used to hide in...
Definition: MnUserCovariance.h:26
ROOT::Minuit2::BasicFunctionMinimum
result of the minimization; both internal and external (MnUserParameterState) representation availabl...
Definition: BasicFunctionMinimum.h:33
ROOT::Minuit2::FunctionMinimum::FunctionMinimum
FunctionMinimum(const MinimumSeed &seed, const std::vector< MinimumState > &states, double up, MnAboveMaxEdm)
constructor at the end of a failed minimization due to edm above maximum value
Definition: FunctionMinimum.h:56
ROOT::Minuit2::FunctionMinimum::FunctionMinimum
FunctionMinimum(const MinimumSeed &seed, const std::vector< MinimumState > &states, double up, MnReachedCallLimit)
constructor at the end of a failed minimization due to exceeding function call limit
Definition: FunctionMinimum.h:50
ROOT::Minuit2::FunctionMinimum::UserState
const MnUserParameterState & UserState() const
Definition: FunctionMinimum.h:71
ROOT::Minuit2::FunctionMinimum::Error
const MinimumError & Error() const
Definition: FunctionMinimum.h:78
ROOT::Minuit2::FunctionMinimum::Fval
double Fval() const
Definition: FunctionMinimum.h:80
ROOT::Minuit2::MinimumParameters
Definition: MinimumParameters.h:21
ROOT::Minuit2::MnUserParameters
API class for the user interaction with the parameters; serves as input to the minimizer as well as o...
Definition: MnUserParameters.h:36
ROOT::Minuit2::FunctionMinimum::Edm
double Edm() const
Definition: FunctionMinimum.h:81
ROOT::Minuit2::FunctionMinimum::Add
void Add(const MinimumState &state)
Definition: FunctionMinimum.h:62
BasicFunctionMinimum.h
ROOT::Minuit2::FunctionMinimum::UserCovariance
const MnUserCovariance & UserCovariance() const
Definition: FunctionMinimum.h:73
ROOT::Minuit2::FunctionMinimum::Grad
const FunctionGradient & Grad() const
Definition: FunctionMinimum.h:79
ROOT::Minuit2::FunctionMinimum
class holding the full result of the minimization; both internal and external (MnUserParameterState) ...
Definition: FunctionMinimum.h:33
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::BasicFunctionMinimum::MnAboveMaxEdm
Definition: BasicFunctionMinimum.h:38
ROOT::Minuit2::MinimumError
MinimumError keeps the inv.
Definition: MinimumError.h:26
ROOT::Minuit2::FunctionMinimum::Add
void Add(const MinimumState &state, MnAboveMaxEdm)
Definition: FunctionMinimum.h:65
ROOT::Minuit2::FunctionMinimum::FunctionMinimum
FunctionMinimum(const MinimumSeed &seed, const std::vector< MinimumState > &states, double up)
constructor at the end of a successfull minimization from seed and vector of states
Definition: FunctionMinimum.h:44
ROOT::Minuit2::FunctionMinimum::NFcn
int NFcn() const
Definition: FunctionMinimum.h:82
ROOT::Minuit2::FunctionMinimum::HasValidCovariance
bool HasValidCovariance() const
Definition: FunctionMinimum.h:87
ROOT::Minuit2::FunctionMinimum::HasPosDefCovar
bool HasPosDefCovar() const
Definition: FunctionMinimum.h:89
ROOT::Minuit2::FunctionMinimum::HasValidParameters
bool HasValidParameters() const
Definition: FunctionMinimum.h:86
ROOT::Minuit2::FunctionMinimum::Parameters
const MinimumParameters & Parameters() const
Definition: FunctionMinimum.h:77
ROOT::Minuit2::FunctionMinimum::IsAboveMaxEdm
bool IsAboveMaxEdm() const
Definition: FunctionMinimum.h:93
ROOT::Minuit2::FunctionMinimum::HasCovariance
bool HasCovariance() const
Definition: FunctionMinimum.h:92
ROOT::Minuit2::FunctionMinimum::State
const MinimumState & State() const
Definition: FunctionMinimum.h:76
ROOT::Minuit2::FunctionMinimum::States
const std::vector< ROOT::Minuit2::MinimumState > & States() const
Definition: FunctionMinimum.h:68
ROOT::Minuit2::FunctionMinimum::HasMadePosDefCovar
bool HasMadePosDefCovar() const
Definition: FunctionMinimum.h:90
ROOT::Minuit2::BasicFunctionMinimum::MnReachedCallLimit
Definition: BasicFunctionMinimum.h:36
ROOT::Minuit2::FunctionMinimum::UserParameters
const MnUserParameters & UserParameters() const
Definition: FunctionMinimum.h:72
ROOT::Minuit2::FunctionMinimum::FunctionMinimum
FunctionMinimum(const MinimumSeed &seed, double up)
constructor from only MinimumSeed. Minimum is only from seed result not full minimization
Definition: FunctionMinimum.h:41
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::MinimumSeed
MinimumSeed contains the starting values for the minimization produced by the SeedGenerator.
Definition: MinimumSeed.h:31