Quantum nondemolition photon (QND) counting in a high Q cavity is performed by using circular Rydberg atoms. The atoms behave as clocks whose ticking rate is affected by light shifts induced by the cavity field. Measurning the atoms projects the field on non-classical states such as number states or Schrodinger cat states. We also use the QND measurement method for reconstructing the Wigner function of these states and to monitor their decoherence. These field manipulation methods can be applied to state preparation by quantum feedback and to demonstrate non locality with two fields located in separated cavities.