Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
MnContours.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_MnContours
11 #define ROOT_Minuit2_MnContours
12 
13 
14 #include "Minuit2/MnConfig.h"
15 #include "Minuit2/MnStrategy.h"
16 
17 #include <vector>
18 #include <utility>
19 
20 namespace ROOT {
21 
22  namespace Minuit2 {
23 
24 
25 class FCNBase;
26 class FunctionMinimum;
27 class ContoursError;
28 
29 //_____________________________________________________________
30 /**
31  API class for Contours Error analysis (2-dim errors);
32  minimization has to be done before and Minimum must be valid;
33  possibility to ask only for the points or the points and associated Minos
34  errors;
35  */
36 
37 class MnContours {
38 
39 public:
40 
41  /// construct from FCN + Minimum
42  MnContours(const FCNBase& fcn, const FunctionMinimum& min) : fFCN(fcn), fMinimum(min), fStrategy(MnStrategy(1)) {}
43 
44  /// construct from FCN + Minimum + strategy
45  MnContours(const FCNBase& fcn, const FunctionMinimum& min, unsigned int stra) : fFCN(fcn), fMinimum(min), fStrategy(MnStrategy(stra)) {}
46 
47  /// construct from FCN + Minimum + strategy
48  MnContours(const FCNBase& fcn, const FunctionMinimum& min, const MnStrategy& stra) : fFCN(fcn), fMinimum(min), fStrategy(stra) {}
49 
50  ~MnContours() {}
51 
52  /// ask for one Contour (points only) from number of points (>=4) and parameter indeces
53  std::vector<std::pair<double,double> > operator()(unsigned int, unsigned int, unsigned int npoints = 20) const;
54 
55  /// ask for one Contour ContoursError (MinosErrors + points)
56  /// from number of points (>=4) and parameter indeces
57  /// can be printed via std::cout
58  ContoursError Contour(unsigned int, unsigned int, unsigned int npoints = 20) const;
59 
60  const MnStrategy& Strategy() const {return fStrategy;}
61 
62 private:
63 
64  const FCNBase& fFCN;
65  const FunctionMinimum& fMinimum;
66  MnStrategy fStrategy;
67 };
68 
69  } // namespace Minuit2
70 
71 } // namespace ROOT
72 
73 #endif // ROOT_Minuit2_MnContours