Example illustrating how to draw the n-sigma contour of a Minuit fit.
To get the n-sigma contour the ERRDEF parameter in Minuit has to set to n^2. The fcn function has to be set before the routine is called.
WARNING!!! This test works only with TMinuit
The TGraph object is created via the interpreter. The user must cast it to a TGraph*
FCN=96.6163 FROM MIGRAD STATUS=CONVERGED 62 CALLS 63 TOTAL
EDM=2.07594e-08 STRATEGY= 1 ERROR MATRIX ACCURATE
EXT PARAMETER STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 Constant 1.43454e+02 2.29666e+00 9.00732e-03 -6.49594e-05
2 Mean 1.60911e-02 1.30402e-02 6.28520e-05 3.57224e-03
3 Sigma 9.87683e-01 9.45637e-03 1.24479e-05 2.14428e-02
void fitcont()
{
TH1F *
h =
new TH1F(
"h",
"My histogram",100,-3,3);
h->FillRandom(
"gaus",6000);
}
R__EXTERN TMinuit * gMinuit
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
A TGraph is an object made of two arrays X and Y with npoints each.
void Draw(Option_t *chopt="") override
Draw this graph with its current attributes.
1-D histogram with a float per channel (see TH1 documentation)
virtual Int_t SetErrorDef(Double_t up)
To get the n-sigma contour the error def parameter "up" has to set to n^2.
virtual TObject * Contour(Int_t npoints=10, Int_t pa1=0, Int_t pa2=1)
Creates a TGraph object describing the n-sigma contour of a TMinuit fit.
static void SetDefaultFitter(const char *name="")
static: set name of default fitter
- Author
- Rene Brun
Definition in file fitcont.C.