Performance of the Muon g−2 calorimeter and readout systems measured with test beam data