Sum of pdf's

Dear experts,

I’m looking for a way to build a pdf consisting of a number of different functions, one for each bin of the x axis.
I.e. I want to fit each bin using a different function, of course the parameters of interest are common to all of them.

Could you point me to a solution?


Continuing with my previous question, I guess I have to use RooSimultaneous.
However, I’m not able to find how to perform fits on different ranges of a RooDataHist (all the relevant examples I’ve come across so far are about unbinned data).

If you have a hint, even a tiny one, please let me know.




There should be no difference for this use case for binned or unbinned datasets.
They key in using a RooSimultaneous pdf for bins with different ranges is to use
the SplitRange() feature [ as explained in the RooSimultaneous class documentation ].

The only extra point of care is that for binned data you should make sure that the
ranges you specify for each bin map to bin boundaries for the corresponding dataset.