Left: the spin density matrix element \rzz of prompt \Dstar mesons as a function of \pt in the rapidity interval $0.3 |y| 0.8$ for central (0--10\%) and midcentral (30--50\%) Pb--Pb collisions at $\snn=5.02 \TeV$. Right: \rzz of prompt \Dstar mesons as a function of \pt in the two rapidity intervals for midcentral (30--50\%) Pb--Pb collisions at $\snn=5.02 \TeV$. The measurements are carried out with respect to the direction perpendicular to the reaction plane. Statistical and systematic uncertainties are represented by bars and boxes, respectively.