Hi everyone,
something weird is happening on my pull distribution and I can’t figure out why.
I want to plot the pull distribution of a fit, but the result on my pull canvas is the fit itself. Here is a snippet of my code:
TFile *file = new TFile("BDT_Xibm_sel_C.root");
TTree *tree = (TTree*)file->Get("mytree");
TH1F *hist = new TH1F ("hist","hist",125,5600,5930);
tree->Project("hist","lab0_M", "BDT_response>0.5");
RooRealVar x ("lab0_M","lab0_M",5600.,5930);
RooDataHist data("data","data",x,hist);
...
model.fitTo(data,Extended());
RooPlot* xframe = x.frame() ;
...
xframe->Draw();
...
RooHist* hpull = xframe->pullHist() ;
RooPlot* frame2 = x.frame(Title("Pull Distribution")) ;
frame2->addPlotable(hpull,"P") ;
TCanvas *can2 = new TCanvas ("c2","c2",500,150);
frame2->Draw();
Here are the plots I get for the fit distribution and the pull distribution:
FIT.pdf (29.4 KB)
PULL.pdf (22.6 KB)
Can anyone help?
Thanks,
Andrea