It is like

    l = fooarray / hist.sum() * hist.sum()
    h = bararray / hist.sum() * hist.sum()