45 : fMagneticField(magneticfield)
50 ReadCmd =
new G4UIcmdWithAString(
"/MagneticField/ReadFieldMap",
this);
51 ReadCmd->SetGuidance(
"Read the specified magnetic field from file");
52 ReadCmd->SetParameterName(
"file",
true);
53 ReadCmd->SetDefaultValue(
"MainMagnet_FieldMap.dat");
54 ReadCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
57 PrintCmd =
new G4UIcmdWith3VectorAndUnit(
"/MagneticField/PrintValue",
this);
58 PrintCmd->SetGuidance(
"Print the magnetic field value for specified position");
59 PrintCmd->SetParameterName(
"x",
"y",
"z",
false);
60 PrintCmd->SetDefaultValue(G4ThreeVector(0.0,0.0,0.0));
61 PrintCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
64 RefCurrentCmd =
new G4UIcmdWithADouble(
"/MagneticField/SetReferenceCurrent",
this);
65 RefCurrentCmd->SetGuidance(
"Set reference current of read field map");
67 RefCurrentCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
69 ActCurrentCmd =
new G4UIcmdWithADouble(
"/MagneticField/SetActualCurrent",
this);
70 ActCurrentCmd->SetGuidance(
"Set actual current of the magnetic field for simulation");
72 ActCurrentCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
74 ScaleCmd =
new G4UIcmdWithADouble(
"/MagneticField/SetScale",
this);
75 ScaleCmd->SetGuidance(
"Set scale of the magnetic field for simulation");
76 ScaleCmd->SetParameterName(
"bfil",
false);
77 ScaleCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
80 RotationCmd =
new G4UIcmdWithADoubleAndUnit(
"/MagneticField/SetRotation",
this);
81 RotationCmd->SetGuidance(
"Set rotation angle of the magnetic field to be read");
84 RotationCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
86 TranslationCmd =
new G4UIcmdWithADoubleAndUnit(
"/MagneticField/SetTranslation",
this);
87 TranslationCmd->SetGuidance(
"Set translation in z of the magnetic field (applied on field read-in)");
92 TranslationVectorCmd =
new G4UIcmdWith3VectorAndUnit(
"/MagneticField/SetTranslationVector",
this);
93 TranslationVectorCmd->SetGuidance(
"Set translation vector of the magnetic field (applied on field evaluation)");
99 MinZCmd =
new G4UIcmdWithADoubleAndUnit(
"/MagneticField/SetMinZ",
this);
100 MinZCmd->SetGuidance(
"Set the minimum z position of the field map grid to be read");
101 MinZCmd->SetParameterName(
"min_r",
false);
103 MinZCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
105 MaxZCmd =
new G4UIcmdWithADoubleAndUnit(
"/MagneticField/SetMaxZ",
this);
106 MaxZCmd->SetGuidance(
"Set the maximum z position of the field map grid to be read");
107 MaxZCmd->SetParameterName(
"max_r",
false);
109 MaxZCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
111 StepZCmd =
new G4UIcmdWithADoubleAndUnit(
"/MagneticField/SetStepZ",
this);
112 StepZCmd->SetGuidance(
"Set the step z position of the field map grid to be read");
113 StepZCmd->SetParameterName(
"step_r",
false);
115 StepZCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
118 MinRCmd =
new G4UIcmdWithADoubleAndUnit(
"/MagneticField/SetMinR",
this);
119 MinRCmd->SetGuidance(
"Set the minimum radius of the field map grid to be read");
120 MinRCmd->SetParameterName(
"min_r",
false);
122 MinRCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
124 MaxRCmd =
new G4UIcmdWithADoubleAndUnit(
"/MagneticField/SetMaxR",
this);
125 MaxRCmd->SetGuidance(
"Set the maximum radius of the field map grid to be read");
126 MaxRCmd->SetParameterName(
"max_r",
false);
128 MaxRCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
130 StepRCmd =
new G4UIcmdWithADoubleAndUnit(
"/MagneticField/SetStepR",
this);
131 StepRCmd->SetGuidance(
"Set the step radius of the field map grid to be read");
132 StepRCmd->SetParameterName(
"step_r",
false);
134 StepRCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
137 MinPhiCmd =
new G4UIcmdWithADoubleAndUnit(
"/MagneticField/SetMinPhi",
this);
138 MinPhiCmd->SetGuidance(
"Set the minimum phi of the field map grid to be read");
139 MinPhiCmd->SetParameterName(
"min_phi",
false);
141 MinPhiCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
143 MaxPhiCmd =
new G4UIcmdWithADoubleAndUnit(
"/MagneticField/SetMaxPhi",
this);
144 MaxPhiCmd->SetGuidance(
"Set the maximum phi of the field map grid to be read");
145 MaxPhiCmd->SetParameterName(
"max_phi",
false);
147 MaxPhiCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
149 StepPhiCmd =
new G4UIcmdWithADoubleAndUnit(
"/MagneticField/SetStepPhi",
this);
150 StepPhiCmd->SetGuidance(
"Set the step phi of the field map grid to be read");
151 StepPhiCmd->SetParameterName(
"step_phi",
false);
153 StepPhiCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
155 WrapPhiCmd =
new G4UIcmdWithAnInteger(
"/MagneticField/SetWrapPhi",
this);
156 WrapPhiCmd->SetGuidance(
"Set the wrap in phi of the field map grid to be read");
157 WrapPhiCmd->SetParameterName(
"wrap_phi",
false);
158 WrapPhiCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
161 StepperCmd =
new G4UIcmdWithAnInteger(
"/MagneticField/SetStepperType",
this);
162 StepperCmd->SetGuidance(
"Select stepper type for magnetic field");
165 StepperCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
167 MinStepCmd =
new G4UIcmdWithADoubleAndUnit(
"/MagneticField/SetMinStep",
this);
168 MinStepCmd->SetGuidance(
"Define minimal step");
169 MinStepCmd->SetParameterName(
"min step",
false,
false);
173 UpdateCmd =
new G4UIcmdWithoutParameter(
"/MagneticField/Update",
this);
174 UpdateCmd->SetGuidance(
"Update Main Magnet geometry.");
175 UpdateCmd->SetGuidance(
"This command MUST be applied before \"beamOn\" ");
176 UpdateCmd->SetGuidance(
"if you changed geometrical value(s).");
177 UpdateCmd->AvailableForStates(G4State_Idle);
222 }
else if (command ==
MinZCmd) {
224 }
else if (command ==
MinRCmd) {
228 }
else if (command ==
MaxZCmd) {
230 }
else if (command ==
MaxRCmd) {
249 G4ThreeVector vector =
PrintCmd->GetNew3VectorValue(newValue);
251 point[0] = vector.x();
252 point[1] = vector.y();
253 point[2] = vector.z();
256 }
else if (command ==
ReadCmd) {
G4UIcmdWithADoubleAndUnit * StepRCmd
void SetTranslationVector(const G4ThreeVector translationvector)
Set the field translation vector.
G4UIcmdWithADoubleAndUnit * StepZCmd
void SetTranslation(const double translation)
Set the field translation along z.
G4UIcmdWithADoubleAndUnit * MinRCmd
QweakSimMagneticField * fMagneticField
G4UIcmdWithAString * ReadCmd
G4UIcmdWithADoubleAndUnit * MinStepCmd
G4UIcmdWithAnInteger * WrapPhiCmd
G4UIdirectory * MagneticFieldDir
void SetWrap(const int value, const int i)
Set the wrap.
G4UIcmdWithADoubleAndUnit * MinPhiCmd
G4UIcmdWithAnInteger * StepperCmd
void SetReferenceCurrent(const double referencecurrent)
Set the reference current.
void ReadFieldMap(const G4String &filename)
Read the field map.
G4UIcmdWithADouble * RefCurrentCmd
QweakSimMagneticFieldMessenger(QweakSimMagneticField *)
~QweakSimMagneticFieldMessenger()
G4UIcmdWithoutParameter * UpdateCmd
G4UIcmdWithADoubleAndUnit * MinZCmd
G4UIcmdWith3VectorAndUnit * PrintCmd
void SetScaleFactor(const double scalefactor)
Set the scale factor.
void SetStep(const double value, const int i)
Set the step.
void SetNewValue(G4UIcommand *command, G4String newValue)
G4UIcmdWithADoubleAndUnit * TranslationCmd
G4UIcmdWithADoubleAndUnit * MaxZCmd
G4UIcmdWithADouble * ActCurrentCmd
G4UIcmdWith3VectorAndUnit * TranslationVectorCmd
void SetRotation(const double rotation)
Set the field rotation around z.
G4UIcmdWithADoubleAndUnit * MaxPhiCmd
G4UIcmdWithADouble * ScaleCmd
void SetMaximum(const double value, const int i)
Set the maximum.
G4UIcmdWithADoubleAndUnit * RotationCmd
G4UIcmdWithADoubleAndUnit * StepPhiCmd
G4UIcmdWithADoubleAndUnit * MaxRCmd
void PrintFieldValue(const G4double point[4]) const
Print the field value.
void SetMinimum(const double value, const int i)
Set the minimum.
void SetActualCurrent(const double actualcurrent)
Set the actual current.