The sedimentation of dilute particle suspensions in a channel flow into a cavity at finite Reynolds number is analysed numerically using a coupled lattice Boltzmann method with the discrete element method. The effects of fluid inertia, particle density and cavity size on the trap efficiency in the cavity are systematically investigated. The results show that decreasing the Reynolds number, and increasing the length and depth of the cavity all lead to an increase in the trap efficiency. A close examination of the trajectory of particles reveals three distinct dynamic behaviours in the cavity flow: i) resuspension, ii) circulation in the central vortex and iii) deposition near the tailing edge of the cavity. Three distinctive regimes were then identified using a dimensionless trap number Tp: a resuspension regime with Tp<1, a fully trapped regime with Tp>2.5, and a continuous circulating regime in between.