how to add a rectangular bend magnetic?

I want add a rectangular bend magnetic.a weak vertical weak focusing is needed.but i cant constrcuct this magnetic field in Geant4.maybe i cant get the method.can you tell me how to do it?