Getting counts for pdf components in sub range of x

Hi Experts,
I am looking for a correct way to get the event counts for pdf components in subrange of x.
In the running example, you can see red, green and blue (dashed) component curves. I want to get the events counts (not fractions) for each in 11 < x < 13 units. For e.g. if solid blue curve has N events (in 11<x<13) then what is the contribution of components in the same range.
fitExample3.C (1.7 KB)

Hi,
Here is the script modified to get the counts. I have also fixed an issue with the parameter definition. NSig should not be an independent parameter but the resulting of the addition of nSig1 and nSig2.

fitExample3.C (2.4 KB)

Lorenzo

1 Like

Thanks @moneta
It works very well. This is what I was looking for.
Actually, I am fitting labeled data using RooSimultaneous and the actual model description is here
model.C (2.5 KB)
This is just a snippet. Here, I want to integrate pdfs FBx_FF and RxFF_comp in sub range of X.
createIntegral(*X,*X,Range("myrange")) works well for FBx_FF but for RxComp_FF it is not working. Similarly it works for Msig_FF but not for Mbkg_FF. I don’t see any reason for such behaviour , it should work for all the components in the same way.

What do you mean is not working, is it giving a computation/evaluation error or a configuration error?

If X sub interval myrange is varied, integral value is always 1 which should be less than 1. It seems that createIntegral() is not accepting myrange.

I would need a running code showing the problem. Also in the model you have put above to is not clear which are the function you want to integrate.

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