  Low light level charge coupled devices (L3CCDs) have recently been developed,
incorporating on-chip gain. They may be operated to give an effective readout
noise much less than one electron by implementing an on-chip gain process
allowing the detection of individual photons. However, the gain mechanism is
stochastic and so introduces significant extra noise into the system. In this
paper we examine how best to process the output signal from an L3CCD so as to
minimize the contribution of stochastic noise, while still maintaining
photometric accuracy.
  We achieve this by optimising a transfer function which translates the
digitised output signal levels from the L3CCD into a value approximating the
photon input as closely as possible by applying thresholding techniques. We
identify several thresholding strategies and quantify their impact on photon
counting accuracy and effective signal-to-noise.
  We find that it is possible to eliminate the noise introduced by the gain
process at the lowest light levels. Reduced improvements are achieved as the
light level increases up to about twenty photons per pixel and above this there
is negligible improvement. Operating L3CCDs at very high speeds will keep the
photon flux low, giving the best improvements in signal-to-noise ratio.
