Traditionally, events collected at relativistic heavy-ion colliders are classified according to some centrality estimator (e.g. the number of produced charged particles) related to the initial energy density and volume of the system. In a naive picture the latter are directly related to the impact parameter of the two nuclei, which sets also the initial eccentricity of the system: zero in the case of the most central events and getting larger for more peripheral collisions. A more realistic modelling requires to take into account eventby-event fluctuations, in particular in the nucleon positions within the colliding nuclei: collisions belonging to the same centrality class can give rise to systems with different initial eccentricity and hence different flow harmonics for the final hadron distributions. This issue can be addressed by an event-shape-engineering analysis, consisting in selecting events with the same centrality but different magnitude of the average bulk anisotropic flow and therefore of the initial-state eccentricity. In this paper we present the implementation of this analysis in the POWLANG transport model, providing predictions for the transversemomentum and angular distributions of charm and beauty hadrons for event-shape selected collisions. In this way it is possible to get information on how the heavy quarks propagating (and hadronizing) in a hot environment respond both to its energy density and to its geometric asymmetry, breaking the perfect correlation between eccentricity and impact parameter which characterizes a modelling of the medium based on smooth average initial conditions. arXiv:1812.08337v1 [physics.data-an]