def trace_replicas_for_ensemble(ensemble, steps):
    """
    List of which replica a given ensemble held at each MC step.

    Parameters
    ----------
    ensemble : paths.Ensemble
        selected ensemble
    steps : iterable of :class:`.MCStep`
        MC steps to analyze (nonsense if not contiguous

    Returns
    -------
    list
        list of replica IDs
    """
    trace = []
    for step in steps:
        sset = step.active
        trace.append(sset[ensemble].replica)
    return trace
