TPaveStats is showing weird fit numbers

Hi there,

Fitting a histogram with one Breit-Wigner signal and a non-resonant background I noticed the fit parameters shown on TPaveStats are completely different, non-physical, than those ones shown in the ROOT command line. I am using version 6.36.00.
The histogram was created with a weight as in:

histosTH1D[“hm4rec2OSpipitt05acc”]->Fill(mrecpi1pi2,1/totemcor);

Would you please advise?
I am attaching the code and pictures.

Many thanks,
Luiz Regis


Please read tips for efficient and successful posting and posting code

Please fill also the fields below. Note that root -b -q will tell you this info, and starting from 6.28/06 upwards, you can call .forum bug from the ROOT prompt to pre-populate a topic.

ROOT Version: 6.36.00
Platform: Fedora Linux 42
Compiler: gcc 15.1.1



mykshort.txt (5.3 KB)

@jonas or @StephanH might have an idea?

Hi Luiz,

in your code, you do hm4rec2OSpipitt05acc->Fit(...) twice. Are you sure the parameters in the statbox and in the terminal come from the same iteration?

Hi Yus,

No, I run once the attached code mykshort.txt (cut and paste in ROOT command line).
As far as I know the information from statbox comes from the last iteration, isn’t it?

hm4rec2OSpipitt05acc is a weighted histogram.

Use "V" instead of "V+".

Hi Wile,

It works! Thanks a lot.

Best,
Luiz