ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
F04DetectorMessenger.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file F04DetectorMessenger.cc
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
29 //
30 
31 #include "F04DetectorMessenger.hh"
32 
33 #include "G4UIdirectory.hh"
34 #include "G4UIcmdWithAString.hh"
35 #include "G4UIcmdWithAnInteger.hh"
38 
39 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
40 
42  : fDetector(detector)
43 {
44  fDetDir = new G4UIdirectory("/field04/");
45  fDetDir->SetGuidance(" field04 Simulation ");
46 
47  fWorldMaterCmd = new G4UIcmdWithAString("/field04/SetWorldMat",this);
48  fWorldMaterCmd->SetGuidance("Select Material of the World");
49  fWorldMaterCmd->SetParameterName("wchoice",true);
53 
54  fWorldRCmd = new G4UIcmdWithADoubleAndUnit("/field04/SetWorldR",this);
55  fWorldRCmd->SetGuidance("Set Radius of the World");
56  fWorldRCmd->SetParameterName("WSizeR",false,false);
58  fWorldRCmd->SetRange("WSizeR>0.");
61 
62  fWorldZCmd = new G4UIcmdWithADoubleAndUnit("/field04/SetWorldZ",this);
63  fWorldZCmd->SetGuidance("Set Length of the World");
64  fWorldZCmd->SetParameterName("WSizeZ",false,false);
66  fWorldZCmd->SetRange("WSizeZ>0.");
69 
70  fCaptureRCmd = new G4UIcmdWithADoubleAndUnit("/field04/SetCaptureR",this);
71  fCaptureRCmd->SetGuidance("Set Radius of the Capture Magnet");
72  fCaptureRCmd->SetParameterName("CSizeR",false,false);
74  fCaptureRCmd->SetRange("CSizeR>0.");
77 
78  fCaptureZCmd = new G4UIcmdWithADoubleAndUnit("/field04/SetCaptureZ",this);
79  fCaptureZCmd->SetGuidance("Set Length of the Capture Magnet");
80  fCaptureZCmd->SetParameterName("CSizeZ",false,false);
82  fCaptureZCmd->SetRange("CSizeZ>0.");
85 
86  fTransferRCmd = new G4UIcmdWithADoubleAndUnit("/field04/SetTransferR",this);
87  fTransferRCmd->SetGuidance("Set Radius of the Transfer Magnet");
88  fTransferRCmd->SetParameterName("TSizeR",false,false);
90  fTransferRCmd->SetRange("TSizeR>0.");
93 
94  fTransferZCmd = new G4UIcmdWithADoubleAndUnit("/field04/SetTransferZ",this);
95  fTransferZCmd->SetGuidance("Set Length of the Transfer Magnet");
96  fTransferZCmd->SetParameterName("TSizeZ",false,false);
98  fTransferZCmd->SetRange("TSizeZ>0.");
101 
102  fTransferPCmd = new G4UIcmdWithADoubleAndUnit("/field04/SetTransferP",this);
103  fTransferPCmd->SetGuidance("Set Z pos of the T-Mgnt from end of C-Mgnt");
104  fTransferPCmd->SetParameterName("TSizeP",false,false);
108 
109  fTgtMaterCmd = new G4UIcmdWithAString("/field04/SetTgtMat",this);
110  fTgtMaterCmd->SetGuidance("Select Material of the Target");
111  fTgtMaterCmd->SetParameterName("tchoice",true);
112  fTgtMaterCmd->SetDefaultValue("Tungsten");
115 
116  fTgtRadCmd = new G4UIcmdWithADoubleAndUnit("/field04/SetTgtRad",this);
117  fTgtRadCmd->SetGuidance("Set Radius of the Target");
118  fTgtRadCmd->SetParameterName("TgtSizeR",false,false);
119  fTgtRadCmd->SetDefaultUnit("cm");
120  fTgtRadCmd->SetRange("TgtSizeR>0.");
123 
124  fTgtThickCmd = new G4UIcmdWithADoubleAndUnit("/field04/SetTgtThick",this);
125  fTgtThickCmd->SetGuidance("Set Thickness of the Target");
126  fTgtThickCmd->SetParameterName("TgtSizeZ",false,false);
128  fTgtThickCmd->SetRange("TgtSizeZ>0.");
131 
132  fTgtPosCmd = new G4UIcmdWithADoubleAndUnit("/field04/SetTgtPos",this);
133  fTgtPosCmd->SetGuidance("Set Z pos of the tgt relative to C-Mgnt centre");
134  fTgtPosCmd->SetParameterName("TgtSizeP",false,false);
135  fTgtPosCmd->SetDefaultUnit("cm");
138 
139  fTgtAngCmd = new G4UIcmdWithAnInteger("/field04/SetTgtAng",this);
140  fTgtAngCmd->
141  SetGuidance("Set the angle [in deg] of the Tgt relative to C-Mgnt centre");
144 
145  fDgrMaterCmd = new G4UIcmdWithAString("/field04/SetDgrMat",this);
146  fDgrMaterCmd->SetGuidance("Select Material of the Degrader");
147  fDgrMaterCmd->SetParameterName("dchoice",true);
148  fDgrMaterCmd->SetDefaultValue("Lead");
151 
152  fDgrRadCmd = new G4UIcmdWithADoubleAndUnit("/field04/SetDgrRad",this);
153  fDgrRadCmd->SetGuidance("Set Radius of the Degrader");
154  fDgrRadCmd->SetParameterName("DrgSizeR",false,false);
155  fDgrRadCmd->SetDefaultUnit("cm");
156  fDgrRadCmd->SetRange("DrgSizeR>0.");
159 
160  fDgrThickCmd = new G4UIcmdWithADoubleAndUnit("/field04/SetDgrThick",this);
161  fDgrThickCmd->SetGuidance("Set Thickness of the Degrader");
162  fDgrThickCmd->SetParameterName("DgrSizeZ",false,false);
164  fDgrThickCmd->SetRange("DgrSizeZ>0.");
167 
168  fDgrPosCmd = new G4UIcmdWithADoubleAndUnit("/field04/SetDgrPos",this);
169  fDgrPosCmd->SetGuidance("Set Z pos of the Dgr relative to T-Mgnt centre");
170  fDgrPosCmd->SetParameterName("DgrSizeP",false,false);
171  fDgrPosCmd->SetDefaultUnit("cm");
174 }
175 
176 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
177 
179 {
180  delete fDetDir;
181 
182  delete fWorldMaterCmd;
183  delete fWorldRCmd;
184  delete fWorldZCmd;
185 
186  delete fCaptureRCmd;
187  delete fCaptureZCmd;
188 
189  delete fTransferRCmd;
190  delete fTransferZCmd;
191  delete fTransferPCmd;
192 
193  delete fTgtMaterCmd;
194  delete fTgtRadCmd;
195  delete fTgtThickCmd;
196  delete fTgtPosCmd;
197  delete fTgtAngCmd;
198 
199  delete fDgrMaterCmd;
200  delete fDgrRadCmd;
201  delete fDgrThickCmd;
202  delete fDgrPosCmd;
203 }
204 
205 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
206 
208 {
209  if( command == fWorldMaterCmd )
210  { fDetector->SetWorldMaterial(newValue);}
211 
212  if( command == fTgtMaterCmd )
213  { fDetector->SetTargetMaterial(newValue);}
214 
215  if( command == fDgrMaterCmd )
216  { fDetector->SetDegraderMaterial(newValue);}
217 
218  if( command == fWorldRCmd )
220 
221  if( command == fWorldZCmd )
223 
224  if( command == fCaptureRCmd )
226 
227  if( command == fCaptureZCmd )
229 
230  if( command == fTransferRCmd )
232 
233  if( command == fTransferZCmd )
235 
236  if( command == fTransferPCmd )
238 
239  if( command == fTgtRadCmd )
241 
242  if( command == fTgtThickCmd )
244 
245  if( command == fTgtPosCmd )
247 
248  if( command == fTgtAngCmd )
250 
251  if( command == fDgrRadCmd )
253 
254  if( command == fDgrThickCmd )
256 
257  if( command == fDgrPosCmd )
259 
260  if( command == fWorldZCmd )
262 
263  if( command == fWorldRCmd )
265 }