VINX89
July 28, 2012, 11:35am
1
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:
Hi,
I have a 1D histogram to which I fit a RooAddPdf (which is 2 gaussians+ a straight line).
I then want to know, for a certain value of the variable, the height/value of the RooAddPdf.
There is something in the normal TF1, called Eval(x) and that give you value of the TF1 at x.
But for a RooAddPdf, I cannot find any function that does it.
Can someone point me to the right method?
Regards
Fatima Soomro
and
Hi expxerts,
I am importing a TH1 with variable binning into a RooDataHist, and the problem is that RooDataHist ‘thinks’ that the original histogram has been normalized for bin size, hence it recalculates the number of entries in each bin based on the bin size (keeping the total normalization constant).
Is there a way/option to tell the RooDataHist that the histogram from which it is being created is a histogram and not a pdf, i.e. not normalized for bin size?
You can run the code below as a …
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
Hi,
I have encountered the following issue.
I performed a fit using RooFit and wanted to extract the TF1 function from the RooAbsPdf.
TF1* func = (TF1*) model->asTF( RooArgList(*OneOverPt), RooArgList(*dy_yield,*p0,*p1,*p2,*p3) );
OneOverPt is my observable.
p0,p1,p2,p3 are the parameters defining the shape of the fit.
dy_yield is the normalization.
I plotted the TF1 and compared it to the RooAbsPdf to find out they look discrepant (see attached images).
For instance you can check the poin…
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…