def livetime(match, hits):
    """Calculate the livetime represented by a set of simulation data.
    Required argument for MongoSimsDB.

    Note that `match.emissionrate` can be given a weight when registered by
    `query`, so don't apply any weight here

    Args:
        match (SimDataMatch): info requested from model and DB response
        hits (list): List of all documents retrieved from the DB. These may
                     be partial docs containing only livetime-relevant info
    Returns:
        livetime (float): the total summed livetime represented by the hits
    """
    nprimaries = sum(doc['nprimaries'] for doc in hits)
    #this function shouldn't be called if emissionrate==0, but it might
    return nprimaries / match.emissionrate