  Aims. We investigate the contribution of shot-noise and sample variance to
the uncertainty of cosmological parameter constraints inferred from cluster
number counts in the context of the Euclid survey. Methods. By analysing 1000
Euclid-like light-cones, produced with the PINOCCHIO approximate method, we
validate the analytical model of Hu & Kravtsov 2003 for the covariance matrix,
which takes into account both sources of statistical error. Then, we use such
covariance to define the likelihood function that better extracts cosmological
information from cluster number counts at the level of precision that will be
reached by the future Euclid photometric catalogs of galaxy clusters. We also
study the impact of the cosmology dependence of the covariance matrix on the
parameter constraints. Results. The analytical covariance matrix reproduces the
variance measured from simulations within the 10 per cent level; such
difference has no sizeable effect on the error of cosmological parameter
constraints at this level of statistics. Also, we find that the Gaussian
likelihood with cosmology-dependent covariance is the only model that provides
an unbiased inference of cosmological parameters without underestimating the
errors.
