{ using namespace RooFit; // observable/parameter/PDF construction RooRealVar x("x", "random variable", 0.0, 1.0); RooRealVar mu("mu", "mean parameter", 0.5, 0.0, 1.0); RooRealVar sigma("sigma", "width parameter", 0.1, 0.0, 0.3); RooGaussian gaus("gaus", "Gaussian PDF", x, mu, sigma); // Generate a random set RooDataSet* data = gaus.generate(x,10000); // Fit pdf to the random data RooFitResult *res = gaus.fitTo(*data, Save(true),Minos(true)); res->Print("v"); // plot the data & PDF RooPlot* frame = x.frame(); data->plotOn(frame); gaus.plotOn(frame); frame->Draw(); }