Design and performance of a magnetic spectrometer for the study of πp → ππN reactions near threshold