A general scheme for optimization of trigger rates in an experiment with limited bandwidth