How are the Salem witch trails related to The Crucible by Arthur Miller?

The correct way to phrase the question is "How is the Crucible related to the Salem Witch Trials." More important and/or older event first. The Crucible is a play that mangles facts and theories about the trials to create an allegory to 1950s McCarthyism.