We consider the performance of the wavefront reconstruction process when a Pyramid wavefront Sensor is used in a closed loop Adaptive Optics System. The Pyramid Sensor sensitivity in closed loop operations has been the subject of a first heuristic analysis showing that the sensor sensitivity is higher than that of a Shack-Hartmann sensor, at least when low order modes are considered. In this paper we evaluate the sensor accuracy by determining the closed loop reconstruction matrix. This is done using a diffractive analysis of the sensor behavior. Furthermore, knowledge of this matrix enables us to quantify the effect of error sources like sensor non linearity and photon noise on the reconstructed wavefront accuracy. Finally, a comparison of the performance of the Shack-Hartmann and Pyramid wavefront sensors is given.