Logo ROOT   master
Reference Guide
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
50 
51  virtual ~TFitResult() {}
52 
53 
54  virtual void Print(Option_t *option="") const;
55 
57 
59 
60  // scan likelihood value of parameter and fill the given graph.
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
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
float xmin
Definition: THbookFile.cxx:93
Returns the available number of logical cores.
Definition: RNumpyDS.hxx:30
TMatrixDSym GetCovarianceMatrix() const
Return the covariance matrix from fit.
Definition: TFitResult.cxx:59
const char Option_t
Definition: RtypesCore.h:64
TMatrixDSym GetCorrelationMatrix() const
Return the correlation matrix from fit.
Definition: TFitResult.cxx:77
#define f(i)
Definition: RSha256.hxx:104
TFitResult(const char *name, const char *title)
Definition: TFitResult.h:43
bool Scan(unsigned int ipar, unsigned int &npoints, double *pntsx, double *pntsy, double xmin=0, double xmax=0)
scan likelihood value of parameter and fill the given graph.
Definition: FitResult.cxx:678
#define ClassDef(name, id)
Definition: Rtypes.h:322
Extends the ROOT::Fit::Result class with a TNamed inheritance providing easy possibility for I/O...
Definition: TFitResult.h:32
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
TFitResult(int status=0)
Definition: TFitResult.h:37
virtual void Print(Option_t *option="") const
Print result of the fit, by default chi2, parameter values and errors.
Definition: TFitResult.cxx:44
bool Contour(unsigned int ipar, unsigned int jpar, TGraph *gr, double confLevel=0.683)
Create a 2D contour around the minimum for the parameter ipar and jpar if a minimum does not exist or...
Definition: TFitResult.cxx:119
bool Scan(unsigned int ipar, TGraph *gr, double xmin=0, double xmax=0)
Scan parameter ipar between value of xmin and xmax A graph must be given which will be on return fill...
Definition: TFitResult.cxx:93
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:889
float xmax
Definition: THbookFile.cxx:93
TGraphErrors * gr
Definition: legend1.C:25
double Error(unsigned int i) const
Definition: TFitResult.h:72
class containg the result of the fit and all the related information (fitted parameter values...
Definition: FitResult.h:47
TFitResultPtr Fit(FitObject *h1, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption, const char *goption, ROOT::Fit::DataRange &range)
Definition: HFitImpl.cxx:133
Print a TSeq at the prompt:
Definition: TDatime.h:115
A TGraph is an object made of two arrays X and Y with npoints each.
Definition: TGraph.h:41
FitResult()
Default constructor for an empty (non valid) fit result.
Definition: FitResult.cxx:45
bool Contour(unsigned int ipar, unsigned int jpar, unsigned int &npoints, double *pntsx, double *pntsy, double confLevel=0.683)
create contour of two parameters around the minimum pass as option confidence level: default is a val...
Definition: FitResult.cxx:699
virtual ~TFitResult()
Definition: TFitResult.h:51
char name[80]
Definition: TGX11.cxx:109
double ParError(unsigned int i) const
parameter error by index
Definition: FitResult.h:190