Dear ROOT experts,

I’m experiencing difficulties in using the createIntegral() function to integrate a custom p.d.f.

The p.d.f. is composed of a background and several peaks. The components are linked by scale factors a, b, c, … and the fit determines which part contributes how much to the data. This works fine.

In the end, I want to integrate the whole function and then set the scale factors consecutively to zero to isolate a single peak or the background and integrate that to determine the ratio of events in each peak.

And here the problems start: Obviously createIntegral() does not work as I think it does. I put together a minimal example with a RooGenericPdf and a toy formula that has no physical meaning. In this example, the integral is always the same although I change a and b between the calls to createIntegral().

What am I doing wrong?

Thanks in advance for your help,

Tobias

problemDemo.C (1.04 KB)