  The production yield of prompt D mesons and their elliptic flow coefficient
$v_2$ were measured with the Event-Shape Engineering (ESE) technique applied to
mid-central (10-30% and 30-50% centrality classes) Pb-Pb collisions at the
centre-of-mass energy per nucleon pair $\sqrt{s_{\rm NN}} =5.02$ TeV, with the
ALICE detector at the LHC. The ESE technique allows the classification of
events, belonging to the same centrality, according to the azimuthal anisotropy
of soft particle production in the collision. The reported measurements give
the opportunity to investigate the dynamics of charm quarks in the Quark-Gluon
Plasma and provide information on their participation in the collective
expansion of the medium. D mesons were reconstructed via their hadronic decays
at mid-rapidity, $|\eta|<0.8$, in the transverse momentum interval $1<p_{\rm
T}<24$ GeV/$c$. The $v_2$ coefficient is found to be sensitive to the
event-shape selection confirming a correlation between the D-meson azimuthal
anisotropy and the collective expansion of the bulk matter, while the per-event
D-meson yields do not show any significant modification within the current
uncertainties.

Nuclear Experiment;High Energy Physics - Experiment