QwGeant4
QweakSimTargetMessenger.cc
Go to the documentation of this file.
1 //=============================================================================
2 //
3 // ---------------------------
4 // | Doxygen File Information |
5 // ---------------------------
6 //
7 /**
8 
9  \file QweakSimTargetMessenger.cc
10 
11  $Revision: 1.2 $
12  $Date: 2005/12/27 19:15:20 $
13 
14  \author Klaus Hans Grimm
15 
16 */
17 //=============================================================================
18 
19 
20 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
21 
23 
24 // user includes
25 #include "QweakSimTarget.hh"
27 
28 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
29 
31 :myTarget(myTar)
32 {
33  // Target related
34  TargetDir = new G4UIdirectory("/Target/");
35  TargetDir -> SetGuidance("target control.");
36 
37  TargCmd = new G4UIcmdWithAString("/Target/SetTarget",this);
38  TargCmd->SetGuidance("Select Target.");
39  TargCmd->SetParameterName("choice",false);
40  TargCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
41 
42  TargZPosCmd = new G4UIcmdWithADoubleAndUnit("/Target/SetCenterPositionInZ",this);
43  TargZPosCmd->SetGuidance("Set the Z position of the target center");
44  TargZPosCmd->SetParameterName("Size",true);
45  //TargZPosCmd->SetRange("Size>=0.");
46  TargZPosCmd->SetUnitCategory("Length");
47  TargZPosCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
48 
49  TargMatCmd = new G4UIcmdWithAString("/Target/SetTargetMaterial",this);
50  TargMatCmd->SetGuidance("Select Material of the Target.");
51  TargMatCmd->SetParameterName("choice",false);
52  TargMatCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
53 
54  TargCellMatCmd = new G4UIcmdWithAString("/Target/SetTargetCellMaterial",this);
55  TargCellMatCmd->SetGuidance("Select Material of the Target Cell.");
56  TargCellMatCmd->SetParameterName("choice",false);
57  TargCellMatCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
58 
59  TargEntWinMatCmd = new G4UIcmdWithAString("/Target/SetTargetEntranceWindowMaterial",this);
60  TargEntWinMatCmd->SetGuidance("Select Material of the Target Entrance Window.");
61  TargEntWinMatCmd->SetParameterName("choice",false);
62  TargEntWinMatCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
63 
64  TargExtWinMatCmd = new G4UIcmdWithAString("/Target/SetTargetExitWindowMaterial",this);
65  TargExtWinMatCmd->SetGuidance("Select Material of the Target Exit Window.");
66  TargExtWinMatCmd->SetParameterName("choice",false);
67  TargExtWinMatCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
68 
69  TargExtWinNipMatCmd = new G4UIcmdWithAString("/Target/SetTargetExitWindowNippleMaterial",this);
70  TargExtWinNipMatCmd->SetGuidance("Select Material of the Target Exit Window.");
71  TargExtWinNipMatCmd->SetParameterName("choice",false);
72  TargExtWinNipMatCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
73 
74  TargLenCmd = new G4UIcmdWithADoubleAndUnit("/Target/SetTargetLength",this);
75  TargLenCmd->SetGuidance("Set the length of the target center");
76  TargLenCmd->SetParameterName("Size",true);
77  TargLenCmd->SetUnitCategory("Length");
78  TargLenCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
79 }
80 
81 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
82 
84 {
85  delete TargCmd;
86  delete TargZPosCmd;
87  delete TargMatCmd;
88  delete TargCellMatCmd;
89  delete TargEntWinMatCmd;
90  delete TargExtWinMatCmd;
91  delete TargExtWinNipMatCmd;
92  delete TargetDir;
93  delete TargLenCmd;
94 }
95 
96 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
97 
98 void QweakSimTargetMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
99 {
100  G4cout << "#### Calling QweakSimTargetMessenger::SetNewValue() " << newValue << G4endl;
101 
102  if( command == TargCmd )
103  {
104  G4cout << "#### Messenger: Setting Target to " << newValue << G4endl;
105 
106  myTarget->SetTarget(newValue);
107  }
108 
109  if( command == TargZPosCmd )
110  {
111  G4cout << "#### Messenger: Setting Target Z position to " << newValue << G4endl;
112 
113  myTarget->SetTargetCenterPositionInZ(TargZPosCmd->GetNewDoubleValue(newValue));
114  }
115 
116  if( command == TargMatCmd )
117  {
118  G4cout << "#### Messenger: Setting Target Material to " << newValue << G4endl;
119 
120  myTarget->SetTargetMaterial(newValue);
121  }
122 
123 
124  if( command == TargCellMatCmd )
125  {
126  G4cout << "#### Messenger: Setting Target Cell Material to " << newValue << G4endl;
127 
128  myTarget->SetTargetCellMaterial(newValue);
129  }
130 
131  if( command == TargEntWinMatCmd )
132  {
133  G4cout << "#### Messenger: Setting Target Entrance Window Material to " << newValue << G4endl;
134 
136  }
137 
138  if( command == TargExtWinMatCmd )
139  {
140  G4cout << "#### Messenger: Setting Target Exit Window Material to " << newValue << G4endl;
141 
143  }
144 
145  if( command == TargExtWinNipMatCmd )
146  {
147  G4cout << "#### Messenger: Setting Target Exit Window Material to " << newValue << G4endl;
148 
150  }
151 
152  if( command == TargLenCmd )
153  {
154  G4cout << "#### Messenger: Setting Target length to " << newValue << G4endl;
155 
156  myTarget->SetTargetLength(TargLenCmd->GetNewDoubleValue(newValue));
157  }
158 
159 
160  G4cout << "#### Leaving QweakSimTargetMessenger::SetNewValue() " << newValue << G4endl;
161 }
162 
163 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
164 
Definition of the Target.
G4UIcmdWithAString * TargExtWinMatCmd
void SetNewValue(G4UIcommand *, G4String)
G4UIcmdWithAString * TargMatCmd
G4UIcmdWithADoubleAndUnit * TargLenCmd
void SetTargetCenterPositionInZ(G4double)
QweakSimTargetMessenger(QweakSimTarget *)
G4UIcmdWithAString * TargExtWinNipMatCmd
void SetTargetEntranceWindowMaterial(G4String)
G4UIcmdWithAString * TargCellMatCmd
void SetTargetMaterial(G4String)
void SetTargetCellMaterial(G4String)
G4UIcmdWithADoubleAndUnit * TargZPosCmd
void SetTargetExitWindowMaterial(G4String)
G4UIcmdWithAString * TargEntWinMatCmd
void SetTargetLength(G4double)
void SetTargetExitWindowNippleMaterial(G4String)
void SetTarget(G4String)