Reconstruction of the momentum of a particle moving in an axially symmetric magnetic field