Why does TH1[F]::SetBinContent increase entries?

Dear ROOT experts,

I am filling a histogram with variable bin widths, and I loop over all bins after filling it and dividing the content by the bin width to adjust for this. I noticed that GetEntries() yields a different result once I am done, so I went to the code and found (TH1F.cxx):

void TH1F::SetBinContent(Int_t bin, Double_t content)
   fArray[bin] = Float_t (content);
   fTsumw = 0;

Why? And is there any way to repair the GetEntries() result? Thanks!


you can repair the number of entries to the actual bin content by calling the method TH1::ResetStats()

Best Regards