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 optical/LXe/src/LXeDetectorMessenger 28 /// \brief Implementation of the LXeDetectorMe 29 // 30 // 31 #include "LXeDetectorMessenger.hh" 32 33 #include "LXeDetectorConstruction.hh" 34 35 #include "G4RunManager.hh" 36 #include "G4Scintillation.hh" 37 #include "G4UIcmdWith3VectorAndUnit.hh" 38 #include "G4UIcmdWithABool.hh" 39 #include "G4UIcmdWithADouble.hh" 40 #include "G4UIcmdWithADoubleAndUnit.hh" 41 #include "G4UIcmdWithAnInteger.hh" 42 #include "G4UIcommand.hh" 43 #include "G4UIdirectory.hh" 44 45 //....oooOO0OOooo........oooOO0OOooo........oo 46 47 LXeDetectorMessenger::LXeDetectorMessenger(LXe 48 : fLXeDetector(detector) 49 { 50 // Setup a command directory for detector co 51 fDetectorDir = new G4UIdirectory("/LXe/detec 52 fDetectorDir->SetGuidance("Detector geometry 53 54 fVolumesDir = new G4UIdirectory("/LXe/detect 55 fVolumesDir->SetGuidance("Enable/disable vol 56 57 // Various commands for modifying detector g 58 fDimensionsCmd = new G4UIcmdWith3VectorAndUn 59 fDimensionsCmd->SetGuidance("Set the dimensi 60 fDimensionsCmd->SetParameterName("scint_x", 61 fDimensionsCmd->SetDefaultUnit("cm"); 62 fDimensionsCmd->AvailableForStates(G4State_P 63 fDimensionsCmd->SetToBeBroadcasted(false); 64 65 fHousingThicknessCmd = new G4UIcmdWithADoubl 66 fHousingThicknessCmd->SetGuidance("Set the t 67 fHousingThicknessCmd->SetParameterName("d_mt 68 fHousingThicknessCmd->SetDefaultUnit("cm"); 69 fHousingThicknessCmd->AvailableForStates(G4S 70 fHousingThicknessCmd->SetToBeBroadcasted(fal 71 72 fPmtRadiusCmd = new G4UIcmdWithADoubleAndUni 73 fPmtRadiusCmd->SetGuidance("Set the radius o 74 fPmtRadiusCmd->SetParameterName("radius", fa 75 fPmtRadiusCmd->SetDefaultUnit("cm"); 76 fPmtRadiusCmd->AvailableForStates(G4State_Pr 77 fPmtRadiusCmd->SetToBeBroadcasted(false); 78 79 fNxCmd = new G4UIcmdWithAnInteger("/LXe/dete 80 fNxCmd->SetGuidance("Set the number of PMTs 81 fNxCmd->SetParameterName("nx", false); 82 fNxCmd->AvailableForStates(G4State_PreInit, 83 fNxCmd->SetToBeBroadcasted(false); 84 85 fNyCmd = new G4UIcmdWithAnInteger("/LXe/dete 86 fNyCmd->SetGuidance("Set the number of PMTs 87 fNyCmd->SetParameterName("ny", false); 88 fNyCmd->AvailableForStates(G4State_PreInit, 89 fNyCmd->SetToBeBroadcasted(false); 90 91 fNzCmd = new G4UIcmdWithAnInteger("/LXe/dete 92 fNzCmd->SetGuidance("Set the number of PMTs 93 fNzCmd->SetParameterName("nz", false); 94 fNzCmd->AvailableForStates(G4State_PreInit, 95 fNzCmd->SetToBeBroadcasted(false); 96 97 fSphereCmd = new G4UIcmdWithABool("/LXe/dete 98 fSphereCmd->SetGuidance("Enable/Disable the 99 fSphereCmd->AvailableForStates(G4State_PreIn 100 fSphereCmd->SetToBeBroadcasted(false); 101 102 fReflectivityCmd = new G4UIcmdWithADouble("/ 103 fReflectivityCmd->SetGuidance("Set the refle 104 fReflectivityCmd->AvailableForStates(G4State 105 fReflectivityCmd->SetToBeBroadcasted(false); 106 107 fWlsCmd = new G4UIcmdWithABool("/LXe/detecto 108 fWlsCmd->SetGuidance("Enable/Disable the WLS 109 fWlsCmd->AvailableForStates(G4State_PreInit, 110 fWlsCmd->SetToBeBroadcasted(false); 111 112 fLxeCmd = new G4UIcmdWithABool("/LXe/detecto 113 fLxeCmd->SetGuidance("Enable/Disable the mai 114 fLxeCmd->AvailableForStates(G4State_PreInit, 115 fLxeCmd->SetToBeBroadcasted(false); 116 117 fNFibersCmd = new G4UIcmdWithAnInteger("/LXe 118 fNFibersCmd->SetGuidance("Set the number of 119 fNFibersCmd->AvailableForStates(G4State_PreI 120 fNFibersCmd->SetToBeBroadcasted(false); 121 122 fMainScintYield = new G4UIcmdWithADouble("/L 123 fMainScintYield->SetGuidance("Set scinitilla 124 fMainScintYield->SetGuidance("Specified in p 125 fMainScintYield->AvailableForStates(G4State_ 126 fMainScintYield->SetToBeBroadcasted(false); 127 128 fWLSScintYield = new G4UIcmdWithADouble("/LX 129 fWLSScintYield->SetGuidance("Set scintillati 130 fWLSScintYield->SetGuidance("Specified in ph 131 fWLSScintYield->AvailableForStates(G4State_P 132 fWLSScintYield->SetToBeBroadcasted(false); 133 134 fSaveThresholdCmd = new G4UIcmdWithAnInteger 135 fSaveThresholdCmd->SetGuidance( 136 "Set the photon count threshold for saving 137 fSaveThresholdCmd->SetParameterName("photons 138 fSaveThresholdCmd->SetDefaultValue(4500); 139 fSaveThresholdCmd->AvailableForStates(G4Stat 140 141 fDefaultsCmd = new G4UIcommand("/LXe/detecto 142 fDefaultsCmd->SetGuidance("Set all detector 143 fDefaultsCmd->AvailableForStates(G4State_Pre 144 fDefaultsCmd->SetToBeBroadcasted(false); 145 } 146 147 //....oooOO0OOooo........oooOO0OOooo........oo 148 149 LXeDetectorMessenger::~LXeDetectorMessenger() 150 { 151 delete fDimensionsCmd; 152 delete fHousingThicknessCmd; 153 delete fPmtRadiusCmd; 154 delete fNxCmd; 155 delete fNyCmd; 156 delete fNzCmd; 157 delete fSphereCmd; 158 delete fWlsCmd; 159 delete fLxeCmd; 160 delete fNFibersCmd; 161 delete fReflectivityCmd; 162 delete fMainScintYield; 163 delete fWLSScintYield; 164 delete fSaveThresholdCmd; 165 delete fDefaultsCmd; 166 delete fDetectorDir; 167 delete fVolumesDir; 168 } 169 170 //....oooOO0OOooo........oooOO0OOooo........oo 171 172 void LXeDetectorMessenger::SetNewValue(G4UIcom 173 { 174 if (command == fDimensionsCmd) { 175 fLXeDetector->SetDimensions(fDimensionsCmd 176 } 177 else if (command == fHousingThicknessCmd) { 178 fLXeDetector->SetHousingThickness(fHousing 179 } 180 else if (command == fPmtRadiusCmd) { 181 fLXeDetector->SetPMTRadius(fPmtRadiusCmd-> 182 } 183 else if (command == fNxCmd) { 184 fLXeDetector->SetNX(fNxCmd->GetNewIntValue 185 } 186 else if (command == fNyCmd) { 187 fLXeDetector->SetNY(fNyCmd->GetNewIntValue 188 } 189 else if (command == fNzCmd) { 190 fLXeDetector->SetNZ(fNzCmd->GetNewIntValue 191 } 192 else if (command == fSphereCmd) { 193 fLXeDetector->SetSphereOn(fSphereCmd->GetN 194 } 195 else if (command == fReflectivityCmd) { 196 fLXeDetector->SetHousingReflectivity(fRefl 197 } 198 else if (command == fWlsCmd) { 199 fLXeDetector->SetWLSSlabOn(fWlsCmd->GetNew 200 } 201 else if (command == fLxeCmd) { 202 fLXeDetector->SetMainVolumeOn(fLxeCmd->Get 203 } 204 else if (command == fNFibersCmd) { 205 fLXeDetector->SetNFibers(fNFibersCmd->GetN 206 } 207 else if (command == fMainScintYield) { 208 fLXeDetector->SetMainScintYield(fMainScint 209 } 210 else if (command == fWLSScintYield) { 211 fLXeDetector->SetWLSScintYield(fWLSScintYi 212 } 213 else if (command == fSaveThresholdCmd) { 214 fLXeDetector->SetSaveThreshold(fSaveThresh 215 } 216 else if (command == fDefaultsCmd) { 217 fLXeDetector->SetDefaults(); 218 G4RunManager::GetRunManager()->Reinitializ 219 } 220 } 221