13 c1 = ROOT.TCanvas(
"c1",
"The FillRandom example",200,10,700,900)
14 pad1 = ROOT.TPad(
"pad1",
"The pad with the function",0.05,0.50,0.95,0.95)
15 pad2 = ROOT.TPad(
"pad2",
"The pad with the histogram",0.05,0.05,0.95,0.45)
19 ROOT.gBenchmark.Start(
"fillrandom")
21 form1 = ROOT.TFormula(
"form1",
"abs(sin(x)/x)")
22 sqroot = ROOT.TF1(
"sqroot",
"x*gaus(0) + [3]*form1",0,10)
23 sqroot.SetParameters(10,4,1,20)
26 pad1.GetFrame().SetBorderMode(-1)
28 sqroot.SetLineColor(4)
29 sqroot.SetLineWidth(6)
31 lfunction = ROOT.TPaveLabel(5,39,9.8,46,
"The sqroot function")
36 pad2.GetFrame().SetBorderMode(-1)
38 h1f = ROOT.TH1F(
"h1f",
"Test random numbers",200,0,10)
40 h1f.FillRandom(
"sqroot",10000)
44 f = ROOT.TFile(
"fillrandom.root",
"RECREATE")
48 ROOT.gBenchmark.Show(
"fillrandom")