What exactly is the result you want? The number of events? Or some "list" of their indices? Something else?