RooFit::Components or RooFit::Normalization?

I create a complex pdf as RooAddPdf and fit it to data.
When I plot its component top_spot, is there any difference between RooFit::Components and RooFit::Normalization?

sum.plotOn(frame, RooFit::Components(top_spot));
// or
top_spot.plotOn(
        frame,
        // fraction value from fit
        RooFit::Normalization(f_top_spot.getVal(), RooAbsReal::Relative),
    );

Which one should I use?

Here are the docs for Normalization and Components (with no documentation).

Should one of the options become obsolete? I looked through the forum, there are many questions on these topics, but I didn’t find the answer to this one.

UPD: initially I created this post about an error, but it seems I found that in my code, so I edited the post.

When I plot them, they are exactly the same. Components seems newer than Normalization (as it appears on the forum). Maybe I shall stay with Normalization because it’s more explicit.

Hi @ynikitenko; I am sure @jonas knows the answer to your question.

Cheers,
J.

1 Like

Hi @ynikitenko!

You can find the documentation for Normalization and Components in the docs to RooAbsPdf::plotOn.

The two options you are describe are indeed identical. RooFit::Components is used quite a lot because it’s very common to plot components, and I think it makes the code nicely self-documented, indicating that you are now plotting a pdf component.

However, RooFit::Normalization is more general because you can give an arbitrary double for the normalization, which is also very useful. So I don’t think any of the options should become obsolete.

In your case I would use Components to make it explicit that what you plot is the component of a pdf.

I hope this helps a bit, if you have further questions let us know!

Cheers,
Jonas

Hi @jonas !

Many thanks for your link. Indeed, I finally decided to use Components, because it was shorter.

Did you consider adding documentation to Components to link it to RooAbsPdf::plotOn? If it can be used outside the RooAbsPdf class, it would be nice to mention that.

UPD: I see that the top of the page with these classes refers to plotOn. Probably I read about Normalization before, because on that page it has no documentation as well. I found that class searching the html documentation.

I see, it’s not great that when you look for the class the docs are empty.

I’ll check tomorrow where these classes are used, so we can at least put some links to the places where the Components and Normalization is actually explained.

1 Like

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