Non-integer bins after rebinning roodataset

Hi,

I have run into trouble trying to rebin a RooDataSet. After loading the data from a TTree:

RooDataSet* data_bkg=new RooDataSet(“data_bkg”,“data_bkg”,(TTree*)file->Get(“tree_passedEvents”),RooArgSet(*ws->var(“mZZ”),leptType,nBTags,mZjj),
“nBTags==0 && (mZjj>75 && mZjj<105) && leptType==1”);

I have plotted this on a rooplot and chose a different binning:

RooPlot *plot_MCbkg = ws->var(“mZZ”)->frame();
data_bkg.plotOn(plot_MCbkg,Binning(50));

However, the histogram this results in has non-integer values. Does anyone know why this is?

Andrew

Hello,

To have a 50 bins plot, I usually would do:

RooPlot *plot_MCbkg = ws->var(“mZZ”)->frame(50);
data_bkg.plotOn(plot_MCbkg);

Does that fix the plot? I don’t know what the plotOn(RooFit::Binning(50)) option does…

The possibility for a non-interger plot would be if you had an event weight but in the snippet you sent it does not seem to be the case.

Regards,

– Gregory