Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 /// \file optical/OpNovice2/src/DetectorMessen 26 /// \file optical/OpNovice2/src/DetectorMessenger.cc 27 /// \brief Implementation of the DetectorMesse 27 /// \brief Implementation of the DetectorMessenger class 28 // 28 // 29 // 29 // 30 //....oooOO0OOooo........oooOO0OOooo........oo 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 31 //....oooOO0OOooo........oooOO0OOooo........oo 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 32 32 33 #include "DetectorMessenger.hh" 33 #include "DetectorMessenger.hh" 34 34 35 #include "DetectorConstruction.hh" << 35 #include <sstream> >> 36 #include <iostream> 36 37 37 #include "G4OpticalSurface.hh" 38 #include "G4OpticalSurface.hh" 38 #include "G4UIcmdWithADouble.hh" << 39 39 #include "G4UIcmdWithADoubleAndUnit.hh" << 40 #include "DetectorConstruction.hh" >> 41 #include "G4UIdirectory.hh" >> 42 #include "G4UIcommand.hh" >> 43 #include "G4UIparameter.hh" 40 #include "G4UIcmdWithAString.hh" 44 #include "G4UIcmdWithAString.hh" >> 45 #include "G4UIcmdWithADouble.hh" 41 #include "G4UIcmdWithAnInteger.hh" 46 #include "G4UIcmdWithAnInteger.hh" >> 47 #include "G4UIcmdWithADoubleAndUnit.hh" 42 #include "G4UIcmdWithoutParameter.hh" 48 #include "G4UIcmdWithoutParameter.hh" 43 #include "G4UIcommand.hh" << 44 #include "G4UIdirectory.hh" << 45 #include "G4UIparameter.hh" << 46 << 47 #include <iostream> << 48 #include <sstream> << 49 49 50 //....oooOO0OOooo........oooOO0OOooo........oo 50 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 51 51 52 DetectorMessenger::DetectorMessenger(DetectorC << 52 DetectorMessenger::DetectorMessenger(DetectorConstruction * Det) 53 { << 53 :G4UImessenger(),fDetector(Det) >> 54 { 54 fOpticalDir = new G4UIdirectory("/opnovice2/ 55 fOpticalDir = new G4UIdirectory("/opnovice2/"); 55 fOpticalDir->SetGuidance("Parameters for opt 56 fOpticalDir->SetGuidance("Parameters for optical simulation."); 56 57 57 fSurfaceTypeCmd = new G4UIcmdWithAString("/o 58 fSurfaceTypeCmd = new G4UIcmdWithAString("/opnovice2/surfaceType", this); 58 fSurfaceTypeCmd->SetGuidance("Surface type." 59 fSurfaceTypeCmd->SetGuidance("Surface type."); 59 fSurfaceTypeCmd->AvailableForStates(G4State_ 60 fSurfaceTypeCmd->AvailableForStates(G4State_PreInit, G4State_Idle); 60 fSurfaceTypeCmd->SetToBeBroadcasted(false); 61 fSurfaceTypeCmd->SetToBeBroadcasted(false); 61 << 62 62 fSurfaceFinishCmd = new G4UIcmdWithAString(" 63 fSurfaceFinishCmd = new G4UIcmdWithAString("/opnovice2/surfaceFinish", this); 63 fSurfaceFinishCmd->SetGuidance("Surface fini 64 fSurfaceFinishCmd->SetGuidance("Surface finish."); 64 fSurfaceFinishCmd->AvailableForStates(G4Stat 65 fSurfaceFinishCmd->AvailableForStates(G4State_PreInit, G4State_Idle); 65 fSurfaceFinishCmd->SetToBeBroadcasted(false) 66 fSurfaceFinishCmd->SetToBeBroadcasted(false); 66 << 67 67 fSurfaceModelCmd = new G4UIcmdWithAString("/ << 68 fSurfaceModelCmd = >> 69 new G4UIcmdWithAString("/opnovice2/surfaceModel", this); 68 fSurfaceModelCmd->SetGuidance("surface model 70 fSurfaceModelCmd->SetGuidance("surface model."); 69 fSurfaceModelCmd->AvailableForStates(G4State 71 fSurfaceModelCmd->AvailableForStates(G4State_PreInit, G4State_Idle); 70 fSurfaceModelCmd->SetToBeBroadcasted(false); 72 fSurfaceModelCmd->SetToBeBroadcasted(false); 71 << 73 72 fSurfaceSigmaAlphaCmd = new G4UIcmdWithADoub << 74 fSurfaceSigmaAlphaCmd = >> 75 new G4UIcmdWithADouble("/opnovice2/surfaceSigmaAlpha", this); 73 fSurfaceSigmaAlphaCmd->SetGuidance("surface 76 fSurfaceSigmaAlphaCmd->SetGuidance("surface sigma alpha"); 74 fSurfaceSigmaAlphaCmd->SetGuidance(" paramet 77 fSurfaceSigmaAlphaCmd->SetGuidance(" parameter."); 75 fSurfaceSigmaAlphaCmd->AvailableForStates(G4 78 fSurfaceSigmaAlphaCmd->AvailableForStates(G4State_PreInit, G4State_Idle); 76 fSurfaceSigmaAlphaCmd->SetToBeBroadcasted(fa 79 fSurfaceSigmaAlphaCmd->SetToBeBroadcasted(false); 77 80 78 fSurfacePolishCmd = new G4UIcmdWithADouble(" << 81 fSurfaceMatPropVectorCmd = 79 fSurfacePolishCmd->SetGuidance("surface poli << 82 new G4UIcmdWithAString("/opnovice2/surfaceProperty", this); 80 fSurfacePolishCmd->SetGuidance(" parameter ( << 81 fSurfacePolishCmd->AvailableForStates(G4Stat << 82 fSurfacePolishCmd->SetToBeBroadcasted(false) << 83 << 84 fSurfaceMatPropVectorCmd = new G4UIcmdWithAS << 85 fSurfaceMatPropVectorCmd->SetGuidance("Set m 83 fSurfaceMatPropVectorCmd->SetGuidance("Set material property vector"); 86 fSurfaceMatPropVectorCmd->SetGuidance(" for 84 fSurfaceMatPropVectorCmd->SetGuidance(" for the surface."); 87 fSurfaceMatPropVectorCmd->AvailableForStates 85 fSurfaceMatPropVectorCmd->AvailableForStates(G4State_PreInit, G4State_Idle); 88 fSurfaceMatPropVectorCmd->SetToBeBroadcasted 86 fSurfaceMatPropVectorCmd->SetToBeBroadcasted(false); 89 87 90 fSurfaceMatPropConstCmd = new G4UIcmdWithASt << 88 fTankMatPropVectorCmd = 91 fSurfaceMatPropConstCmd->SetGuidance("Set ma << 89 new G4UIcmdWithAString("/opnovice2/boxProperty", this); 92 fSurfaceMatPropConstCmd->SetGuidance(" for t << 93 fSurfaceMatPropConstCmd->AvailableForStates( << 94 fSurfaceMatPropConstCmd->SetToBeBroadcasted( << 95 << 96 fTankMatPropVectorCmd = new G4UIcmdWithAStri << 97 fTankMatPropVectorCmd->SetGuidance("Set mate 90 fTankMatPropVectorCmd->SetGuidance("Set material property vector for "); 98 fTankMatPropVectorCmd->SetGuidance("the box. 91 fTankMatPropVectorCmd->SetGuidance("the box."); 99 fTankMatPropVectorCmd->AvailableForStates(G4 92 fTankMatPropVectorCmd->AvailableForStates(G4State_PreInit, G4State_Idle); 100 fTankMatPropVectorCmd->SetToBeBroadcasted(fa 93 fTankMatPropVectorCmd->SetToBeBroadcasted(false); 101 94 102 fTankMatPropConstCmd = new G4UIcmdWithAStrin << 95 fTankMatConstPropVectorCmd = 103 fTankMatPropConstCmd->SetGuidance("Set mater << 96 new G4UIcmdWithAString("/opnovice2/boxConstProperty", this); 104 fTankMatPropConstCmd->SetGuidance("for the b << 97 fTankMatConstPropVectorCmd->SetGuidance("Set material constant property "); 105 fTankMatPropConstCmd->AvailableForStates(G4S << 98 fTankMatConstPropVectorCmd->SetGuidance("for the box."); 106 fTankMatPropConstCmd->SetToBeBroadcasted(fal << 99 fTankMatConstPropVectorCmd->AvailableForStates(G4State_PreInit, G4State_Idle); >> 100 fTankMatConstPropVectorCmd->SetToBeBroadcasted(false); 107 101 108 fTankMaterialCmd = new G4UIcmdWithAString("/ 102 fTankMaterialCmd = new G4UIcmdWithAString("/opnovice2/boxMaterial", this); 109 fTankMaterialCmd->SetGuidance("Set material 103 fTankMaterialCmd->SetGuidance("Set material of box."); 110 fTankMaterialCmd->AvailableForStates(G4State 104 fTankMaterialCmd->AvailableForStates(G4State_PreInit, G4State_Idle); 111 fTankMaterialCmd->SetToBeBroadcasted(false); 105 fTankMaterialCmd->SetToBeBroadcasted(false); 112 106 113 fWorldMatPropVectorCmd = new G4UIcmdWithAStr << 107 fWorldMatPropVectorCmd = >> 108 new G4UIcmdWithAString("/opnovice2/worldProperty", this); 114 fWorldMatPropVectorCmd->SetGuidance("Set mat 109 fWorldMatPropVectorCmd->SetGuidance("Set material property vector "); 115 fWorldMatPropVectorCmd->SetGuidance("for the 110 fWorldMatPropVectorCmd->SetGuidance("for the world."); 116 fWorldMatPropVectorCmd->AvailableForStates(G 111 fWorldMatPropVectorCmd->AvailableForStates(G4State_PreInit, G4State_Idle); 117 fWorldMatPropVectorCmd->SetToBeBroadcasted(f 112 fWorldMatPropVectorCmd->SetToBeBroadcasted(false); 118 113 119 fWorldMatPropConstCmd = new G4UIcmdWithAStri << 114 fWorldMatConstPropVectorCmd = 120 fWorldMatPropConstCmd->SetGuidance("Set mate << 115 new G4UIcmdWithAString("/opnovice2/worldConstProperty", this); 121 fWorldMatPropConstCmd->SetGuidance(" for the << 116 fWorldMatConstPropVectorCmd->SetGuidance("Set material constant property"); 122 fWorldMatPropConstCmd->AvailableForStates(G4 << 117 fWorldMatConstPropVectorCmd->SetGuidance(" for the world."); 123 fWorldMatPropConstCmd->SetToBeBroadcasted(fa << 118 fWorldMatConstPropVectorCmd-> >> 119 AvailableForStates(G4State_PreInit, G4State_Idle); >> 120 fWorldMatConstPropVectorCmd->SetToBeBroadcasted(false); 124 121 125 fWorldMaterialCmd = new G4UIcmdWithAString(" 122 fWorldMaterialCmd = new G4UIcmdWithAString("/opnovice2/worldMaterial", this); 126 fWorldMaterialCmd->SetGuidance("Set material 123 fWorldMaterialCmd->SetGuidance("Set material of world."); 127 fWorldMaterialCmd->AvailableForStates(G4Stat 124 fWorldMaterialCmd->AvailableForStates(G4State_PreInit, G4State_Idle); 128 fWorldMaterialCmd->SetToBeBroadcasted(false) 125 fWorldMaterialCmd->SetToBeBroadcasted(false); >> 126 129 } 127 } 130 128 131 //....oooOO0OOooo........oooOO0OOooo........oo 129 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 132 130 133 DetectorMessenger::~DetectorMessenger() 131 DetectorMessenger::~DetectorMessenger() 134 { 132 { 135 delete fOpticalDir; << 136 delete fSurfaceFinishCmd; 133 delete fSurfaceFinishCmd; 137 delete fSurfaceTypeCmd; 134 delete fSurfaceTypeCmd; 138 delete fSurfaceModelCmd; 135 delete fSurfaceModelCmd; 139 delete fSurfaceSigmaAlphaCmd; 136 delete fSurfaceSigmaAlphaCmd; 140 delete fSurfacePolishCmd; << 141 delete fSurfaceMatPropVectorCmd; 137 delete fSurfaceMatPropVectorCmd; 142 delete fSurfaceMatPropConstCmd; << 143 delete fTankMatPropVectorCmd; 138 delete fTankMatPropVectorCmd; 144 delete fTankMatPropConstCmd; << 139 delete fTankMatConstPropVectorCmd; 145 delete fTankMaterialCmd; 140 delete fTankMaterialCmd; 146 delete fWorldMatPropVectorCmd; 141 delete fWorldMatPropVectorCmd; 147 delete fWorldMatPropConstCmd; << 142 delete fWorldMatConstPropVectorCmd; 148 delete fWorldMaterialCmd; 143 delete fWorldMaterialCmd; 149 } 144 } 150 145 151 //....oooOO0OOooo........oooOO0OOooo........oo 146 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 152 147 153 void DetectorMessenger::SetNewValue(G4UIcomman << 148 void DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue) 154 { << 149 { 155 // FINISH << 150 // FINISH 156 if (command == fSurfaceFinishCmd) { 151 if (command == fSurfaceFinishCmd) { 157 if (newValue == "polished") { 152 if (newValue == "polished") { 158 fDetector->SetSurfaceFinish(polished); 153 fDetector->SetSurfaceFinish(polished); 159 } 154 } 160 else if (newValue == "polishedfrontpainted 155 else if (newValue == "polishedfrontpainted") { 161 fDetector->SetSurfaceFinish(polishedfron 156 fDetector->SetSurfaceFinish(polishedfrontpainted); 162 } 157 } 163 else if (newValue == "polishedbackpainted" 158 else if (newValue == "polishedbackpainted") { 164 fDetector->SetSurfaceFinish(polishedback 159 fDetector->SetSurfaceFinish(polishedbackpainted); 165 } 160 } 166 else if (newValue == "ground") { 161 else if (newValue == "ground") { 167 fDetector->SetSurfaceFinish(ground); 162 fDetector->SetSurfaceFinish(ground); 168 } 163 } 169 else if (newValue == "groundfrontpainted") 164 else if (newValue == "groundfrontpainted") { 170 fDetector->SetSurfaceFinish(groundfrontp 165 fDetector->SetSurfaceFinish(groundfrontpainted); 171 } 166 } 172 else if (newValue == "groundbackpainted") 167 else if (newValue == "groundbackpainted") { 173 fDetector->SetSurfaceFinish(groundbackpa 168 fDetector->SetSurfaceFinish(groundbackpainted); 174 } 169 } 175 else if (newValue == "polishedlumirrorair" 170 else if (newValue == "polishedlumirrorair") { 176 fDetector->SetSurfaceFinish(polishedlumi 171 fDetector->SetSurfaceFinish(polishedlumirrorair); 177 } 172 } 178 else if (newValue == "polishedlumirrorglue 173 else if (newValue == "polishedlumirrorglue") { 179 fDetector->SetSurfaceFinish(polishedlumi 174 fDetector->SetSurfaceFinish(polishedlumirrorglue); 180 } 175 } 181 else if (newValue == "polishedair") { 176 else if (newValue == "polishedair") { 182 fDetector->SetSurfaceFinish(polishedair) 177 fDetector->SetSurfaceFinish(polishedair); 183 } 178 } 184 else if (newValue == "polishedteflonair") 179 else if (newValue == "polishedteflonair") { 185 fDetector->SetSurfaceFinish(polishedtefl 180 fDetector->SetSurfaceFinish(polishedteflonair); 186 } 181 } 187 else if (newValue == "polishedtioair") { 182 else if (newValue == "polishedtioair") { 188 fDetector->SetSurfaceFinish(polishedtioa 183 fDetector->SetSurfaceFinish(polishedtioair); 189 } 184 } 190 else if (newValue == "polishedtyvekair") { 185 else if (newValue == "polishedtyvekair") { 191 fDetector->SetSurfaceFinish(polishedtyve 186 fDetector->SetSurfaceFinish(polishedtyvekair); 192 } 187 } 193 else if (newValue == "polishedvm2000air") 188 else if (newValue == "polishedvm2000air") { 194 fDetector->SetSurfaceFinish(polishedvm20 189 fDetector->SetSurfaceFinish(polishedvm2000air); 195 } 190 } 196 else if (newValue == "polishedvm2000glue") 191 else if (newValue == "polishedvm2000glue") { 197 fDetector->SetSurfaceFinish(polishedvm20 192 fDetector->SetSurfaceFinish(polishedvm2000glue); 198 } 193 } 199 else if (newValue == "etchedlumirrorair") 194 else if (newValue == "etchedlumirrorair") { 200 fDetector->SetSurfaceFinish(etchedlumirr 195 fDetector->SetSurfaceFinish(etchedlumirrorair); 201 } 196 } 202 else if (newValue == "etchedlumirrorglue") 197 else if (newValue == "etchedlumirrorglue") { 203 fDetector->SetSurfaceFinish(etchedlumirr 198 fDetector->SetSurfaceFinish(etchedlumirrorglue); 204 } 199 } 205 else if (newValue == "etchedair") { 200 else if (newValue == "etchedair") { 206 fDetector->SetSurfaceFinish(etchedair); 201 fDetector->SetSurfaceFinish(etchedair); 207 } 202 } 208 else if (newValue == "etchedteflonair") { 203 else if (newValue == "etchedteflonair") { 209 fDetector->SetSurfaceFinish(etchedteflon 204 fDetector->SetSurfaceFinish(etchedteflonair); 210 } 205 } 211 else if (newValue == "etchedtioair") { 206 else if (newValue == "etchedtioair") { 212 fDetector->SetSurfaceFinish(etchedtioair 207 fDetector->SetSurfaceFinish(etchedtioair); 213 } 208 } 214 else if (newValue == "etchedtyvekair") { 209 else if (newValue == "etchedtyvekair") { 215 fDetector->SetSurfaceFinish(etchedtyveka 210 fDetector->SetSurfaceFinish(etchedtyvekair); 216 } 211 } 217 else if (newValue == "etchedvm2000air") { 212 else if (newValue == "etchedvm2000air") { 218 fDetector->SetSurfaceFinish(etchedvm2000 213 fDetector->SetSurfaceFinish(etchedvm2000air); 219 } 214 } 220 else if (newValue == "etchedvm2000glue") { 215 else if (newValue == "etchedvm2000glue") { 221 fDetector->SetSurfaceFinish(etchedvm2000 216 fDetector->SetSurfaceFinish(etchedvm2000glue); 222 } 217 } 223 else if (newValue == "groundlumirrorair") 218 else if (newValue == "groundlumirrorair") { 224 fDetector->SetSurfaceFinish(groundlumirr 219 fDetector->SetSurfaceFinish(groundlumirrorair); 225 } 220 } 226 else if (newValue == "groundlumirrorglue") 221 else if (newValue == "groundlumirrorglue") { 227 fDetector->SetSurfaceFinish(groundlumirr 222 fDetector->SetSurfaceFinish(groundlumirrorglue); 228 } 223 } 229 else if (newValue == "groundair") { 224 else if (newValue == "groundair") { 230 fDetector->SetSurfaceFinish(groundair); 225 fDetector->SetSurfaceFinish(groundair); 231 } 226 } 232 else if (newValue == "groundteflonair") { 227 else if (newValue == "groundteflonair") { 233 fDetector->SetSurfaceFinish(groundteflon 228 fDetector->SetSurfaceFinish(groundteflonair); 234 } 229 } 235 else if (newValue == "groundtioair") { 230 else if (newValue == "groundtioair") { 236 fDetector->SetSurfaceFinish(groundtioair 231 fDetector->SetSurfaceFinish(groundtioair); 237 } 232 } 238 else if (newValue == "groundtyvekair") { 233 else if (newValue == "groundtyvekair") { 239 fDetector->SetSurfaceFinish(groundtyveka 234 fDetector->SetSurfaceFinish(groundtyvekair); 240 } 235 } 241 else if (newValue == "groundvm2000air") { 236 else if (newValue == "groundvm2000air") { 242 fDetector->SetSurfaceFinish(groundvm2000 237 fDetector->SetSurfaceFinish(groundvm2000air); 243 } 238 } 244 else if (newValue == "groundvm2000glue") { 239 else if (newValue == "groundvm2000glue") { 245 fDetector->SetSurfaceFinish(groundvm2000 240 fDetector->SetSurfaceFinish(groundvm2000glue); 246 } 241 } 247 // for Davis model 242 // for Davis model 248 else if (newValue == "Rough_LUT") { 243 else if (newValue == "Rough_LUT") { 249 fDetector->SetSurfaceFinish(Rough_LUT); 244 fDetector->SetSurfaceFinish(Rough_LUT); 250 } 245 } 251 else if (newValue == "RoughTeflon_LUT") { 246 else if (newValue == "RoughTeflon_LUT") { 252 fDetector->SetSurfaceFinish(RoughTeflon_ 247 fDetector->SetSurfaceFinish(RoughTeflon_LUT); 253 } 248 } 254 else if (newValue == "RoughESR_LUT") { 249 else if (newValue == "RoughESR_LUT") { 255 fDetector->SetSurfaceFinish(RoughESR_LUT 250 fDetector->SetSurfaceFinish(RoughESR_LUT); 256 } 251 } 257 else if (newValue == "RoughESRGrease_LUT") 252 else if (newValue == "RoughESRGrease_LUT") { 258 fDetector->SetSurfaceFinish(RoughESRGrea 253 fDetector->SetSurfaceFinish(RoughESRGrease_LUT); 259 } 254 } 260 else if (newValue == "Polished_LUT") { 255 else if (newValue == "Polished_LUT") { 261 fDetector->SetSurfaceFinish(Polished_LUT 256 fDetector->SetSurfaceFinish(Polished_LUT); 262 } 257 } 263 else if (newValue == "PolishedTeflon_LUT") 258 else if (newValue == "PolishedTeflon_LUT") { 264 fDetector->SetSurfaceFinish(PolishedTefl 259 fDetector->SetSurfaceFinish(PolishedTeflon_LUT); 265 } 260 } 266 else if (newValue == "PolishedESR_LUT") { 261 else if (newValue == "PolishedESR_LUT") { 267 fDetector->SetSurfaceFinish(PolishedESR_ 262 fDetector->SetSurfaceFinish(PolishedESR_LUT); 268 } 263 } 269 else if (newValue == "PolishedESRGrease_LU 264 else if (newValue == "PolishedESRGrease_LUT") { 270 fDetector->SetSurfaceFinish(PolishedESRG 265 fDetector->SetSurfaceFinish(PolishedESRGrease_LUT); 271 } 266 } 272 else if (newValue == "Detector_LUT") { 267 else if (newValue == "Detector_LUT") { 273 fDetector->SetSurfaceFinish(Detector_LUT 268 fDetector->SetSurfaceFinish(Detector_LUT); 274 } 269 } 275 else { 270 else { 276 G4ExceptionDescription ed; 271 G4ExceptionDescription ed; 277 ed << "Invalid surface finish: " << newV 272 ed << "Invalid surface finish: " << newValue; 278 G4Exception("DetectorMessenger", "OpNovi << 273 G4Exception("DetectorMessenger", "OpNovice2_003", FatalException,ed); 279 } 274 } 280 } 275 } 281 276 282 // MODEL 277 // MODEL 283 else if (command == fSurfaceModelCmd) { 278 else if (command == fSurfaceModelCmd) { 284 if (newValue == "glisur") { 279 if (newValue == "glisur") { 285 fDetector->SetSurfaceModel(glisur); 280 fDetector->SetSurfaceModel(glisur); 286 } 281 } 287 else if (newValue == "unified") { 282 else if (newValue == "unified") { 288 fDetector->SetSurfaceModel(unified); 283 fDetector->SetSurfaceModel(unified); 289 } 284 } 290 else if (newValue == "LUT") { 285 else if (newValue == "LUT") { 291 fDetector->SetSurfaceModel(LUT); 286 fDetector->SetSurfaceModel(LUT); 292 } 287 } 293 else if (newValue == "DAVIS") { 288 else if (newValue == "DAVIS") { 294 fDetector->SetSurfaceModel(DAVIS); 289 fDetector->SetSurfaceModel(DAVIS); 295 } 290 } 296 else if (newValue == "dichroic") { 291 else if (newValue == "dichroic") { 297 fDetector->SetSurfaceModel(dichroic); 292 fDetector->SetSurfaceModel(dichroic); 298 } 293 } 299 else { 294 else { 300 G4ExceptionDescription ed; 295 G4ExceptionDescription ed; 301 ed << "Invalid surface model: " << newVa 296 ed << "Invalid surface model: " << newValue; 302 G4Exception("DetectorMessenger", "ONovic << 297 G4Exception("DetectorMessenger", "ONovice2_001", >> 298 FatalException,ed); 303 } 299 } 304 } 300 } 305 301 306 // TYPE 302 // TYPE 307 else if (command == fSurfaceTypeCmd) { 303 else if (command == fSurfaceTypeCmd) { 308 if (newValue == "dielectric_metal") { 304 if (newValue == "dielectric_metal") { 309 fDetector->SetSurfaceType(dielectric_met 305 fDetector->SetSurfaceType(dielectric_metal); 310 } 306 } 311 else if (newValue == "dielectric_dielectri 307 else if (newValue == "dielectric_dielectric") { 312 fDetector->SetSurfaceType(dielectric_die 308 fDetector->SetSurfaceType(dielectric_dielectric); 313 } 309 } 314 else if (newValue == "dielectric_LUT") { 310 else if (newValue == "dielectric_LUT") { 315 fDetector->SetSurfaceType(dielectric_LUT 311 fDetector->SetSurfaceType(dielectric_LUT); 316 } 312 } 317 else if (newValue == "dielectric_LUTDAVIS" 313 else if (newValue == "dielectric_LUTDAVIS") { 318 fDetector->SetSurfaceType(dielectric_LUT 314 fDetector->SetSurfaceType(dielectric_LUTDAVIS); 319 } 315 } 320 else if (newValue == "coated") { << 321 fDetector->SetSurfaceType(coated); << 322 } << 323 else { 316 else { 324 G4ExceptionDescription ed; 317 G4ExceptionDescription ed; 325 ed << "Invalid surface type: " << newVal 318 ed << "Invalid surface type: " << newValue; 326 G4Exception("DetectorMessenger", "OpNovi << 319 G4Exception("DetectorMessenger", "OpNovice2_002", FatalException,ed); 327 } 320 } 328 } 321 } 329 else if (command == fSurfaceSigmaAlphaCmd) { 322 else if (command == fSurfaceSigmaAlphaCmd) { 330 fDetector->SetSurfaceSigmaAlpha(G4UIcmdWit << 323 fDetector->SetSurfaceSigmaAlpha( 331 } << 324 G4UIcmdWithADouble::GetNewDoubleValue(newValue)); 332 else if (command == fSurfacePolishCmd) { << 333 fDetector->SetSurfacePolish(G4UIcmdWithADo << 334 } 325 } 335 else if (command == fTankMatPropVectorCmd) { 326 else if (command == fTankMatPropVectorCmd) { 336 // got a string. need to convert it to phy 327 // got a string. need to convert it to physics vector. 337 // string format is property name, then pa << 328 // string format is property name, then pairs of energy, value 338 // specify units for each value, eg 3.0*eV 329 // specify units for each value, eg 3.0*eV 339 // space delimited 330 // space delimited 340 auto mpv = new G4MaterialPropertyVector(); << 331 G4MaterialPropertyVector* mpv = new G4MaterialPropertyVector(); >> 332 mpv->SetSpline(true); 341 std::istringstream instring(newValue); 333 std::istringstream instring(newValue); 342 G4String prop; 334 G4String prop; 343 instring >> prop; 335 instring >> prop; 344 while (instring) { 336 while (instring) { 345 G4String tmp; 337 G4String tmp; 346 instring >> tmp; 338 instring >> tmp; 347 if (tmp == "") { << 339 if (tmp == "") { break; } 348 break; << 349 } << 350 G4double en = G4UIcommand::ConvertToDoub 340 G4double en = G4UIcommand::ConvertToDouble(tmp); 351 instring >> tmp; 341 instring >> tmp; 352 G4double val = G4UIcommand::ConvertToDou << 342 G4double val; >> 343 val = G4UIcommand::ConvertToDouble(tmp); 353 mpv->InsertValues(en, val); 344 mpv->InsertValues(en, val); 354 } << 345 } >> 346 const char* c = prop.c_str(); 355 347 356 fDetector->AddTankMPV(prop, mpv); << 348 fDetector->AddTankMPV(c, mpv); 357 } 349 } 358 else if (command == fWorldMatPropVectorCmd) 350 else if (command == fWorldMatPropVectorCmd) { 359 // Convert string to physics vector 351 // Convert string to physics vector 360 // string format is property name, then pa << 352 // string format is property name, then pairs of energy, value 361 auto mpv = new G4MaterialPropertyVector(); << 353 G4MaterialPropertyVector* mpv = new G4MaterialPropertyVector(); 362 std::istringstream instring(newValue); 354 std::istringstream instring(newValue); 363 G4String prop; 355 G4String prop; 364 instring >> prop; 356 instring >> prop; 365 while (instring) { 357 while (instring) { 366 G4String tmp; 358 G4String tmp; 367 instring >> tmp; 359 instring >> tmp; 368 if (tmp == "") { << 360 if (tmp == "") { break; } 369 break; << 370 } << 371 G4double en = G4UIcommand::ConvertToDoub 361 G4double en = G4UIcommand::ConvertToDouble(tmp); 372 instring >> tmp; 362 instring >> tmp; 373 G4double val = G4UIcommand::ConvertToDou << 363 G4double val; >> 364 val = G4UIcommand::ConvertToDouble(tmp); 374 mpv->InsertValues(en, val); 365 mpv->InsertValues(en, val); 375 } << 366 } 376 fDetector->AddWorldMPV(prop, mpv); << 367 const char* c = prop.c_str(); >> 368 fDetector->AddWorldMPV(c, mpv); 377 } 369 } 378 else if (command == fSurfaceMatPropVectorCmd 370 else if (command == fSurfaceMatPropVectorCmd) { 379 // Convert string to physics vector 371 // Convert string to physics vector 380 // string format is property name, then pa << 372 // string format is property name, then pairs of energy, value 381 // space delimited 373 // space delimited 382 auto mpv = new G4MaterialPropertyVector(); << 374 G4MaterialPropertyVector* mpv = new G4MaterialPropertyVector(); 383 G4cout << newValue << G4endl; 375 G4cout << newValue << G4endl; 384 std::istringstream instring(newValue); 376 std::istringstream instring(newValue); 385 G4String prop; 377 G4String prop; 386 instring >> prop; 378 instring >> prop; 387 while (instring) { 379 while (instring) { 388 G4String tmp; 380 G4String tmp; 389 instring >> tmp; 381 instring >> tmp; 390 if (tmp == "") { << 382 if (tmp == "") { break; } 391 break; << 392 } << 393 G4double en = G4UIcommand::ConvertToDoub 383 G4double en = G4UIcommand::ConvertToDouble(tmp); 394 instring >> tmp; 384 instring >> tmp; 395 G4double val = G4UIcommand::ConvertToDou << 385 G4double val; >> 386 val = G4UIcommand::ConvertToDouble(tmp); 396 mpv->InsertValues(en, val); 387 mpv->InsertValues(en, val); 397 } << 388 } 398 fDetector->AddSurfaceMPV(prop, mpv); << 389 const char* c = prop.c_str(); >> 390 fDetector->AddSurfaceMPV(c, mpv); 399 } 391 } 400 392 401 else if (command == fTankMatPropConstCmd) { << 393 else if (command == fTankMatConstPropVectorCmd) { 402 // Convert string to physics vector << 403 // string format is property name, then va << 404 // space delimited << 405 std::istringstream instring(newValue); << 406 G4String prop; << 407 G4String tmp; << 408 instring >> prop; << 409 instring >> tmp; << 410 G4double val = G4UIcommand::ConvertToDoubl << 411 fDetector->AddTankMPC(prop, val); << 412 } << 413 else if (command == fWorldMatPropConstCmd) { << 414 // Convert string to physics vector 394 // Convert string to physics vector 415 // string format is property name, then va 395 // string format is property name, then value 416 // space delimited 396 // space delimited 417 std::istringstream instring(newValue); 397 std::istringstream instring(newValue); 418 G4String prop; 398 G4String prop; 419 G4String tmp; 399 G4String tmp; 420 instring >> prop; 400 instring >> prop; 421 instring >> tmp; 401 instring >> tmp; 422 G4double val = G4UIcommand::ConvertToDoubl 402 G4double val = G4UIcommand::ConvertToDouble(tmp); 423 fDetector->AddWorldMPC(prop, val); << 403 const char* c = prop.c_str(); >> 404 fDetector->AddTankMPCV(c, val); 424 } 405 } 425 else if (command == fSurfaceMatPropConstCmd) << 406 else if (command == fWorldMatConstPropVectorCmd) { 426 // Convert string to physics vector 407 // Convert string to physics vector 427 // string format is property name, then va 408 // string format is property name, then value 428 // space delimited 409 // space delimited 429 std::istringstream instring(newValue); 410 std::istringstream instring(newValue); 430 G4String prop; 411 G4String prop; 431 G4String tmp; 412 G4String tmp; 432 instring >> prop; 413 instring >> prop; 433 instring >> tmp; 414 instring >> tmp; 434 G4double val = G4UIcommand::ConvertToDoubl 415 G4double val = G4UIcommand::ConvertToDouble(tmp); 435 fDetector->AddSurfaceMPC(prop, val); << 416 const char* c = prop.c_str(); >> 417 fDetector->AddTankMPCV(c, val); 436 } 418 } 437 else if (command == fWorldMaterialCmd) { 419 else if (command == fWorldMaterialCmd) { 438 fDetector->SetWorldMaterial(newValue); 420 fDetector->SetWorldMaterial(newValue); 439 } 421 } 440 else if (command == fTankMaterialCmd) { 422 else if (command == fTankMaterialCmd) { 441 fDetector->SetTankMaterial(newValue); 423 fDetector->SetTankMaterial(newValue); 442 } 424 } 443 } 425 } 444 426 445 //....oooOO0OOooo........oooOO0OOooo........oo 427 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 446 428