16 auto form1 =
new TFormula(
"form1",
"abs(sin(x)/x)");
17 auto sqroot =
new TF1(
"sqroot",
"x*gaus(0) + [3]*form1",0,10);
18 sqroot->SetLineColor(4);
19 sqroot->SetLineWidth(6);
20 sqroot->SetParameters(10,4,1,20);
24 auto h1f =
new TH1F(
"h1f",
"Test random numbers",200,0,10);
25 h1f->FillRandom(
"sqroot",10000);
28 TFile myfile(
"fillrandom.root",
"RECREATE");
37 auto pad1 =
new TPad(
"pad1",
"The pad with the function",0.05,0.50,0.95,0.95);
38 auto pad2 =
new TPad(
"pad2",
"The pad with the histogram",0.05,0.05,0.95,0.45);
45 pad1->GetFrame()->SetBorderMode(-1);
46 pad1->GetFrame()->SetBorderSize(5);
49 auto lfunction =
new TPaveLabel(5,39,9.8,46,
"The sqroot function");
54 pad2->GetFrame()->SetBorderMode(-1);
55 pad2->GetFrame()->SetBorderSize(5);
57 h1f->SetFillColor(45);
R__EXTERN TBenchmark * gBenchmark
winID h TVirtualViewer3D TVirtualGLPainter char TVirtualGLPainter plot
virtual void Start(const char *name)
Starts Benchmark with the specified name.
virtual void Show(const char *name)
Stops Benchmark name and Prints results.
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)
The most important graphics class in the ROOT system.
A Pave (see TPave) with a text centered in the Pave.