{ TFile *fin = new TFile("example_data.root"); TNtupleD* nt = (TNtupleD *)fin->Get("nt"); RooRealVar mass("mass","mass",0.,2.); RooDataSet data("data","data",nt,RooArgSet(mass)); data.Print("v"); TH1D* hist = (TH1D *)fin->Get("hist"); RooDataHist bindata("bindata","bindata",RooArgList(mass),hist); bindata.Print("v"); mass.setBins(50); RooDataHist bindata2("bindata2","bindata2",RooArgList(mass),data); bindata2.Print("v"); }