get the movement of oculus rift

I was wandering how to get the movement of the HMD.If the person wearing the HMD raise his head or lower his head,can his movement be detected?How to get the movement of the head?