def _cluster(param, tom, imtls, gsims, grp_ids, pmap):
    """
    Computes the probability map in case of a cluster group
    """
    pmapclu = AccumDict({grp_id: ProbabilityMap(len(imtls.array), len(gsims))
                         for grp_id in grp_ids})
    # Get temporal occurrence model
    # Number of occurrences for the cluster
    first = True
    for nocc in range(0, 50):
        # TODO fix this once the occurrence rate will be used just as
        # an object attribute
        ocr = tom.occurrence_rate
        prob_n_occ = tom.get_probability_n_occurrences(ocr, nocc)
        if first:
            pmapclu = prob_n_occ * (~pmap)**nocc
            first = False
        else:
            pmapclu += prob_n_occ * (~pmap)**nocc
    pmap = ~pmapclu
    return pmap
Computes the probability map in case of a cluster group