  The Supernova Legacy Survey (SNLS) has produced a high-quality, homogeneous
sample of Type Ia supernovae (SNe Ia) out to redshifts greater than z=1. In its
first four years of full operation (to June 2007), the SNLS discovered more
than 3000 transient candidates, 373 of which have been confirmed
spectroscopically as SNe Ia. Use of these SNe Ia in precision cosmology
critically depends on an analysis of the observational biases incurred in the
SNLS survey due to the incomplete sampling of the underlying SN Ia population.
This paper describes our real-time supernova detection and analysis procedures,
and uses detailed Monte Carlo simulations to examine the effects of Malmquist
bias and spectroscopic sampling. Such sampling effects are found to become
apparent at z~0.6, with a significant shift in the average magnitude of the
spectroscopically confirmed SN Ia sample towards brighter values for z>0.75. We
describe our approach to correct for these selection biases in our three-year
SNLS cosmological analysis (SNLS3), and present a breakdown of the systematic
uncertainties involved.
