How to access signal and background number only and TLegend in Roofit

Dear All,
I want to access the signal and background number only in roofit. All other fitting parameters can be excused.

How can I write signal and background number by using TLegend as well. I am struggling to write the plus minus symbol in correct manner(please see the attached figure. The plus/minus symbol is not written in proper manner).

Thanks in Advance.

fit.pdf (19.4 KB)

For the plus/minus symbol, try #pm, e.g. legend->AddEntry("h1","x = 3 #pm 1","l");

Thanks, It did help. It just latex symbol.

By the way Is there any way I can define Y axis manually ?
Like Entries/0.00225 to Entries/2.25 MeV/c^2

I am sorry I had to ask in this thread.

Thanks.

If you are drawing histogram/s, you can try h->SetMaximum(mymax); and SetMinimum. Otherwise, use the Search feature in this forum with your specific case, I’m sure many have asked the same :slight_smile:

In histogram there is no problem. I am asking in roofit. How can I define Y axis manually.

Thanks

Hi,

from the frame (RooPlot) object, you should be able to get its y axis calling RooPlot::GetYaxis.
See https://root.cern.ch/doc/master/classRooPlot.html#a785130d0de3b11856a68f4870530df2b

Lorenzo

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