Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TFitResult.h
Go to the documentation of this file.
1 // @(#)root/mathcore:$Id$
2 // Author: David Gonzalez Maline Tue Nov 10 15:01:24 2009
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2009, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TFitResult
13 #define ROOT_TFitResult
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TFitResult //
18 // //
19 // Provides a way to view the fit result and to store them. //
20 // //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #include "TNamed.h"
25 
26 #include "Fit/FitResult.h"
27 
28 #include "TMatrixDSym.h"
29 
30 class TGraph;
31 
32 class TFitResult:public TNamed, public ROOT::Fit::FitResult {
33 
34 public:
35 
36  // Default constructor for I/O
37  TFitResult(int status = 0): TNamed("TFitResult","TFitResult"),
38  ROOT::Fit::FitResult() {
39  fStatus = status;
40  };
41 
42  // constructor from name and title
43  TFitResult(const char * name, const char * title) :
44  TNamed(name,title),
45  ROOT::Fit::FitResult()
46  {}
47 
48  // constructor from an FitResult
49  TFitResult(const ROOT::Fit::FitResult& f);
50 
51  virtual ~TFitResult() {}
52 
53 
54  virtual void Print(Option_t *option="") const;
55 
56  TMatrixDSym GetCovarianceMatrix() const;
57 
58  TMatrixDSym GetCorrelationMatrix() const;
59 
60  // scan likelihood value of parameter and fill the given graph.
61  using ROOT::Fit::FitResult::Scan;
62  bool Scan(unsigned int ipar, TGraph * gr, double xmin = 0, double xmax = 0);
63 
64  // create contour of two parameters around the minimum
65  // pass as option confidence level: default is a value of 0.683
66  using ROOT::Fit::FitResult::Contour;
67  bool Contour(unsigned int ipar, unsigned int jpar, TGraph * gr , double confLevel = 0.683);
68 
69  using TObject::Error;
70 
71  // need to re-implement to solve conflict with TObject::Error
72  double Error(unsigned int i) const {
73  return ParError(i);
74  }
75 
76 private:
77  ClassDef(TFitResult, 0); // Class holding the result of the fit
78 };
79 
80 namespace cling {
81  std::string printValue(const TFitResult* val);
82 }
83 #endif