added comments
refactored GeometryProducer code and move the update of the magnetic field in one method
removed unused function