A seismic loss assessment procedure for masonry buildings