Logo ROOT   6.14/05
Reference Guide
MnHesse.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_MnHesse
11 #define ROOT_Minuit2_MnHesse
12 
13 #include "Minuit2/MnConfig.h"
14 #include "Minuit2/MnStrategy.h"
15 
16 #include <vector>
17 
18 namespace ROOT {
19 
20  namespace Minuit2 {
21 
22 
23 class FCNBase;
24 class MnUserParameterState;
25 class MnUserParameters;
26 class MnUserCovariance;
27 class MnUserTransformation;
28 class MinimumState;
29 class MnMachinePrecision;
30 class MnFcn;
31 class FunctionMinimum;
32 
33 //_______________________________________________________________________
34 /**
35  API class for calculating the numerical covariance matrix
36  (== 2x Inverse Hessian == 2x Inverse 2nd derivative); can be used by the
37  user or Minuit itself
38  */
39 
40 class MnHesse {
41 
42 public:
43 
44  /// default constructor with default strategy
46 
47  /// constructor with user-defined strategy level
48  MnHesse(unsigned int stra) : fStrategy(MnStrategy(stra)) {}
49 
50  /// conctructor with specific strategy
51  MnHesse(const MnStrategy& stra) : fStrategy(stra) {}
52 
53  ~MnHesse() {}
54 
55  ///
56  /// low-level API
57  ///
58  /// FCN + parameters + errors
59  MnUserParameterState operator()(const FCNBase&, const std::vector<double>&, const std::vector<double>&, unsigned int maxcalls=0) const;
60  /// FCN + parameters + covariance
61  MnUserParameterState operator()(const FCNBase&, const std::vector<double>&, unsigned int nrow, const std::vector<double>&, unsigned int maxcalls = 0) const;
62  /// FCN + parameters + MnUserCovariance
63  MnUserParameterState operator()(const FCNBase&, const std::vector<double>&, const MnUserCovariance&, unsigned int maxcalls=0) const;
64  ///
65  /// high-level API
66  ///
67  /// FCN + MnUserParameters
68  MnUserParameterState operator()(const FCNBase&, const MnUserParameters&, unsigned int maxcalls=0) const;
69  /// FCN + MnUserParameters + MnUserCovariance
70  MnUserParameterState operator()(const FCNBase&, const MnUserParameters&, const MnUserCovariance&, unsigned int maxcalls=0) const;
71  /// FCN + MnUserParameterState
72  MnUserParameterState operator()(const FCNBase&, const MnUserParameterState&, unsigned int maxcalls=0) const;
73  ///
74  /// API to use MnHesse after minimization when function mimimum is avalilable, otherwise information on the last state will be
75  /// lost. (It would be needed to re-call the gradient and spend extra useless function calls)
76  /// The Function Minimum is updated (modified) by adding the Hesse results as last state of minimization
77  ///
78  void operator()(const FCNBase&, FunctionMinimum&, unsigned int maxcalls=0) const;
79 
80 
81  /// internal interface
82  ///
83  MinimumState operator()(const MnFcn&, const MinimumState&, const MnUserTransformation&, unsigned int maxcalls=0) const;
84 
85  /// forward interface of MnStrategy
86  unsigned int Ncycles() const {return fStrategy.HessianNCycles();}
87  double Tolerstp() const {return fStrategy.HessianStepTolerance();}
88  double TolerG2() const {return fStrategy.HessianG2Tolerance();}
89 
90 private:
91 
93 };
94 
95  } // namespace Minuit2
96 
97 } // namespace ROOT
98 
99 #endif // ROOT_Minuit2_MnHesse
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
MnHesse(const MnStrategy &stra)
conctructor with specific strategy
Definition: MnHesse.h:51
double HessianStepTolerance() const
Definition: MnStrategy.h:46
MnHesse()
default constructor with default strategy
Definition: MnHesse.h:45
MnStrategy fStrategy
Definition: MnHesse.h:92
class holding the full result of the minimization; both internal and external (MnUserParameterState) ...
API class for calculating the numerical covariance matrix (== 2x Inverse Hessian == 2x Inverse 2nd de...
Definition: MnHesse.h:40
unsigned int HessianNCycles() const
Definition: MnStrategy.h:45
double HessianG2Tolerance() const
Definition: MnStrategy.h:47
Wrapper class to FCNBase interface used internally by Minuit.
Definition: MnFcn.h:33
Interface (abstract class) defining the function to be minimized, which has to be implemented by the ...
Definition: FCNBase.h:47
class which holds the external user and/or internal Minuit representation of the parameters and error...
class dealing with the transformation between user specified parameters (external) and internal param...
API class for the user interaction with the parameters; serves as input to the minimizer as well as o...
double TolerG2() const
Definition: MnHesse.h:88
MnHesse(unsigned int stra)
constructor with user-defined strategy level
Definition: MnHesse.h:48
MnUserParameterState operator()(const FCNBase &, const std::vector< double > &, const std::vector< double > &, unsigned int maxcalls=0) const
low-level API
Definition: MnHesse.cxx:38
double Tolerstp() const
Definition: MnHesse.h:87
unsigned int Ncycles() const
forward interface of MnStrategy
Definition: MnHesse.h:86
MinimumState keeps the information (position, Gradient, 2nd deriv, etc) after one minimization step (...
Definition: MinimumState.h:29
API class for defining three levels of strategies: low (0), medium (1), high (>=2); acts on: Migrad (...
Definition: MnStrategy.h:27
Class containing the covariance matrix data represented as a vector of size n*(n+1)/2 Used to hide in...