Cosmology with galaxy surveys : how galaxies trace mass at large scales