def getHistSeparation( S, B ):
    """Compare TH1* S and B -- need same dimensions
       Copied from : https://root.cern.ch/doc/master/MethodBase_8cxx_source.html#l02740
    """
    separation = 0

    nstep  = S.GetNbinsX()
    xaxis  = S.GetXaxis()

    nS = S.GetSumOfWeights()
    nB = B.GetSumOfWeights()
    for bin in range(nstep):
        s = S.GetBinContent( bin+1 )/nS
        b = B.GetBinContent( bin+1 )/nB
        if (s+b)>0: separation += (s - b)*(s - b)/(s + b)

    separation *= 0.5

    return separation