48 fDirectory->SetGuidance(
"Global uniform magnetic field UI commands");
51 fSetValueCmd->SetGuidance(
"Set uniform magnetic field value.");
52 fSetValueCmd->SetParameterName(
"Bx",
"By",
"By",
false);
53 fSetValueCmd->SetUnitCategory(
"Magnetic flux density");
57 fSetVerboseCmd->SetGuidance(
"Set verbose level: ");
58 fSetVerboseCmd->SetGuidance(
" 0: no output");
59 fSetVerboseCmd->SetGuidance(
" 1: printing new field value");
60 fSetVerboseCmd->SetParameterName(
"globalFieldVerbose",
false);
61 fSetVerboseCmd->SetRange(
"globalFieldVerbose>=0");
68 SetField(value,
"G4GlobalMagFieldMessenger::G4GlobalMagFieldMessenger");
77 delete fSetVerboseCmd;
83void G4GlobalMagFieldMessenger::SetField(
const G4ThreeVector& value,
96 if ( fVerboseLevel > 0 )
98 G4cout <<
"Magnetic field is inactive, fieldValue = (0,0,0)." <<
G4endl;
103 fMagField->SetFieldValue(value);
107 if ( fVerboseLevel > 0 )
109 G4cout <<
"Magnetic field is active, fieldValue = ("
120 if ( command == fSetValueCmd )
122 SetField(fSetValueCmd->GetNew3VectorValue(newValue),
123 "G4GlobalMagFieldMessenger::SetNewValue");
125 else if ( command == fSetVerboseCmd )
135 SetField(value,
"G4GlobalMagFieldMessenger::SetFieldValue");
142 if ( fMagField !=
nullptr ) {
return fMagField->GetConstantFieldValue(); }
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cout
G4bool SetDetectorField(G4Field *detectorField, G4int failMode=0)
void CreateChordFinder(G4MagneticField *detectorMagField)
void SetVerboseLevel(G4int verboseLevel)
~G4GlobalMagFieldMessenger() override
void SetNewValue(G4UIcommand *, G4String) override
G4ThreeVector GetFieldValue() const
G4GlobalMagFieldMessenger(const G4ThreeVector &value=G4ThreeVector())
void SetFieldValue(const G4ThreeVector &value)
static G4TransportationManager * GetTransportationManager()
G4FieldManager * GetFieldManager() const