BDSIM: A particle tracking code for accelerator beam-line simulations including particle–matter interactions