Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
32class TGraph;
33
35
36public:
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 ~TFitResult() override {}
54
55
56 void Print(Option_t *option="") const override;
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
78private:
79 ClassDefOverride(TFitResult, 0); // Class holding the result of the fit
80};
81
82namespace cling {
83 std::string printValue(const TFitResult* val);
84}
85#endif
#define f(i)
Definition RSha256.hxx:104
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t option
char name[80]
Definition TGX11.cxx:110
float xmin
float xmax
class containing the result of the fit and all the related information (fitted parameter values,...
Definition FitResult.h:47
double ParError(unsigned int i) const
parameter error by index
Definition FitResult.h:183
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.
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...
int fStatus
minimizer status code
Definition FitResult.h:348
Extends the ROOT::Fit::Result class with a TNamed inheritance providing easy possibility for I/O.
Definition TFitResult.h:34
~TFitResult() override
Definition TFitResult.h:53
TFitResult(int status=0)
Definition TFitResult.h:39
double Error(unsigned int i) const
Definition TFitResult.h:74
TMatrixDSym GetCorrelationMatrix() const
Return the correlation matrix from fit.
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...
TMatrixDSym GetCovarianceMatrix() const
Return the covariance matrix from fit.
void Print(Option_t *option="") const override
Print result of the fit, by default chi2, parameter values and errors.
TFitResult(const char *name, const char *title)
Definition TFitResult.h:45
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...
A TGraph is an 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:976
TGraphErrors * gr
Definition legend1.C:25
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.