Definition of seismic input for out-of-plane response of masonry walls: II formulation