Grain rotation and lattice deformation during photoinduced chemical reactions revealed by in situ X-ray nanodiffraction.