The role of the foundation soil on the dynamic behaviour of reinforced-concrete and masonry buildings