00001 void qa2() {
00002
00003 TCanvas *c1 = new TCanvas("c1","The FillRandom example",0,0,700,500);
00004 c1->SetFillColor(18);
00005
00006 gBenchmark->Start("fillrandom");
00007
00008
00009
00010
00011 form1 = new TFormula("form1","abs(sin(x)/x)");
00012 sqroot = new TF1("sqroot","x*gaus(0) + [3]*form1",0,10);
00013 sqroot->SetParameters(10,4,1,20);
00014
00015
00016
00017
00018
00019 h1f = new TH1F("h1f","Test random numbers",200,0,10);
00020 h1f->SetFillColor(45);
00021 h1f->FillRandom("sqroot",100000);
00022 h1f->Draw();
00023 lfunction = new TPaveLabel(5,39,9.8,46,"The sqroot function");
00024 lfunction->SetFillColor(41);
00025
00026 c1->SetGridx();
00027 c1->SetGridy();
00028 c1->GetFrame()->SetFillColor(42);
00029 c1->GetFrame()->SetBorderMode(-1);
00030 c1->GetFrame()->SetBorderSize(5);
00031
00032 h1f->SetDirectory(0);
00033
00034 c1->Update();
00035
00036 sqroot->SetParameters(200,4,1,20);
00037 }