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