QwGeant4
QweakSimPMTOnlyMessenger.cc
Go to the documentation of this file.
1 
2 // QweakSimPMTOnlyMessenger.cc
3 // Marty McHugh
4 // 2013-06-11
5 
6 /////// --------------------------------------------------------------------
7 
9 
10 //--- user includes
11 #include "QweakSimPMTOnly.hh"
13 
14 
15 
16 /////// --------------------------------------------------------------------
17 
19 :myPMTOnly(thePMTOnly)
20 {
21 
22  PMTOnlyDir = new G4UIdirectory("/PMTOnly/");
23  PMTOnlyDir -> SetGuidance("Lead Glass Detector control.");
24 
25  //--- Material
26 
27  PMTOnly_SetMaterial_Cmd = new G4UIcmdWithAString("/PMTOnly/SetMaterial",this);
28  PMTOnly_SetMaterial_Cmd -> SetGuidance("Select Material of the PMTOnly.");
29  PMTOnly_SetMaterial_Cmd -> SetParameterName("choice",false);
30  PMTOnly_SetMaterial_Cmd -> AvailableForStates(G4State_PreInit, G4State_Idle);
31 
32  //--- Position
33  //--- Set
34  PMTOnly_SetCenterPositionInX_Cmd = new G4UIcmdWithADoubleAndUnit("/PMTOnly/SetCenterPositionInX",this);
35  PMTOnly_SetCenterPositionInX_Cmd -> SetGuidance("Set the X position of the PMTOnly");
36  PMTOnly_SetCenterPositionInX_Cmd -> SetParameterName("Size",true);
37  PMTOnly_SetCenterPositionInX_Cmd -> SetUnitCategory("Length");
38  PMTOnly_SetCenterPositionInX_Cmd -> AvailableForStates(G4State_PreInit, G4State_Idle);
39 
40  PMTOnly_SetCenterPositionInY_Cmd = new G4UIcmdWithADoubleAndUnit("/PMTOnly/SetCenterPositionInY",this);
41  PMTOnly_SetCenterPositionInY_Cmd -> SetGuidance("Set the Y position of the PMTOnly");
42  PMTOnly_SetCenterPositionInY_Cmd -> SetParameterName("Size",true);
43  PMTOnly_SetCenterPositionInY_Cmd -> SetUnitCategory("Length");
44  PMTOnly_SetCenterPositionInY_Cmd -> AvailableForStates(G4State_PreInit, G4State_Idle);
45 
46  PMTOnly_SetCenterPositionInZ_Cmd = new G4UIcmdWithADoubleAndUnit("/PMTOnly/SetCenterPositionInZ",this);
47  PMTOnly_SetCenterPositionInZ_Cmd -> SetGuidance("Set the Z position of the PMTOnly");
48  PMTOnly_SetCenterPositionInZ_Cmd -> SetParameterName("Size",true);
49  PMTOnly_SetCenterPositionInZ_Cmd -> SetUnitCategory("Length");
50  PMTOnly_SetCenterPositionInZ_Cmd -> AvailableForStates(G4State_PreInit, G4State_Idle);
51 
52  //--- Get
53  PMTOnly_FindMotherCenter_Cmd = new G4UIcmdWithoutParameter("/PMTOnly/FindMotherCenter", this);
54  PMTOnly_FindMotherCenter_Cmd -> SetGuidance("Find Center of PMTOnly Volumes");
55  PMTOnly_FindMotherCenter_Cmd -> AvailableForStates(G4State_PreInit, G4State_Idle);
56 
57  //--- Rotation
58 
59  PMTOnly_SetTiltAngleInX_Cmd = new G4UIcmdWithADoubleAndUnit("/PMTOnly/SetTiltAngleInX",this);
60  PMTOnly_SetTiltAngleInX_Cmd -> SetGuidance("Set the X tilting angle of the PMTOnly");
61  PMTOnly_SetTiltAngleInX_Cmd -> SetParameterName("Angle",true);
62  PMTOnly_SetTiltAngleInX_Cmd -> SetDefaultUnit("degree");
63  PMTOnly_SetTiltAngleInX_Cmd -> AvailableForStates(G4State_PreInit, G4State_Idle);
64 
65  PMTOnly_SetTiltAngleInY_Cmd = new G4UIcmdWithADoubleAndUnit("/PMTOnly/SetTiltAngleInY",this);
66  PMTOnly_SetTiltAngleInY_Cmd -> SetGuidance("Set the Y tilting angle of the PMTOnly");
67  PMTOnly_SetTiltAngleInY_Cmd -> SetParameterName("Angle",true);
68  PMTOnly_SetTiltAngleInY_Cmd -> SetDefaultUnit("degree");
69  PMTOnly_SetTiltAngleInY_Cmd -> AvailableForStates(G4State_PreInit, G4State_Idle);
70 
71  PMTOnly_SetTiltAngleInZ_Cmd = new G4UIcmdWithADoubleAndUnit("/PMTOnly/SetTiltAngleInZ",this);
72  PMTOnly_SetTiltAngleInZ_Cmd -> SetGuidance("Set the Z tilting angle of the PMTOnly");
73  PMTOnly_SetTiltAngleInZ_Cmd -> SetParameterName("Angle",true);
74  PMTOnly_SetTiltAngleInZ_Cmd -> SetDefaultUnit("degree");
75  PMTOnly_SetTiltAngleInZ_Cmd -> AvailableForStates(G4State_PreInit, G4State_Idle);
76 
77  //--- Enable
78 
79  PMTOnly_SetEnabled_Cmd = new G4UIcmdWithoutParameter("/PMTOnly/Enable",this);
80  PMTOnly_SetEnabled_Cmd -> SetGuidance("Enables the PMTOnly");
81  PMTOnly_SetEnabled_Cmd -> AvailableForStates(G4State_PreInit, G4State_Idle);
82 
83  //--- Disable
84 
85  PMTOnly_SetDisabled_Cmd = new G4UIcmdWithoutParameter("/PMTOnly/Disable",this);
86  PMTOnly_SetDisabled_Cmd -> SetGuidance("Disables the PMTOnly");
87  PMTOnly_SetDisabled_Cmd -> AvailableForStates(G4State_PreInit, G4State_Idle);
88 
89 }
90 
91 
92 
93 /////// --------------------------------------------------------------------
94 
96 {
98 
102 
104 
107 
108  if (PMTOnlyDir) delete PMTOnlyDir;
109 
110 }
111 
112 
113 
114 /////// --------------------------------------------------------------------
115 
116 void QweakSimPMTOnlyMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
117 {
118  G4cout << "=== Calling QweakSimPMTOnlyMessenger::SetNewValue() " << newValue << G4endl;
119 
120  //--- Set New Material
121 
122  if (command == PMTOnly_SetMaterial_Cmd)
123  {
124  G4cout << "=== Messenger: Setting PMTOnly Material to " << newValue << G4endl;
125  myPMTOnly -> SetPMTOnly_Material(newValue);
126  }
127 
128  //--- Set New Position
129 
130  if (command == PMTOnly_SetCenterPositionInX_Cmd)
131  {
132  G4cout << "=== Messenger: Setting PMTOnly X position to " << newValue << G4endl;
133  myPMTOnly -> SetPMTOnly_CenterPositionInX(PMTOnly_SetCenterPositionInX_Cmd -> GetNewDoubleValue(newValue));
134  }
135 
136  if (command == PMTOnly_SetCenterPositionInY_Cmd)
137  {
138  G4cout << "=== Messenger: Setting PMTOnly Y position to " << newValue << G4endl;
139  myPMTOnly -> SetPMTOnly_CenterPositionInY(PMTOnly_SetCenterPositionInY_Cmd -> GetNewDoubleValue(newValue));
140  }
141 
142  if (command == PMTOnly_SetCenterPositionInZ_Cmd)
143  {
144  G4cout << "=== Messenger: Setting PMTOnly Z position to " << newValue << G4endl;
145  myPMTOnly -> SetPMTOnly_CenterPositionInZ(PMTOnly_SetCenterPositionInZ_Cmd -> GetNewDoubleValue(newValue));
146  }
147 
148 
149  //--- Find New Position
150  if (command == PMTOnly_FindMotherCenter_Cmd)
151  {
152  G4cout << "=== Messenger: Finding PMTOnly Center position" << G4endl;
153  myPMTOnly -> FindPMTOnly_MotherCenter();
154  }
155 
156  //--- Set New Tilting Anngle
157 
158  if (command == PMTOnly_SetTiltAngleInX_Cmd)
159  {
160  G4cout << "=== Messenger: Setting PMTOnly X tilting angle to " << newValue << G4endl;
161  myPMTOnly -> SetPMTOnly_TiltAngleInX(PMTOnly_SetTiltAngleInX_Cmd -> GetNewDoubleValue(newValue));
162  }
163 
164  if (command == PMTOnly_SetTiltAngleInY_Cmd)
165  {
166  G4cout << "=== Messenger: Setting PMTOnly Y tilting angle to " << newValue << G4endl;
167  myPMTOnly -> SetPMTOnly_TiltAngleInY(PMTOnly_SetTiltAngleInY_Cmd -> GetNewDoubleValue(newValue));
168  }
169 
170  if (command == PMTOnly_SetTiltAngleInZ_Cmd)
171  {
172  G4cout << "=== Messenger: Setting PMTOnly Z tilting angle to " << newValue << G4endl;
173  myPMTOnly -> SetPMTOnly_TiltAngleInZ(PMTOnly_SetTiltAngleInZ_Cmd -> GetNewDoubleValue(newValue));
174  }
175 
176  //--- Enable
177 
178  if (command == PMTOnly_SetEnabled_Cmd)
179  {
180  G4cout << "=== Messenger: ENABLE the PMTOnly" << G4endl;
181  myPMTOnly -> SetPMTOnly_Enabled();
182  }
183 
184  //----Disable
185 
186  if (command == PMTOnly_SetDisabled_Cmd)
187  {
188  G4cout << "=== Messenger: DISABLE the PMTOnly" << G4endl;
189  myPMTOnly -> SetPMTOnly_Disabled();
190  }
191 
192  G4cout << "=== Leaving QweakSimPMTOnlyMessenger::SetNewValue() " << newValue << G4endl;
193 }
194 
195 
196 
197 /////// --------------------------------------------------------------------
198 
G4UIcmdWithADoubleAndUnit * PMTOnly_SetTiltAngleInX_Cmd
G4UIcmdWithoutParameter * PMTOnly_FindMotherCenter_Cmd
G4UIcmdWithADoubleAndUnit * PMTOnly_SetTiltAngleInZ_Cmd
QweakSimPMTOnlyMessenger(QweakSimPMTOnly *)
G4UIcmdWithAString * PMTOnly_SetMaterial_Cmd
G4UIcmdWithADoubleAndUnit * PMTOnly_SetCenterPositionInY_Cmd
void SetNewValue(G4UIcommand *, G4String)
G4UIcmdWithoutParameter * PMTOnly_SetDisabled_Cmd
G4UIcmdWithADoubleAndUnit * PMTOnly_SetCenterPositionInX_Cmd
G4UIcmdWithADoubleAndUnit * PMTOnly_SetCenterPositionInZ_Cmd
G4UIcmdWithoutParameter * PMTOnly_SetEnabled_Cmd
G4UIcmdWithADoubleAndUnit * PMTOnly_SetTiltAngleInY_Cmd