Geant4  10.02
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 
51  new G4UIcmdWithAString("/WLS/setPhotonDetGeometry",this);
53  SetGuidance("Select the geometry of the PhotonDet detector");
54  fSetPhotonDetGeometryCmd->SetGuidance("Only Accepts 'Circle' and 'Square'");
55  fSetPhotonDetGeometryCmd->SetCandidates("Circle Square");
58 
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");
67 
69  new G4UIcmdWithADouble("/WLS/setSurfaceRoughness", this);
71  SetGuidance("Set the roughness between Clad1 and WLS Fiber");
72  fSetSurfaceRoughnessCmd->SetParameterName("roughness",false);
73  fSetSurfaceRoughnessCmd->SetRange("roughness>0 && roughness<=1");
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");
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");
90 
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");
98 
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");
106 
108  new G4UIcmdWithADouble("/WLS/setPhotonDetReflectivity", this);
110  SetGuidance("Set the reflectivity of the mirror");
111  fSetPhotonDetReflectivityCmd->SetParameterName("reflectivity",false);
112  fSetPhotonDetReflectivityCmd->SetRange("reflectivity>=0 && reflectivity<=1");
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.");
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.");
133 
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.");
143 
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.");
153 
155  new G4UIcmdWithADoubleAndUnit("/WLS/setPhotonDetHalfLength",this);
157  SetGuidance("Set the half length of PhotonDet detector");
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.");
173 
175  new G4UIcmdWithADoubleAndUnit("/WLS/setAlignment",this);
177  SetGuidance("Set the deviation of PhotonDet from z axis");
181  fSetPhotonDetAlignmentCmd->SetRange("theta>-90. && theta<90.");
184 
185  fSetMirrorCmd = new G4UIcmdWithABool("/WLS/setMirror", this);
186  fSetMirrorCmd->SetGuidance("Place a mirror at the end of the fiber");
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.");
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");
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.");
216 
218  new G4UIcmdWithADoubleAndUnit("/WLS/setCoatingThickness",this);
220  SetGuidance("Set thickness of the coating on the bars");
224  fSetCoatingThicknessCmd->SetRange("thick>=0.");
227 
229  new G4UIcmdWithADoubleAndUnit("/WLS/setCoatingRadius",this);
231  SetGuidance("Set inner radius of the corner bar coating");
232  fSetCoatingRadiusCmd->SetParameterName("cradius",false);
235  fSetCoatingRadiusCmd->SetRange("cradius>=0.");
238 }
239 
240 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
241 
243 {
244  delete fDetDir;
245 
247  delete fSetNumOfCladLayersCmd;
248  delete fSetWLSLengthCmd;
249  delete fSetWLSRadiusCmd;
250  delete fSetClad1RadiusCmd;
251  delete fSetClad2RadiusCmd;
253  delete fSetGapCmd;
256  delete fSetMirrorPolishCmd;
258  delete fSetXYRatioCmd;
259  delete fSetMirrorCmd;
260  delete fSetBarLengthCmd;
261  delete fSetBarBaseCmd;
262  delete fSetHoleRadiusCmd;
264  delete fSetCoatingRadiusCmd;
265 }
266 
267 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
268 
270 {
271  if( command == fSetPhotonDetGeometryCmd ) {
272 
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 }
G4UIcmdWithADoubleAndUnit * fSetBarLengthCmd
G4UIcmdWithADoubleAndUnit * fSetPhotonDetHalfLengthCmd
G4UIcmdWithADoubleAndUnit * fSetHoleRadiusCmd
virtual void SetNewValue(G4UIcommand *, G4String)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4int GetNewIntValue(const char *paramString)
G4UIcmdWithADouble * fSetMirrorPolishCmd
WLSDetectorMessenger(WLSDetectorConstruction *)
WLSDetectorConstruction * fDetector
void SetToBeBroadcasted(G4bool val)
Definition: G4UIcommand.hh:184
G4UIcmdWithADouble * fSetXYRatioCmd
G4UIcmdWithADoubleAndUnit * fSetCoatingThicknessCmd
G4UIcmdWithADoubleAndUnit * fSetClad2RadiusCmd
void SetUnitCategory(const char *unitCategory)
static G4double GetNewDoubleValue(const char *paramString)
static G4bool GetNewBoolValue(const char *paramString)
G4UIcmdWithADoubleAndUnit * fSetWLSLengthCmd
G4UIcmdWithADoubleAndUnit * fSetWLSRadiusCmd
G4UIcmdWithADouble * fSetMirrorReflectivityCmd
G4UIcmdWithADoubleAndUnit * fSetCoatingRadiusCmd
G4UIcmdWithADoubleAndUnit * fSetBarBaseCmd
static G4double GetNewDoubleValue(const char *paramString)
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
G4UIcmdWithADoubleAndUnit * fSetGapCmd
G4UIcmdWithABool * fSetMirrorCmd
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:239
G4UIcmdWithADoubleAndUnit * fSetClad1RadiusCmd
G4UIcmdWithADouble * fSetSurfaceRoughnessCmd
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G4UIcmdWithAString * fSetPhotonDetGeometryCmd
G4UIcmdWithADouble * fSetPhotonDetReflectivityCmd
void SetDefaultUnit(const char *defUnit)
G4UIcmdWithADoubleAndUnit * fSetPhotonDetAlignmentCmd
void SetCandidates(const char *candidateList)
G4UIcmdWithAnInteger * fSetNumOfCladLayersCmd
Definition of the WLSDetectorMessenger class.
G4UIcmdWithADouble * fSetPhotonDetPolishCmd
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)