Hello,
I am doing a simulation with B-field using the G4LineCurrentMagField in the DetectorConstructor.cc. Here are the B-field code:
G4LineCurrentMagFieldfield2 =new G4LineCurrentMagField(32 2teslamm);
G4FieldManager *fman2= new G4FieldManager();
fman2->SetDetectorField(field2);
fman2->CreateChordFinder(field2);
LogicalV->SetFieldManager(fman2,true);
I try to visualise the B-field, following the example “purging_magnet”, by using the command
/vis/scene/add/magneticField (and “/vis/scence/activateModel Field false” and then “/vis/scene/add/magneticField”). It worked perfectly (showing arrows) when I was running “purging_magnet” but I got “No Magnetic field in this extent” while running my simulation.
I fired a low energy electron in the B-field volume and saw a curved trajectory thus I am sure the B-field existed in the simulation.
I tried using the “/vis/set/extentForField xx xx xx xx xx xx mm"or " /vis/set/volumeForField phyV” and then /vis/scene/add/magneticField, still got “No Magnetic field in this extent”.
I read the source code of “purging_magnet” but I cannot find code about visualisation of B-field.
Can anyone give some hints what I have missed or overlooked ?