What is the advised way to plot a RooFormulaVar, made in this way:
m_ws.factory("expr::dm('@0-@1', {Dstar_M, D0_M})");
Where the inputs are RooRealVars from data.
dataset = new RooDataSet("dm_data", "dm_data", tree, RooArgList(Dstar_M,D0_M));
So far nothing has worked, and there is no information online about how to do this. I have tried this so far:
RooFormulaVar * dm = (RooFormulaVar*) m_ws.function("dm");
RooRealVar * dm_plot = (RooRealVar*) dataset->addColumn(*dm);
RooPlot *fr = dm_plot->frame(RooFit::Bins(50),RooFit::Range(139,160));
m_dataset->plotOn(fr, RooFit::MarkerSize(0.9));
fr->Draw()
...
But it just produces a blank canvas.