  Accurate modeling of selection effects is a key ingredient to the success of
gravitational-wave astronomy. The detection probability plays a crucial role in
both statistical population studies, where it enters the hierarchical Bayesian
likelihood, and astrophysical modeling, where it is used to convert predictions
from population-synthesis codes into observable distributions. We review the
most commonly used approximations, extend them, and present some recipes for a
straightforward implementation. These include a closed-form expression
capturing both multiple detectors and noise realizations written in terms of
the so-called Marcum Q-function and a ready-to-use mapping between
signal-to-noise ratio thresholds and false-alarm rates from state-of-the-art
detection pipelines. The bias introduced by approximating the matched filter
signal-to-noise ratio with the optimal signal-to-noise ratio is not symmetric:
sources that are nominally below threshold are more likely to be detected than
sources above threshold are to be missed. Using both analytical considerations
and software injections in detection pipelines, we confirm that including noise
realizations when estimating the selection function introduces an average
variation of a few %. This effect is most relevant for large catalogs and
specific subpopulations of sources at the edge of detectability (e.g. high
redshifts).
