Here is highly recommended article written by Jeff Jacoby on punishment deterrence capacity and his link on excellent collection of scientific articles on the issue.
Classical paper by Isaak Ehrlich (1975) must be added to the above mentioned list of papers.
BTW, both, dead felons and dead terrorists can’t kill.