I am just wondering how the ProjWData option is accelerated/optimized for RooDecay? I just did a simple test with my own Exp*Gaus Pdf, the calculation of the convolution is simplified to the calculation of the Error function (Tmath::Erf). I thought this is a form as “analytical” as possible. I used RooClassFactory::makePdf to generate the Pdf, the evaluate part is in the following:
Double_t RooMyGE::evaluate() const
// ENTER EXPRESSION IN TERMS OF VARIABLE ARGUMENTS HERE
return 1./(2.*tau) * TMath::Exp(stSF*stSF*st*st/(2.*tau*tau)-t/tau)* (1-TMath::Erf(stSF*st/(TMath::Sqrt(2)*tau)-t/(TMath::Sqrt(2)*stSF*st))) ;
Its fitting speed is slower than RooDecay. We still can afford it (for a more complicated Pdf). But the plotOn with the ProjWData option is very slow. Could you please give me some hints (or point me to the relevant source code) how it is accelerate/optimized, so that I can learn how to optimize a more complicated Pdf?
Another problem is that the NumCPU option in the fitting doesn’t help at all for my own Pdf. Using more CPUs even slow down the fitting process. I guess I also need add something?
The macros used to do the comparison is attached.
my own Pdf: useMyGE.C)
Thanks a lot.
plotSpeed.tar.gz (216 KB)