def C_ungroomed(z, theta, beta, acc='LL'):
    """The contribution of an ungroomed emission
    to a generalized energy correlation function (ECF).

    Parameters
    ----------
    z : float
        The energy fraction of the ungroomed emission.
    theta : float
        The angle of the ungroomed emission.
    acc  : str
        The accuracy to which we calculate the observable.

    Returns
    -------
    float
        A generalized ECF associated with the ungroomed
        emission.
    """
    # assert beta > 1, "beta must be greater than 1!"
    assert acc in ['LL', 'MLL'], "Accuracy must be LL or MLL"

    # LL accuracy in the observable:
    if acc == 'LL':
        return z * theta**beta

    # MLL accuracy in the observable:
    return z * (1.-z) * theta**beta