{ using namespace RooFit; RooRealVar x("x","x",0.,1.); RooGaussian Gauss("Gauss","Gaussian PDF",x,RooConst(0.5),RooConst(0.05)); RooExponential Exp("Exp","exponential PDF",x,RooConst(-0.1)); RooAddPdf model("model","joint model",Gauss,Exp,RooConst(0.5)); RooDataSet *data = model.generate(x,10000); RooPlot *frame = x.frame(); data->plotOn(frame); frame->Draw(); }