21 TF1 f1(
"f1",
"pol1",0,10);
23 TH1F h(
"background",
"linear background",100,0,10);
24 h.FillRandom(
"f1",10000);
25 TFile f(
"background.root",
"recreate");
29 TF1 f2(
"f2",
"gaus",0,10);
30 f2.SetParameters(1,6,0.5);
31 h.FillRandom(
"f2",2000);
36double ftotal(
double *
x,
double *par) {
40 double arg = (xx-par[1])/par[2];
50 background = (
TH1F*)
f->Get(
"background");
53 TF1 *ftot =
new TF1(
"ftot",ftotal,0,10,4);
54 double norm =
result->GetMaximum();
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 Int_t FindBin(Double_t x)
Find bin number corresponding to abscissa x.
virtual void SetParLimits(Int_t ipar, Double_t parmin, Double_t parmax)
Set lower and upper limits for parameter ipar.
virtual void SetParameters(const Double_t *params)
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
1-D histogram with a float per channel (see TH1 documentation)
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
Double_t Exp(Double_t x)
Returns the base-e exponential function of x, which is e raised to the power x.