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