Mean of distibution in ntuple and TH1D is not the same


I noticed something curious. I filled an ntuple and a histogram with the same quantity. I can see the dsitributions are the same (I overlaid them and I see no difference), the number of entries is the same and the rms is the same. However the mean is not the same in both cases. Given the dsitributions are the same and all the other stats are the same why is the mean not the same? Is it not calculated in the same way in both cases? or maybe they are not expected to have the same mean and I have overlooked something obvious?

I attach a root file I made using the Gaudi framework (which might mean I am asking in the wrong place I suppose if the problem lies with how the file was madeā€¦) which contains a ntuple with one leaf and a histogram of the same quantity.

I am using root V5 (but I see the same effect iin root V4 as well) on scientific linux to view the root file.


new.root (8.24 KB)

if you do

root [1] TFile f("new.root") root [2] UsernJets.Draw() root [3] new TCanvas root [4] TTree *T=(TTree*)f.Get("9002") root [5] T.Draw("QCD_nJets"); //you get mean at 4.70 root [6] T.Draw("QCD_nJets+0.5"); //you get 5.26 like in histogram
This means that the histogram has been filled with +0.5