Hi
I have a file containing a very complicated numerical function. I want to define this in RooFit (actually one of the dimensions of the TF2 ends up being a parameter) as a RooAbsPdf. What I have is shown below. This actually works… you first have to compile the RooLS pdf (my user defined pdf), then load it using CINT into the code (similar to root.cern.ch/root/html/tutorials … ory.C.html). But, because it opens and closes the file each time, it is extremely slow. (though it does work). Any suggestions on speeding this up? If I could somehow pass a TF2 to the RooLS class, that would probably solve the problem. Evidently others have had similar issues (RooClassFactory passing additional objects to constructor)
An alternative which I explored was using bindPdf from a user defined TF1. However, the issue I have is that bindPdf from a TF1 does not seem to produce a Pdf with free parameters, as others have discovered (RooFit: fitting a TF1-binded function?).
Thanks
Ben Carlson
Double_t RooLS::evaluate() const
{
TFile *lineshape_file = new TFile("/Users/carlsonbt1/results/data_files/smearing_newbins_feb11.root","READ");
TF2 *LS1_shape = (TF2*)lineshape_file->FindObjectAny(LS_namew(1,0,0).c_str());
// ENTER EXPRESSION IN TERMS OF VARIABLE ARGUMENTS HERE
Double_t LS= LS1_shape->Eval(x-deltaM, cw);
delete LS1_shape;
delete lineshape_file;
return LS;
}