Fitting composite models in RooFit

Dear rooters,

I have a question of rather theoretical nature. Firstly, I fitted a Crystal-Ball(CB) and a Gaussian (G) to a histogram using TF1 and fitting panel. I got relative heights of the CB an G, for example, 377 and 74.3. Now, if I want to use them as a composite model for roofit, should I use these values ( change them to a fraction 377/74.3 and 1) or should I rather integrate the CB and G separately on the range that I was fitting and use a different the ratio of events (results of integration, here it gave me 97332 and 26168).
By the way, if I fit a CB I usually add a parameter describing it’s height, so that the total fitting function looks like:

ROOT::Math::crystalball_function(x, [0], [1], [2], [3])*[4]+gaus(5)

What is the correct way to calculate the fractions? Is there a way to fit a CB and gaussian without the height parameter?

EDIT:
OK, so I did some more fitting and displayed only the needed model components. For one signal component which is a sum of CB and G, it should look like this: (dashed light blue line from TF1 fit, ratio of events ~3.72)

While it looks like this (light blue line for sum CB+G, green for gaussian and black for CB):


One can see that the ratio of CB and G is totally different. A piece of code to show how I do this:

RooRealVar sigratioCat1("sigratioCat1","Cb/G frac",3.72,0.0,10.0) ;
RooRealVar one("one","one",5,0,10) ;
one.setConstant(kTRUE);
sigratioCat1.setConstant(kTRUE);
RooAddPdf SigCat1("sigCat1","CB+G",RooArgList(CBSigCat1,GSigCat1),RooArgList(sigratioCat1,one)) ; 

Cheers,
Maks

OK, so I think I found a solution: use recursive fractions as specified in:
https://root.cern.ch/doc/master/classRooAddPdf.html
and use the ratio of integrals.

Hi,

When you add two functions in ROOT you are adding just the functions, while in ROOFIT you make a normalized sum of the two functions, so the coefficients are different. You can transform from one to the other but you need to take into account the integral of the function components in the fitted range.
Recently in ROOT we have added a new class , TF1NormSum to perform additions like in RooFit.

Lorenzo

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