Doctor Who: The Mind of Evil by Terrance Dicks

The Third Doctor and his companion, Jo, visit Stangmoor prison where a Professor Kettering is using a device on criminals that, it is claimed, drains all evil and negative impulses from their minds. The machine is used on a prisoner named Barnham who, to the Doctor’s horror, is successfully pacified by being turned into a drooling imbecile….