def j_ret(hist_dat,cut):
    """
    Computes retention rate of hist_dat based on the cut provided
    :param hist_dat: numpy array of counting data
    :param cut: int, counting threshold above which an event is considered to be >0 atoms loaded into the trap

    :return: retention: float, fraction of loaded atoms retained between shots 0 and 1
    """
    retention = (1.0 * (hist_dat[:, 0] >= cut) * (hist_dat[:, 1] > cut)).sum() / (hist_dat[:, 0] >= cut).sum()
    return retention