Fill a 1-D histogram from a parametric function.
TCanvas *c1 =
new TCanvas(
"c1",
"The FillRandom example",200,10,700,900);
auto pad1 =
new TPad(
"pad1",
"The pad with the function",0.05,0.50,0.95,0.95);
auto pad2 =
new TPad(
"pad2",
"The pad with the histogram",0.05,0.05,0.95,0.45);
auto form1 =
new TFormula(
"form1",
"abs(sin(x)/x)");
auto sqroot =
new TF1(
"sqroot",
"x*gaus(0) + [3]*form1",0,10);
auto lfunction =
new TPaveLabel(5,39,9.8,46,
"The sqroot function");
auto h1f =
new TH1F(
"h1f",
"Test random numbers",200,0,10);
TFile myfile(
"fillrandom.root",
"RECREATE");
}
- Author
- Rene Brun
Definition in file fillrandom.C.