Parametrize a RooHistPdf pdf

Hi ROOT experts,

I attached a root file with 10 histograms, each made with a different parameter (gausians with different mean) and a piece of code that takes a histogram and makes it into a RooHistPdf, that is in practice a Pdf.

The code takes a double and interpolates the histograms to give a histogram corresponding to the double. So the histograms depend continuously on “i” and I want to transfer that dependence to the RooHistPdf so that “i” becomes a fitting parameter for instance.

Is there a way to do this? Could you please modify the code I attached in the right way if its possible?

code.C (2 KB)
histograms.root (6.51 KB)

Hi guys,

I attached the code that is doing what I wanted, if someone needs it someday. However I think is very slow. When evaluate() is run and the histogram is sampled, does roostats try to get enough points to make a smooth function? Because the points are gotten from a histogram and it is not smooth, it has steps, so would the machine take longer to get the points needed? In this case how could we improve this?

utils.h (3.75 KB)
test.C (574 Bytes)
HistPDF.h (1016 Bytes)
HistPDF.cxx (1.23 KB)
histograms.root (6.51 KB)