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 // 26 // 27 /// \file optical/wls/src/WLSDetectorMessenger << 28 /// \brief Implementation of the WLSDetectorMe << 29 // << 30 // 27 // >> 28 31 #include "WLSDetectorMessenger.hh" 29 #include "WLSDetectorMessenger.hh" 32 30 >> 31 #include "G4UIdirectory.hh" 33 #include "G4UIcmdWithABool.hh" 32 #include "G4UIcmdWithABool.hh" 34 #include "G4UIcmdWithADouble.hh" << 35 #include "G4UIcmdWithADoubleAndUnit.hh" << 36 #include "G4UIcmdWithAString.hh" 33 #include "G4UIcmdWithAString.hh" >> 34 #include "G4UIcmdWithADouble.hh" 37 #include "G4UIcmdWithAnInteger.hh" 35 #include "G4UIcmdWithAnInteger.hh" >> 36 #include "G4UIcmdWithADoubleAndUnit.hh" 38 #include "G4UIcmdWithoutParameter.hh" 37 #include "G4UIcmdWithoutParameter.hh" 39 #include "G4UIdirectory.hh" << 40 << 41 //....oooOO0OOooo........oooOO0OOooo........oo << 42 38 43 WLSDetectorMessenger::WLSDetectorMessenger(WLS << 39 WLSDetectorMessenger::WLSDetectorMessenger(WLSDetectorConstruction * Det) >> 40 : Detector(Det) 44 { 41 { 45 fDetDir = new G4UIdirectory("/WLS/"); << 42 detDir = new G4UIdirectory("/WLS/"); 46 fDetDir->SetGuidance(" Geometry Setup "); << 43 detDir->SetGuidance(" Geometry Setup "); 47 44 48 fSetPhotonDetGeometryCmd = new G4UIcmdWithAS << 45 UpdateCmd = new G4UIcmdWithoutParameter("/WLS/Update",this); 49 fSetPhotonDetGeometryCmd->SetGuidance("Selec << 46 UpdateCmd->SetGuidance("Update musr geometry"); 50 fSetPhotonDetGeometryCmd->SetGuidance("Only << 47 UpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" "); 51 fSetPhotonDetGeometryCmd->SetCandidates("Cir << 48 UpdateCmd->SetGuidance("if you changed geometrical value(s)."); 52 fSetPhotonDetGeometryCmd->AvailableForStates << 49 UpdateCmd->AvailableForStates(G4State_Idle); 53 fSetPhotonDetGeometryCmd->SetToBeBroadcasted << 50 54 << 51 SetPhotonDetGeometryCmd = 55 fSetNumOfCladLayersCmd = new G4UIcmdWithAnIn << 52 new G4UIcmdWithAString("/WLS/setPhotonDetGeometry",this); 56 fSetNumOfCladLayersCmd->SetGuidance("Select << 53 SetPhotonDetGeometryCmd-> 57 fSetNumOfCladLayersCmd->SetGuidance("Maximum << 54 SetGuidance("Select the geometry of the PhotonDet detector"); 58 fSetNumOfCladLayersCmd->SetParameterName("nu << 55 SetPhotonDetGeometryCmd->SetGuidance("Only Accepts 'Circle' and 'Square'"); 59 fSetNumOfCladLayersCmd->SetRange("numberOfLa << 56 SetPhotonDetGeometryCmd->SetCandidates("Circle Square"); 60 fSetNumOfCladLayersCmd->AvailableForStates(G << 57 SetPhotonDetGeometryCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 61 fSetNumOfCladLayersCmd->SetToBeBroadcasted(f << 58 62 << 59 SetNumOfCladLayersCmd = new G4UIcmdWithAnInteger("/WLS/setNumOfLayers", this); 63 fSetSurfaceRoughnessCmd = new G4UIcmdWithADo << 60 SetNumOfCladLayersCmd->SetGuidance("Select the number of cladding layers"); 64 fSetSurfaceRoughnessCmd->SetGuidance("Set th << 61 SetNumOfCladLayersCmd->SetGuidance("Maximum number is 2"); 65 fSetSurfaceRoughnessCmd->SetParameterName("r << 62 SetNumOfCladLayersCmd->SetParameterName("numberOfLayers",false); 66 fSetSurfaceRoughnessCmd->SetRange("roughness << 63 SetNumOfCladLayersCmd->SetRange("numberOfLayers>=0 && numberOfLayers<=2"); 67 fSetSurfaceRoughnessCmd->AvailableForStates( << 64 SetNumOfCladLayersCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 68 fSetSurfaceRoughnessCmd->SetToBeBroadcasted( << 65 69 << 66 SetSurfaceRoughnessCmd = 70 fSetXYRatioCmd = new G4UIcmdWithADouble("/WL << 67 new G4UIcmdWithADouble("/WLS/setSurfaceRoughness", this); 71 fSetXYRatioCmd->SetGuidance("Set the ratio b << 68 SetSurfaceRoughnessCmd-> 72 fSetXYRatioCmd->SetParameterName("ratio", fa << 69 SetGuidance("Set the roughness between Clad1 and WLS Fiber"); 73 fSetXYRatioCmd->SetRange("ratio>0 && ratio<= << 70 SetSurfaceRoughnessCmd->SetParameterName("roughness",false); 74 fSetXYRatioCmd->AvailableForStates(G4State_P << 71 SetSurfaceRoughnessCmd->SetRange("roughness>0 && roughness<=1"); 75 fSetXYRatioCmd->SetToBeBroadcasted(false); << 72 SetSurfaceRoughnessCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 76 << 73 77 fSetMirrorPolishCmd = new G4UIcmdWithADouble << 74 SetXYRatioCmd = new G4UIcmdWithADouble("/WLS/setXYRatio", this); 78 fSetMirrorPolishCmd->SetGuidance("Set the po << 75 SetXYRatioCmd->SetGuidance("Set the ratio between x and y axis (x/y)"); 79 fSetMirrorPolishCmd->SetParameterName("polis << 76 SetXYRatioCmd->SetParameterName("ratio",false); 80 fSetMirrorPolishCmd->SetRange("polish>0 && p << 77 SetXYRatioCmd->SetRange("ratio>0 && ratio<=1"); 81 fSetMirrorPolishCmd->AvailableForStates(G4St << 78 SetXYRatioCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 82 fSetMirrorPolishCmd->SetToBeBroadcasted(fals << 79 83 << 80 SetMirrorPolishCmd = new G4UIcmdWithADouble("/WLS/setMirrorPolish", this); 84 fSetMirrorReflectivityCmd = new G4UIcmdWithA << 81 SetMirrorPolishCmd->SetGuidance("Set the polish of the mirror"); 85 fSetMirrorReflectivityCmd->SetGuidance("Set << 82 SetMirrorPolishCmd->SetParameterName("polish",false); 86 fSetMirrorReflectivityCmd->SetParameterName( << 83 SetMirrorPolishCmd->SetRange("polish>0 && polish<=1"); 87 fSetMirrorReflectivityCmd->SetRange("reflect << 84 SetMirrorPolishCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 88 fSetMirrorReflectivityCmd->AvailableForState << 85 89 fSetMirrorReflectivityCmd->SetToBeBroadcaste << 86 SetMirrorReflectivityCmd = 90 << 87 new G4UIcmdWithADouble("/WLS/setMirrorReflectivity", this); 91 fSetPhotonDetPolishCmd = new G4UIcmdWithADou << 88 SetMirrorReflectivityCmd->SetGuidance("Set the reflectivity of the mirror"); 92 fSetPhotonDetPolishCmd->SetGuidance("Set the << 89 SetMirrorReflectivityCmd->SetParameterName("reflectivity",false); 93 fSetPhotonDetPolishCmd->SetParameterName("po << 90 SetMirrorReflectivityCmd->SetRange("reflectivity>=0 && reflectivity<=1"); 94 fSetPhotonDetPolishCmd->SetRange("polish>0 & << 91 SetMirrorReflectivityCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 95 fSetPhotonDetPolishCmd->AvailableForStates(G << 92 96 fSetPhotonDetPolishCmd->SetToBeBroadcasted(f << 93 SetPhotonDetPolishCmd = 97 << 94 new G4UIcmdWithADouble("/WLS/setPhotonDetPolish", this); 98 fSetPhotonDetReflectivityCmd = new G4UIcmdWi << 95 SetPhotonDetPolishCmd->SetGuidance("Set the polish of the mirror"); 99 fSetPhotonDetReflectivityCmd->SetGuidance("S << 96 SetPhotonDetPolishCmd->SetParameterName("polish",false); 100 fSetPhotonDetReflectivityCmd->SetParameterNa << 97 SetPhotonDetPolishCmd->SetRange("polish>0 && polish<=1"); 101 fSetPhotonDetReflectivityCmd->SetRange("refl << 98 SetPhotonDetPolishCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 102 fSetPhotonDetReflectivityCmd->AvailableForSt << 99 103 fSetPhotonDetReflectivityCmd->SetToBeBroadca << 100 SetPhotonDetReflectivityCmd = 104 << 101 new G4UIcmdWithADouble("/WLS/setPhotonDetReflectivity", this); 105 fSetWLSLengthCmd = new G4UIcmdWithADoubleAnd << 102 SetPhotonDetReflectivityCmd-> 106 fSetWLSLengthCmd->SetGuidance("Set the half << 103 SetGuidance("Set the reflectivity of the mirror"); 107 fSetWLSLengthCmd->SetParameterName("length", << 104 SetPhotonDetReflectivityCmd->SetParameterName("reflectivity",false); 108 fSetWLSLengthCmd->SetRange("length>0."); << 105 SetPhotonDetReflectivityCmd->SetRange("reflectivity>=0 && reflectivity<=1"); 109 fSetWLSLengthCmd->SetUnitCategory("Length"); << 106 SetPhotonDetReflectivityCmd->AvailableForStates(G4State_PreInit); 110 fSetWLSLengthCmd->SetDefaultUnit("mm"); << 107 111 fSetWLSLengthCmd->AvailableForStates(G4State << 108 SetWLSLengthCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setWLSLength",this); 112 fSetWLSLengthCmd->SetToBeBroadcasted(false); << 109 SetWLSLengthCmd->SetGuidance("Set the half length of the WLS fiber"); 113 << 110 SetWLSLengthCmd->SetParameterName("length",false); 114 fSetWLSRadiusCmd = new G4UIcmdWithADoubleAnd << 111 SetWLSLengthCmd->SetRange("length>0."); 115 fSetWLSRadiusCmd->SetGuidance("Set the radiu << 112 SetWLSLengthCmd->SetUnitCategory("Length"); 116 fSetWLSRadiusCmd->SetParameterName("radius", << 113 SetWLSLengthCmd->SetDefaultUnit("mm"); 117 fSetWLSRadiusCmd->SetRange("radius>0."); << 114 SetWLSLengthCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 118 fSetWLSRadiusCmd->SetUnitCategory("Length"); << 115 119 fSetWLSRadiusCmd->SetDefaultUnit("mm"); << 116 SetWLSRadiusCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setWLSRadius",this); 120 fSetWLSRadiusCmd->AvailableForStates(G4State << 117 SetWLSRadiusCmd->SetGuidance("Set the radius of the WLS fiber"); 121 fSetWLSRadiusCmd->SetToBeBroadcasted(false); << 118 SetWLSRadiusCmd->SetParameterName("radius",false); 122 << 119 SetWLSRadiusCmd->SetRange("radius>0."); 123 fSetClad1RadiusCmd = new G4UIcmdWithADoubleA << 120 SetWLSRadiusCmd->SetUnitCategory("Length"); 124 fSetClad1RadiusCmd->SetGuidance("Set the rad << 121 SetWLSRadiusCmd->SetDefaultUnit("mm"); 125 fSetClad1RadiusCmd->SetParameterName("radius << 122 SetWLSRadiusCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 126 fSetClad1RadiusCmd->SetRange("radius>0."); << 123 127 fSetClad1RadiusCmd->SetUnitCategory("Length" << 124 SetClad1RadiusCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setClad1Radius",this); 128 fSetClad1RadiusCmd->SetDefaultUnit("mm"); << 125 SetClad1RadiusCmd->SetGuidance("Set the radius of Cladding 1"); 129 fSetClad1RadiusCmd->AvailableForStates(G4Sta << 126 SetClad1RadiusCmd->SetParameterName("radius",false); 130 fSetClad1RadiusCmd->SetToBeBroadcasted(false << 127 SetClad1RadiusCmd->SetRange("radius>0."); 131 << 128 SetClad1RadiusCmd->SetUnitCategory("Length"); 132 fSetClad2RadiusCmd = new G4UIcmdWithADoubleA << 129 SetClad1RadiusCmd->SetDefaultUnit("mm"); 133 fSetClad2RadiusCmd->SetGuidance("Set the rad << 130 SetClad1RadiusCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 134 fSetClad2RadiusCmd->SetParameterName("radius << 131 135 fSetClad2RadiusCmd->SetRange("radius>0."); << 132 SetClad2RadiusCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setClad2Radius",this); 136 fSetClad2RadiusCmd->SetUnitCategory("Length" << 133 SetClad2RadiusCmd->SetGuidance("Set the radius of Cladding 2"); 137 fSetClad2RadiusCmd->SetDefaultUnit("mm"); << 134 SetClad2RadiusCmd->SetParameterName("radius",false); 138 fSetClad2RadiusCmd->AvailableForStates(G4Sta << 135 SetClad2RadiusCmd->SetRange("radius>0."); 139 fSetClad2RadiusCmd->SetToBeBroadcasted(false << 136 SetClad2RadiusCmd->SetUnitCategory("Length"); 140 << 137 SetClad2RadiusCmd->SetDefaultUnit("mm"); 141 fSetPhotonDetHalfLengthCmd = new G4UIcmdWith << 138 SetClad2RadiusCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 142 fSetPhotonDetHalfLengthCmd->SetGuidance("Set << 139 143 fSetPhotonDetHalfLengthCmd->SetParameterName << 140 SetPhotonDetHalfLengthCmd = 144 fSetPhotonDetHalfLengthCmd->SetRange("halfL> << 141 new G4UIcmdWithADoubleAndUnit("/WLS/setPhotonDetHalfLength",this); 145 fSetPhotonDetHalfLengthCmd->SetUnitCategory( << 142 SetPhotonDetHalfLengthCmd-> 146 fSetPhotonDetHalfLengthCmd->SetDefaultUnit(" << 143 SetGuidance("Set the half length of PhotonDet detector"); 147 fSetPhotonDetHalfLengthCmd->AvailableForStat << 144 SetPhotonDetHalfLengthCmd->SetParameterName("halfL",false); 148 fSetPhotonDetHalfLengthCmd->SetToBeBroadcast << 145 SetPhotonDetHalfLengthCmd->SetRange("halfL>0."); 149 << 146 SetPhotonDetHalfLengthCmd->SetUnitCategory("Length"); 150 fSetGapCmd = new G4UIcmdWithADoubleAndUnit(" << 147 SetPhotonDetHalfLengthCmd->SetDefaultUnit("mm"); 151 fSetGapCmd->SetGuidance("Set the distance be << 148 SetPhotonDetHalfLengthCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 152 fSetGapCmd->SetParameterName("theta", false) << 149 153 fSetGapCmd->SetUnitCategory("Length"); << 150 SetGapCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setGap",this); 154 fSetGapCmd->SetDefaultUnit("mm"); << 151 SetGapCmd->SetGuidance("Set the distance between PhotonDet and fiber end"); 155 fSetGapCmd->SetRange("theta>=0."); << 152 SetGapCmd->SetParameterName("theta",false); 156 fSetGapCmd->AvailableForStates(G4State_PreIn << 153 SetGapCmd->SetUnitCategory("Length"); 157 fSetGapCmd->SetToBeBroadcasted(false); << 154 SetGapCmd->SetDefaultUnit("mm"); 158 << 155 SetGapCmd->SetRange("theta>=0."); 159 fSetPhotonDetAlignmentCmd = new G4UIcmdWithA << 156 SetGapCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 160 fSetPhotonDetAlignmentCmd->SetGuidance("Set << 157 161 fSetPhotonDetAlignmentCmd->SetParameterName( << 158 SetPhotonDetAlignmentCmd = 162 fSetPhotonDetAlignmentCmd->SetUnitCategory(" << 159 new G4UIcmdWithADoubleAndUnit("/WLS/setAlignment",this); 163 fSetPhotonDetAlignmentCmd->SetDefaultUnit("d << 160 SetPhotonDetAlignmentCmd-> 164 fSetPhotonDetAlignmentCmd->SetRange("theta>- << 161 SetGuidance("Set the deviation of PhotonDet from z axis"); 165 fSetPhotonDetAlignmentCmd->AvailableForState << 162 SetPhotonDetAlignmentCmd->SetParameterName("theta",false); 166 fSetPhotonDetAlignmentCmd->SetToBeBroadcaste << 163 SetPhotonDetAlignmentCmd->SetUnitCategory("Angle"); 167 << 164 SetPhotonDetAlignmentCmd->SetDefaultUnit("deg"); 168 fSetMirrorCmd = new G4UIcmdWithABool("/WLS/s << 165 SetPhotonDetAlignmentCmd->SetRange("theta>-90. && theta<90."); 169 fSetMirrorCmd->SetGuidance("Place a mirror a << 166 SetPhotonDetAlignmentCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 170 fSetMirrorCmd->AvailableForStates(G4State_Pr << 167 171 fSetMirrorCmd->SetToBeBroadcasted(false); << 168 SetMirrorCmd = new G4UIcmdWithABool("/WLS/setMirror", this); 172 << 169 SetMirrorCmd->SetGuidance("Place a mirror at the end of the fiber"); 173 fSetBarLengthCmd = new G4UIcmdWithADoubleAnd << 170 SetMirrorCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 174 fSetBarLengthCmd->SetGuidance("Set the lengt << 171 175 fSetBarLengthCmd->SetParameterName("length", << 172 SetBarLengthCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setBarLength",this); 176 fSetBarLengthCmd->SetRange("length>0."); << 173 SetBarLengthCmd->SetGuidance("Set the length of the scintillator bar"); 177 fSetBarLengthCmd->SetUnitCategory("Length"); << 174 SetBarLengthCmd->SetParameterName("length",false); 178 fSetBarLengthCmd->SetDefaultUnit("mm"); << 175 SetBarLengthCmd->SetRange("length>0."); 179 fSetBarLengthCmd->AvailableForStates(G4State << 176 SetBarLengthCmd->SetUnitCategory("Length"); 180 fSetBarLengthCmd->SetToBeBroadcasted(false); << 177 SetBarLengthCmd->SetDefaultUnit("mm"); 181 << 178 SetBarLengthCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 182 fSetBarBaseCmd = new G4UIcmdWithADoubleAndUn << 179 183 fSetBarBaseCmd->SetGuidance("Set the side le << 180 SetBarBaseCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setBarBase",this); 184 fSetBarBaseCmd->SetParameterName("length", f << 181 SetBarBaseCmd->SetGuidance("Set the side length of the scintillator bar"); 185 fSetBarBaseCmd->SetRange("length>0."); << 182 SetBarBaseCmd->SetParameterName("length",false); 186 fSetBarBaseCmd->SetUnitCategory("Length"); << 183 SetBarBaseCmd->SetRange("length>0."); 187 fSetBarBaseCmd->SetDefaultUnit("mm"); << 184 SetBarBaseCmd->SetUnitCategory("Length"); 188 fSetBarBaseCmd->AvailableForStates(G4State_P << 185 SetBarBaseCmd->SetDefaultUnit("mm"); 189 fSetBarBaseCmd->SetToBeBroadcasted(false); << 186 SetBarBaseCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 190 << 187 191 fSetHoleRadiusCmd = new G4UIcmdWithADoubleAn << 188 SetHoleRadiusCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setHoleRadius",this); 192 fSetHoleRadiusCmd->SetGuidance("Set the radi << 189 SetHoleRadiusCmd->SetGuidance("Set the radius of the fiber hole"); 193 fSetHoleRadiusCmd->SetParameterName("radius" << 190 SetHoleRadiusCmd->SetParameterName("radius",false); 194 fSetHoleRadiusCmd->SetRange("radius>0."); << 191 SetHoleRadiusCmd->SetRange("radius>0."); 195 fSetHoleRadiusCmd->SetUnitCategory("Length") << 192 SetHoleRadiusCmd->SetUnitCategory("Length"); 196 fSetHoleRadiusCmd->SetDefaultUnit("mm"); << 193 SetHoleRadiusCmd->SetDefaultUnit("mm"); 197 fSetHoleRadiusCmd->AvailableForStates(G4Stat << 194 SetHoleRadiusCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 198 fSetHoleRadiusCmd->SetToBeBroadcasted(false) << 195 199 << 196 SetCoatingThicknessCmd = 200 fSetCoatingThicknessCmd = new G4UIcmdWithADo << 197 new G4UIcmdWithADoubleAndUnit("/WLS/setCoatingThickness",this); 201 fSetCoatingThicknessCmd->SetGuidance("Set th << 198 SetCoatingThicknessCmd-> 202 fSetCoatingThicknessCmd->SetParameterName("t << 199 SetGuidance("Set thickness of the coating on the bars"); 203 fSetCoatingThicknessCmd->SetUnitCategory("Le << 200 SetCoatingThicknessCmd->SetParameterName("thick",false); 204 fSetCoatingThicknessCmd->SetDefaultUnit("mm" << 201 SetCoatingThicknessCmd->SetUnitCategory("Length"); 205 fSetCoatingThicknessCmd->SetRange("thick>=0. << 202 SetCoatingThicknessCmd->SetDefaultUnit("mm"); 206 fSetCoatingThicknessCmd->AvailableForStates( << 203 SetCoatingThicknessCmd->SetRange("thick>=0."); 207 fSetCoatingThicknessCmd->SetToBeBroadcasted( << 204 SetCoatingThicknessCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 208 << 205 209 fSetCoatingRadiusCmd = new G4UIcmdWithADoubl << 206 SetCoatingRadiusCmd = 210 fSetCoatingRadiusCmd->SetGuidance("Set inner << 207 new G4UIcmdWithADoubleAndUnit("/WLS/setCoatingRadius",this); 211 fSetCoatingRadiusCmd->SetParameterName("crad << 208 SetCoatingRadiusCmd-> 212 fSetCoatingRadiusCmd->SetUnitCategory("Lengt << 209 SetGuidance("Set inner radius of the corner bar coating"); 213 fSetCoatingRadiusCmd->SetDefaultUnit("mm"); << 210 SetCoatingRadiusCmd->SetParameterName("cradius",false); 214 fSetCoatingRadiusCmd->SetRange("cradius>=0." << 211 SetCoatingRadiusCmd->SetUnitCategory("Length"); 215 fSetCoatingRadiusCmd->AvailableForStates(G4S << 212 SetCoatingRadiusCmd->SetDefaultUnit("mm"); 216 fSetCoatingRadiusCmd->SetToBeBroadcasted(fal << 213 SetCoatingRadiusCmd->SetRange("cradius>=0."); 217 } << 214 SetCoatingRadiusCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 218 215 219 //....oooOO0OOooo........oooOO0OOooo........oo << 216 } 220 217 221 WLSDetectorMessenger::~WLSDetectorMessenger() 218 WLSDetectorMessenger::~WLSDetectorMessenger() 222 { 219 { 223 delete fDetDir; << 220 delete detDir; 224 221 225 delete fSetBarLengthCmd; << 222 delete UpdateCmd; 226 delete fSetBarBaseCmd; << 227 delete fSetClad1RadiusCmd; << 228 delete fSetClad2RadiusCmd; << 229 delete fSetCoatingThicknessCmd; << 230 delete fSetCoatingRadiusCmd; << 231 delete fSetGapCmd; << 232 delete fSetHoleRadiusCmd; << 233 delete fSetMirrorCmd; << 234 delete fSetMirrorPolishCmd; << 235 delete fSetMirrorReflectivityCmd; << 236 delete fSetNumOfCladLayersCmd; << 237 delete fSetPhotonDetAlignmentCmd; << 238 delete fSetPhotonDetGeometryCmd; << 239 delete fSetPhotonDetHalfLengthCmd; << 240 delete fSetPhotonDetPolishCmd; << 241 delete fSetPhotonDetReflectivityCmd; << 242 delete fSetSurfaceRoughnessCmd; << 243 delete fSetWLSLengthCmd; << 244 delete fSetWLSRadiusCmd; << 245 delete fSetXYRatioCmd; << 246 } << 247 223 248 //....oooOO0OOooo........oooOO0OOooo........oo << 224 delete SetPhotonDetGeometryCmd; >> 225 delete SetNumOfCladLayersCmd; >> 226 delete SetWLSLengthCmd; >> 227 delete SetWLSRadiusCmd; >> 228 delete SetClad1RadiusCmd; >> 229 delete SetClad2RadiusCmd; >> 230 delete SetPhotonDetHalfLengthCmd; >> 231 delete SetGapCmd; >> 232 delete SetPhotonDetAlignmentCmd; >> 233 delete SetSurfaceRoughnessCmd; >> 234 delete SetMirrorPolishCmd; >> 235 delete SetMirrorReflectivityCmd; >> 236 delete SetXYRatioCmd; >> 237 delete SetMirrorCmd; >> 238 delete SetBarLengthCmd; >> 239 delete SetBarBaseCmd; >> 240 delete SetHoleRadiusCmd; >> 241 delete SetCoatingThicknessCmd; >> 242 delete SetCoatingRadiusCmd; >> 243 } 249 244 250 void WLSDetectorMessenger::SetNewValue(G4UIcom << 245 void WLSDetectorMessenger::SetNewValue(G4UIcommand* command,G4String val) 251 { 246 { 252 if (command == fSetPhotonDetGeometryCmd) { << 247 if( command == UpdateCmd ) { 253 fDetector->SetPhotonDetGeometry(val); << 248 >> 249 Detector->UpdateGeometry(); >> 250 } >> 251 else if( command == SetPhotonDetGeometryCmd ) { >> 252 >> 253 Detector->SetPhotonDetGeometry(val); 254 } 254 } 255 else if (command == fSetNumOfCladLayersCmd) << 255 else if( command == SetNumOfCladLayersCmd ) { 256 fDetector->SetNumberOfCladding(G4UIcmdWith << 256 >> 257 Detector->SetNumberOfCladding(G4UIcmdWithAnInteger::GetNewIntValue(val)); 257 } 258 } 258 else if (command == fSetSurfaceRoughnessCmd) << 259 else if( command == SetSurfaceRoughnessCmd ) { 259 fDetector->SetSurfaceRoughness(G4UIcmdWith << 260 >> 261 Detector->SetSurfaceRoughness(G4UIcmdWithADouble::GetNewDoubleValue(val)); 260 } 262 } 261 else if (command == fSetXYRatioCmd) { << 263 else if( command == SetXYRatioCmd ) { 262 fDetector->SetXYRatio(G4UIcmdWithADouble:: << 264 >> 265 Detector->SetXYRatio(G4UIcmdWithADouble::GetNewDoubleValue(val)); 263 } 266 } 264 else if (command == fSetMirrorPolishCmd) { << 267 else if( command == SetMirrorPolishCmd ) { 265 fDetector->SetMirrorPolish(G4UIcmdWithADou << 268 >> 269 Detector->SetMirrorPolish(G4UIcmdWithADouble::GetNewDoubleValue(val)); 266 } 270 } 267 else if (command == fSetMirrorReflectivityCm << 271 else if( command == SetMirrorReflectivityCmd ) { 268 fDetector->SetMirrorReflectivity(G4UIcmdWi << 272 >> 273 Detector-> >> 274 SetMirrorReflectivity(G4UIcmdWithADouble::GetNewDoubleValue(val)); 269 } 275 } 270 else if (command == fSetPhotonDetPolishCmd) << 276 else if( command == SetPhotonDetPolishCmd ) { 271 fDetector->SetPhotonDetPolish(G4UIcmdWithA << 277 >> 278 Detector->SetPhotonDetPolish(G4UIcmdWithADouble::GetNewDoubleValue(val)); 272 } 279 } 273 else if (command == fSetPhotonDetReflectivit << 280 else if( command == SetPhotonDetReflectivityCmd ) { 274 fDetector->SetPhotonDetReflectivity(G4UIcm << 281 >> 282 Detector-> >> 283 SetPhotonDetReflectivity(G4UIcmdWithADouble::GetNewDoubleValue(val)); 275 } 284 } 276 else if (command == fSetWLSLengthCmd) { << 285 else if( command == SetWLSLengthCmd ) { 277 fDetector->SetWLSLength(G4UIcmdWithADouble << 286 >> 287 Detector->SetWLSLength(G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(val)); 278 } 288 } 279 else if (command == fSetWLSRadiusCmd) { << 289 else if( command == SetWLSRadiusCmd ) { 280 fDetector->SetWLSRadius(G4UIcmdWithADouble << 290 >> 291 Detector->SetWLSRadius(G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(val)); 281 } 292 } 282 else if (command == fSetClad1RadiusCmd) { << 293 else if( command == SetClad1RadiusCmd ) { 283 fDetector->SetClad1Radius(G4UIcmdWithADoub << 294 >> 295 Detector-> >> 296 SetClad1Radius(G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(val)); 284 } 297 } 285 else if (command == fSetClad2RadiusCmd) { << 298 else if( command == SetClad2RadiusCmd ) { 286 fDetector->SetClad2Radius(G4UIcmdWithADoub << 299 >> 300 Detector-> >> 301 SetClad2Radius(G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(val)); 287 } 302 } 288 else if (command == fSetPhotonDetHalfLengthC << 303 else if( command == SetPhotonDetHalfLengthCmd ) { 289 fDetector->SetPhotonDetHalfLength(G4UIcmdW << 304 >> 305 Detector-> >> 306 SetPhotonDetHalfLength(G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(val)); 290 } 307 } 291 else if (command == fSetGapCmd) { << 308 else if( command == SetGapCmd ) { 292 fDetector->SetGap(G4UIcmdWithADoubleAndUni << 309 >> 310 Detector->SetGap(G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(val)); 293 } 311 } 294 else if (command == fSetPhotonDetAlignmentCm << 312 else if( command == SetPhotonDetAlignmentCmd ) { 295 fDetector->SetPhotonDetAlignment(G4UIcmdWi << 313 >> 314 Detector-> >> 315 SetPhotonDetAlignment(G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(val)); 296 } 316 } 297 else if (command == fSetMirrorCmd) { << 317 else if( command == SetMirrorCmd ) { 298 fDetector->SetMirror(G4UIcmdWithABool::Get << 318 >> 319 Detector->SetMirror(G4UIcmdWithABool::GetNewBoolValue(val)); 299 } 320 } 300 else if (command == fSetBarLengthCmd) { << 321 else if( command == SetBarLengthCmd ) { 301 fDetector->SetBarLength(G4UIcmdWithADouble << 322 >> 323 Detector->SetBarLength(G4UIcmdWithABool::GetNewBoolValue(val)); 302 } 324 } 303 else if (command == fSetBarBaseCmd) { << 325 else if( command == SetBarBaseCmd ) { 304 fDetector->SetBarBase(G4UIcmdWithADoubleAn << 326 >> 327 Detector->SetBarBase(G4UIcmdWithABool::GetNewBoolValue(val)); 305 } 328 } 306 else if (command == fSetHoleRadiusCmd) { << 329 else if( command == SetHoleRadiusCmd ) { 307 fDetector->SetHoleRadius(G4UIcmdWithADoubl << 330 >> 331 Detector->SetHoleRadius(G4UIcmdWithABool::GetNewBoolValue(val)); 308 } 332 } 309 else if (command == fSetCoatingThicknessCmd) << 333 else if( command == SetCoatingThicknessCmd ) { 310 fDetector->SetCoatingThickness(G4UIcmdWith << 334 >> 335 Detector->SetCoatingThickness(G4UIcmdWithABool::GetNewBoolValue(val)); 311 } 336 } 312 else if (command == fSetCoatingRadiusCmd) { << 337 else if( command == SetCoatingRadiusCmd ) { 313 fDetector->SetCoatingRadius(G4UIcmdWithADo << 338 >> 339 Detector->SetCoatingRadius(G4UIcmdWithABool::GetNewBoolValue(val)); 314 } 340 } 315 } 341 } 316 342