Draw RooFit pdfs

I have a fitted RooFit pdf that I want to overlay on a stacked histogram. Is there anyway to draw pdf outside of RooFit frames? Alternatively can a frame accept a stacked histogram and plot it without changing its style?

Thanks!

Hi @sciencecw

try
https://root.cern.ch/doc/master/classRooAbsReal.html#a6659d2c301e5cd65b83ee8c9422c2553

You can then always Draw(“same”) the histogram.

Cheers,
Stephan

Hi,

I guess the solution is 1) make histogram from pdf as you suggest
2) Draw using option “L” or “C” so it draws a line through bin centers instead of zig-zag

Thanks

Seeing that a function seems to be better for you case, there is also asTF. See here:
https://root.cern.ch/doc/master/classRooAbsReal.html#a5b1ad5b6d761c664adc2434689ef8f99

This doesn’t have the right normalization. I wonder if this information is in the pdf at all? How does the RooFit frame work out the normalization?

All PDFs are normalised to unity. That’s, in fact, the definition of a PDF.

When you start to draw a PDF and the histogram contains a dataset, RooFit automatically scales the PDF to the number of data events in the histogram. See here:
https://root.cern.ch/doc/master/classRooAbsReal.html#a32073d896314ad08535328f556379780

You indeed would have to scale the TF1 to the number of data events in your frame.

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