Geant4 Cross Reference |
1 // 1 2 // ******************************************* 3 // * License and Disclaimer 4 // * 5 // * The Geant4 software is copyright of th 6 // * the Geant4 Collaboration. It is provided 7 // * conditions of the Geant4 Software License 8 // * LICENSE and available at http://cern.ch/ 9 // * include a list of copyright holders. 10 // * 11 // * Neither the authors of this software syst 12 // * institutes,nor the agencies providing fin 13 // * work make any representation or warran 14 // * regarding this software system or assum 15 // * use. Please see the license in the file 16 // * for the full disclaimer and the limitatio 17 // * 18 // * This code implementation is the result 19 // * technical work of the GEANT4 collaboratio 20 // * By using, copying, modifying or distri 21 // * any work based on the software) you ag 22 // * use in resulting scientific publicati 23 // * acceptance of all terms of the Geant4 Sof 24 // ******************************************* 25 // 26 // 27 /// \file field/field04/src/F04DetectorMesseng 28 /// \brief Implementation of the F04DetectorMe 29 // 30 31 #include "F04DetectorMessenger.hh" 32 33 #include "G4UIcmdWithADoubleAndUnit.hh" 34 #include "G4UIcmdWithAString.hh" 35 #include "G4UIcmdWithAnInteger.hh" 36 #include "G4UIcmdWithoutParameter.hh" 37 #include "G4UIdirectory.hh" 38 39 //....oooOO0OOooo........oooOO0OOooo........oo 40 41 F04DetectorMessenger::F04DetectorMessenger(F04 42 { 43 fDetDir = new G4UIdirectory("/field04/"); 44 fDetDir->SetGuidance(" field04 Simulation ") 45 46 fWorldMaterCmd = new G4UIcmdWithAString("/fi 47 fWorldMaterCmd->SetGuidance("Select Material 48 fWorldMaterCmd->SetParameterName("wchoice", 49 fWorldMaterCmd->SetDefaultValue("Air"); 50 fWorldMaterCmd->AvailableForStates(G4State_P 51 fWorldMaterCmd->SetToBeBroadcasted(false); 52 53 fWorldRCmd = new G4UIcmdWithADoubleAndUnit(" 54 fWorldRCmd->SetGuidance("Set Radius of the W 55 fWorldRCmd->SetParameterName("WSizeR", false 56 fWorldRCmd->SetDefaultUnit("cm"); 57 fWorldRCmd->SetRange("WSizeR>0."); 58 fWorldRCmd->AvailableForStates(G4State_PreIn 59 fWorldRCmd->SetToBeBroadcasted(false); 60 61 fWorldZCmd = new G4UIcmdWithADoubleAndUnit(" 62 fWorldZCmd->SetGuidance("Set Length of the W 63 fWorldZCmd->SetParameterName("WSizeZ", false 64 fWorldZCmd->SetDefaultUnit("cm"); 65 fWorldZCmd->SetRange("WSizeZ>0."); 66 fWorldZCmd->AvailableForStates(G4State_PreIn 67 fWorldZCmd->SetToBeBroadcasted(false); 68 69 fCaptureRCmd = new G4UIcmdWithADoubleAndUnit 70 fCaptureRCmd->SetGuidance("Set Radius of the 71 fCaptureRCmd->SetParameterName("CSizeR", fal 72 fCaptureRCmd->SetDefaultUnit("cm"); 73 fCaptureRCmd->SetRange("CSizeR>0."); 74 fCaptureRCmd->AvailableForStates(G4State_Pre 75 fCaptureRCmd->SetToBeBroadcasted(false); 76 77 fCaptureZCmd = new G4UIcmdWithADoubleAndUnit 78 fCaptureZCmd->SetGuidance("Set Length of the 79 fCaptureZCmd->SetParameterName("CSizeZ", fal 80 fCaptureZCmd->SetDefaultUnit("cm"); 81 fCaptureZCmd->SetRange("CSizeZ>0."); 82 fCaptureZCmd->AvailableForStates(G4State_Pre 83 fCaptureZCmd->SetToBeBroadcasted(false); 84 85 fTransferRCmd = new G4UIcmdWithADoubleAndUni 86 fTransferRCmd->SetGuidance("Set Radius of th 87 fTransferRCmd->SetParameterName("TSizeR", fa 88 fTransferRCmd->SetDefaultUnit("cm"); 89 fTransferRCmd->SetRange("TSizeR>0."); 90 fTransferRCmd->AvailableForStates(G4State_Pr 91 fTransferRCmd->SetToBeBroadcasted(false); 92 93 fTransferZCmd = new G4UIcmdWithADoubleAndUni 94 fTransferZCmd->SetGuidance("Set Length of th 95 fTransferZCmd->SetParameterName("TSizeZ", fa 96 fTransferZCmd->SetDefaultUnit("cm"); 97 fTransferZCmd->SetRange("TSizeZ>0."); 98 fTransferZCmd->AvailableForStates(G4State_Pr 99 fTransferZCmd->SetToBeBroadcasted(false); 100 101 fTransferPCmd = new G4UIcmdWithADoubleAndUni 102 fTransferPCmd->SetGuidance("Set Z pos of the 103 fTransferPCmd->SetParameterName("TSizeP", fa 104 fTransferPCmd->SetDefaultUnit("cm"); 105 fTransferPCmd->AvailableForStates(G4State_Pr 106 fTransferPCmd->SetToBeBroadcasted(false); 107 108 fTgtMaterCmd = new G4UIcmdWithAString("/fiel 109 fTgtMaterCmd->SetGuidance("Select Material o 110 fTgtMaterCmd->SetParameterName("tchoice", tr 111 fTgtMaterCmd->SetDefaultValue("Tungsten"); 112 fTgtMaterCmd->AvailableForStates(G4State_Pre 113 fTgtMaterCmd->SetToBeBroadcasted(false); 114 115 fTgtRadCmd = new G4UIcmdWithADoubleAndUnit(" 116 fTgtRadCmd->SetGuidance("Set Radius of the T 117 fTgtRadCmd->SetParameterName("TgtSizeR", fal 118 fTgtRadCmd->SetDefaultUnit("cm"); 119 fTgtRadCmd->SetRange("TgtSizeR>0."); 120 fTgtRadCmd->AvailableForStates(G4State_PreIn 121 fTgtRadCmd->SetToBeBroadcasted(false); 122 123 fTgtThickCmd = new G4UIcmdWithADoubleAndUnit 124 fTgtThickCmd->SetGuidance("Set Thickness of 125 fTgtThickCmd->SetParameterName("TgtSizeZ", f 126 fTgtThickCmd->SetDefaultUnit("cm"); 127 fTgtThickCmd->SetRange("TgtSizeZ>0."); 128 fTgtThickCmd->AvailableForStates(G4State_Pre 129 fTgtThickCmd->SetToBeBroadcasted(false); 130 131 fTgtPosCmd = new G4UIcmdWithADoubleAndUnit(" 132 fTgtPosCmd->SetGuidance("Set Z pos of the tg 133 fTgtPosCmd->SetParameterName("TgtSizeP", fal 134 fTgtPosCmd->SetDefaultUnit("cm"); 135 fTgtPosCmd->AvailableForStates(G4State_PreIn 136 fTgtPosCmd->SetToBeBroadcasted(false); 137 138 fTgtAngCmd = new G4UIcmdWithAnInteger("/fiel 139 fTgtAngCmd->SetGuidance("Set the angle [in d 140 fTgtAngCmd->AvailableForStates(G4State_PreIn 141 fTgtAngCmd->SetToBeBroadcasted(false); 142 143 fDgrMaterCmd = new G4UIcmdWithAString("/fiel 144 fDgrMaterCmd->SetGuidance("Select Material o 145 fDgrMaterCmd->SetParameterName("dchoice", tr 146 fDgrMaterCmd->SetDefaultValue("Lead"); 147 fDgrMaterCmd->AvailableForStates(G4State_Pre 148 fDgrMaterCmd->SetToBeBroadcasted(false); 149 150 fDgrRadCmd = new G4UIcmdWithADoubleAndUnit(" 151 fDgrRadCmd->SetGuidance("Set Radius of the D 152 fDgrRadCmd->SetParameterName("DrgSizeR", fal 153 fDgrRadCmd->SetDefaultUnit("cm"); 154 fDgrRadCmd->SetRange("DrgSizeR>0."); 155 fDgrRadCmd->AvailableForStates(G4State_PreIn 156 fDgrRadCmd->SetToBeBroadcasted(false); 157 158 fDgrThickCmd = new G4UIcmdWithADoubleAndUnit 159 fDgrThickCmd->SetGuidance("Set Thickness of 160 fDgrThickCmd->SetParameterName("DgrSizeZ", f 161 fDgrThickCmd->SetDefaultUnit("cm"); 162 fDgrThickCmd->SetRange("DgrSizeZ>0."); 163 fDgrThickCmd->AvailableForStates(G4State_Pre 164 fDgrThickCmd->SetToBeBroadcasted(false); 165 166 fDgrPosCmd = new G4UIcmdWithADoubleAndUnit(" 167 fDgrPosCmd->SetGuidance("Set Z pos of the Dg 168 fDgrPosCmd->SetParameterName("DgrSizeP", fal 169 fDgrPosCmd->SetDefaultUnit("cm"); 170 fDgrPosCmd->AvailableForStates(G4State_PreIn 171 fDgrPosCmd->SetToBeBroadcasted(false); 172 } 173 174 //....oooOO0OOooo........oooOO0OOooo........oo 175 176 F04DetectorMessenger::~F04DetectorMessenger() 177 { 178 delete fDetDir; 179 180 delete fWorldMaterCmd; 181 delete fWorldRCmd; 182 delete fWorldZCmd; 183 184 delete fCaptureRCmd; 185 delete fCaptureZCmd; 186 187 delete fTransferRCmd; 188 delete fTransferZCmd; 189 delete fTransferPCmd; 190 191 delete fTgtMaterCmd; 192 delete fTgtRadCmd; 193 delete fTgtThickCmd; 194 delete fTgtPosCmd; 195 delete fTgtAngCmd; 196 197 delete fDgrMaterCmd; 198 delete fDgrRadCmd; 199 delete fDgrThickCmd; 200 delete fDgrPosCmd; 201 } 202 203 //....oooOO0OOooo........oooOO0OOooo........oo 204 205 void F04DetectorMessenger::SetNewValue(G4UIcom 206 { 207 if (command == fWorldMaterCmd) { 208 fDetector->SetWorldMaterial(newValue); 209 } 210 211 if (command == fTgtMaterCmd) { 212 fDetector->SetTargetMaterial(newValue); 213 } 214 215 if (command == fDgrMaterCmd) { 216 fDetector->SetDegraderMaterial(newValue); 217 } 218 219 if (command == fWorldRCmd) { 220 fDetector->SetWorldSizeR(fWorldRCmd->GetNe 221 } 222 223 if (command == fWorldZCmd) { 224 fDetector->SetWorldSizeZ(fWorldZCmd->GetNe 225 } 226 227 if (command == fCaptureRCmd) 228 fDetector->SetCaptureMgntRadius(fCaptureRC 229 230 if (command == fCaptureZCmd) 231 fDetector->SetCaptureMgntLength(fCaptureZC 232 233 if (command == fTransferRCmd) 234 fDetector->SetTransferMgntRadius(fTransfer 235 236 if (command == fTransferZCmd) 237 fDetector->SetTransferMgntLength(fTransfer 238 239 if (command == fTransferPCmd) 240 fDetector->SetTransferMgntPos(fTransferPCm 241 242 if (command == fTgtRadCmd) fDetector->SetTar 243 244 if (command == fTgtThickCmd) 245 fDetector->SetTargetThickness(fTgtThickCmd 246 247 if (command == fTgtPosCmd) fDetector->SetTar 248 249 if (command == fTgtAngCmd) fDetector->SetTar 250 251 if (command == fDgrRadCmd) fDetector->SetDeg 252 253 if (command == fDgrThickCmd) 254 fDetector->SetDegraderThickness(fDgrThickC 255 256 if (command == fDgrPosCmd) fDetector->SetDeg 257 258 if (command == fWorldZCmd) fDetector->SetWor 259 260 if (command == fWorldRCmd) fDetector->SetWor 261 } 262