  AGN are known to have complex X-ray spectra that depend on both the
properties of the accreting SMBH (e.g. mass, accretion rate) and the
distribution of obscuring material in its vicinity ("torus"). Often however,
simple and even unphysical models are adopted to represent the X-ray spectra of
AGN. In the case of blank field surveys in particular, this should have an
impact on e.g. the determination of the AGN luminosity function, the inferred
accretion history of the Universe and also on our understanding of the relation
between AGN and their host galaxies. We develop a Bayesian framework for model
comparison and parameter estimation of X-ray spectra. We take into account
uncertainties associated with X-ray data and photometric redshifts. We also
demonstrate how Bayesian model comparison can be used to select among ten
different physically motivated X-ray spectral models the one that provides a
better representation of the observations. Despite the use of low-count
spectra, our methodology is able to draw strong inferences on the geometry of
the torus. For a sample of 350 AGN in the 4 Ms Chandra Deep Field South field,
our analysis identifies four components needed to represent the diversity of
the observed X-ray spectra: (abridged). Simpler models are ruled out with
decisive evidence in favour of a geometrically extended structure with
significant Compton scattering. Regarding the geometry of the obscurer, there
is strong evidence against both a completely closed or entirely open toroidal
geometry, in favour of an intermediate case. The additional Compton reflection
required by data over that predicted by toroidal geometry models, may be a sign
of a density gradient in the torus or reflection off the accretion disk.
Finally, we release a catalogue with estimated parameters such as the accretion
luminosity in the 2-10 keV band and the column density, $N_{H}$, of the
obscurer.
