QwGeant4
QweakSimHDCMessenger.cc
Go to the documentation of this file.
1 
2 //=============================================================================
3 //
4 // ---------------------------
5 // | Doxygen File Information |
6 // ---------------------------
7 //
8 /**
9 
10  \file QweakSimHDCMessenger.cc
11 
12  $Revision: 1.2 $
13  $Date: 2005/12/27 19:12:24 $
14 
15  \author Klaus Hans Grimm
16 
17 */
18 //=============================================================================
19 
20 //=============================================================================
21 // -----------------------
22 // | CVS File Information |
23 // -----------------------
24 //
25 // Last Update: $Author: grimm $
26 // Update Date: $Date: 2005/12/27 19:12:24 $
27 // CVS/RCS Revision: $Revision: 1.2 $
28 // Status: $State: Exp $
29 //
30 // ===================================
31 // CVS Revision Log at end of file !!
32 // ===================================
33 //
34 //============================================================================
35 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
36 
37 #include "QweakSimHDCMessenger.hh"
38 
39 // user includes
40 #include "QweakSimHDC.hh"
42 
43 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
44 
46 :myHDC(theHDC),fPackage(pkg)
47 {
48  // HDC related
49  HDCDir = new G4UIdirectory("/HDC/");
50  HDCDir -> SetGuidance("HDC control.");
51 
52  //--------------------
53 
54  HDC_FrontCenterPositionInX_Cmd = new G4UIcmdWithADoubleAndUnit("/HDC/SetFrontCenterPositionInX",this);
55  HDC_FrontCenterPositionInX_Cmd->SetGuidance("Set the X position of the HDC Front container center");
56  HDC_FrontCenterPositionInX_Cmd->SetParameterName("Size",true);
57  HDC_FrontCenterPositionInX_Cmd->SetUnitCategory("Length");
58  HDC_FrontCenterPositionInX_Cmd->AvailableForStates(G4State_PreInit,G4State_Idle);
59 
60  HDC_FrontCenterPositionInY_Cmd = new G4UIcmdWithADoubleAndUnit("/HDC/SetFrontCenterPositionInY",this);
61  HDC_FrontCenterPositionInY_Cmd->SetGuidance("Set the Y position of the HDC Front container center");
62  HDC_FrontCenterPositionInY_Cmd->SetParameterName("Size",true);
63  HDC_FrontCenterPositionInY_Cmd->SetUnitCategory("Length");
64  HDC_FrontCenterPositionInY_Cmd->AvailableForStates(G4State_PreInit,G4State_Idle);
65 
66  HDC_FrontCenterPositionInZ_Cmd = new G4UIcmdWithADoubleAndUnit("/HDC/SetFrontCenterPositionInZ",this);
67  HDC_FrontCenterPositionInZ_Cmd->SetGuidance("Set the Z position of the HDC Front container center");
68  HDC_FrontCenterPositionInZ_Cmd->SetParameterName("Size",true);
69  HDC_FrontCenterPositionInZ_Cmd->SetUnitCategory("Length");
70  HDC_FrontCenterPositionInZ_Cmd->AvailableForStates(G4State_PreInit,G4State_Idle);
71 
72  //--------------------
73 
74  HDC_BackCenterPositionInX_Cmd = new G4UIcmdWithADoubleAndUnit("/HDC/SetBackCenterPositionInX",this);
75  HDC_BackCenterPositionInX_Cmd->SetGuidance("Set the X position of the HDC Back container center");
76  HDC_BackCenterPositionInX_Cmd->SetParameterName("Size",true);
77  HDC_BackCenterPositionInX_Cmd->SetUnitCategory("Length");
78  HDC_BackCenterPositionInX_Cmd->AvailableForStates(G4State_PreInit,G4State_Idle);
79 
80  HDC_BackCenterPositionInY_Cmd = new G4UIcmdWithADoubleAndUnit("/HDC/SetBackCenterPositionInY",this);
81  HDC_BackCenterPositionInY_Cmd->SetGuidance("Set the Y position of the HDC Back container center");
82  HDC_BackCenterPositionInY_Cmd->SetParameterName("Size",true);
83  HDC_BackCenterPositionInY_Cmd->SetUnitCategory("Length");
84  HDC_BackCenterPositionInY_Cmd->AvailableForStates(G4State_PreInit,G4State_Idle);
85 
86  HDC_BackCenterPositionInZ_Cmd = new G4UIcmdWithADoubleAndUnit("/HDC/SetBackCenterPositionInZ",this);
87  HDC_BackCenterPositionInZ_Cmd->SetGuidance("Set the Z position of the HDC Back container center");
88  HDC_BackCenterPositionInZ_Cmd->SetParameterName("Size",true);
89  HDC_BackCenterPositionInZ_Cmd->SetUnitCategory("Length");
90  HDC_BackCenterPositionInZ_Cmd->AvailableForStates(G4State_PreInit,G4State_Idle);
91 
92  //--------------------
93 
94  HDC_MasterContainerMatCmd = new G4UIcmdWithAString("/HDC/SetMasterContainerMaterial",this);
95  HDC_MasterContainerMatCmd->SetGuidance("Select Material of the HDC MasterContainer.");
96  HDC_MasterContainerMatCmd->SetParameterName("choice",false);
97  HDC_MasterContainerMatCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
98 
99  HDC_SubContainerMatCmd = new G4UIcmdWithAString("/HDC/SetSubContainerMaterial",this);
100  HDC_SubContainerMatCmd->SetGuidance("Select Material of the HDC MasterContainer.");
101  HDC_SubContainerMatCmd->SetParameterName("choice",false);
102  HDC_SubContainerMatCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
103 
104  HDC_FoilMatCmd = new G4UIcmdWithAString("/HDC/SetFoilMaterial",this);
105  HDC_FoilMatCmd->SetGuidance("Select Material of the HDC Foil.");
106  HDC_FoilMatCmd->SetParameterName("choice",false);
107  HDC_FoilMatCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
108 
109  HDC_FrameMatCmd = new G4UIcmdWithAString("/HDC/SetFrameMaterial",this);
110  HDC_FrameMatCmd->SetGuidance("Select Material of the HDC Frame.");
111  HDC_FrameMatCmd->SetParameterName("choice",false);
112  HDC_FrameMatCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
113 
114  HDC_WirePlaneMatCmd = new G4UIcmdWithAString("/HDC/SetWirePlaneMaterial",this);
115  HDC_WirePlaneMatCmd->SetGuidance("Select Material of the HDC WirePlane.");
116  HDC_WirePlaneMatCmd->SetParameterName("choice",false);
117  HDC_WirePlaneMatCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
118 
119 
120  HDC_RotationAngleInPhi_Cmd = new G4UIcmdWithADoubleAndUnit("/HDC/SetRotationAngleInPhi",this);
121  HDC_RotationAngleInPhi_Cmd->SetGuidance("Set the rotation angle in phi");
122  HDC_RotationAngleInPhi_Cmd->SetParameterName("Size",true);
123  HDC_RotationAngleInPhi_Cmd->SetUnitCategory("Angle");
124  HDC_RotationAngleInPhi_Cmd->AvailableForStates(G4State_PreInit,G4State_Idle);
125 
126  //-----------------------------------------------------------------------------------
127  // Below commands for single HDC Packages
128 
129  G4String DirPerPackage_name = "/HDC/HDC" + G4UIcommand::ConvertToString(pkg+1);
130  DirPerPackage = new G4UIdirectory(G4String(DirPerPackage_name + "/"));
131  DirPerPackage -> SetGuidance("Individual HDC detector control.");
132 
133  HDC_FrontCenterPositionInX_Pkg_Cmd = new G4UIcmdWithADoubleAndUnit(G4String(DirPerPackage_name + "/SetFrontCenterPositionInX"),this);
134  HDC_FrontCenterPositionInX_Pkg_Cmd->SetGuidance("Set the X position of the HDC Front container center of a package");
135  HDC_FrontCenterPositionInX_Pkg_Cmd->SetParameterName("Size",true);
136  HDC_FrontCenterPositionInX_Pkg_Cmd->SetUnitCategory("Length");
137  HDC_FrontCenterPositionInX_Pkg_Cmd->AvailableForStates(G4State_PreInit,G4State_Idle);
138 
139  HDC_FrontCenterPositionInY_Pkg_Cmd = new G4UIcmdWithADoubleAndUnit(G4String(DirPerPackage_name + "/SetFrontCenterPositionInY"),this);
140  HDC_FrontCenterPositionInY_Pkg_Cmd->SetGuidance("Set the Y position of the HDC Front container center");
141  HDC_FrontCenterPositionInY_Pkg_Cmd->SetParameterName("Size",true);
142  HDC_FrontCenterPositionInY_Pkg_Cmd->SetUnitCategory("Length");
143  HDC_FrontCenterPositionInY_Pkg_Cmd->AvailableForStates(G4State_PreInit,G4State_Idle);
144 
145  HDC_FrontCenterPositionInZ_Pkg_Cmd = new G4UIcmdWithADoubleAndUnit(G4String(DirPerPackage_name + "/SetFrontCenterPositionInZ"),this);
146  HDC_FrontCenterPositionInZ_Pkg_Cmd->SetGuidance("Set the Z position of the HDC Front container center");
147  HDC_FrontCenterPositionInZ_Pkg_Cmd->SetParameterName("Size",true);
148  HDC_FrontCenterPositionInZ_Pkg_Cmd->SetUnitCategory("Length");
149  HDC_FrontCenterPositionInZ_Pkg_Cmd->AvailableForStates(G4State_PreInit,G4State_Idle);
150 
151 
152  HDC_BackCenterPositionInX_Pkg_Cmd = new G4UIcmdWithADoubleAndUnit(G4String(DirPerPackage_name + "/SetBackCenterPositionInX"),this);
153  HDC_BackCenterPositionInX_Pkg_Cmd->SetGuidance("Set the X position of the HDC Back container center");
154  HDC_BackCenterPositionInX_Pkg_Cmd->SetParameterName("Size",true);
155  HDC_BackCenterPositionInX_Pkg_Cmd->SetUnitCategory("Length");
156  HDC_BackCenterPositionInX_Pkg_Cmd->AvailableForStates(G4State_PreInit,G4State_Idle);
157 
158  HDC_BackCenterPositionInY_Pkg_Cmd = new G4UIcmdWithADoubleAndUnit(G4String(DirPerPackage_name + "/SetBackCenterPositionInY"),this);
159  HDC_BackCenterPositionInY_Pkg_Cmd->SetGuidance("Set the Y position of the HDC Back container center");
160  HDC_BackCenterPositionInY_Pkg_Cmd->SetParameterName("Size",true);
161  HDC_BackCenterPositionInY_Pkg_Cmd->SetUnitCategory("Length");
162  HDC_BackCenterPositionInY_Pkg_Cmd->AvailableForStates(G4State_PreInit,G4State_Idle);
163 
164  HDC_BackCenterPositionInZ_Pkg_Cmd = new G4UIcmdWithADoubleAndUnit(G4String(DirPerPackage_name + "/SetBackCenterPositionInZ"),this);
165  HDC_BackCenterPositionInZ_Pkg_Cmd->SetGuidance("Set the Z position of the HDC Back container center");
166  HDC_BackCenterPositionInZ_Pkg_Cmd->SetParameterName("Size",true);
167  HDC_BackCenterPositionInZ_Pkg_Cmd->SetUnitCategory("Length");
168  HDC_BackCenterPositionInZ_Pkg_Cmd->AvailableForStates(G4State_PreInit,G4State_Idle);
169 
170  HDC_RotationAngleInPhi_Pkg_Cmd = new G4UIcmdWithADoubleAndUnit(G4String(DirPerPackage_name + "/SetRotationAngleInPhi"),this);
171  HDC_RotationAngleInPhi_Pkg_Cmd->SetGuidance("Set the rotation angle in phi");
172  HDC_RotationAngleInPhi_Pkg_Cmd->SetParameterName("Size",true);
173  HDC_RotationAngleInPhi_Pkg_Cmd->SetUnitCategory("Angle");
174  HDC_RotationAngleInPhi_Pkg_Cmd->AvailableForStates(G4State_PreInit,G4State_Idle);
175 
176 }
177 
178 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
179 
181 {
182 
184  if (HDC_FoilMatCmd) delete HDC_FoilMatCmd;
185  if (HDC_FrameMatCmd) delete HDC_FrameMatCmd;
188 
192 
196 
198 
199 
203 
207 
209 
210  if (HDCDir) delete HDCDir;
211  if (DirPerPackage) delete DirPerPackage;
212 }
213 
214 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
215 
216 void QweakSimHDCMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
217 {
218  G4cout << "#### Calling QweakSimHDCMessenger::SetNewValue() " << newValue << G4endl;
219 
220 
221  if( command == HDC_MasterContainerMatCmd )
222  {
223  G4cout << "#### Messenger: Setting HDC MasterContainer Material to " << newValue << G4endl;
224 
226  }
227 
228 
229  if( command == HDC_SubContainerMatCmd )
230  {
231  G4cout << "#### Messenger: Setting HDC SubContainer Material to " << newValue << G4endl;
232 
234  }
235 
236 
237  if( command == HDC_FrameMatCmd )
238  {
239  G4cout << "#### Messenger: Setting HDC Frame Material to " << newValue << G4endl;
240 
241  myHDC->SetHDC_FrameMaterial(newValue);
242  }
243 
244 
245  if( command == HDC_FoilMatCmd )
246  {
247  G4cout << "#### Messenger: Setting HDC Foil Material to " << newValue << G4endl;
248 
249  myHDC->SetHDC_FoilMaterial(newValue);
250  }
251 
252 
253 
254  if( command == HDC_WirePlaneMatCmd )
255  {
256  G4cout << "#### Messenger: Setting HDC WirePlane Material to " << newValue << G4endl;
257 
258  myHDC->SetHDC_WirePlaneMaterial(newValue);
259  }
260 
261  //-----------------------------------------------------------
262 
263  if( command == HDC_FrontCenterPositionInX_Cmd )
264  {
265  G4cout << "#### Messenger: Setting HDC FrontCenter Xpos to " << newValue << G4endl;
266 
267  myHDC->SetFrontHDC_CenterPositionInX(HDC_FrontCenterPositionInX_Cmd->GetNewDoubleValue(newValue),0);
268  }
269 
270  if( command == HDC_FrontCenterPositionInY_Cmd )
271  {
272  G4cout << "#### Messenger: Setting HDC FrontCenter Ypos to " << newValue << G4endl;
273 
274  myHDC->SetFrontHDC_CenterPositionInY(HDC_FrontCenterPositionInY_Cmd->GetNewDoubleValue(newValue),0);
275  }
276 
277  if( command == HDC_FrontCenterPositionInZ_Cmd )
278  {
279  G4cout << "#### Messenger: Setting HDC FrontCenter Zpos to " << newValue << G4endl;
280 
281  myHDC->SetFrontHDC_CenterPositionInZ(HDC_FrontCenterPositionInZ_Cmd->GetNewDoubleValue(newValue),0);
282  }
283 
284 
285  //-----------------------------------------------------------
286 
287  if( command == HDC_BackCenterPositionInX_Cmd )
288  {
289  G4cout << "#### Messenger: Setting HDC BackCenter Xpos to " << newValue << G4endl;
290 
291  myHDC->SetBackHDC_CenterPositionInX(HDC_BackCenterPositionInX_Cmd->GetNewDoubleValue(newValue),0);
292  }
293 
294  if( command == HDC_BackCenterPositionInY_Cmd )
295  {
296  G4cout << "#### Messenger: Setting HDC BackCenter Ypos to " << newValue << G4endl;
297 
298  myHDC->SetBackHDC_CenterPositionInY(HDC_BackCenterPositionInY_Cmd->GetNewDoubleValue(newValue),0);
299  }
300 
301  if( command == HDC_BackCenterPositionInZ_Cmd )
302  {
303  G4cout << "#### Messenger: Setting HDC BackCenter Zpos to " << newValue << G4endl;
304 
305  myHDC->SetBackHDC_CenterPositionInZ(HDC_BackCenterPositionInZ_Cmd->GetNewDoubleValue(newValue),0);
306  }
307 
308 
309 
310  if( command == HDC_RotationAngleInPhi_Cmd )
311  {
312  G4cout << "#### Messenger: Setting HDC rotation angle in phi to " << newValue << G4endl;
313 
314  myHDC->SetHDC_RotationAngleInPhi(HDC_RotationAngleInPhi_Cmd->GetNewDoubleValue(newValue),0);
315  myHDC->SetHDC_RotationAngleInPhi(HDC_RotationAngleInPhi_Cmd->GetNewDoubleValue(newValue)+180.0*degree,1);
316  }
317  //-----------------------------------------------------------
318 
319  if( command == HDC_FrontCenterPositionInX_Pkg_Cmd )
320  {
321  G4cout << "#### Messenger: Setting HDC FrontCenter Xpos to " << newValue << G4endl;
322 
324  }
325 
326  if( command == HDC_FrontCenterPositionInY_Pkg_Cmd )
327  {
328  G4cout << "#### Messenger: Setting HDC FrontCenter Ypos to " << newValue << G4endl;
329 
331  }
332 
333  if( command == HDC_FrontCenterPositionInZ_Pkg_Cmd )
334  {
335  G4cout << "#### Messenger: Setting HDC FrontCenter Zpos to " << newValue << G4endl;
336 
338  }
339 
340 
341  //-----------------------------------------------------------
342 
343  if( command == HDC_BackCenterPositionInX_Pkg_Cmd )
344  {
345  G4cout << "#### Messenger: Setting HDC BackCenter Xpos to " << newValue << G4endl;
346 
348  }
349 
350  if( command == HDC_BackCenterPositionInY_Pkg_Cmd )
351  {
352  G4cout << "#### Messenger: Setting HDC BackCenter Ypos to " << newValue << G4endl;
353 
355  }
356 
357  if( command == HDC_BackCenterPositionInZ_Pkg_Cmd )
358  {
359  G4cout << "#### Messenger: Setting HDC BackCenter Zpos to " << newValue << G4endl;
360 
362  }
363 
364  if( command == HDC_RotationAngleInPhi_Pkg_Cmd )
365  {
366  G4cout << "#### Messenger: Setting HDC rotation angle in phi to " << newValue << G4endl;
367 
369  }
370 
371  G4cout << "#### Leaving QweakSimHDC Messenger::SetNewValue() " << newValue << G4endl;
372 }
373 
374 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
375 
376 //=======================================================
377 // -----------------------
378 // | CVS File Information |
379 // -----------------------
380 //
381 // $Revisions$
382 // $Log: QweakSimHDCMessenger.cc,v $
383 // Revision 1.2 2005/12/27 19:12:24 grimm
384 // - Redesign of Doxygen header containing CVS info like revision and date
385 // - Added CVS revision log at the end of file
386 //
387 //
388 
G4UIcmdWithADoubleAndUnit * HDC_FrontCenterPositionInZ_Cmd
void SetBackHDC_CenterPositionInZ(G4double zPos, G4int pkg)
Definition: QweakSimHDC.cc:617
void SetHDC_RotationAngleInPhi(G4double HDC_phiangle, G4int pkg)
Definition: QweakSimHDC.cc:630
G4UIcmdWithADoubleAndUnit * HDC_BackCenterPositionInY_Cmd
void SetHDC_SubContainerMaterial(G4String)
Definition: QweakSimHDC.cc:473
void SetFrontHDC_CenterPositionInZ(G4double zPos, G4int pkg)
Definition: QweakSimHDC.cc:574
G4UIcmdWithADoubleAndUnit * HDC_FrontCenterPositionInZ_Pkg_Cmd
G4UIcmdWithAString * HDC_MasterContainerMatCmd
G4UIcmdWithADoubleAndUnit * HDC_BackCenterPositionInZ_Cmd
G4UIcmdWithAString * HDC_FrameMatCmd
G4UIcmdWithADoubleAndUnit * HDC_BackCenterPositionInX_Pkg_Cmd
void SetBackHDC_CenterPositionInY(G4double yPos, G4int pkg)
Definition: QweakSimHDC.cc:603
G4UIcmdWithAString * HDC_WirePlaneMatCmd
void SetHDC_MasterContainerMaterial(G4String)
Definition: QweakSimHDC.cc:456
void SetHDC_WirePlaneMaterial(G4String)
Definition: QweakSimHDC.cc:524
void SetHDC_FrameMaterial(G4String)
Definition: QweakSimHDC.cc:490
G4UIcmdWithADoubleAndUnit * HDC_BackCenterPositionInZ_Pkg_Cmd
G4UIcmdWithADoubleAndUnit * HDC_RotationAngleInPhi_Cmd
G4UIcmdWithADoubleAndUnit * HDC_FrontCenterPositionInX_Cmd
G4UIcmdWithAString * HDC_FoilMatCmd
G4UIcmdWithADoubleAndUnit * HDC_FrontCenterPositionInY_Cmd
G4UIcmdWithADoubleAndUnit * HDC_BackCenterPositionInX_Cmd
void SetFrontHDC_CenterPositionInY(G4double yPos, G4int pkg)
Definition: QweakSimHDC.cc:560
G4UIcmdWithADoubleAndUnit * HDC_FrontCenterPositionInY_Pkg_Cmd
Region 2 Horizontal Drift Chamber.
Definition: QweakSimHDC.hh:65
G4UIcmdWithADoubleAndUnit * HDC_RotationAngleInPhi_Pkg_Cmd
G4UIcmdWithADoubleAndUnit * HDC_FrontCenterPositionInX_Pkg_Cmd
void SetFrontHDC_CenterPositionInX(G4double xPos, G4int pkg)
Definition: QweakSimHDC.cc:546
G4UIcmdWithAString * HDC_SubContainerMatCmd
G4UIdirectory * DirPerPackage
G4UIcmdWithADoubleAndUnit * HDC_BackCenterPositionInY_Pkg_Cmd
void SetNewValue(G4UIcommand *, G4String)
void SetHDC_FoilMaterial(G4String)
Definition: QweakSimHDC.cc:507
QweakSimHDCMessenger(QweakSimHDC *, G4int pkg=0)
void SetBackHDC_CenterPositionInX(G4double xPos, G4int pkg)
Definition: QweakSimHDC.cc:589