Loading...
Searching...
No Matches
WLSDetectorMessenger.cc
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26//
27/// \file optical/wls/src/WLSDetectorMessenger.cc
28/// \brief Implementation of the WLSDetectorMessenger class
29//
30//
32
33#include "G4UIcmdWithABool.hh"
34#include "G4UIcmdWithADouble.hh"
35#include "G4UIcmdWithADoubleAndUnit.hh"
36#include "G4UIcmdWithAnInteger.hh"
37#include "G4UIcmdWithAString.hh"
38#include "G4UIcmdWithoutParameter.hh"
39#include "G4UIdirectory.hh"
40
41//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
42
44 : fDetector(det)
45{
46 fDetDir = new G4UIdirectory("/WLS/");
47 fDetDir->SetGuidance(" Geometry Setup ");
48
50 new G4UIcmdWithAString("/WLS/setPhotonDetGeometry", this);
51 fSetPhotonDetGeometryCmd->SetGuidance(
52 "Select the geometry of the PhotonDet detector");
53 fSetPhotonDetGeometryCmd->SetGuidance("Only Accepts 'Circle' and 'Square'");
54 fSetPhotonDetGeometryCmd->SetCandidates("Circle Square");
55 fSetPhotonDetGeometryCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
56 fSetPhotonDetGeometryCmd->SetToBeBroadcasted(false);
57
59 new G4UIcmdWithAnInteger("/WLS/setNumOfLayers", this);
60 fSetNumOfCladLayersCmd->SetGuidance("Select the number of cladding layers");
61 fSetNumOfCladLayersCmd->SetGuidance("Maximum number is 2");
62 fSetNumOfCladLayersCmd->SetParameterName("numberOfLayers", false);
63 fSetNumOfCladLayersCmd->SetRange("numberOfLayers>=0 && numberOfLayers<=2");
64 fSetNumOfCladLayersCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
65 fSetNumOfCladLayersCmd->SetToBeBroadcasted(false);
66
68 new G4UIcmdWithADouble("/WLS/setSurfaceRoughness", this);
69 fSetSurfaceRoughnessCmd->SetGuidance(
70 "Set the roughness between Clad1 and WLS Fiber");
71 fSetSurfaceRoughnessCmd->SetParameterName("roughness", false);
72 fSetSurfaceRoughnessCmd->SetRange("roughness>0 && roughness<=1");
73 fSetSurfaceRoughnessCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
74 fSetSurfaceRoughnessCmd->SetToBeBroadcasted(false);
75
76 fSetXYRatioCmd = new G4UIcmdWithADouble("/WLS/setXYRatio", this);
77 fSetXYRatioCmd->SetGuidance("Set the ratio between x and y axis (x/y)");
78 fSetXYRatioCmd->SetParameterName("ratio", false);
79 fSetXYRatioCmd->SetRange("ratio>0 && ratio<=1");
80 fSetXYRatioCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
81 fSetXYRatioCmd->SetToBeBroadcasted(false);
82
83 fSetMirrorPolishCmd = new G4UIcmdWithADouble("/WLS/setMirrorPolish", this);
84 fSetMirrorPolishCmd->SetGuidance("Set the polish of the mirror");
85 fSetMirrorPolishCmd->SetParameterName("polish", false);
86 fSetMirrorPolishCmd->SetRange("polish>0 && polish<=1");
87 fSetMirrorPolishCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
88 fSetMirrorPolishCmd->SetToBeBroadcasted(false);
89
91 new G4UIcmdWithADouble("/WLS/setMirrorReflectivity", this);
92 fSetMirrorReflectivityCmd->SetGuidance("Set the reflectivity of the mirror");
93 fSetMirrorReflectivityCmd->SetParameterName("reflectivity", false);
94 fSetMirrorReflectivityCmd->SetRange("reflectivity>=0 && reflectivity<=1");
95 fSetMirrorReflectivityCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
96 fSetMirrorReflectivityCmd->SetToBeBroadcasted(false);
97
99 new G4UIcmdWithADouble("/WLS/setPhotonDetPolish", this);
100 fSetPhotonDetPolishCmd->SetGuidance("Set the polish of the mirror");
101 fSetPhotonDetPolishCmd->SetParameterName("polish", false);
102 fSetPhotonDetPolishCmd->SetRange("polish>0 && polish<=1");
103 fSetPhotonDetPolishCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
104 fSetPhotonDetPolishCmd->SetToBeBroadcasted(false);
105
107 new G4UIcmdWithADouble("/WLS/setPhotonDetReflectivity", this);
108 fSetPhotonDetReflectivityCmd->SetGuidance(
109 "Set the reflectivity of the mirror");
110 fSetPhotonDetReflectivityCmd->SetParameterName("reflectivity", false);
111 fSetPhotonDetReflectivityCmd->SetRange("reflectivity>=0 && reflectivity<=1");
112 fSetPhotonDetReflectivityCmd->AvailableForStates(G4State_PreInit);
113 fSetPhotonDetReflectivityCmd->SetToBeBroadcasted(false);
114
115 fSetWLSLengthCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setWLSLength", this);
116 fSetWLSLengthCmd->SetGuidance("Set the half length of the WLS fiber");
117 fSetWLSLengthCmd->SetParameterName("length", false);
118 fSetWLSLengthCmd->SetRange("length>0.");
119 fSetWLSLengthCmd->SetUnitCategory("Length");
120 fSetWLSLengthCmd->SetDefaultUnit("mm");
121 fSetWLSLengthCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
122 fSetWLSLengthCmd->SetToBeBroadcasted(false);
123
124 fSetWLSRadiusCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setWLSRadius", this);
125 fSetWLSRadiusCmd->SetGuidance("Set the radius of the WLS fiber");
126 fSetWLSRadiusCmd->SetParameterName("radius", false);
127 fSetWLSRadiusCmd->SetRange("radius>0.");
128 fSetWLSRadiusCmd->SetUnitCategory("Length");
129 fSetWLSRadiusCmd->SetDefaultUnit("mm");
130 fSetWLSRadiusCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
131 fSetWLSRadiusCmd->SetToBeBroadcasted(false);
132
134 new G4UIcmdWithADoubleAndUnit("/WLS/setClad1Radius", this);
135 fSetClad1RadiusCmd->SetGuidance("Set the radius of Cladding 1");
136 fSetClad1RadiusCmd->SetParameterName("radius", false);
137 fSetClad1RadiusCmd->SetRange("radius>0.");
138 fSetClad1RadiusCmd->SetUnitCategory("Length");
139 fSetClad1RadiusCmd->SetDefaultUnit("mm");
140 fSetClad1RadiusCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
141 fSetClad1RadiusCmd->SetToBeBroadcasted(false);
142
144 new G4UIcmdWithADoubleAndUnit("/WLS/setClad2Radius", this);
145 fSetClad2RadiusCmd->SetGuidance("Set the radius of Cladding 2");
146 fSetClad2RadiusCmd->SetParameterName("radius", false);
147 fSetClad2RadiusCmd->SetRange("radius>0.");
148 fSetClad2RadiusCmd->SetUnitCategory("Length");
149 fSetClad2RadiusCmd->SetDefaultUnit("mm");
150 fSetClad2RadiusCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
151 fSetClad2RadiusCmd->SetToBeBroadcasted(false);
152
154 new G4UIcmdWithADoubleAndUnit("/WLS/setPhotonDetHalfLength", this);
155 fSetPhotonDetHalfLengthCmd->SetGuidance(
156 "Set the half length of PhotonDet detector");
157 fSetPhotonDetHalfLengthCmd->SetParameterName("halfL", false);
158 fSetPhotonDetHalfLengthCmd->SetRange("halfL>0.");
159 fSetPhotonDetHalfLengthCmd->SetUnitCategory("Length");
160 fSetPhotonDetHalfLengthCmd->SetDefaultUnit("mm");
161 fSetPhotonDetHalfLengthCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
162 fSetPhotonDetHalfLengthCmd->SetToBeBroadcasted(false);
163
164 fSetGapCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setGap", this);
165 fSetGapCmd->SetGuidance("Set the distance between PhotonDet and fiber end");
166 fSetGapCmd->SetParameterName("theta", false);
167 fSetGapCmd->SetUnitCategory("Length");
168 fSetGapCmd->SetDefaultUnit("mm");
169 fSetGapCmd->SetRange("theta>=0.");
170 fSetGapCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
171 fSetGapCmd->SetToBeBroadcasted(false);
172
174 new G4UIcmdWithADoubleAndUnit("/WLS/setAlignment", this);
175 fSetPhotonDetAlignmentCmd->SetGuidance(
176 "Set the deviation of PhotonDet from z axis");
177 fSetPhotonDetAlignmentCmd->SetParameterName("theta", false);
178 fSetPhotonDetAlignmentCmd->SetUnitCategory("Angle");
179 fSetPhotonDetAlignmentCmd->SetDefaultUnit("deg");
180 fSetPhotonDetAlignmentCmd->SetRange("theta>-90. && theta<90.");
181 fSetPhotonDetAlignmentCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
182 fSetPhotonDetAlignmentCmd->SetToBeBroadcasted(false);
183
184 fSetMirrorCmd = new G4UIcmdWithABool("/WLS/setMirror", this);
185 fSetMirrorCmd->SetGuidance("Place a mirror at the end of the fiber");
186 fSetMirrorCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
187 fSetMirrorCmd->SetToBeBroadcasted(false);
188
189 fSetBarLengthCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setBarLength", this);
190 fSetBarLengthCmd->SetGuidance("Set the length of the scintillator bar");
191 fSetBarLengthCmd->SetParameterName("length", false);
192 fSetBarLengthCmd->SetRange("length>0.");
193 fSetBarLengthCmd->SetUnitCategory("Length");
194 fSetBarLengthCmd->SetDefaultUnit("mm");
195 fSetBarLengthCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
196 fSetBarLengthCmd->SetToBeBroadcasted(false);
197
198 fSetBarBaseCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setBarBase", this);
199 fSetBarBaseCmd->SetGuidance("Set the side length of the scintillator bar");
200 fSetBarBaseCmd->SetParameterName("length", false);
201 fSetBarBaseCmd->SetRange("length>0.");
202 fSetBarBaseCmd->SetUnitCategory("Length");
203 fSetBarBaseCmd->SetDefaultUnit("mm");
204 fSetBarBaseCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
205 fSetBarBaseCmd->SetToBeBroadcasted(false);
206
207 fSetHoleRadiusCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setHoleRadius", this);
208 fSetHoleRadiusCmd->SetGuidance("Set the radius of the fiber hole");
209 fSetHoleRadiusCmd->SetParameterName("radius", false);
210 fSetHoleRadiusCmd->SetRange("radius>0.");
211 fSetHoleRadiusCmd->SetUnitCategory("Length");
212 fSetHoleRadiusCmd->SetDefaultUnit("mm");
213 fSetHoleRadiusCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
214 fSetHoleRadiusCmd->SetToBeBroadcasted(false);
215
217 new G4UIcmdWithADoubleAndUnit("/WLS/setCoatingThickness", this);
218 fSetCoatingThicknessCmd->SetGuidance(
219 "Set thickness of the coating on the bars");
220 fSetCoatingThicknessCmd->SetParameterName("thick", false);
221 fSetCoatingThicknessCmd->SetUnitCategory("Length");
222 fSetCoatingThicknessCmd->SetDefaultUnit("mm");
223 fSetCoatingThicknessCmd->SetRange("thick>=0.");
224 fSetCoatingThicknessCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
225 fSetCoatingThicknessCmd->SetToBeBroadcasted(false);
226
228 new G4UIcmdWithADoubleAndUnit("/WLS/setCoatingRadius", this);
229 fSetCoatingRadiusCmd->SetGuidance(
230 "Set inner radius of the corner bar coating");
231 fSetCoatingRadiusCmd->SetParameterName("cradius", false);
232 fSetCoatingRadiusCmd->SetUnitCategory("Length");
233 fSetCoatingRadiusCmd->SetDefaultUnit("mm");
234 fSetCoatingRadiusCmd->SetRange("cradius>=0.");
235 fSetCoatingRadiusCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
236 fSetCoatingRadiusCmd->SetToBeBroadcasted(false);
237}
238
239//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
240
267
268//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
269
271{
272 if(command == fSetPhotonDetGeometryCmd)
273 {
275 }
276 else if(command == fSetNumOfCladLayersCmd)
277 {
278 fDetector->SetNumberOfCladding(G4UIcmdWithAnInteger::GetNewIntValue(val));
279 }
280 else if(command == fSetSurfaceRoughnessCmd)
281 {
282 fDetector->SetSurfaceRoughness(G4UIcmdWithADouble::GetNewDoubleValue(val));
283 }
284 else if(command == fSetXYRatioCmd)
285 {
286 fDetector->SetXYRatio(G4UIcmdWithADouble::GetNewDoubleValue(val));
287 }
288 else if(command == fSetMirrorPolishCmd)
289 {
290 fDetector->SetMirrorPolish(G4UIcmdWithADouble::GetNewDoubleValue(val));
291 }
292 else if(command == fSetMirrorReflectivityCmd)
293 {
295 G4UIcmdWithADouble::GetNewDoubleValue(val));
296 }
297 else if(command == fSetPhotonDetPolishCmd)
298 {
299 fDetector->SetPhotonDetPolish(G4UIcmdWithADouble::GetNewDoubleValue(val));
300 }
301 else if(command == fSetPhotonDetReflectivityCmd)
302 {
304 G4UIcmdWithADouble::GetNewDoubleValue(val));
305 }
306 else if(command == fSetWLSLengthCmd)
307 {
308 fDetector->SetWLSLength(G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(val));
309 }
310 else if(command == fSetWLSRadiusCmd)
311 {
312 fDetector->SetWLSRadius(G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(val));
313 }
314 else if(command == fSetClad1RadiusCmd)
315 {
317 G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(val));
318 }
319 else if(command == fSetClad2RadiusCmd)
320 {
322 G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(val));
323 }
324 else if(command == fSetPhotonDetHalfLengthCmd)
325 {
327 G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(val));
328 }
329 else if(command == fSetGapCmd)
330 {
331 fDetector->SetGap(G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(val));
332 }
333 else if(command == fSetPhotonDetAlignmentCmd)
334 {
336 G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(val));
337 }
338 else if(command == fSetMirrorCmd)
339 {
340 fDetector->SetMirror(G4UIcmdWithABool::GetNewBoolValue(val));
341 }
342 else if(command == fSetBarLengthCmd)
343 {
344 fDetector->SetBarLength(G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(val));
345 }
346 else if(command == fSetBarBaseCmd)
347 {
348 fDetector->SetBarBase(G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(val));
349 }
350 else if(command == fSetHoleRadiusCmd)
351 {
353 G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(val));
354 }
355 else if(command == fSetCoatingThicknessCmd)
356 {
358 G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(val));
359 }
360 else if(command == fSetCoatingRadiusCmd)
361 {
363 G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(val));
364 }
365}
Definition of the WLSDetectorMessenger class.
G4UIcmdWithADoubleAndUnit * fSetWLSRadiusCmd
G4UIcmdWithADoubleAndUnit * fSetCoatingRadiusCmd
void SetNewValue(G4UIcommand *, G4String) override
WLSDetectorConstruction * fDetector
G4UIcmdWithADouble * fSetPhotonDetPolishCmd
G4UIcmdWithADoubleAndUnit * fSetHoleRadiusCmd
G4UIcmdWithADouble * fSetMirrorPolishCmd
G4UIcmdWithADouble * fSetXYRatioCmd
G4UIcmdWithABool * fSetMirrorCmd
G4UIcmdWithADoubleAndUnit * fSetClad2RadiusCmd
G4UIcmdWithADouble * fSetSurfaceRoughnessCmd
WLSDetectorMessenger(WLSDetectorConstruction *)
G4UIcmdWithADoubleAndUnit * fSetWLSLengthCmd
G4UIcmdWithADoubleAndUnit * fSetBarBaseCmd
G4UIcmdWithAString * fSetPhotonDetGeometryCmd
G4UIcmdWithAnInteger * fSetNumOfCladLayersCmd
G4UIcmdWithADouble * fSetMirrorReflectivityCmd
G4UIcmdWithADouble * fSetPhotonDetReflectivityCmd
G4UIcmdWithADoubleAndUnit * fSetGapCmd
G4UIcmdWithADoubleAndUnit * fSetClad1RadiusCmd
G4UIcmdWithADoubleAndUnit * fSetBarLengthCmd
G4UIcmdWithADoubleAndUnit * fSetPhotonDetAlignmentCmd
G4UIcmdWithADoubleAndUnit * fSetCoatingThicknessCmd
G4UIcmdWithADoubleAndUnit * fSetPhotonDetHalfLengthCmd

Applications | User Support | Publications | Collaboration