def find_max_slice(arr):
    """
    Given the enrichment score of each pixel along the candidate stripe,
    find the slice with the largest sum as a called stripe.

    Parameters
    ----------
    arr: np.array (1D)
        Enrichment score

    Returns
    ----------
    head: int
        The start location of the slice

    tail: int
        The end location of the slice

    _max: float
        The sum of scores of the slice

    """
    _max, head, tail = 0, 0, 0
    _max_ending, h, t = 0, 0, 0
    i = 0
    while i < len(arr):
        _max_ending = _max_ending + arr[i]
        if _max_ending < 0:
            h, t = i + 1, i + 1
            _max_ending = 0
        else:
            t = i + 1
        if _max_ending > _max:
            head, tail, _max = h, t, _max_ending
        i += 1
    return head, tail, _max