Problems fitting in a range with RooFit using pyroot

Dear RooFit Experts,
I have a dataset defined on two variables x[0,100],y[0,10] and I would like to fit it in a bin of the varible y.
I tried to do it using these lines of code:

minEdge = 0
maxEdge = 2
fitmodel.fitTo(DataComb, RooFit.Range('myRange'), RooFit.Save())

But it fits in the full range and not in the sub-range “myRange”.

What am I doing wrong?

In the attachment you have my simple test case with:

  1. Fit on the full range (results on Canvas 1)
  2. Fit on the bin from the reduced dataset (results on Canvas 2)
  3. Fit on the bin setting the range at the level of the fit (results on Canvas 3)
    The problem is that the results of 3 are the same of 1 instead of being the same of 2.

Thanks a lot,

    Barbara (2.18 KB)


no idea: I’ve been looking through all the obvious potential problems, but no such thing. I also note that setting up a range on ‘x’ in the same way as you’ve done for ‘y’, does have effect. I therefore think it’s highly unlikely that this is a python issue, and I hope you have more luck in the stat forum, as this is beyond my roofit knowledge …