TH1D Histograms visualization/filling in new (6.24) and old version (5.34/36) of ROOT: problem of error bars?

Filling histograms the same way in ROOT 5.34/36 and ROOT 6.24/06 gives me different results.
For example,

double N[2000];
for (int k = 0; k < 2000; k++) N[k] = k * 5;
TH1D *n = new TH1D("n", " ", 2000, -0.5, 1999.5);
for (int k = 0; k < 2000; k++) n -> Fill(k,N[k]);

The result - a histogram with big “error bars”, while the same part of code gives a nice line without any “error bars”. It comes from the Fill method, correct? In other words, I used this command before in the old version of ROOT, but now it works differently with the new version.

histogram->Fill(value, weight);

If more explanations or pictures from TBrowser needed, I can provide them asap. Kindly ask someone to clarify this little problem.
P.S. Probably, this problem was discussed many times, but I could not find the solution myself.

Either (after filling) n->Sumw2(kFALSE); or n->Draw("HIST");


This worked well if it is written after the hist filling loop. Could you please show me where to look to understand the source of this difference between old and new versions of ROOT? Normally, the same commands should give the same results in different versions of ROOT, as I understand. Thanks for your time!

ROOT 6 TH1::Fill (note the word “automatically”) versus ROOT 5 TH1::Fill.

1 Like

Thank you. Have a good day.