  Cavity enhanced light scattering off an ultracold gas in an optical lattice
constitutes a quantum measurement with a controllable form of the measurement
back-action. Time-resolved counting of scattered photons alters the state of
the atoms without particle loss implementing a quantum nondemolition (QND)
measurement. The conditional dynamics is given by the interplay between
photodetection events (quantum jumps) and no-count processes. The class of
emerging atomic many-body states can be chosen via the optical geometry and
light frequencies. Light detection along the angle of a diffraction maximum
(Bragg angle) creates an atom-number squeezed state, while light detection at
diffraction minima leads to the macroscopic superposition states (Schroedinger
cat states) of different atom numbers in the cavity mode. A measurement of the
cavity transmission intensity can lead to atom-number squeezed or macroscopic
superposition states depending on its outcome. We analyze the robustness of the
superposition with respect to missed counts and find that a transmission
measurement yields more robust and controllable superposition states than the
ones obtained by scattering at a diffraction minimum.
