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 
17 #ifdef G__DICTIONARY
18 typedef ROOT::Minuit2::MinimumState MinimumState;
19 #endif
20 
21 namespace ROOT {
22 
23  namespace Minuit2 {
24 
25 //______________________________________________________________________________________________
26 /**
27  class holding the full result of the minimization;
28  both internal and external (MnUserParameterState) representation available
29  for the parameters at the Minimum
30  */
31 
32 class FunctionMinimum {
33 
34 public:
35 
36  class MnReachedCallLimit {};
37  class MnAboveMaxEdm {};
38 
39 public:
40 
41 
42  /// constructor from only MinimumSeed. Minimum is only from seed result not full minimization
44 
45  /// constructor at the end of a successfull minimization from seed and vector of states
46  FunctionMinimum(const MinimumSeed& seed, const std::vector<MinimumState>& states, double up) : fData(MnRefCountedPointer<BasicFunctionMinimum>(new BasicFunctionMinimum(seed, states, up))) {}
47 
48  /// constructor at the end of a failed minimization due to exceeding function call limit
49  FunctionMinimum(const MinimumSeed& seed, const std::vector<MinimumState>& states, double up, MnReachedCallLimit) : fData(MnRefCountedPointer<BasicFunctionMinimum>(new BasicFunctionMinimum(seed, states, up, BasicFunctionMinimum::MnReachedCallLimit()))) {}
50 
51  /// constructor at the end of a failed minimization due to edm above maximum value
52  FunctionMinimum(const MinimumSeed& seed, const std::vector<MinimumState>& states, double up, MnAboveMaxEdm) : fData(MnRefCountedPointer<BasicFunctionMinimum>(new BasicFunctionMinimum(seed, states, up, BasicFunctionMinimum::MnAboveMaxEdm()))) {}
53 
54  /// copy constructo
56 
58  fData = min.fData;
59  return *this;
60  }
61 
62  ~FunctionMinimum() {}
63 
64  // add new state
65  void Add(const MinimumState& state) {fData->Add(state);}
66 
67  // add new state
68  void Add(const MinimumState& state, MnAboveMaxEdm) {fData->Add(state,BasicFunctionMinimum::MnAboveMaxEdm());}
69 
70  const MinimumSeed& Seed() const {return fData->Seed();}
71  const std::vector<ROOT::Minuit2::MinimumState>& States() const {return fData->States();}
72 
73 // user representation of state at Minimum
75  return fData->UserState();
76  }
78  return fData->UserParameters();
79  }
81  return fData->UserCovariance();
82  }
83 
84 // forward interface of last state
85  const MinimumState& State() const {return fData->State();}
86  const MinimumParameters& Parameters() const {return fData->Parameters();}
87  const MinimumError& Error() const {return fData->Error();}
88  const FunctionGradient& Grad() const {return fData->Grad();}
89  double Fval() const {return fData->Fval();}
90  double Edm() const {return fData->Edm();}
91  int NFcn() const {return fData->NFcn();}
92 
93  double Up() const {return fData->Up();}
94  bool IsValid() const {return fData->IsValid();}
95  bool HasValidParameters() const {return fData->HasValidParameters();}
96  bool HasValidCovariance() const {return fData->HasValidCovariance();}
97  bool HasAccurateCovar() const {return fData->HasAccurateCovar();}
98  bool HasPosDefCovar() const {return fData->HasPosDefCovar();}
99  bool HasMadePosDefCovar() const {return fData->HasMadePosDefCovar();}
100  bool HesseFailed() const {return fData->HesseFailed();}
101  bool HasCovariance() const {return fData->HasCovariance();}
102  bool IsAboveMaxEdm() const {return fData->IsAboveMaxEdm();}
103  bool HasReachedCallLimit() const {return fData->HasReachedCallLimit();}
104 
105  void SetErrorDef( double up) { return fData->SetErrorDef(up);}
106 
107 private:
108 
110 };
111 
112  } // namespace Minuit2
113 
114 } // namespace ROOT
115 
116 #endif // ROOT_Minuit2_FunctionMinimum
ROOT::Minuit2::FunctionMinimum::Up
double Up() const
Definition: FunctionMinimum.h:105
ROOT::Minuit2::MinimumState
MinimumState keeps the information (position, Gradient, 2nd deriv, etc) after one minimization step (...
Definition: MinimumState.h:37
ROOT::Minuit2::FunctionMinimum::HesseFailed
bool HesseFailed() const
Definition: FunctionMinimum.h:112
ROOT::Minuit2::FunctionMinimum::IsValid
bool IsValid() const
Definition: FunctionMinimum.h:106
ROOT::Minuit2::FunctionMinimum::Seed
const MinimumSeed & Seed() const
Definition: FunctionMinimum.h:82
ROOT::Minuit2::FunctionMinimum::HasAccurateCovar
bool HasAccurateCovar() const
Definition: FunctionMinimum.h:109
ROOT::Minuit2::FunctionMinimum::HasReachedCallLimit
bool HasReachedCallLimit() const
Definition: FunctionMinimum.h:115
ROOT::Minuit2::FunctionMinimum::SetErrorDef
void SetErrorDef(double up)
Definition: FunctionMinimum.h:117
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:35
ROOT::Minuit2::BasicFunctionMinimum
result of the minimization; both internal and external (MnUserParameterState) representation availabl...
Definition: BasicFunctionMinimum.h:42
ROOT::Minuit2::FunctionMinimum::UserState
const MnUserParameterState & UserState() const
Definition: FunctionMinimum.h:86
ROOT::Minuit2::FunctionMinimum::~FunctionMinimum
~FunctionMinimum()
Definition: FunctionMinimum.h:74
ROOT::Minuit2::FunctionMinimum::Error
const MinimumError & Error() const
Definition: FunctionMinimum.h:99
ROOT::Minuit2::FunctionMinimum::Fval
double Fval() const
Definition: FunctionMinimum.h:101
ROOT::Minuit2::MinimumParameters
Definition: MinimumParameters.h:29
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:45
ROOT::Minuit2::FunctionMinimum::Edm
double Edm() const
Definition: FunctionMinimum.h:102
ROOT::Minuit2::FunctionMinimum::Add
void Add(const MinimumState &state)
Definition: FunctionMinimum.h:77
BasicFunctionMinimum.h
ROOT::Minuit2::MnRefCountedPointer
Definition: MnRefCountedPointer.h:28
ROOT::Minuit2::FunctionMinimum::UserCovariance
const MnUserCovariance & UserCovariance() const
Definition: FunctionMinimum.h:92
ROOT::Minuit2::FunctionMinimum::Grad
const FunctionGradient & Grad() const
Definition: FunctionMinimum.h:100
ROOT::Minuit2::FunctionMinimum
class holding the full result of the minimization; both internal and external (MnUserParameterState) ...
Definition: FunctionMinimum.h:40
ROOT::Minuit2::MnUserParameterState
class which holds the external user and/or internal Minuit representation of the parameters and error...
Definition: MnUserParameterState.h:42
ROOT::Minuit2::BasicFunctionMinimum::MnAboveMaxEdm
Definition: BasicFunctionMinimum.h:51
ROOT::Minuit2::MinimumError
MinimumError keeps the inv.
Definition: MinimumError.h:34
ROOT::Minuit2::FunctionMinimum::MnReachedCallLimit
Definition: FunctionMinimum.h:48
ROOT::Minuit2::FunctionMinimum::NFcn
int NFcn() const
Definition: FunctionMinimum.h:103
ROOT::Minuit2::FunctionMinimum::HasValidCovariance
bool HasValidCovariance() const
Definition: FunctionMinimum.h:108
ROOT::Minuit2::FunctionMinimum::HasPosDefCovar
bool HasPosDefCovar() const
Definition: FunctionMinimum.h:110
ROOT::Minuit2::FunctionMinimum::MnAboveMaxEdm
Definition: FunctionMinimum.h:49
ROOT::Minuit2::FunctionMinimum::HasValidParameters
bool HasValidParameters() const
Definition: FunctionMinimum.h:107
ROOT::Minuit2::FunctionMinimum::Parameters
const MinimumParameters & Parameters() const
Definition: FunctionMinimum.h:98
ROOT::Minuit2::FunctionMinimum::IsAboveMaxEdm
bool IsAboveMaxEdm() const
Definition: FunctionMinimum.h:114
ROOT::Minuit2::FunctionMinimum::HasCovariance
bool HasCovariance() const
Definition: FunctionMinimum.h:113
ROOT::Minuit2::FunctionMinimum::State
const MinimumState & State() const
Definition: FunctionMinimum.h:97
ROOT::Minuit2::FunctionMinimum::operator=
FunctionMinimum & operator=(const FunctionMinimum &min)
Definition: FunctionMinimum.h:69
ROOT::Minuit2::FunctionMinimum::States
const std::vector< ROOT::Minuit2::MinimumState > & States() const
Definition: FunctionMinimum.h:83
ROOT::Minuit2::FunctionMinimum::HasMadePosDefCovar
bool HasMadePosDefCovar() const
Definition: FunctionMinimum.h:111
ROOT::Minuit2::FunctionMinimum::fData
MnRefCountedPointer< BasicFunctionMinimum > fData
Definition: FunctionMinimum.h:121
ROOT::Minuit2::FunctionMinimum::UserParameters
const MnUserParameters & UserParameters() const
Definition: FunctionMinimum.h:89
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:55
ROOT
VSD Structures.
Definition: StringConv.hxx:21
ROOT::Minuit2::MinimumSeed
MinimumSeed contains the starting values for the minimization produced by the SeedGenerator.
Definition: MinimumSeed.h:39