<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def effective_sample_size(h):
 """ Calculate the effective sample size for a histogram the same way as ROOT does. """

    sum = 0
    ew = 0
    w = 0
    for bin in h.bins(overflow=False):
        sum += bin.value
        ew = bin.error
        w += ew * ew
    esum = sum * sum / w
    return esum