How to DIY a pdf for fitting

Hi ROOTers,

I want to define a new PDF, rather than using something like RooPolynomial or RooGaussian. Is there any way? I thought it should be like “RooAbsPdf *mypdf = new RooAbsPdf(xxxx)” but it seems not the solution.


Hi @ReynLieu,

there is the RooGenericPdf.

Check out the tutorial rf103 to see how to use it:

Hi Stephan,

Thanks, that really solved my problem! But I wonder why it uses RooArgSet rather than RooArgList. I learn from that RooRealVar in RooArgSet are not ordered so how can it decide the first one in the set is the variable while the rest are parameters.


Hello Reyn,

that’s not entirely true. The objects do follow the insertion order, but if you insert an object twice, only the first one will be kept. In that sense, there is ordering, but not for double insertions.
Why it’s not using an ArgList as argument is probably an oversight by the author.

Oh I see. Thank you!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.