Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LXeDetectorMessenger.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 #include "LXeDetectorMessenger.hh"
32 
35 #include "G4UIcmdWithAnInteger.hh"
36 #include "G4UIcommand.hh"
37 #include "G4UIdirectory.hh"
38 #include "G4UIcmdWithABool.hh"
39 #include "G4UIcmdWithADouble.hh"
40 #include "G4Scintillation.hh"
41 
42 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
43 
45  : fLXeDetector(detector)
46 {
47  //Setup a command directory for detector controls with guidance
48  fDetectorDir = new G4UIdirectory("/LXe/detector/");
49  fDetectorDir->SetGuidance("Detector geometry control");
50 
51  fVolumesDir = new G4UIdirectory("/LXe/detector/volumes/");
52  fVolumesDir->SetGuidance("Enable/disable volumes");
53 
54  //Various commands for modifying detector geometry
55  fDimensionsCmd =
56  new G4UIcmdWith3VectorAndUnit("/LXe/detector/dimensions",this);
57  fDimensionsCmd->SetGuidance("Set the dimensions of the detector volume.");
58  fDimensionsCmd->SetParameterName("scint_x","scint_y","scint_z",false);
59  fDimensionsCmd->SetDefaultUnit("cm");
60 
61  fHousingThicknessCmd = new G4UIcmdWithADoubleAndUnit
62  ("/LXe/detector/housingThickness",this);
63  fHousingThicknessCmd->SetGuidance("Set the thickness of the housing.");
64  fHousingThicknessCmd->SetParameterName("d_mtl",false);
65  fHousingThicknessCmd->SetDefaultUnit("cm");
66 
67  fPmtRadiusCmd = new G4UIcmdWithADoubleAndUnit
68  ("/LXe/detector/pmtRadius",this);
69  fPmtRadiusCmd->SetGuidance("Set the radius of the PMTs.");
70  fPmtRadiusCmd->SetParameterName("radius",false);
71  fPmtRadiusCmd->SetDefaultUnit("cm");
72 
73  fNxCmd = new G4UIcmdWithAnInteger("/LXe/detector/nx",this);
74  fNxCmd->SetGuidance("Set the number of PMTs along the x-dimension.");
75  fNxCmd->SetParameterName("nx",false);
76 
77  fNyCmd = new G4UIcmdWithAnInteger("/LXe/detector/ny",this);
78  fNyCmd->SetGuidance("Set the number of PMTs along the y-dimension.");
79  fNyCmd->SetParameterName("ny",false);
80 
81  fNzCmd = new G4UIcmdWithAnInteger("/LXe/detector/nz",this);
82  fNzCmd->SetGuidance("Set the number of PMTs along the z-dimension.");
83  fNzCmd->SetParameterName("nz",false);
84 
85  fSphereCmd = new G4UIcmdWithABool("/LXe/detector/volumes/sphere",this);
86  fSphereCmd->SetGuidance("Enable/Disable the sphere.");
87 
88  fReflectivityCmd = new G4UIcmdWithADouble("/LXe/detector/reflectivity",this);
89  fReflectivityCmd->SetGuidance("Set the reflectivity of the housing.");
90 
91  fWlsCmd = new G4UIcmdWithABool("/LXe/detector/volumes/wls",this);
92  fWlsCmd->SetGuidance("Enable/Disable the WLS slab");
93 
94  fLxeCmd = new G4UIcmdWithABool("/LXe/detector/volumes/lxe",this);
95  fLxeCmd->SetGuidance("Enable/Disable the main detector volume.");
96 
97  fNFibersCmd = new G4UIcmdWithAnInteger("/LXe/detector/nfibers",this);
98  fNFibersCmd->SetGuidance("Set the number of WLS fibers in the WLS slab.");
99 
100  fUpdateCmd = new G4UIcommand("/LXe/detector/update",this);
101  fUpdateCmd->SetGuidance("Update the detector geometry with changed values.");
102  fUpdateCmd->SetGuidance
103  ("Must be run before beamOn if detector has been changed.");
104 
105  fDefaultsCmd = new G4UIcommand("/LXe/detector/defaults",this);
106  fDefaultsCmd->SetGuidance("Set all detector geometry values to defaults.");
107  fDefaultsCmd->SetGuidance("(Update still required)");
108 
109  fMainScintYield=new G4UIcmdWithADouble("/LXe/detector/MainScintYield",this);
110  fMainScintYield->SetGuidance("Set scinitillation yield of main volume.");
111  fMainScintYield->SetGuidance("Specified in photons/MeV");
112 
113  fWLSScintYield = new G4UIcmdWithADouble("/LXe/detector/WLSScintYield",this);
114  fWLSScintYield->SetGuidance("Set scintillation yield of WLS Slab");
115  fWLSScintYield->SetGuidance("Specified in photons/MeV");
116 }
117 
118 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
119 
121 {
122  delete fDimensionsCmd;
123  delete fHousingThicknessCmd;
124  delete fPmtRadiusCmd;
125  delete fNxCmd;
126  delete fNyCmd;
127  delete fNzCmd;
128  delete fUpdateCmd;
129  delete fDetectorDir;
130  delete fVolumesDir;
131  delete fDefaultsCmd;
132  delete fSphereCmd;
133  delete fWlsCmd;
134  delete fLxeCmd;
135  delete fNFibersCmd;
136  delete fReflectivityCmd;
137  delete fMainScintYield;
138  delete fWLSScintYield;
139 }
140 
141 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
142 
144 {
145  if( command == fDimensionsCmd ){
146  fLXeDetector->SetDimensions(fDimensionsCmd->GetNew3VectorValue(newValue));
147  }
148  else if (command == fHousingThicknessCmd){
149  fLXeDetector->SetHousingThickness(fHousingThicknessCmd
150  ->GetNewDoubleValue(newValue));
151  }
152  else if (command == fPmtRadiusCmd){
153  fLXeDetector->SetPMTRadius(fPmtRadiusCmd->GetNewDoubleValue(newValue));
154  }
155  else if (command == fNxCmd){
156  fLXeDetector->SetNX(fNxCmd->GetNewIntValue(newValue));
157  }
158  else if (command == fNyCmd){
159  fLXeDetector->SetNY(fNyCmd->GetNewIntValue(newValue));
160  }
161  else if (command == fNzCmd){
162  fLXeDetector->SetNZ(fNzCmd->GetNewIntValue(newValue));
163  }
164  else if (command == fUpdateCmd){
165  fLXeDetector->UpdateGeometry();
166  }
167  else if (command == fDefaultsCmd){
168  fLXeDetector->SetDefaults();
169  }
170  else if (command == fSphereCmd){
171  fLXeDetector->SetSphereOn(fSphereCmd->GetNewBoolValue(newValue));
172  }
173  else if (command == fReflectivityCmd){
174  fLXeDetector
175  ->SetHousingReflectivity(fReflectivityCmd->GetNewDoubleValue(newValue));
176  }
177  else if (command == fWlsCmd){
178  fLXeDetector->SetWLSSlabOn(fWlsCmd->GetNewBoolValue(newValue));
179  }
180  else if (command == fLxeCmd){
181  fLXeDetector->SetMainVolumeOn(fLxeCmd->GetNewBoolValue(newValue));
182  }
183  else if (command == fNFibersCmd){
184  fLXeDetector->SetNFibers(fNFibersCmd->GetNewIntValue(newValue));
185  }
186  else if (command == fMainScintYield){
187  fLXeDetector->SetMainScintYield(fMainScintYield->GetNewDoubleValue(newValue));
188  }
189  else if (command == fWLSScintYield){
190  fLXeDetector->SetWLSScintYield(fWLSScintYield->GetNewDoubleValue(newValue));
191  }
192 }