Logo ROOT  
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 #include <string>
31 
32 class TGraph;
33 
34 class TFitResult:public TNamed, public ROOT::Fit::FitResult {
35 
36 public:
37 
38  // Default constructor for I/O
39  TFitResult(int status = 0): TNamed("TFitResult","TFitResult"),
40  ROOT::Fit::FitResult() {
41  fStatus = status;
42  };
43 
44  // constructor from name and title
45  TFitResult(const char * name, const char * title) :
46  TNamed(name,title),
47  ROOT::Fit::FitResult()
48  {}
49 
50  // constructor from an FitResult
52 
53  virtual ~TFitResult() {}
54 
55 
56  virtual void Print(Option_t *option="") const;
57 
59 
61 
62  // scan likelihood value of parameter and fill the given graph.
64  bool Scan(unsigned int ipar, TGraph * gr, double xmin = 0, double xmax = 0);
65 
66  // create contour of two parameters around the minimum
67  // pass as option confidence level: default is a value of 0.683
69  bool Contour(unsigned int ipar, unsigned int jpar, TGraph * gr , double confLevel = 0.683);
70 
71  using TObject::Error;
72 
73  // need to re-implement to solve conflict with TObject::Error
74  double Error(unsigned int i) const {
75  return ParError(i);
76  }
77 
78 private:
79  ClassDef(TFitResult, 0); // Class holding the result of the fit
80 };
81 
82 namespace cling {
83  std::string printValue(const TFitResult* val);
84 }
85 #endif
TFitResult::GetCovarianceMatrix
TMatrixDSym GetCovarianceMatrix() const
Return the covariance matrix from fit.
Definition: TFitResult.cxx:59
HFit::Fit
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
ROOT::Fit::FitResult::FitResult
FitResult()
Default constructor for an empty (non valid) fit result.
Definition: FitResult.cxx:45
f
#define f(i)
Definition: RSha256.hxx:104
Option_t
const char Option_t
Definition: RtypesCore.h:66
ROOT::Fit::FitResult::Contour
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:704
xmax
float xmax
Definition: THbookFile.cxx:95
TNamed.h
TObject::Error
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:893
TFitResult
Extends the ROOT::Fit::Result class with a TNamed inheritance providing easy possibility for I/O.
Definition: TFitResult.h:34
TMatrixTSym< Double_t >
ROOT::Fit::FitResult::fStatus
int fStatus
Definition: FitResult.h:349
TFitResult::GetCorrelationMatrix
TMatrixDSym GetCorrelationMatrix() const
Return the correlation matrix from fit.
Definition: TFitResult.cxx:77
TMatrixDSym.h
ROOT::Fit::FitResult::Scan
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:683
xmin
float xmin
Definition: THbookFile.cxx:95
gr
TGraphErrors * gr
Definition: legend1.C:25
TNamed
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
ROOT::Fit::FitResult
class containg the result of the fit and all the related information (fitted parameter values,...
Definition: FitResult.h:47
TFitResult::Contour
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
TFitResult::TFitResult
TFitResult(int status=0)
Definition: TFitResult.h:39
TFitResult::Print
virtual void Print(Option_t *option="") const
Print result of the fit, by default chi2, parameter values and errors.
Definition: TFitResult.cxx:44
TFitResult::~TFitResult
virtual ~TFitResult()
Definition: TFitResult.h:53
TGraph
A TGraph is an object made of two arrays X and Y with npoints each.
Definition: TGraph.h:41
TFitResult::Error
double Error(unsigned int i) const
Definition: TFitResult.h:74
ROOT::Fit::FitResult::ParError
double ParError(unsigned int i) const
parameter error by index
Definition: FitResult.h:190
TFitResult::TFitResult
TFitResult(const char *name, const char *title)
Definition: TFitResult.h:45
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
name
char name[80]
Definition: TGX11.cxx:110
TFitResult::Scan
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
FitResult.h
ROOT
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Definition: EExecutionPolicy.hxx:4