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
30class TGraph;
31
33
34public:
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),
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
76private:
77 ClassDef(TFitResult, 0); // Class holding the result of the fit
78};
79
80namespace cling {
81 std::string printValue(const TFitResult* val);
82}
83#endif
#define f(i)
Definition: RSha256.hxx:104
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:326
char name[80]
Definition: TGX11.cxx:109
float xmin
Definition: THbookFile.cxx:93
float xmax
Definition: THbookFile.cxx:93
class containg the result of the fit and all the related information (fitted parameter values,...
Definition: FitResult.h:48
double ParError(unsigned int i) const
parameter error by index
Definition: FitResult.h:191
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:686
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:707
Extends the ROOT::Fit::Result class with a TNamed inheritance providing easy possibility for I/O.
Definition: TFitResult.h:32
TFitResult(int status=0)
Definition: TFitResult.h:37
double Error(unsigned int i) const
Definition: TFitResult.h:72
TMatrixDSym GetCorrelationMatrix() const
Return the correlation matrix from fit.
Definition: TFitResult.cxx:77
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
virtual ~TFitResult()
Definition: TFitResult.h:51
TMatrixDSym GetCovarianceMatrix() const
Return the covariance matrix from fit.
Definition: TFitResult.cxx:59
TFitResult(const char *name, const char *title)
Definition: TFitResult.h:43
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 Print(Option_t *option="") const
Print result of the fit, by default chi2, parameter values and errors.
Definition: TFitResult.cxx:44
A Graph is a graphics object made of two arrays X and Y with npoints each.
Definition: TGraph.h:41
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:880
TGraphErrors * gr
Definition: legend1.C:25
TFitResultPtr Fit(FitObject *h1, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption, const char *goption, ROOT::Fit::DataRange &range)
Definition: HFitImpl.cxx:134
VSD Structures.
Definition: StringConv.hxx:21