Count infections by group and time

sum_infections_by_group(inf_hist, group_ids_vec, n_groups)