RooFit: evaluate function in a given point

Dear all,

I have a simple problem: I performed a fit using a certain pdf (Landau-Gaussian convolution), and now I need to compute the value of that function in different points.
My purpose is to compare experimental points with the curve obtained from fit.
In ROOT (with a TF1 “langauss”) I would write something like:

for(i=0; i<entries; i++){
experimental=h->GetBinContent(i);
x = h->GetBinCenter(i);
theoretical=langauss->Eval(x);
diff[i]=experimental-theoretical;
}

Unfortunately, I didn’t find anything like “Eval” in pdf classes.
Any suggestion?

Thank you.
Vincenzo.

Hi
check out two previous posts:

and

I have yet to get this to actually work. Please let me know if you do get it to work.

I have found an easier approach is to instead just make a TF1 and use the standard root tools to evaluate.
see

Only in my case, I was not using actual pointers for my RooRealVar etc. So my TF1 conversion looks like this:

[code]
RooRealVar x(“x”,“x”,initial,start,end);
RooRealVar m1(“m1”,“m1”, initial,start,end);

TF1 func=(TF1)model_gg.asTF(RooArgList(x), RooArgList(m1,m2,s1,s2,b),x );[/code]

Hope that helps…