  We study the orbital properties of dark matter haloes by combining a spectral
method and cosmological simulations of Milky Way-sized galaxies. We compare the
dynamics and orbits of individual dark matter particles from both hydrodynamic
and $N$-body simulations, and find that the fraction of box, tube and resonant
orbits of the dark matter halo decreases significantly due to the effects of
baryons. In particular, the central region of the dark matter halo in the
hydrodynamic simulation is dominated by regular, short-axis tube orbits, in
contrast to the chaotic, box and thin orbits dominant in the $N$-body run. This
leads to a more spherical dark matter halo in the hydrodynamic run compared to
a prolate one as commonly seen in the $N$-body simulations. Furthermore, by
using a kernel based density estimator, we compare the coarse-grained
phase-space densities of dark matter haloes in both simulations and find that
it is lower by $\sim0.5$ dex in the hydrodynamic run due to changes in the
angular momentum distribution, which indicates that the baryonic process that
affects the dark matter is irreversible. Our results imply that baryons play an
important role in determining the shape, kinematics and phase-space density of
dark matter haloes in galaxies.
