  (Abridged) Gaia aims to make a 3-dimensional map of 1,000 million stars in
our Milky Way to unravel its kinematical, dynamical, and chemical structure and
evolution. Gaia's on-board detection software discriminates stars from spurious
objects like cosmic rays and Solar protons. For this, parametrised
point-spread-function-shape criteria are used. This study aims to provide an
optimum set of parameters for these filters. We developed an emulation of the
on-board detection software, which has 20 free, so-called rejection parameters
which govern the boundaries between stars on the one hand and sharp or extended
events on the other hand. We evaluate the detection and rejection performance
of the algorithm using catalogues of simulated single stars, double stars,
cosmic rays, Solar protons, unresolved galaxies, and asteroids. We optimised
the rejection parameters, improving - with respect to the functional baseline -
the detection performance of single and double stars, while, at the same time,
improving the rejection performance of cosmic rays and of Solar protons. We
find that the minimum separation to resolve a close, equal-brightness double
star is 0.23 arcsec in the along-scan and 0.70 arcsec in the across-scan
direction, independent of the brightness of the primary. We find that, whereas
the optimised rejection parameters have no significant impact on the
detectability of de Vaucouleurs profiles, they do significantly improve the
detection of exponential-disk profiles. We also find that the optimised
rejection parameters provide detection gains for asteroids fainter than 20 mag
and for fast-moving near-Earth objects fainter than 18 mag, albeit this gain
comes at the expense of a modest detection-probability loss for bright,
fast-moving near-Earth objects. The major side effect of the optimised
parameters is that spurious ghosts in the wings of bright stars essentially
pass unfiltered.
