Th1::Fill(x,scalefactor) same as TH1::Scale(scalefactor)?


The subject line says it:

Is TH1::Fill(x,scalefactor) for all data the same as TH1::Scale(scalefactor) after filling where scalefactor is a constant? - Specifically in the calculation of errors, I mean.

I notice that the code for ::Fill updates internal variables fSumw2, fTsumw, fTsumw2, fTsumwx, and fTsumwx2, whereas ::Scale just updates fSumw2. But I couldn’t find where these fT* variables are used, except perhaps in the reporting of statistics.

-Phil D.


Yes these two should be the same. You might need to call TH1::Sumw2() before in order to compute the correct bin error