{ using namespace RooFit; // observables, decay time and its error RooRealVar t("t","decay time",0.,10.); RooRealVar terr("terr","decay time error",0.001,0.4); // model for decay time error RooRealVar terr_mu("terr_mu","time err mu",0.2); RooRealVar terr_sigma("terr_sigma","time err sigma",0.02); RooGaussian terr_model("terr_model","time err model",terr,terr_mu,terr_sigma); // model for decay time (w/ time error in the resolution model) RooRealVar tau("tau","Lifetime",1.6,1.2,2.0); RooGaussModel res("res","Resolution model",t,RooConst(0.),terr); RooDecay t_model("t_model","t_model",t,tau,res,RooDecay::SingleSided); RooProdPdf model("model","full model",t_model,terr_model); RooDataSet* data = model.generate(RooArgSet(t,terr), 10000); model.fitTo(*data,Minos(true),ConditionalObservables(terr)); RooPlot *frame = t.frame(); data->plotOn(frame); model.plotOn(frame); frame->Draw(); }