Joint Beam Training and Positioning for Intelligent Reflecting Surfaces Assisted Millimeter Wave Communications