Accelerators for hadrontherapy: from Lawrence cyclotrons to linacs