  We study HI and metal-line absorption around $z\approx2$ star-forming
galaxies by comparing an analysis of data from the Keck Baryonic Structure
Survey to mock spectra generated from the EAGLE cosmological, hydrodynamical
simulations. We extract sightlines from the simulations and compare the
properties of the absorption by HI, CIV and SiIV around simulated and observed
galaxies using pixel optical depths. We mimic the resolution, pixel size, and
signal-to-noise ratio of the observations, as well as the distributions of
impact parameters and galaxy redshift errors. We find that the EAGLE reference
model is in excellent agreement with the observations. In particular, the
simulation reproduces the high metal-line optical depths found at small
galactocentric distances, the optical depth enhancements out to impact
parameters of 2 proper Mpc, and the prominent redshift-space distortions which
we find are due to peculiar velocities rather than redshift errors. The
agreement is best for halo masses $\sim10^{12.0}$ M$_\odot$, for which the
observed and simulated stellar masses also agree most closely. We examine the
median ion mass-weighted radial gas velocities around the galaxies, and find
that most of the gas is infalling, with the infall velocity depending on halo
rather than stellar mass. From this we conclude that the observed
redshift-space distortions are predominantly caused by infall rather than
outflows.
