Fitting a 2-D histogram This tutorial illustrates :
- how to create a 2-d function
- fill a 2-d histogram randomly from this function
- fit the histogram
- display the fitted function on top of the histogram
This example can be executed via the interpreter or ACLIC
****************************************
Minimizer is Minuit2 / Migrad
Chi2 = 1048.29
NDf = 1139
Edm = 3.90056e-06
NCalls = 519
p0 = 392.558 +/- 2.07088
p1 = -2.99838 +/- 0.0116072
p2 = 2.98484 +/- 0.00840711
p3 = -3.00201 +/- 0.0115172
p4 = 2.97271 +/- 0.00841038
p5 = 601.133 +/- 10.5562
p6 = 0.00614073 +/- 0.0119548
p7 = 0.81626 +/- 0.0107847
p8 = -0.000781266 +/- 0.0134062
p9 = 0.911288 +/- 0.0119899
p10 = 146.899 +/- 5.12261
p11 = 3.9882 +/- 0.0182639
p12 = 0.727561 +/- 0.0142962
p13 = 4.02637 +/- 0.0175896
p14 = 0.703077 +/- 0.0140242
double g2(
double *
x,
double *par) {
}
double fun2(
double *
x,
double *par) {
}
{100,-3,3,-3,3,160,0,0.8,0,0.9,40,4,0.7,4,0.7};
TH2F *
h2 =
new TH2F(
"h2",
"from f2",40,-10,10,40,-10,10);
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
virtual void SetParameters(const Double_t *params)
A 2-Dim function with parameters.
2-D histogram with a float per channel (see TH1 documentation)
double ratio(double numerator, double denominator)
Double_t Exp(Double_t x)
Returns the base-e exponential function of x, which is e raised to the power x.
- Author
- Rene Brun
Definition in file fit2.C.