  We present a new algorithm (PINOCCHIO, PINpointing Orbit-Crossing Collapsed
HIerarchical objects) to predict accurately the formation and evolution of
individual dark matter haloes in a given realization of an initial linear
density field. Compared with the halo population formed in a large (360^3
particles) collisionless simulation of a CDM universe, our method is able to
predict to better than 10 per cent statistical quantities such as the mass
function, two-point correlation function and progenitor mass function of the
haloes. Masses of individual haloes are estimated accurately as well, with
errors typically of order 30 per cent in the mass range well resolved by the
numerical simulation. These results show that the hierarchical formation of
dark matter haloes can be accurately predicted using local approximations to
the dynamics when the correlations in the initial density field are properly
taken into account. The approach allows one to automatically generate a large
ensemble of accurate merging histories of haloes with complete knowledge of
their spatial distribution. The construction of the full merger tree for a
256^3 realisation requires a few hours of CPU-time on a personal computer,
orders of magnitude faster than the corresponding N-body simulation would take,
and without needing any extensive post-processing. The technique can be
efficiently used, for instance, for generating the input for galaxy formation
modeling.
