A radiotherapy apparatus is disclosed, with a linear accelerator for producing a beam of electrons, a target aligned with the electron beam, the target being capable of producing photons when electrons are incident thereon, and a material which is capable of producing neutrons when photons of sufficient energy are incident thereon. A neutron detector capable of providing a signal to a controller of the linear accelerator is provided, the controller being capable of varying the energy of the electrons of the electron beam.