Particle tracing in the earth's magnetosphere and the ring current formation during storm times