What sensor should I use to detect object going through a hole?

Thank you very much. It is appreciated. Do you (or anyone) have an opinion on using a laser + a photocell or using infrared?