28 float x[
np] = {1.913521, 1.953769, 2.347435, 2.883654, 3.493567, 4.047560, 4.337210, 4.364347, 4.563004,
29 5.054247, 5.194183, 5.380521, 5.303213, 5.384578, 5.563983, 5.728500, 5.685752, 5.080029,
30 4.251809, 3.372246, 2.207432, 1.227541, 0.8597788, 0.8220503, 0.8046592, 0.7684097, 0.7469761,
31 0.8019787, 0.8362375, 0.8744895, 0.9143721, 0.9462768, 0.9285364, 0.8954604, 0.8410891, 0.7853871,
32 0.7100883, 0.6938808, 0.7363682, 0.7032954, 0.6029015, 0.5600163, 0.7477068, 1.188785, 1.938228,
33 2.602717, 3.472962, 4.465014, 5.177035};
36 TH1F *
h =
new TH1F(
"h",
"Example of several fits in subranges",
np, 85, 134);
39 for (
int i = 0; i <
np; i++) {
40 h->SetBinContent(i + 1,
x[i]);
47 TF1 *g1 =
new TF1(
"g1",
"gaus", 85, 95);
48 TF1 *g2 =
new TF1(
"g2",
"gaus", 98, 108);
49 TF1 *g3 =
new TF1(
"g3",
"gaus", 110, 121);
52 TF1 *
total =
new TF1(
"total",
"gaus(0)+gaus(3)+gaus(6)", 85, 125);
53 total->SetLineColor(2);
64 h->Fit(g3,
"+",
"", 110, 121);
72 total->SetParameters(par);
static unsigned int total
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 Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t np
virtual Double_t * GetParameters() const
1-D histogram with a float per channel (see TH1 documentation)