Reducing LED spread via pinhole
The beam is the straight lines directly joining the emitting area to the receiving area. 

The emitting area of an unfocused smt led is quite small, maybe 0.2mm square. So it is already the pinhole size that you want. A small led and small photodiode will give you a small beam.

You do not need to cut out the light that goes in other directions, as it simply does not lie on the beam.

Note that using an unfocused LED like this, gives you the same intensity in the (narrow) beam (mW/mm^2), that you get with a focused LED - you are not losing anything. This is counter-intuitive, but true. No lens or mirror is able to get any of the off-beam light back into the (0.2mm) beam - it's impossible.

You want to ensure that your tube is not reflective i.e. matte black, just to reduce the scattered light that reaches the detector and reduces the darkness of a blocked beam



If the chamber is close to the led, then the beam size is the led emission size. If it is close to the detector, then it is the detector size. You can change the beam size by choosing these.

When you have a choice, you use baffles (perpendicular to the light) not flat walls. The next choice is machining grooves in, which has a 90 degree corner angle.

You can have multiple leds with one photodiode. You can also use an image sensor, area or linear for the photodiode, and sample a big area at once. Linear sensors are quite simple and low power to read with a micro.

For lowest power consumption VCSEL lasers are also available in SMT, and achieve high beam intensity at lower DC power, as the spread is smaller (eg 8 deg vs 160 deg)



You can "remove" the lens by putting a drop of clear epoxy onto the lens, and pressing a microscope cover slip flat onto it (no air bubbles). Any flat, clear sheet will do.

You can align baffles with small holes by threading them all onto a rod or tensioned thread, from sender to receiver, then fixing them in place and removing the rod/thread. [if it is vertical then it does not droop]

When working with infrared you must test your "black" materials (ink, paint, plastic). Carbon-loaded black is black. Red+Blue dyed black is transparent to NIR. Black plastic that lets IR through is common. 

Infrared leds can take very high pulse currents. Pulsing with high currents and short pulses, which have a repetition rate such that you cannot miss a bug, will likely give the best system.