Roofit: How to fit a pdf (i.e. RooBernstein) with supporting interval smaller than data range?


I am using Bernstein polynomials in order to describe background terms. These are naturally defined on the interval s=[0,1]. Thus Roofit transforms a given range of the independent variable x into the s interval before evaluating the polynomials.

In my particular use case, I want these Bernstein polynomials to be defined on a domain (support) which is only a subrange of x.

The situation can be modeled as follows:

In the end, RooFit shall separate signal and background components by means of a RooAddPdf based on RooBernstein (degree n=1, with supporting interval [7,10]) and a RooGaussian. The fit shall also be limited to the given subrange s.

With root v6.26 (which I am using for my daily analysis tasks) I finally succeeded:

But the whole process was quite complicated and I do not understand everything I did there. Also I found a minor bug in the copy constructor of RooBernstein which caused similar effects as described here: Problem with fit in range with RooBernstein

Thus, I created a notebook including the entire test case and lots of descriptive comments.
I would like to understand if everything I did there is correct and if there is a better (more canonical way) to do it. Especially the very last code cell looks very hacky to me. And I would love to stick to the ranges strategy described therein, but it did not properly fit the combined distribution.

Furthermore, I tried the notebook together with the HEAD of the v6-30-00-patches branch resulting in different type of errors. So the solution presented here is not future-proof. How can I port this notebook to root 6.30 once it gets released?

Many thanks and best regards,

May be @jonas can help.

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