Logo ROOT  
Reference Guide
MnStrategy.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_MnStrategy
11 #define ROOT_Minuit2_MnStrategy
12 
13 namespace ROOT {
14 
15  namespace Minuit2 {
16 
17 //_________________________________________________________________________
18 /**
19  API class for defining three levels of strategies: low (0), medium (1),
20  high (>=2);
21  acts on: Migrad (behavioural),
22  Minos (lowers strategy by 1 for Minos-own minimization),
23  Hesse (iterations),
24  Numerical2PDerivative (iterations)
25  */
26 
27 class MnStrategy {
28 
29 public:
30 
31  //default strategy
32  MnStrategy();
33 
34  //user defined strategy (0, 1, >=2)
35  explicit MnStrategy(unsigned int);
36 
37  ~MnStrategy() {}
38 
39  unsigned int Strategy() const {return fStrategy;}
40 
41  unsigned int GradientNCycles() const {return fGradNCyc;}
42  double GradientStepTolerance() const {return fGradTlrStp;}
43  double GradientTolerance() const {return fGradTlr;}
44 
45  unsigned int HessianNCycles() const {return fHessNCyc;}
46  double HessianStepTolerance() const {return fHessTlrStp;}
47  double HessianG2Tolerance() const {return fHessTlrG2;}
48  unsigned int HessianGradientNCycles() const {return fHessGradNCyc;}
49 
50  int StorageLevel() const { return fStoreLevel; }
51 
52  bool IsLow() const {return fStrategy == 0;}
53  bool IsMedium() const {return fStrategy == 1;}
54  bool IsHigh() const {return fStrategy >= 2;}
55 
56  void SetLowStrategy();
59 
60  void SetGradientNCycles(unsigned int n) {fGradNCyc = n;}
61  void SetGradientStepTolerance(double stp) {fGradTlrStp = stp;}
62  void SetGradientTolerance(double toler) {fGradTlr = toler;}
63 
64  void SetHessianNCycles(unsigned int n) {fHessNCyc = n;}
65  void SetHessianStepTolerance(double stp) {fHessTlrStp = stp;}
66  void SetHessianG2Tolerance(double toler) {fHessTlrG2 = toler;}
67  void SetHessianGradientNCycles(unsigned int n) {fHessGradNCyc = n;}
68 
69  // set storage level of iteration quantities
70  // 0 = store only last iterations 1 = full storage (default)
71  void SetStorageLevel(unsigned int level) { fStoreLevel = level; }
72 private:
73 
74  unsigned int fStrategy;
75 
76  unsigned int fGradNCyc;
77  double fGradTlrStp;
78  double fGradTlr;
79  unsigned int fHessNCyc;
80  double fHessTlrStp;
81  double fHessTlrG2;
82  unsigned int fHessGradNCyc;
84 };
85 
86  } // namespace Minuit2
87 
88 } // namespace ROOT
89 
90 #endif // ROOT_Minuit2_MnStrategy
n
const Int_t n
Definition: legend1.C:16
ROOT::Minuit2::MnStrategy::Strategy
unsigned int Strategy() const
Definition: MnStrategy.h:51
ROOT::Minuit2::MnStrategy::fHessTlrStp
double fHessTlrStp
Definition: MnStrategy.h:92
ROOT::Minuit2::MnStrategy::HessianStepTolerance
double HessianStepTolerance() const
Definition: MnStrategy.h:58
ROOT::Minuit2::MnStrategy::SetHessianG2Tolerance
void SetHessianG2Tolerance(double toler)
Definition: MnStrategy.h:78
ROOT::Minuit2::MnStrategy::SetLowStrategy
void SetLowStrategy()
Definition: MnStrategy.cxx:39
ROOT::Minuit2::MnStrategy::IsHigh
bool IsHigh() const
Definition: MnStrategy.h:66
ROOT::Minuit2::MnStrategy::fHessGradNCyc
unsigned int fHessGradNCyc
Definition: MnStrategy.h:94
ROOT::Minuit2::MnStrategy::MnStrategy
MnStrategy()
Definition: MnStrategy.cxx:26
ROOT::Minuit2::MnStrategy::GradientNCycles
unsigned int GradientNCycles() const
Definition: MnStrategy.h:53
ROOT::Minuit2::MnStrategy::SetHessianGradientNCycles
void SetHessianGradientNCycles(unsigned int n)
Definition: MnStrategy.h:79
ROOT::Minuit2::MnStrategy::IsLow
bool IsLow() const
Definition: MnStrategy.h:64
ROOT::Minuit2::MnStrategy::GradientTolerance
double GradientTolerance() const
Definition: MnStrategy.h:55
ROOT::Minuit2::MnStrategy::GradientStepTolerance
double GradientStepTolerance() const
Definition: MnStrategy.h:54
ROOT::Minuit2::MnStrategy::SetGradientStepTolerance
void SetGradientStepTolerance(double stp)
Definition: MnStrategy.h:73
ROOT::Minuit2::MnStrategy::fGradTlrStp
double fGradTlrStp
Definition: MnStrategy.h:89
ROOT::Minuit2::MnStrategy::fHessTlrG2
double fHessTlrG2
Definition: MnStrategy.h:93
ROOT::Minuit2::MnStrategy::HessianNCycles
unsigned int HessianNCycles() const
Definition: MnStrategy.h:57
ROOT::Minuit2::MnStrategy::SetHessianStepTolerance
void SetHessianStepTolerance(double stp)
Definition: MnStrategy.h:77
ROOT::Minuit2::MnStrategy::SetGradientTolerance
void SetGradientTolerance(double toler)
Definition: MnStrategy.h:74
ROOT::Minuit2::MnStrategy::StorageLevel
int StorageLevel() const
Definition: MnStrategy.h:62
ROOT::Minuit2::MnStrategy::fGradTlr
double fGradTlr
Definition: MnStrategy.h:90
ROOT::Minuit2::MnStrategy::fStoreLevel
int fStoreLevel
Definition: MnStrategy.h:95
ROOT::Minuit2::MnStrategy::HessianG2Tolerance
double HessianG2Tolerance() const
Definition: MnStrategy.h:59
ROOT::Minuit2::MnStrategy::fHessNCyc
unsigned int fHessNCyc
Definition: MnStrategy.h:91
ROOT::Minuit2::MnStrategy::IsMedium
bool IsMedium() const
Definition: MnStrategy.h:65
ROOT::Minuit2::MnStrategy::fGradNCyc
unsigned int fGradNCyc
Definition: MnStrategy.h:88
ROOT::Minuit2::MnStrategy::fStrategy
unsigned int fStrategy
Definition: MnStrategy.h:86
ROOT::Minuit2::MnStrategy::~MnStrategy
~MnStrategy()
Definition: MnStrategy.h:49
ROOT::Minuit2::MnStrategy::SetHighStrategy
void SetHighStrategy()
Definition: MnStrategy.cxx:63
ROOT::Minuit2::MnStrategy::HessianGradientNCycles
unsigned int HessianGradientNCycles() const
Definition: MnStrategy.h:60
ROOT::Minuit2::MnStrategy::SetStorageLevel
void SetStorageLevel(unsigned int level)
Definition: MnStrategy.h:83
ROOT::Minuit2::MnStrategy::SetHessianNCycles
void SetHessianNCycles(unsigned int n)
Definition: MnStrategy.h:76
ROOT
VSD Structures.
Definition: StringConv.hxx:21
ROOT::Minuit2::MnStrategy::SetMediumStrategy
void SetMediumStrategy()
Definition: MnStrategy.cxx:51
ROOT::Minuit2::MnStrategy::SetGradientNCycles
void SetGradientNCycles(unsigned int n)
Definition: MnStrategy.h:72