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