Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 //
28 //
29 //
30 //
31 
32 #include "WLSDetectorMessenger.hh"
33 
34 #include "G4UIdirectory.hh"
35 #include "G4UIcmdWithABool.hh"
36 #include "G4UIcmdWithAString.hh"
37 #include "G4UIcmdWithADouble.hh"
38 #include "G4UIcmdWithAnInteger.hh"
41 
43  : Detector(Det)
44 {
45  detDir = new G4UIdirectory("/WLS/");
46  detDir->SetGuidance(" Geometry Setup ");
47 
48  UpdateCmd = new G4UIcmdWithoutParameter("/WLS/Update",this);
49  UpdateCmd->SetGuidance("Update musr geometry");
50  UpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
51  UpdateCmd->SetGuidance("if you changed geometrical value(s).");
52  UpdateCmd->AvailableForStates(G4State_Idle);
53 
54  SetPhotonDetGeometryCmd =
55  new G4UIcmdWithAString("/WLS/setPhotonDetGeometry",this);
56  SetPhotonDetGeometryCmd->
57  SetGuidance("Select the geometry of the PhotonDet detector");
58  SetPhotonDetGeometryCmd->SetGuidance("Only Accepts 'Circle' and 'Square'");
59  SetPhotonDetGeometryCmd->SetCandidates("Circle Square");
60  SetPhotonDetGeometryCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
61 
62  SetNumOfCladLayersCmd = new G4UIcmdWithAnInteger("/WLS/setNumOfLayers", this);
63  SetNumOfCladLayersCmd->SetGuidance("Select the number of cladding layers");
64  SetNumOfCladLayersCmd->SetGuidance("Maximum number is 2");
65  SetNumOfCladLayersCmd->SetParameterName("numberOfLayers",false);
66  SetNumOfCladLayersCmd->SetRange("numberOfLayers>=0 && numberOfLayers<=2");
67  SetNumOfCladLayersCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
68 
69  SetSurfaceRoughnessCmd =
70  new G4UIcmdWithADouble("/WLS/setSurfaceRoughness", this);
71  SetSurfaceRoughnessCmd->
72  SetGuidance("Set the roughness between Clad1 and WLS Fiber");
73  SetSurfaceRoughnessCmd->SetParameterName("roughness",false);
74  SetSurfaceRoughnessCmd->SetRange("roughness>0 && roughness<=1");
75  SetSurfaceRoughnessCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
76 
77  SetXYRatioCmd = new G4UIcmdWithADouble("/WLS/setXYRatio", this);
78  SetXYRatioCmd->SetGuidance("Set the ratio between x and y axis (x/y)");
79  SetXYRatioCmd->SetParameterName("ratio",false);
80  SetXYRatioCmd->SetRange("ratio>0 && ratio<=1");
82 
83  SetMirrorPolishCmd = new G4UIcmdWithADouble("/WLS/setMirrorPolish", this);
84  SetMirrorPolishCmd->SetGuidance("Set the polish of the mirror");
85  SetMirrorPolishCmd->SetParameterName("polish",false);
86  SetMirrorPolishCmd->SetRange("polish>0 && polish<=1");
87  SetMirrorPolishCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
88 
89  SetMirrorReflectivityCmd =
90  new G4UIcmdWithADouble("/WLS/setMirrorReflectivity", this);
91  SetMirrorReflectivityCmd->SetGuidance("Set the reflectivity of the mirror");
92  SetMirrorReflectivityCmd->SetParameterName("reflectivity",false);
93  SetMirrorReflectivityCmd->SetRange("reflectivity>=0 && reflectivity<=1");
94  SetMirrorReflectivityCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
95 
96  SetPhotonDetPolishCmd =
97  new G4UIcmdWithADouble("/WLS/setPhotonDetPolish", this);
98  SetPhotonDetPolishCmd->SetGuidance("Set the polish of the mirror");
99  SetPhotonDetPolishCmd->SetParameterName("polish",false);
100  SetPhotonDetPolishCmd->SetRange("polish>0 && polish<=1");
101  SetPhotonDetPolishCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
102 
103  SetPhotonDetReflectivityCmd =
104  new G4UIcmdWithADouble("/WLS/setPhotonDetReflectivity", this);
105  SetPhotonDetReflectivityCmd->
106  SetGuidance("Set the reflectivity of the mirror");
107  SetPhotonDetReflectivityCmd->SetParameterName("reflectivity",false);
108  SetPhotonDetReflectivityCmd->SetRange("reflectivity>=0 && reflectivity<=1");
109  SetPhotonDetReflectivityCmd->AvailableForStates(G4State_PreInit);
110 
111  SetWLSLengthCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setWLSLength",this);
112  SetWLSLengthCmd->SetGuidance("Set the half length of the WLS fiber");
113  SetWLSLengthCmd->SetParameterName("length",false);
114  SetWLSLengthCmd->SetRange("length>0.");
115  SetWLSLengthCmd->SetUnitCategory("Length");
116  SetWLSLengthCmd->SetDefaultUnit("mm");
118 
119  SetWLSRadiusCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setWLSRadius",this);
120  SetWLSRadiusCmd->SetGuidance("Set the radius of the WLS fiber");
121  SetWLSRadiusCmd->SetParameterName("radius",false);
122  SetWLSRadiusCmd->SetRange("radius>0.");
123  SetWLSRadiusCmd->SetUnitCategory("Length");
124  SetWLSRadiusCmd->SetDefaultUnit("mm");
126 
127  SetClad1RadiusCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setClad1Radius",this);
128  SetClad1RadiusCmd->SetGuidance("Set the radius of Cladding 1");
129  SetClad1RadiusCmd->SetParameterName("radius",false);
130  SetClad1RadiusCmd->SetRange("radius>0.");
131  SetClad1RadiusCmd->SetUnitCategory("Length");
132  SetClad1RadiusCmd->SetDefaultUnit("mm");
133  SetClad1RadiusCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
134 
135  SetClad2RadiusCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setClad2Radius",this);
136  SetClad2RadiusCmd->SetGuidance("Set the radius of Cladding 2");
137  SetClad2RadiusCmd->SetParameterName("radius",false);
138  SetClad2RadiusCmd->SetRange("radius>0.");
139  SetClad2RadiusCmd->SetUnitCategory("Length");
140  SetClad2RadiusCmd->SetDefaultUnit("mm");
141  SetClad2RadiusCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
142 
143  SetPhotonDetHalfLengthCmd =
144  new G4UIcmdWithADoubleAndUnit("/WLS/setPhotonDetHalfLength",this);
145  SetPhotonDetHalfLengthCmd->
146  SetGuidance("Set the half length of PhotonDet detector");
147  SetPhotonDetHalfLengthCmd->SetParameterName("halfL",false);
148  SetPhotonDetHalfLengthCmd->SetRange("halfL>0.");
149  SetPhotonDetHalfLengthCmd->SetUnitCategory("Length");
150  SetPhotonDetHalfLengthCmd->SetDefaultUnit("mm");
151  SetPhotonDetHalfLengthCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
152 
153  SetGapCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setGap",this);
154  SetGapCmd->SetGuidance("Set the distance between PhotonDet and fiber end");
155  SetGapCmd->SetParameterName("theta",false);
156  SetGapCmd->SetUnitCategory("Length");
157  SetGapCmd->SetDefaultUnit("mm");
158  SetGapCmd->SetRange("theta>=0.");
160 
161  SetPhotonDetAlignmentCmd =
162  new G4UIcmdWithADoubleAndUnit("/WLS/setAlignment",this);
163  SetPhotonDetAlignmentCmd->
164  SetGuidance("Set the deviation of PhotonDet from z axis");
165  SetPhotonDetAlignmentCmd->SetParameterName("theta",false);
166  SetPhotonDetAlignmentCmd->SetUnitCategory("Angle");
167  SetPhotonDetAlignmentCmd->SetDefaultUnit("deg");
168  SetPhotonDetAlignmentCmd->SetRange("theta>-90. && theta<90.");
169  SetPhotonDetAlignmentCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
170 
171  SetMirrorCmd = new G4UIcmdWithABool("/WLS/setMirror", this);
172  SetMirrorCmd->SetGuidance("Place a mirror at the end of the fiber");
174 
175  SetBarLengthCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setBarLength",this);
176  SetBarLengthCmd->SetGuidance("Set the length of the scintillator bar");
177  SetBarLengthCmd->SetParameterName("length",false);
178  SetBarLengthCmd->SetRange("length>0.");
179  SetBarLengthCmd->SetUnitCategory("Length");
180  SetBarLengthCmd->SetDefaultUnit("mm");
182 
183  SetBarBaseCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setBarBase",this);
184  SetBarBaseCmd->SetGuidance("Set the side length of the scintillator bar");
185  SetBarBaseCmd->SetParameterName("length",false);
186  SetBarBaseCmd->SetRange("length>0.");
187  SetBarBaseCmd->SetUnitCategory("Length");
188  SetBarBaseCmd->SetDefaultUnit("mm");
190 
191  SetHoleRadiusCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setHoleRadius",this);
192  SetHoleRadiusCmd->SetGuidance("Set the radius of the fiber hole");
193  SetHoleRadiusCmd->SetParameterName("radius",false);
194  SetHoleRadiusCmd->SetRange("radius>0.");
195  SetHoleRadiusCmd->SetUnitCategory("Length");
196  SetHoleRadiusCmd->SetDefaultUnit("mm");
198 
199  SetCoatingThicknessCmd =
200  new G4UIcmdWithADoubleAndUnit("/WLS/setCoatingThickness",this);
201  SetCoatingThicknessCmd->
202  SetGuidance("Set thickness of the coating on the bars");
203  SetCoatingThicknessCmd->SetParameterName("thick",false);
204  SetCoatingThicknessCmd->SetUnitCategory("Length");
205  SetCoatingThicknessCmd->SetDefaultUnit("mm");
206  SetCoatingThicknessCmd->SetRange("thick>=0.");
207  SetCoatingThicknessCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
208 
209  SetCoatingRadiusCmd =
210  new G4UIcmdWithADoubleAndUnit("/WLS/setCoatingRadius",this);
211  SetCoatingRadiusCmd->
212  SetGuidance("Set inner radius of the corner bar coating");
213  SetCoatingRadiusCmd->SetParameterName("cradius",false);
214  SetCoatingRadiusCmd->SetUnitCategory("Length");
215  SetCoatingRadiusCmd->SetDefaultUnit("mm");
216  SetCoatingRadiusCmd->SetRange("cradius>=0.");
217  SetCoatingRadiusCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
218 
219 }
220 
222 {
223  delete detDir;
224 
225  delete UpdateCmd;
226 
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 }
247 
249 {
250  if( command == UpdateCmd ) {
251 
252  Detector->UpdateGeometry();
253  }
254  else if( command == SetPhotonDetGeometryCmd ) {
255 
256  Detector->SetPhotonDetGeometry(val);
257  }
258  else if( command == SetNumOfCladLayersCmd ) {
259 
261  }
262  else if( command == SetSurfaceRoughnessCmd ) {
263 
265  }
266  else if( command == SetXYRatioCmd ) {
267 
269  }
270  else if( command == SetMirrorPolishCmd ) {
271 
273  }
274  else if( command == SetMirrorReflectivityCmd ) {
275 
276  Detector->
277  SetMirrorReflectivity(G4UIcmdWithADouble::GetNewDoubleValue(val));
278  }
279  else if( command == SetPhotonDetPolishCmd ) {
280 
282  }
283  else if( command == SetPhotonDetReflectivityCmd ) {
284 
285  Detector->
286  SetPhotonDetReflectivity(G4UIcmdWithADouble::GetNewDoubleValue(val));
287  }
288  else if( command == SetWLSLengthCmd ) {
289 
291  }
292  else if( command == SetWLSRadiusCmd ) {
293 
295  }
296  else if( command == SetClad1RadiusCmd ) {
297 
298  Detector->
300  }
301  else if( command == SetClad2RadiusCmd ) {
302 
303  Detector->
305  }
306  else if( command == SetPhotonDetHalfLengthCmd ) {
307 
308  Detector->
309  SetPhotonDetHalfLength(G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(val));
310  }
311  else if( command == SetGapCmd ) {
312 
314  }
315  else if( command == SetPhotonDetAlignmentCmd ) {
316 
317  Detector->
318  SetPhotonDetAlignment(G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(val));
319  }
320  else if( command == SetMirrorCmd ) {
321 
323  }
324  else if( command == SetBarLengthCmd ) {
325 
327  }
328  else if( command == SetBarBaseCmd ) {
329 
331  }
332  else if( command == SetHoleRadiusCmd ) {
333 
335  }
336  else if( command == SetCoatingThicknessCmd ) {
337 
339  }
340  else if( command == SetCoatingRadiusCmd ) {
341 
343  }
344 }