Planck 2013 results. X. HFI energetic particle effects: Characterization, removal, and simulation