Geant4  10.00.p01
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 77487 2013-11-25 10:15:04Z 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  SetPhotonDetGeometryCmd->SetGuidance("Only Accepts 'Circle' and 'Square'");
55  SetPhotonDetGeometryCmd->SetCandidates("Circle Square");
58 
59  SetNumOfCladLayersCmd = new G4UIcmdWithAnInteger("/WLS/setNumOfLayers", this);
60  SetNumOfCladLayersCmd->SetGuidance("Select the number of cladding layers");
61  SetNumOfCladLayersCmd->SetGuidance("Maximum number is 2");
62  SetNumOfCladLayersCmd->SetParameterName("numberOfLayers",false);
63  SetNumOfCladLayersCmd->SetRange("numberOfLayers>=0 && numberOfLayers<=2");
66 
68  new G4UIcmdWithADouble("/WLS/setSurfaceRoughness", this);
70  SetGuidance("Set the roughness between Clad1 and WLS Fiber");
71  SetSurfaceRoughnessCmd->SetParameterName("roughness",false);
72  SetSurfaceRoughnessCmd->SetRange("roughness>0 && roughness<=1");
75 
76  SetXYRatioCmd = new G4UIcmdWithADouble("/WLS/setXYRatio", this);
77  SetXYRatioCmd->SetGuidance("Set the ratio between x and y axis (x/y)");
78  SetXYRatioCmd->SetParameterName("ratio",false);
79  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");
89 
91  new G4UIcmdWithADouble("/WLS/setMirrorReflectivity", this);
92  SetMirrorReflectivityCmd->SetGuidance("Set the reflectivity of the mirror");
93  SetMirrorReflectivityCmd->SetParameterName("reflectivity",false);
94  SetMirrorReflectivityCmd->SetRange("reflectivity>=0 && reflectivity<=1");
97 
99  new G4UIcmdWithADouble("/WLS/setPhotonDetPolish", this);
100  SetPhotonDetPolishCmd->SetGuidance("Set the polish of the mirror");
101  SetPhotonDetPolishCmd->SetParameterName("polish",false);
102  SetPhotonDetPolishCmd->SetRange("polish>0 && polish<=1");
105 
107  new G4UIcmdWithADouble("/WLS/setPhotonDetReflectivity", this);
109  SetGuidance("Set the reflectivity of the mirror");
110  SetPhotonDetReflectivityCmd->SetParameterName("reflectivity",false);
111  SetPhotonDetReflectivityCmd->SetRange("reflectivity>=0 && reflectivity<=1");
114 
115  SetWLSLengthCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setWLSLength",this);
116  SetWLSLengthCmd->SetGuidance("Set the half length of the WLS fiber");
117  SetWLSLengthCmd->SetParameterName("length",false);
118  SetWLSLengthCmd->SetRange("length>0.");
119  SetWLSLengthCmd->SetUnitCategory("Length");
123 
124  SetWLSRadiusCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setWLSRadius",this);
125  SetWLSRadiusCmd->SetGuidance("Set the radius of the WLS fiber");
126  SetWLSRadiusCmd->SetParameterName("radius",false);
127  SetWLSRadiusCmd->SetRange("radius>0.");
128  SetWLSRadiusCmd->SetUnitCategory("Length");
132 
133  SetClad1RadiusCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setClad1Radius",this);
134  SetClad1RadiusCmd->SetGuidance("Set the radius of Cladding 1");
135  SetClad1RadiusCmd->SetParameterName("radius",false);
136  SetClad1RadiusCmd->SetRange("radius>0.");
141 
142  SetClad2RadiusCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setClad2Radius",this);
143  SetClad2RadiusCmd->SetGuidance("Set the radius of Cladding 2");
144  SetClad2RadiusCmd->SetParameterName("radius",false);
145  SetClad2RadiusCmd->SetRange("radius>0.");
150 
152  new G4UIcmdWithADoubleAndUnit("/WLS/setPhotonDetHalfLength",this);
154  SetGuidance("Set the half length of PhotonDet detector");
156  SetPhotonDetHalfLengthCmd->SetRange("halfL>0.");
161 
162  SetGapCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setGap",this);
163  SetGapCmd->SetGuidance("Set the distance between PhotonDet and fiber end");
164  SetGapCmd->SetParameterName("theta",false);
165  SetGapCmd->SetUnitCategory("Length");
166  SetGapCmd->SetDefaultUnit("mm");
167  SetGapCmd->SetRange("theta>=0.");
170 
172  new G4UIcmdWithADoubleAndUnit("/WLS/setAlignment",this);
174  SetGuidance("Set the deviation of PhotonDet from z axis");
178  SetPhotonDetAlignmentCmd->SetRange("theta>-90. && theta<90.");
181 
182  SetMirrorCmd = new G4UIcmdWithABool("/WLS/setMirror", this);
183  SetMirrorCmd->SetGuidance("Place a mirror at the end of the fiber");
186 
187  SetBarLengthCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setBarLength",this);
188  SetBarLengthCmd->SetGuidance("Set the length of the scintillator bar");
189  SetBarLengthCmd->SetParameterName("length",false);
190  SetBarLengthCmd->SetRange("length>0.");
191  SetBarLengthCmd->SetUnitCategory("Length");
195 
196  SetBarBaseCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setBarBase",this);
197  SetBarBaseCmd->SetGuidance("Set the side length of the scintillator bar");
198  SetBarBaseCmd->SetParameterName("length",false);
199  SetBarBaseCmd->SetRange("length>0.");
200  SetBarBaseCmd->SetUnitCategory("Length");
204 
205  SetHoleRadiusCmd = new G4UIcmdWithADoubleAndUnit("/WLS/setHoleRadius",this);
206  SetHoleRadiusCmd->SetGuidance("Set the radius of the fiber hole");
207  SetHoleRadiusCmd->SetParameterName("radius",false);
208  SetHoleRadiusCmd->SetRange("radius>0.");
213 
215  new G4UIcmdWithADoubleAndUnit("/WLS/setCoatingThickness",this);
217  SetGuidance("Set thickness of the coating on the bars");
221  SetCoatingThicknessCmd->SetRange("thick>=0.");
224 
226  new G4UIcmdWithADoubleAndUnit("/WLS/setCoatingRadius",this);
228  SetGuidance("Set inner radius of the corner bar coating");
229  SetCoatingRadiusCmd->SetParameterName("cradius",false);
232  SetCoatingRadiusCmd->SetRange("cradius>=0.");
235 }
236 
237 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
238 
240 {
241  delete fDetDir;
242 
244  delete SetNumOfCladLayersCmd;
245  delete SetWLSLengthCmd;
246  delete SetWLSRadiusCmd;
247  delete SetClad1RadiusCmd;
248  delete SetClad2RadiusCmd;
250  delete SetGapCmd;
252  delete SetSurfaceRoughnessCmd;
253  delete SetMirrorPolishCmd;
255  delete SetXYRatioCmd;
256  delete SetMirrorCmd;
257  delete SetBarLengthCmd;
258  delete SetBarBaseCmd;
259  delete SetHoleRadiusCmd;
260  delete SetCoatingThicknessCmd;
261  delete SetCoatingRadiusCmd;
262 }
263 
264 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
265 
267 {
268  if( command == SetPhotonDetGeometryCmd ) {
269 
271  }
272  else if( command == SetNumOfCladLayersCmd ) {
273 
275  }
276  else if( command == SetSurfaceRoughnessCmd ) {
277 
279  }
280  else if( command == SetXYRatioCmd ) {
281 
283  }
284  else if( command == SetMirrorPolishCmd ) {
285 
287  }
288  else if( command == SetMirrorReflectivityCmd ) {
289 
290  fDetector->
291  SetMirrorReflectivity(G4UIcmdWithADouble::GetNewDoubleValue(val));
292  }
293  else if( command == SetPhotonDetPolishCmd ) {
294 
296  }
297  else if( command == SetPhotonDetReflectivityCmd ) {
298 
299  fDetector->
300  SetPhotonDetReflectivity(G4UIcmdWithADouble::GetNewDoubleValue(val));
301  }
302  else if( command == SetWLSLengthCmd ) {
303 
305  }
306  else if( command == SetWLSRadiusCmd ) {
307 
309  }
310  else if( command == SetClad1RadiusCmd ) {
311 
312  fDetector->
314  }
315  else if( command == SetClad2RadiusCmd ) {
316 
317  fDetector->
319  }
320  else if( command == SetPhotonDetHalfLengthCmd ) {
321 
322  fDetector->
323  SetPhotonDetHalfLength(G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(val));
324  }
325  else if( command == SetGapCmd ) {
326 
328  }
329  else if( command == SetPhotonDetAlignmentCmd ) {
330 
331  fDetector->
332  SetPhotonDetAlignment(G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(val));
333  }
334  else if( command == SetMirrorCmd ) {
335 
337  }
338  else if( command == SetBarLengthCmd ) {
339 
341  }
342  else if( command == SetBarBaseCmd ) {
343 
345  }
346  else if( command == SetHoleRadiusCmd ) {
347 
349  }
350  else if( command == SetCoatingThicknessCmd ) {
351 
353  }
354  else if( command == SetCoatingRadiusCmd ) {
355 
357  }
358 }
G4UIcmdWithADoubleAndUnit * SetBarLengthCmd
G4UIcmdWithADoubleAndUnit * SetClad2RadiusCmd
virtual void SetNewValue(G4UIcommand *, G4String)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G4UIcmdWithABool * SetMirrorCmd
G4UIcmdWithADouble * SetMirrorReflectivityCmd
static G4int GetNewIntValue(const char *paramString)
G4UIcmdWithADoubleAndUnit * SetCoatingThicknessCmd
G4UIcmdWithADouble * SetXYRatioCmd
G4UIcmdWithADouble * SetPhotonDetReflectivityCmd
WLSDetectorMessenger(WLSDetectorConstruction *)
WLSDetectorConstruction * fDetector
void SetToBeBroadcasted(G4bool val)
Definition: G4UIcommand.hh:184
G4UIcmdWithADoubleAndUnit * SetCoatingRadiusCmd
G4UIcmdWithADoubleAndUnit * SetPhotonDetHalfLengthCmd
void SetUnitCategory(const char *unitCategory)
static G4double GetNewDoubleValue(const char *paramString)
static G4bool GetNewBoolValue(const char *paramString)
G4UIcmdWithADoubleAndUnit * SetHoleRadiusCmd
G4UIcmdWithADoubleAndUnit * SetGapCmd
G4UIcmdWithADoubleAndUnit * SetPhotonDetAlignmentCmd
G4UIcmdWithADoubleAndUnit * SetClad1RadiusCmd
G4UIcmdWithADoubleAndUnit * SetWLSRadiusCmd
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:225
G4UIcmdWithADouble * SetSurfaceRoughnessCmd
G4UIcmdWithADoubleAndUnit * SetWLSLengthCmd
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultUnit(const char *defUnit)
G4UIcmdWithADouble * SetMirrorPolishCmd
void SetCandidates(const char *candidateList)
G4UIcmdWithADoubleAndUnit * SetBarBaseCmd
Definition of the WLSDetectorMessenger class.
G4UIcmdWithADouble * SetPhotonDetPolishCmd
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G4UIcmdWithAString * SetPhotonDetGeometryCmd
G4UIcmdWithAnInteger * SetNumOfCladLayersCmd