RooFit timing usinf makeFunction tool

Dear all,
I’m addressing the tough work of running a very big fit with RooFitTools
on a very big dataset. This translates directly into timing problems.
To make the code as efficient as possible I’ve started to play with
makePdf and makeFunction tools.

The makePdf one performed in an excellent way. By translating some
RooGenericPdfs to RooXXXPdf with analytic intregal I was able to save a
factor 3 in time consumption having exactly the same results (I was
Now I have tried also to convert a RooFormulaVar into a RooXXXVar by using
the makeFunction tool.

What I don’t understand is that the replacement INCREASE the fit timing!

I’ve replaced the RooFormula:
accB02piK = new

accB02piK = new Acceptance(“accB02piK”,“acceptance

The Acceptance.* files being attached.
This change slowed the fit nearly for a factor 1.5 (150% more time spent).

I did expect the opposite:
why is that?
What am I doing wrong?

Thank you so much for your help.

Hi Alessio,

That sounds counterintuitive indeed. However I did not see your attachement with the Acceptance class code, which I really need
to have a look at. Can you please send that (again).

Thanks, Wouter

Hi wouter,
sorry for the late answer.
Here I try again to add the Acceptance function…

Acceptance.h (1.43 KB)
Acceptance.cxx (1.72 KB)