C__ reminded me of frozensets, using which can make the whole event selection process much simpler.