Software Toolkit for Charged-Particle and X-Ray Simulations