{ TH1F *h1 = new TH1F("h1","A Random Histogram",120,-0.1,1.1); TF1 *f1 = new TF1("f1","[0]+[1]*x+[2]*gaus(2)"); f1->SetParameters(2.,-1.0,2.5,0.5,0.05); for(int evt=0; evt<10000; evt++) h1->Fill(f1->GetRandom()); h1->SetFillColor(50); h1->Draw(); }