new caching of Magnetic Field in GlobalTrajectoryParamters class

code from Matevz Tadel.