Template fitting in roofit

Hi,

I want to do a template fitting using roofit. I have a TH1D data histogram and three MC template histograms of the same variable. I want to fit the data using these three templates and get the fractions in the data. I could not find any tutorial showing this?
It will be very helpful if some can point me to such an example.

with regards,
Vineet

Hello @vineet.salar,

you should try a combination of
https://root.cern.ch/doc/master/rf102__dataimport_8C.html
which is about importing histograms,
https://root.cern.ch/doc/master/rf706__histpdf_8C.html
to construct templates
and then you need either the RooAddPdf or the RooRealSumPdf to add all the components. Here’s a tutorial where the RooAddPdf is used:
https://root.cern.ch/doc/master/rf201__composite_8C.html

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