In both configurations, an optical trap is created 5 μm above the coverslip in a sample of highly concentrated particles (Figs. 2(b) and 2(c)). The software then waits for a particle to diffuse into the trap. This event can be identified computationally by analysing images recorded by the camera. Background subtraction on these images means the average intensity of the brightest pixel in the image is near zero, with only camera noise contributing. The standard deviation of the brightest pixel value is then small. When a particle diffuses into the empty trap, this standard deviation increases (Fig. 3). Therefore, we use this criterion to identify the presence of a particle. If the standard deviation increases further (typically because two or more particles have diffused into the trap) the trap is switched off, and the software waits 30 seconds before restarting. If the particle meets the criterion, then, in the case using a shield, the shield is switched on. In the case without a shield, no change is made to the hologram. 3×105 position data and pixel intensities are saved to file for later analysis. The trap then switches off for 30 seconds and the experiment repeats, allowing many measurements to be taken with different particles. Figure 2(a) shows tracks of diffusing particles, two of which are trapped in optical traps. The left hand of these traps is surrounded by an optical shield which is seen to deflect material from the trap.