Wherever you live, chances are that on Oct. 31 you’ll be visited by pirates, ghosts, princesses, and monsters crying, “Trick or treat!” at your front door. Costumes and going door-to-door for treats can be traced back to pagan and Christian rituals from the Middle Ages.