Theoretical and Experimental Engineering Analysis for Seismically Damaged Masonry Buildings