using namespace RooFit; void test() { TFile *inFile_Rx = TFile::Open("wspace_Rx.root"); RooWorkspace *ww_Rx = (RooWorkspace*)inFile_Rx->Get("ws_Rx"); RooRealVar *X = ww_Rx->var("PsProperDL"); ww_Rx->Print(); //----------- //X->setBins(100); //X->setRange(-0.3,0.3); //cout << X->getBinning() << endl; RooDataHist *RxHist_FS = (RooDataHist*)ww_Rx->data("RxHist_FS"); RooHistPdf *RxHistPdf_FS = new RooHistPdf("RxHistPdf_FS","RxHistPdf_FS",*X,*RxHist_FS,1); RooDataHist *RxHist_FF = (RooDataHist*)ww_Rx->data("RxHist_FF"); RooHistPdf *RxHistPdf_FF = new RooHistPdf("RxHistPdf_FF","RxHistPdf_FF",*X,*RxHist_FF,1); RooPlot *pp = X->frame(); RxHistPdf_FF->plotOn(pp,LineColor(kBlue)); RxHistPdf_FS->plotOn(pp,LineColor(kRed)); pp->Draw(); }