Fill a 1-D histogram from a parametric function.
More...
Go to the source code of this file.
Fill a 1-D histogram from a parametric function.
void fillrandom() {
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,21);
auto pad2 =
new TPad(
"pad2",
"The pad with the histogram",0.05,0.05,0.95,0.45,21);
auto sqroot =
new TF1(
"sqroot",
"x*gaus(0) + [3]*form1",0,10);
sqroot->SetParameters(10,4,1,20);
auto h1f =
new TH1F(
"h1f",
"Test random numbers",200,0,10);
h1f->FillRandom(
"sqroot",10000);
}
- Author
- Rene Brun
Definition in file fillrandom.C.