Error in TProfile for Weighted Events


I am making a profile histogram and I have weighted events in there.
So, I am wondering if Profile handles the errors correctly for weighted events?
The default error for a particular bin in profile is the error on the mean = RMS/sqrt(N).
But if the events are weighted then does it save sum of squares of weights like a normal histogram?

I saw one very old post where it is said that it has been included in TProfile: … 43810.html

Could anybody please confirm this.

Thanks in advance.


Hello Arun,

If you call TProfile::Sumw2() before filling the profile, The Profile histogram will take into account the weights when computing the errors on
the mean Y values.

The error will be computed in this case as STD/sqrt(Neff), where STD is the weighted sample standard deviation and Neff is the number of effective entries
defined as ( Sum(weight) )^2/ Sum(weight^2).

Best Regards