Pātuhitia tēnei: Beam-based correction and optimization for accelerators /