  We present a maximum-likelihood analysis of galaxy-galaxy lensing effects in
galaxy clusters and in the field. The aim is to determine the accuracy and
robustness of constraints that can be obtained on galaxy halo properties in
both environments - the high density cluster and the low density field. This
paper is theoretically motivated, therefore, we work exclusively with simulated
data (nevertheless defined to match observations) to study the accuracy with
which input parameters for mass distributions for galaxies can be extracted. We
model galaxies in the cluster and the field using a wide range of mass
profiles: the truncated pseudo isothermal elliptical mass distribution, the
Navarro, Frenk and White profile, and a Power Law model with a core radius. We
find that independent of the choice of profile the mean mass of galaxies (of
the order of 10^{12}Mo) can be estimated to within 15% from ground-based data
and with an error of less than 10% with space observations. Additionally robust
constraints can be obtained on the mean slope of the mass profile. The two
standard parameters that characterise galaxy halo models, the central velocity
dispersion and the truncation radius can also be retrieved reliably from the
maximum-likelihood analysis. Furthermore, going beyond the usual formulation,
we propose a re-parameterisation of the mass models that allows us to put yet
stronger constraints on the aperture mass of a galaxy halo (with less than 10%
error). The gain in signal to noise using space observations, expected for
instance with the proposed SNAP satellite compared to ground based data in
terms of accuracy of retrieving input parameters is highly significant.
