A three-dimensional electron pencil-beam algorithm.