Even after setting non-zero value of mag field it is ignored in particles tracking in example N02. After adding the call to SetDetectorField(this) to the field manager in the ExN02MagneticField constructor, it works ok: ExN02MagneticField::ExN02MagneticField() : G4UniformMagField(G4ThreeVector()) { // need to be added GetGlobalFieldManager()->SetDetectorField(this); GetGlobalFieldManager()->CreateChordFinder(this); } ExN02MagneticField::ExN02MagneticField(G4ThreeVector fieldVector) : G4UniformMagField(fieldVector) { // need to be added GetGlobalFieldManager()->SetDetectorField(this); GetGlobalFieldManager()->CreateChordFinder(this); }
Will verify if this problem is still outstanding on Geant4.2.0.
The code is now fixed and will be included in December public release 3.0. Thanks for reporting the problem.