Geant4  10.03.p03
 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 //
26 // $Id: WLSDetectorMessenger.cc 84595 2014-10-17 07:33:27Z gcosmo $
27 //
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 
42 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
43 
45  : fDetector(det)
46 {
47  fDetDir = new G4UIdirectory("/WLS/");
48  fDetDir->SetGuidance(" Geometry Setup ");
49 
50  fSetPhotonDetGeometryCmd =
51  new G4UIcmdWithAString("/WLS/setPhotonDetGeometry",this);
52  fSetPhotonDetGeometryCmd->
53  SetGuidance("Select the geometry of the PhotonDet detector");
54  fSetPhotonDetGeometryCmd->SetGuidance("Only Accepts 'Circle' and 'Square'");
55  fSetPhotonDetGeometryCmd->SetCandidates("Circle Square");
56  fSetPhotonDetGeometryCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
57  fSetPhotonDetGeometryCmd->SetToBeBroadcasted(false);
58 
59  fSetNumOfCladLayersCmd =
60  new G4UIcmdWithAnInteger("/WLS/setNumOfLayers", this);
61  fSetNumOfCladLayersCmd->SetGuidance("Select the number of cladding layers");
62  fSetNumOfCladLayersCmd->SetGuidance("Maximum number is 2");
63  fSetNumOfCladLayersCmd->SetParameterName("numberOfLayers",false);
64  fSetNumOfCladLayersCmd->SetRange("numberOfLayers>=0 && numberOfLayers<=2");
65  fSetNumOfCladLayersCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
66  fSetNumOfCladLayersCmd->SetToBeBroadcasted(false);
67 
68  fSetSurfaceRoughnessCmd =
69  new G4UIcmdWithADouble("/WLS/setSurfaceRoughness", this);
70  fSetSurfaceRoughnessCmd->
71  SetGuidance("Set the roughness between Clad1 and WLS Fiber");
72  fSetSurfaceRoughnessCmd->SetParameterName("roughness",false);
73  fSetSurfaceRoughnessCmd->SetRange("roughness>0 && roughness<=1");
74  fSetSurfaceRoughnessCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
75  fSetSurfaceRoughnessCmd->SetToBeBroadcasted(false);
76 
77  fSetXYRatioCmd = new G4UIcmdWithADouble("/WLS/setXYRatio", this);
78  fSetXYRatioCmd->SetGuidance("Set the ratio between x and y axis (x/y)");
79  fSetXYRatioCmd->SetParameterName("ratio",false);
80  fSetXYRatioCmd->SetRange("ratio>0 && ratio<=1");
82  fSetXYRatioCmd->SetToBeBroadcasted(false);
83 
84  fSetMirrorPolishCmd = new G4UIcmdWithADouble("/WLS/setMirrorPolish", this);
85  fSetMirrorPolishCmd->SetGuidance("Set the polish of the mirror");
86  fSetMirrorPolishCmd->SetParameterName("polish",false);
87  fSetMirrorPolishCmd->SetRange("polish>0 && polish<=1");
88  fSetMirrorPolishCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
89  fSetMirrorPolishCmd->SetToBeBroadcasted(false);
90 
91  fSetMirrorReflectivityCmd =
92  new G4UIcmdWithADouble("/WLS/setMirrorReflectivity", this);
93  fSetMirrorReflectivityCmd->SetGuidance("Set the reflectivity of the mirror");
94  fSetMirrorReflectivityCmd->SetParameterName("reflectivity",false);
95  fSetMirrorReflectivityCmd->SetRange("reflectivity>=0 && reflectivity<=1");
96  fSetMirrorReflectivityCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
97  fSetMirrorReflectivityCmd->SetToBeBroadcasted(false);
98 
99  fSetPhotonDetPolishCmd =
100  new G4UIcmdWithADouble("/WLS/setPhotonDetPolish", this);
101  fSetPhotonDetPolishCmd->SetGuidance("Set the polish of the mirror");
102  fSetPhotonDetPolishCmd->SetParameterName("polish",false);
103  fSetPhotonDetPolishCmd->SetRange("polish>0 && polish<=1");
104  fSetPhotonDetPolishCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
105  fSetPhotonDetPolishCmd->SetToBeBroadcasted(false);
106 
107  fSetPhotonDetReflectivityCmd =
108  new G4UIcmdWithADouble("/WLS/setPhotonDetReflectivity", this);
109  fSetPhotonDetReflectivityCmd->
110  SetGuidance("Set the reflectivity of the mirror");
111  fSetPhotonDetReflectivityCmd->SetParameterName("reflectivity",false);
112  fSetPhotonDetReflectivityCmd->SetRange("reflectivity>=0 && reflectivity<=1");
113  fSetPhotonDetReflectivityCmd->AvailableForStates(G4State_PreInit);
114  fSetPhotonDetReflectivityCmd->SetToBeBroadcasted(false);
115 
116  fSetWLSLengthCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setWLSLength",this);
117  fSetWLSLengthCmd->SetGuidance("Set the half length of the WLS fiber");
118  fSetWLSLengthCmd->SetParameterName("length",false);
119  fSetWLSLengthCmd->SetRange("length>0.");
120  fSetWLSLengthCmd->SetUnitCategory("Length");
121  fSetWLSLengthCmd->SetDefaultUnit("mm");
123  fSetWLSLengthCmd->SetToBeBroadcasted(false);
124 
125  fSetWLSRadiusCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setWLSRadius",this);
126  fSetWLSRadiusCmd->SetGuidance("Set the radius of the WLS fiber");
127  fSetWLSRadiusCmd->SetParameterName("radius",false);
128  fSetWLSRadiusCmd->SetRange("radius>0.");
129  fSetWLSRadiusCmd->SetUnitCategory("Length");
130  fSetWLSRadiusCmd->SetDefaultUnit("mm");
132  fSetWLSRadiusCmd->SetToBeBroadcasted(false);
133 
134  fSetClad1RadiusCmd =
135  new G4UIcmdWithADoubleAndUnit("/WLS/setClad1Radius",this);
136  fSetClad1RadiusCmd->SetGuidance("Set the radius of Cladding 1");
137  fSetClad1RadiusCmd->SetParameterName("radius",false);
138  fSetClad1RadiusCmd->SetRange("radius>0.");
139  fSetClad1RadiusCmd->SetUnitCategory("Length");
140  fSetClad1RadiusCmd->SetDefaultUnit("mm");
141  fSetClad1RadiusCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
142  fSetClad1RadiusCmd->SetToBeBroadcasted(false);
143 
144  fSetClad2RadiusCmd =
145  new G4UIcmdWithADoubleAndUnit("/WLS/setClad2Radius",this);
146  fSetClad2RadiusCmd->SetGuidance("Set the radius of Cladding 2");
147  fSetClad2RadiusCmd->SetParameterName("radius",false);
148  fSetClad2RadiusCmd->SetRange("radius>0.");
149  fSetClad2RadiusCmd->SetUnitCategory("Length");
150  fSetClad2RadiusCmd->SetDefaultUnit("mm");
151  fSetClad2RadiusCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
152  fSetClad2RadiusCmd->SetToBeBroadcasted(false);
153 
154  fSetPhotonDetHalfLengthCmd =
155  new G4UIcmdWithADoubleAndUnit("/WLS/setPhotonDetHalfLength",this);
156  fSetPhotonDetHalfLengthCmd->
157  SetGuidance("Set the half length of PhotonDet detector");
158  fSetPhotonDetHalfLengthCmd->SetParameterName("halfL",false);
159  fSetPhotonDetHalfLengthCmd->SetRange("halfL>0.");
160  fSetPhotonDetHalfLengthCmd->SetUnitCategory("Length");
161  fSetPhotonDetHalfLengthCmd->SetDefaultUnit("mm");
162  fSetPhotonDetHalfLengthCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
163  fSetPhotonDetHalfLengthCmd->SetToBeBroadcasted(false);
164 
165  fSetGapCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setGap",this);
166  fSetGapCmd->SetGuidance("Set the distance between PhotonDet and fiber end");
167  fSetGapCmd->SetParameterName("theta",false);
168  fSetGapCmd->SetUnitCategory("Length");
169  fSetGapCmd->SetDefaultUnit("mm");
170  fSetGapCmd->SetRange("theta>=0.");
172  fSetGapCmd->SetToBeBroadcasted(false);
173 
174  fSetPhotonDetAlignmentCmd =
175  new G4UIcmdWithADoubleAndUnit("/WLS/setAlignment",this);
176  fSetPhotonDetAlignmentCmd->
177  SetGuidance("Set the deviation of PhotonDet from z axis");
178  fSetPhotonDetAlignmentCmd->SetParameterName("theta",false);
179  fSetPhotonDetAlignmentCmd->SetUnitCategory("Angle");
180  fSetPhotonDetAlignmentCmd->SetDefaultUnit("deg");
181  fSetPhotonDetAlignmentCmd->SetRange("theta>-90. && theta<90.");
182  fSetPhotonDetAlignmentCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
183  fSetPhotonDetAlignmentCmd->SetToBeBroadcasted(false);
184 
185  fSetMirrorCmd = new G4UIcmdWithABool("/WLS/setMirror", this);
186  fSetMirrorCmd->SetGuidance("Place a mirror at the end of the fiber");
188  fSetMirrorCmd->SetToBeBroadcasted(false);
189 
190  fSetBarLengthCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setBarLength",this);
191  fSetBarLengthCmd->SetGuidance("Set the length of the scintillator bar");
192  fSetBarLengthCmd->SetParameterName("length",false);
193  fSetBarLengthCmd->SetRange("length>0.");
194  fSetBarLengthCmd->SetUnitCategory("Length");
195  fSetBarLengthCmd->SetDefaultUnit("mm");
197  fSetBarLengthCmd->SetToBeBroadcasted(false);
198 
199  fSetBarBaseCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setBarBase",this);
200  fSetBarBaseCmd->SetGuidance("Set the side length of the scintillator bar");
201  fSetBarBaseCmd->SetParameterName("length",false);
202  fSetBarBaseCmd->SetRange("length>0.");
203  fSetBarBaseCmd->SetUnitCategory("Length");
204  fSetBarBaseCmd->SetDefaultUnit("mm");
206  fSetBarBaseCmd->SetToBeBroadcasted(false);
207 
208  fSetHoleRadiusCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setHoleRadius",this);
209  fSetHoleRadiusCmd->SetGuidance("Set the radius of the fiber hole");
210  fSetHoleRadiusCmd->SetParameterName("radius",false);
211  fSetHoleRadiusCmd->SetRange("radius>0.");
212  fSetHoleRadiusCmd->SetUnitCategory("Length");
213  fSetHoleRadiusCmd->SetDefaultUnit("mm");
214  fSetHoleRadiusCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
215  fSetHoleRadiusCmd->SetToBeBroadcasted(false);
216 
217  fSetCoatingThicknessCmd =
218  new G4UIcmdWithADoubleAndUnit("/WLS/setCoatingThickness",this);
219  fSetCoatingThicknessCmd->
220  SetGuidance("Set thickness of the coating on the bars");
221  fSetCoatingThicknessCmd->SetParameterName("thick",false);
222  fSetCoatingThicknessCmd->SetUnitCategory("Length");
223  fSetCoatingThicknessCmd->SetDefaultUnit("mm");
224  fSetCoatingThicknessCmd->SetRange("thick>=0.");
225  fSetCoatingThicknessCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
226  fSetCoatingThicknessCmd->SetToBeBroadcasted(false);
227 
228  fSetCoatingRadiusCmd =
229  new G4UIcmdWithADoubleAndUnit("/WLS/setCoatingRadius",this);
230  fSetCoatingRadiusCmd->
231  SetGuidance("Set inner radius of the corner bar coating");
232  fSetCoatingRadiusCmd->SetParameterName("cradius",false);
233  fSetCoatingRadiusCmd->SetUnitCategory("Length");
234  fSetCoatingRadiusCmd->SetDefaultUnit("mm");
235  fSetCoatingRadiusCmd->SetRange("cradius>=0.");
236  fSetCoatingRadiusCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
237  fSetCoatingRadiusCmd->SetToBeBroadcasted(false);
238 }
239 
240 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
241 
243 {
244  delete fDetDir;
245 
246  delete fSetPhotonDetGeometryCmd;
247  delete fSetNumOfCladLayersCmd;
248  delete fSetWLSLengthCmd;
249  delete fSetWLSRadiusCmd;
250  delete fSetClad1RadiusCmd;
251  delete fSetClad2RadiusCmd;
252  delete fSetPhotonDetHalfLengthCmd;
253  delete fSetGapCmd;
254  delete fSetPhotonDetAlignmentCmd;
255  delete fSetSurfaceRoughnessCmd;
256  delete fSetMirrorPolishCmd;
257  delete fSetMirrorReflectivityCmd;
258  delete fSetXYRatioCmd;
259  delete fSetMirrorCmd;
260  delete fSetBarLengthCmd;
261  delete fSetBarBaseCmd;
262  delete fSetHoleRadiusCmd;
263  delete fSetCoatingThicknessCmd;
264  delete fSetCoatingRadiusCmd;
265 }
266 
267 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
268 
270 {
271  if( command == fSetPhotonDetGeometryCmd ) {
272 
273  fDetector->SetPhotonDetGeometry(val);
274  }
275  else if( command == fSetNumOfCladLayersCmd ) {
276 
278  }
279  else if( command == fSetSurfaceRoughnessCmd ) {
280 
282  }
283  else if( command == fSetXYRatioCmd ) {
284 
286  }
287  else if( command == fSetMirrorPolishCmd ) {
288 
290  }
291  else if( command == fSetMirrorReflectivityCmd ) {
292 
293  fDetector->
294  SetMirrorReflectivity(G4UIcmdWithADouble::GetNewDoubleValue(val));
295  }
296  else if( command == fSetPhotonDetPolishCmd ) {
297 
299  }
300  else if( command == fSetPhotonDetReflectivityCmd ) {
301 
302  fDetector->
303  SetPhotonDetReflectivity(G4UIcmdWithADouble::GetNewDoubleValue(val));
304  }
305  else if( command == fSetWLSLengthCmd ) {
306 
308  }
309  else if( command == fSetWLSRadiusCmd ) {
310 
312  }
313  else if( command == fSetClad1RadiusCmd ) {
314 
315  fDetector->
317  }
318  else if( command == fSetClad2RadiusCmd ) {
319 
320  fDetector->
322  }
323  else if( command == fSetPhotonDetHalfLengthCmd ) {
324 
325  fDetector->
326  SetPhotonDetHalfLength(G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(val));
327  }
328  else if( command == fSetGapCmd ) {
329 
331  }
332  else if( command == fSetPhotonDetAlignmentCmd ) {
333 
334  fDetector->
335  SetPhotonDetAlignment(G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(val));
336  }
337  else if( command == fSetMirrorCmd ) {
338 
340  }
341  else if( command == fSetBarLengthCmd ) {
342 
344  }
345  else if( command == fSetBarBaseCmd ) {
346 
348  }
349  else if( command == fSetHoleRadiusCmd ) {
350 
352  }
353  else if( command == fSetCoatingThicknessCmd ) {
354 
356  }
357  else if( command == fSetCoatingRadiusCmd ) {
358 
360  }
361 }
virtual void SetNewValue(G4UIcommand *, G4String)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4int GetNewIntValue(const char *paramString)
WLSDetectorMessenger(WLSDetectorConstruction *)
void SetToBeBroadcasted(G4bool val)
Definition: G4UIcommand.hh:184
void SetUnitCategory(const char *unitCategory)
static G4double GetNewDoubleValue(const char *paramString)
static G4bool GetNewBoolValue(const char *paramString)
static G4double GetNewDoubleValue(const char *paramString)
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:240
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultUnit(const char *defUnit)
void SetCandidates(const char *candidateList)
Definition of the WLSDetectorMessenger class.
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)