35 #include <Geant4/G4UIdirectory.hh>
36 #include <Geant4/G4UIcmdWithAString.hh>
37 #include <Geant4/G4UIcmdWithAnInteger.hh>
38 #include <Geant4/G4UIcmdWithADouble.hh>
39 #include <Geant4/G4UIcmdWithADoubleAndUnit.hh>
40 #include <Geant4/G4UIcmdWithoutParameter.hh>
45 :fEFieldSetup(pEMfield)
47 G4TBdetDir =
new G4UIdirectory(
"/field/");
48 G4TBdetDir->SetGuidance(
"G4TB field tracking control.");
50 StepperCmd =
new G4UIcmdWithAnInteger(
"/field/setStepperType",
this);
51 StepperCmd->SetGuidance(
"Select stepper type for electric field");
52 StepperCmd->SetParameterName(
"choice",
true);
53 StepperCmd->SetDefaultValue(4);
54 StepperCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
57 UpdateCmd =
new G4UIcmdWithoutParameter(
"/field/update",
this);
58 UpdateCmd->SetGuidance(
"Update calorimeter geometry.");
59 UpdateCmd->SetGuidance(
"This command MUST be applied before \"beamOn\" ");
60 UpdateCmd->SetGuidance(
"if you changed geometrical value(s).");
61 UpdateCmd->AvailableForStates(G4State_Idle);
63 ElFieldCmd =
new G4UIcmdWithADoubleAndUnit(
"/field/setFieldZ",
this);
64 ElFieldCmd->SetGuidance(
"Define uniform Electric field.");
65 ElFieldCmd->SetGuidance(
"Electric field will be in Z direction.");
66 ElFieldCmd->SetGuidance(
"Value of Electric field has to be given in volt/m");
67 ElFieldCmd->SetParameterName(
"Ez",
false,
false);
68 ElFieldCmd->SetDefaultUnit(
"volt/m");
69 ElFieldCmd->AvailableForStates(G4State_Idle);
71 MinStepCmd =
new G4UIcmdWithADoubleAndUnit(
"/field/setMinStep",
this);
72 MinStepCmd->SetGuidance(
"Define minimal step");
73 MinStepCmd->SetParameterName(
"min step",
false,
false);
74 MinStepCmd->SetDefaultUnit(
"mm");
75 MinStepCmd->AvailableForStates(G4State_Idle);
77 AbsMaterCmd =
new G4UIcmdWithAString(
"/field/setAbsMat",
this);
78 AbsMaterCmd->SetGuidance(
"Select Material of the Absorber.");
79 AbsMaterCmd->SetParameterName(
"choice",
true);
80 AbsMaterCmd->SetDefaultValue(
"Xe");
81 AbsMaterCmd->AvailableForStates(G4State_Idle);
105 if( command == StepperCmd )
107 fEFieldSetup->
SetStepperType(StepperCmd->GetNewIntValue(newValue));
109 if( command == UpdateCmd )
113 if( command == ElFieldCmd )
115 fEFieldSetup->
SetFieldValue(ElFieldCmd->GetNewDoubleValue(newValue));
117 if( command == MinStepCmd )
119 fEFieldSetup->
SetMinStep(MinStepCmd->GetNewDoubleValue(newValue));
void SetNewValue(G4UIcommand *, G4String)
virtual ~G4TBFieldMessenger()
G4TBFieldMessenger(G4TBMagneticFieldSetup *)
void SetStepperType(const G4int i)
void SetFieldValue(const G4ThreeVector fieldVector)
void SetMinStep(const G4double s)