  The analysis of Fermi Large Area Telescope (LAT) gamma-ray data in a given
Region Of Interest (RoI) usually consists of performing a binned log-likelihood
fit in order to determine the sky model that, after convolution with the
instrument response, best accounts for the distribution of observed counts.
While tools are available to perform such a fit, it is not easy to check the
goodness-of-fit. The difficulty of the assessment of the data/model agreement
is twofold. First of all, the observed and predicted counts are binned in three
dimensions (two spatial dimensions and one energy dimension) and comparing two
3D maps is not straightforward. Secondly, gamma-ray source spectra generally
decrease with energy as the inverse of the energy square. As a consequence the
number of counts above several GeV generally falls into the Poisson regime,
which precludes performing a simple $\chi^2$ test. We propose a method that
overcomes these two obstacles by producing and comparing spatially integrated
count spectra for data and model at each pixel of the analysed RoI. The
comparison is performed following a log-likelihood approach that extends the
$\chi^2$ test to histograms with low statistics. This method can take into
account likelihood weights that are used to account for systematic
uncertainties. We optimize the new method so that it provides a fast and
reliable tool to assess the goodness-of-fit of Fermi-LAT data and we use it to
check the latest gamma-ray source catalog on 10~years of data.
