Software for Numerical Calculations of Particle Trajectories in the Earth’s Magnetosphere and Its Use in Processing PAMELA Experimental Data