ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
WLSDetectorMessenger.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file WLSDetectorMessenger.cc
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 //
29 //
30 //
31 #include "WLSDetectorMessenger.hh"
32 
33 #include "G4UIdirectory.hh"
34 #include "G4UIcmdWithABool.hh"
35 #include "G4UIcmdWithAString.hh"
36 #include "G4UIcmdWithADouble.hh"
37 #include "G4UIcmdWithAnInteger.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);
52  SetGuidance("Select the geometry of the PhotonDet detector");
53  fSetPhotonDetGeometryCmd->SetGuidance("Only Accepts 'Circle' and 'Square'");
54  fSetPhotonDetGeometryCmd->SetCandidates("Circle Square");
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");
66 
68  new G4UIcmdWithADouble("/WLS/setSurfaceRoughness", this);
70  SetGuidance("Set the roughness between Clad1 and WLS Fiber");
71  fSetSurfaceRoughnessCmd->SetParameterName("roughness",false);
72  fSetSurfaceRoughnessCmd->SetRange("roughness>0 && roughness<=1");
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");
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");
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");
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");
105 
107  new G4UIcmdWithADouble("/WLS/setPhotonDetReflectivity", this);
109  SetGuidance("Set the reflectivity of the mirror");
110  fSetPhotonDetReflectivityCmd->SetParameterName("reflectivity",false);
111  fSetPhotonDetReflectivityCmd->SetRange("reflectivity>=0 && reflectivity<=1");
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.");
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.");
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.");
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.");
152 
154  new G4UIcmdWithADoubleAndUnit("/WLS/setPhotonDetHalfLength",this);
156  SetGuidance("Set the half length of PhotonDet detector");
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.");
172 
174  new G4UIcmdWithADoubleAndUnit("/WLS/setAlignment",this);
176  SetGuidance("Set the deviation of PhotonDet from z axis");
180  fSetPhotonDetAlignmentCmd->SetRange("theta>-90. && theta<90.");
183 
184  fSetMirrorCmd = new G4UIcmdWithABool("/WLS/setMirror", this);
185  fSetMirrorCmd->SetGuidance("Place a mirror at the end of the fiber");
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.");
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");
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.");
215 
217  new G4UIcmdWithADoubleAndUnit("/WLS/setCoatingThickness",this);
219  SetGuidance("Set thickness of the coating on the bars");
223  fSetCoatingThicknessCmd->SetRange("thick>=0.");
226 
228  new G4UIcmdWithADoubleAndUnit("/WLS/setCoatingRadius",this);
230  SetGuidance("Set inner radius of the corner bar coating");
231  fSetCoatingRadiusCmd->SetParameterName("cradius",false);
234  fSetCoatingRadiusCmd->SetRange("cradius>=0.");
237 }
238 
239 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
240 
242 {
243  delete fDetDir;
244 
246  delete fSetNumOfCladLayersCmd;
247  delete fSetWLSLengthCmd;
248  delete fSetWLSRadiusCmd;
249  delete fSetClad1RadiusCmd;
250  delete fSetClad2RadiusCmd;
252  delete fSetGapCmd;
255  delete fSetMirrorPolishCmd;
257  delete fSetXYRatioCmd;
258  delete fSetMirrorCmd;
259  delete fSetBarLengthCmd;
260  delete fSetBarBaseCmd;
261  delete fSetHoleRadiusCmd;
263  delete fSetCoatingRadiusCmd;
264 }
265 
266 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
267 
269 {
270  if( command == fSetPhotonDetGeometryCmd ) {
271 
273  }
274  else if( command == fSetNumOfCladLayersCmd ) {
275 
277  }
278  else if( command == fSetSurfaceRoughnessCmd ) {
279 
281  }
282  else if( command == fSetXYRatioCmd ) {
283 
285  }
286  else if( command == fSetMirrorPolishCmd ) {
287 
289  }
290  else if( command == fSetMirrorReflectivityCmd ) {
291 
292  fDetector->
293  SetMirrorReflectivity(G4UIcmdWithADouble::GetNewDoubleValue(val));
294  }
295  else if( command == fSetPhotonDetPolishCmd ) {
296 
298  }
299  else if( command == fSetPhotonDetReflectivityCmd ) {
300 
301  fDetector->
302  SetPhotonDetReflectivity(G4UIcmdWithADouble::GetNewDoubleValue(val));
303  }
304  else if( command == fSetWLSLengthCmd ) {
305 
307  }
308  else if( command == fSetWLSRadiusCmd ) {
309 
311  }
312  else if( command == fSetClad1RadiusCmd ) {
313 
314  fDetector->
316  }
317  else if( command == fSetClad2RadiusCmd ) {
318 
319  fDetector->
321  }
322  else if( command == fSetPhotonDetHalfLengthCmd ) {
323 
324  fDetector->
325  SetPhotonDetHalfLength(G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(val));
326  }
327  else if( command == fSetGapCmd ) {
328 
330  }
331  else if( command == fSetPhotonDetAlignmentCmd ) {
332 
333  fDetector->
334  SetPhotonDetAlignment(G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(val));
335  }
336  else if( command == fSetMirrorCmd ) {
337 
339  }
340  else if( command == fSetBarLengthCmd ) {
341 
343  }
344  else if( command == fSetBarBaseCmd ) {
345 
347  }
348  else if( command == fSetHoleRadiusCmd ) {
349 
351  }
352  else if( command == fSetCoatingThicknessCmd ) {
353 
355  }
356  else if( command == fSetCoatingRadiusCmd ) {
357 
359  }
360 }