I am trying to simply do the following :
TFile *open =new TFile("file.root","READ"); TH1F *hnew = (TH1F*)open->Get("h"); RooRealVar mass("mass","mass",3,10); RooDataHist data("data","data",mass,hnew); . .generating fit called massfit here . massfit.fitTo(data); TCanvas *c2 = new TCanvas("c2","c2",200,10,600,400); RooPlot *frame_m =mass.frame(); data->plotOn(frame_m); massfit->plotOn(frame_m); frame_m->Draw();
The histogram that I am getting from the file was generated by subtracting two histograms. When I did this subtraction in ROOT I took care of the error size by using the Sumw2 on each of the histograms being subtracted. When I look simply at hnew by drawing it, I can see that the errors are the size that they should be. However, after the fitting and then drawing the RooDataHist the histogram now has small (square root of the bin value) at each point instead of the larger, correct errors. It seems that when making a RooDataHist the errors are being recalculated and I am wondering if there is a way around this, or a way to display the histogram with the correct errors.