Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
F04DetectorMessenger Class Reference

#include <F04DetectorMessenger.hh>

Inheritance diagram for F04DetectorMessenger:
G4UImessenger

Public Member Functions

 F04DetectorMessenger (F04DetectorConstruction *)
 
virtual ~F04DetectorMessenger ()
 
virtual void SetNewValue (G4UIcommand *, G4String)
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
G4bool operator== (const G4UImessenger &messenger) const
 

Additional Inherited Members

- Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
 
G4String DtoS (G4double a)
 
G4String BtoS (G4bool b)
 
G4int StoI (G4String s)
 
G4double StoD (G4String s)
 
G4bool StoB (G4String s)
 
void AddUIcommand (G4UIcommand *newCommand)
 
void CreateDirectory (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
template<typename T >
T * CreateCommand (const G4String &cname, const G4String &dsc)
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir
 
G4String baseDirName
 

Detailed Description

Definition at line 46 of file F04DetectorMessenger.hh.

Constructor & Destructor Documentation

F04DetectorMessenger::F04DetectorMessenger ( F04DetectorConstruction detector)

Definition at line 42 of file F04DetectorMessenger.cc.

References G4UIcommand::AvailableForStates(), G4State_Idle, G4State_PreInit, G4UIcmdWithADoubleAndUnit::SetDefaultUnit(), G4UIcmdWithAString::SetDefaultValue(), G4UIcommand::SetGuidance(), G4UIcmdWithAString::SetParameterName(), G4UIcmdWithADoubleAndUnit::SetParameterName(), G4UIcommand::SetRange(), and G4UIcommand::SetToBeBroadcasted().

43  : fDetector(detector)
44 {
45  fDetDir = new G4UIdirectory("/field04/");
46  fDetDir->SetGuidance(" field04 Simulation ");
47 
48  fWorldMaterCmd = new G4UIcmdWithAString("/field04/SetWorldMat",this);
49  fWorldMaterCmd->SetGuidance("Select Material of the World");
50  fWorldMaterCmd->SetParameterName("wchoice",true);
51  fWorldMaterCmd->SetDefaultValue("Air");
53  fWorldMaterCmd->SetToBeBroadcasted(false);
54 
55  fWorldRCmd = new G4UIcmdWithADoubleAndUnit("/field04/SetWorldR",this);
56  fWorldRCmd->SetGuidance("Set Radius of the World");
57  fWorldRCmd->SetParameterName("WSizeR",false,false);
58  fWorldRCmd->SetDefaultUnit("cm");
59  fWorldRCmd->SetRange("WSizeR>0.");
61  fWorldRCmd->SetToBeBroadcasted(false);
62 
63  fWorldZCmd = new G4UIcmdWithADoubleAndUnit("/field04/SetWorldZ",this);
64  fWorldZCmd->SetGuidance("Set Length of the World");
65  fWorldZCmd->SetParameterName("WSizeZ",false,false);
66  fWorldZCmd->SetDefaultUnit("cm");
67  fWorldZCmd->SetRange("WSizeZ>0.");
69  fWorldZCmd->SetToBeBroadcasted(false);
70 
71  fCaptureRCmd = new G4UIcmdWithADoubleAndUnit("/field04/SetCaptureR",this);
72  fCaptureRCmd->SetGuidance("Set Radius of the Capture Magnet");
73  fCaptureRCmd->SetParameterName("CSizeR",false,false);
74  fCaptureRCmd->SetDefaultUnit("cm");
75  fCaptureRCmd->SetRange("CSizeR>0.");
77  fCaptureRCmd->SetToBeBroadcasted(false);
78 
79  fCaptureZCmd = new G4UIcmdWithADoubleAndUnit("/field04/SetCaptureZ",this);
80  fCaptureZCmd->SetGuidance("Set Length of the Capture Magnet");
81  fCaptureZCmd->SetParameterName("CSizeZ",false,false);
82  fCaptureZCmd->SetDefaultUnit("cm");
83  fCaptureZCmd->SetRange("CSizeZ>0.");
85  fCaptureZCmd->SetToBeBroadcasted(false);
86 
87  fTransferRCmd = new G4UIcmdWithADoubleAndUnit("/field04/SetTransferR",this);
88  fTransferRCmd->SetGuidance("Set Radius of the Transfer Magnet");
89  fTransferRCmd->SetParameterName("TSizeR",false,false);
90  fTransferRCmd->SetDefaultUnit("cm");
91  fTransferRCmd->SetRange("TSizeR>0.");
93  fTransferRCmd->SetToBeBroadcasted(false);
94 
95  fTransferZCmd = new G4UIcmdWithADoubleAndUnit("/field04/SetTransferZ",this);
96  fTransferZCmd->SetGuidance("Set Length of the Transfer Magnet");
97  fTransferZCmd->SetParameterName("TSizeZ",false,false);
98  fTransferZCmd->SetDefaultUnit("cm");
99  fTransferZCmd->SetRange("TSizeZ>0.");
101  fTransferZCmd->SetToBeBroadcasted(false);
102 
103  fTransferPCmd = new G4UIcmdWithADoubleAndUnit("/field04/SetTransferP",this);
104  fTransferPCmd->SetGuidance("Set Z pos of the T-Mgnt from end of C-Mgnt");
105  fTransferPCmd->SetParameterName("TSizeP",false,false);
106  fTransferPCmd->SetDefaultUnit("cm");
108  fTransferPCmd->SetToBeBroadcasted(false);
109 
110  fTgtMaterCmd = new G4UIcmdWithAString("/field04/SetTgtMat",this);
111  fTgtMaterCmd->SetGuidance("Select Material of the Target");
112  fTgtMaterCmd->SetParameterName("tchoice",true);
113  fTgtMaterCmd->SetDefaultValue("Tungsten");
115  fTgtMaterCmd->SetToBeBroadcasted(false);
116 
117  fTgtRadCmd = new G4UIcmdWithADoubleAndUnit("/field04/SetTgtRad",this);
118  fTgtRadCmd->SetGuidance("Set Radius of the Target");
119  fTgtRadCmd->SetParameterName("TgtSizeR",false,false);
120  fTgtRadCmd->SetDefaultUnit("cm");
121  fTgtRadCmd->SetRange("TgtSizeR>0.");
123  fTgtRadCmd->SetToBeBroadcasted(false);
124 
125  fTgtThickCmd = new G4UIcmdWithADoubleAndUnit("/field04/SetTgtThick",this);
126  fTgtThickCmd->SetGuidance("Set Thickness of the Target");
127  fTgtThickCmd->SetParameterName("TgtSizeZ",false,false);
128  fTgtThickCmd->SetDefaultUnit("cm");
129  fTgtThickCmd->SetRange("TgtSizeZ>0.");
131  fTgtThickCmd->SetToBeBroadcasted(false);
132 
133  fTgtPosCmd = new G4UIcmdWithADoubleAndUnit("/field04/SetTgtPos",this);
134  fTgtPosCmd->SetGuidance("Set Z pos of the tgt relative to C-Mgnt centre");
135  fTgtPosCmd->SetParameterName("TgtSizeP",false,false);
136  fTgtPosCmd->SetDefaultUnit("cm");
138  fTgtPosCmd->SetToBeBroadcasted(false);
139 
140  fTgtAngCmd = new G4UIcmdWithAnInteger("/field04/SetTgtAng",this);
141  fTgtAngCmd->
142  SetGuidance("Set the angle [in deg] of the Tgt relative to C-Mgnt centre");
144  fTgtAngCmd->SetToBeBroadcasted(false);
145 
146  fDgrMaterCmd = new G4UIcmdWithAString("/field04/SetDgrMat",this);
147  fDgrMaterCmd->SetGuidance("Select Material of the Degrader");
148  fDgrMaterCmd->SetParameterName("dchoice",true);
149  fDgrMaterCmd->SetDefaultValue("Lead");
151  fDgrMaterCmd->SetToBeBroadcasted(false);
152 
153  fDgrRadCmd = new G4UIcmdWithADoubleAndUnit("/field04/SetDgrRad",this);
154  fDgrRadCmd->SetGuidance("Set Radius of the Degrader");
155  fDgrRadCmd->SetParameterName("DrgSizeR",false,false);
156  fDgrRadCmd->SetDefaultUnit("cm");
157  fDgrRadCmd->SetRange("DrgSizeR>0.");
159  fDgrRadCmd->SetToBeBroadcasted(false);
160 
161  fDgrThickCmd = new G4UIcmdWithADoubleAndUnit("/field04/SetDgrThick",this);
162  fDgrThickCmd->SetGuidance("Set Thickness of the Degrader");
163  fDgrThickCmd->SetParameterName("DgrSizeZ",false,false);
164  fDgrThickCmd->SetDefaultUnit("cm");
165  fDgrThickCmd->SetRange("DgrSizeZ>0.");
167  fDgrThickCmd->SetToBeBroadcasted(false);
168 
169  fDgrPosCmd = new G4UIcmdWithADoubleAndUnit("/field04/SetDgrPos",this);
170  fDgrPosCmd->SetGuidance("Set Z pos of the Dgr relative to T-Mgnt centre");
171  fDgrPosCmd->SetParameterName("DgrSizeP",false,false);
172  fDgrPosCmd->SetDefaultUnit("cm");
174  fDgrPosCmd->SetToBeBroadcasted(false);
175 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetToBeBroadcasted(G4bool val)
Definition: G4UIcommand.hh:184
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:225
void SetDefaultValue(const char *defVal)
void SetDefaultUnit(const char *defUnit)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
F04DetectorMessenger::~F04DetectorMessenger ( )
virtual

Definition at line 179 of file F04DetectorMessenger.cc.

180 {
181  delete fDetDir;
182 
183  delete fWorldMaterCmd;
184  delete fWorldRCmd;
185  delete fWorldZCmd;
186 
187  delete fCaptureRCmd;
188  delete fCaptureZCmd;
189 
190  delete fTransferRCmd;
191  delete fTransferZCmd;
192  delete fTransferPCmd;
193 
194  delete fTgtMaterCmd;
195  delete fTgtRadCmd;
196  delete fTgtThickCmd;
197  delete fTgtPosCmd;
198  delete fTgtAngCmd;
199 
200  delete fDgrMaterCmd;
201  delete fDgrRadCmd;
202  delete fDgrThickCmd;
203  delete fDgrPosCmd;
204 }

Member Function Documentation

void F04DetectorMessenger::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 208 of file F04DetectorMessenger.cc.

References G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(), G4UIcmdWithAnInteger::GetNewIntValue(), F04DetectorConstruction::SetCaptureMgntLength(), F04DetectorConstruction::SetCaptureMgntRadius(), F04DetectorConstruction::SetDegraderMaterial(), F04DetectorConstruction::SetDegraderPos(), F04DetectorConstruction::SetDegraderRadius(), F04DetectorConstruction::SetDegraderThickness(), F04DetectorConstruction::SetTargetAngle(), F04DetectorConstruction::SetTargetMaterial(), F04DetectorConstruction::SetTargetPos(), F04DetectorConstruction::SetTargetRadius(), F04DetectorConstruction::SetTargetThickness(), F04DetectorConstruction::SetTransferMgntLength(), F04DetectorConstruction::SetTransferMgntPos(), F04DetectorConstruction::SetTransferMgntRadius(), F04DetectorConstruction::SetWorldMaterial(), F04DetectorConstruction::SetWorldSizeR(), and F04DetectorConstruction::SetWorldSizeZ().

209 {
210  if( command == fWorldMaterCmd )
211  { fDetector->SetWorldMaterial(newValue);}
212 
213  if( command == fTgtMaterCmd )
214  { fDetector->SetTargetMaterial(newValue);}
215 
216  if( command == fDgrMaterCmd )
217  { fDetector->SetDegraderMaterial(newValue);}
218 
219  if( command == fWorldRCmd )
220  { fDetector->SetWorldSizeR(fWorldRCmd->GetNewDoubleValue(newValue));}
221 
222  if( command == fWorldZCmd )
223  { fDetector->SetWorldSizeZ(fWorldZCmd->GetNewDoubleValue(newValue));}
224 
225  if( command == fCaptureRCmd )
226  fDetector->SetCaptureMgntRadius(fCaptureRCmd->GetNewDoubleValue(newValue));
227 
228  if( command == fCaptureZCmd )
229  fDetector->SetCaptureMgntLength(fCaptureZCmd->GetNewDoubleValue(newValue));
230 
231  if( command == fTransferRCmd )
232  fDetector->SetTransferMgntRadius(fTransferRCmd->GetNewDoubleValue(newValue));
233 
234  if( command == fTransferZCmd )
235  fDetector->SetTransferMgntLength(fTransferZCmd->GetNewDoubleValue(newValue));
236 
237  if( command == fTransferPCmd )
238  fDetector->SetTransferMgntPos(fTransferPCmd->GetNewDoubleValue(newValue));
239 
240  if( command == fTgtRadCmd )
241  fDetector->SetTargetRadius(fTgtRadCmd->GetNewDoubleValue(newValue));
242 
243  if( command == fTgtThickCmd )
244  fDetector->SetTargetThickness(fTgtThickCmd->GetNewDoubleValue(newValue));
245 
246  if( command == fTgtPosCmd )
247  fDetector->SetTargetPos(fTgtPosCmd->GetNewDoubleValue(newValue));
248 
249  if( command == fTgtAngCmd )
250  fDetector->SetTargetAngle(fTgtAngCmd->GetNewIntValue(newValue));
251 
252  if( command == fDgrRadCmd )
253  fDetector->SetDegraderRadius(fDgrRadCmd->GetNewDoubleValue(newValue));
254 
255  if( command == fDgrThickCmd )
256  fDetector->SetDegraderThickness(fDgrThickCmd->GetNewDoubleValue(newValue));
257 
258  if( command == fDgrPosCmd )
259  fDetector->SetDegraderPos(fDgrPosCmd->GetNewDoubleValue(newValue));
260 
261  if( command == fWorldZCmd )
262  fDetector->SetWorldSizeZ(fWorldZCmd->GetNewDoubleValue(newValue));
263 
264  if( command == fWorldRCmd )
265  fDetector->SetWorldSizeR(fWorldRCmd->GetNewDoubleValue(newValue));
266 }
static G4int GetNewIntValue(const char *paramString)
static G4double GetNewDoubleValue(const char *paramString)

The documentation for this class was generated from the following files: