Shielding a volume from Magnetic Field effects

Hi,
I have two volumes, one is a tube that goes inside the main volume that is my magnet. My beam shoots from the end of the tube to the magnet. I want to have it such that my magnet’s magnetic field doesn’t affect the beam while it is inside the tube and only start acting upon it once the beam comes outside. I tried using two different Magnetic fields such as

fMagneticField = new MagneticField();
  	fFieldMgr = new G4FieldManager();
  	fFieldMgr->SetDetectorField(fMagneticField);
  	fFieldMgr->CreateChordFinder(fMagneticField);
  	G4bool forceToAllDaughters = false;
  	logicMagTube->SetFieldManager(fFieldMgr, forceToAllDaughters);

	fMagneticFieldTube = new MagneticField(0);
  	fFieldMgrTube = new G4FieldManager();
  	fFieldMgrTube->SetDetectorField(fMagneticFieldTube);
  	fFieldMgrTube->CreateChordFinder(fMagneticFieldTube);
  	logicTube->SetFieldManager(fFieldMgrTube, forceToAllDaughters);

However, this does not work as the main volume’s magnetic field affects the beam within the tube. Is there a way to do this or do I have to use imported magnetic field profiles or calculate strength of mangetic field at points and exclude the area of the tube?

For reference, I have two constructors of the magnetic field class, in one I have a defined magnetic field and the other one should take the value of strenght of a uniform magentic field and set it.
Thank you