Range in Fit ,Significance ,Expected limit

Hello Roofit and Roostat experts.

I am trying to create an exclusion limits of a BSM particle .When i try to change the range of my fit from 15,000 to 20,000 , i found out that my significance and my expected limits change significantly. Below is the image of my fits,

and .

By the way, i just want to know the best way to do.


@StephanH can you please take a look?

Thank you,


at the moment, I only see a plotting artifact. The curves are not drawn with infinite precision. If you make the plot wider, the curve becomes a bit edgier, because the bump isn’t sampled accurately.
You can fix this by using more points. Try the precision argument documented here:

Hello Stephan

Okay, thanks for the response. By the way, can i ask you one more thing. In my RooWorkspace, i follow the tutorial (hhttps://twiki.cern.ch/twiki/bin/view/RooStats/RooStatsTutorialsJune2013) especially the part Fit of a Signal over an Exponential Background.I also increase my range (3600-40000). There is a line there x->setBins(50). In my case i change this one to 100 and i got different result in my limits, i change it again to 200 and changes again but when i change it to 500 it give me the same result as the 600. By the way, why the value changes? in the first place i used unbinned data (RooDataSet).

Well, when you use binned data, you lose a bit of information (the precise position of each event is lost). Therefore, when binning, the fit becomes a little bit less accurate. With a lot of bins, this inaccuracy becomes smaller, so at some point, the number of bins doesn’t matter, any more.

Hello Stephan

But in my case, i used RooDataSet to generate events? I thought binning doesnt effect unbinned data.

You said that you did a binned fit. If you generate unbinned, and then you throw the data into bins, you do a binned fit and the information is lost.

Hello Stephan.

Sorry, i thought when i fit an unbinned data with a pdf that is unbinned fit. Thanks for your time sir. Marlon

Hello Stephan
It seems that when I do generate data with RooDataSet and do unbinned fit , It will just give me same result when i do generate same unbinned RooDataSet data and binned fit (I do x->setBins(100) ). May i know why?

setBins decides how many bins are used for plotting. Whether a fit is binned or not depends on the dataset:

pdf->fitTo(<RooDataSet>); --> unbinned
pdf->fitTo(<RooDataHist>) --> binned

By the way:
Check out the tutorials. Binned fits (and many other things) are demonstrated here:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.