  We introduce a new technique that adopts the halo occupation framework for
understanding the origin of QSO absorption-line systems. Our initial study
focuses specifically on MgII absorbers. We construct a model of the gaseous
content in which the absorption equivalent width W_r is determined by the the
amount of cold gas, in the form of discrete clouds, along a sightline through a
halo. The two quantities that we specify per halo in the model are (1) the mean
absorption strength per unit surface mass density A_W(M), and (2) the mean
covering factor kappa_g(M) of the gaseous clouds. These parameters determine
the conditional probability distribution of W_r as a function of halo mass,
P(W_r|M). Two empirical measurements are applied to constrain the model: (i)
the absorber frequency distribution function and (ii) the W_r-dependent
clustering amplitude. We find that the data demand a rapid transition in the
gas content of halos at ~10^11.5 Msol/h, below which halos contain
predominantly cold gas and beyond which gas becomes predominantly hot. In order
to reproduce the observed overall strong clustering of the absorbers and the
anti-correlation between W_r and halo mass M, roughly 5% of gas in halos up to
10^14 Msol/h is required to be cold. The gas covering factor is near unity over
a wide range of halo mass, supporting that Mg II systems probe an unbiased
sample of typical galaxies. We discuss the implications of our study in the
contexts of mass assembly of distant galaxies and the origin of QSO absorption
line systems.
