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
impressed).
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
RooFormulaVar(“acc”,"(@0*@2>0)(@1@0*@2)5/(1+(@1@0@2)**5)",
RooArgSet(*tom,*alphaB02Kpi,RooConst(5.279)));

with
accB02piK = new Acceptance(“accB02piK”,“acceptance
B02piK”,*tom,*alphaB02Kpi,RooConst(5.279));

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.
Cheers,
Alessio

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…

Cheers,
alessio
Acceptance.h (1.43 KB)
Acceptance.cxx (1.72 KB)