Geant4  10.01
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 //
26 // $Id: LXeDetectorMessenger.cc 77486 2013-11-25 10:14:16Z gcosmo $
27 //
30 //
31 //
32 #include "LXeDetectorMessenger.hh"
34 
37 #include "G4UIcmdWithAnInteger.hh"
38 #include "G4UIcommand.hh"
39 #include "G4UIdirectory.hh"
40 #include "G4UIcmdWithABool.hh"
41 #include "G4UIcmdWithADouble.hh"
42 #include "G4Scintillation.hh"
43 
44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
45 
47  : fLXeDetector(detector)
48 {
49  //Setup a command directory for detector controls with guidance
50  fDetectorDir = new G4UIdirectory("/LXe/detector/");
51  fDetectorDir->SetGuidance("Detector geometry control");
52 
53  fVolumesDir = new G4UIdirectory("/LXe/detector/volumes/");
54  fVolumesDir->SetGuidance("Enable/disable volumes");
55 
56  //Various commands for modifying detector geometry
58  new G4UIcmdWith3VectorAndUnit("/LXe/detector/dimensions",this);
59  fDimensionsCmd->SetGuidance("Set the dimensions of the detector volume.");
60  fDimensionsCmd->SetParameterName("scint_x","scint_y","scint_z",false);
64 
66  ("/LXe/detector/housingThickness",this);
67  fHousingThicknessCmd->SetGuidance("Set the thickness of the housing.");
68  fHousingThicknessCmd->SetParameterName("d_mtl",false);
72 
74  ("/LXe/detector/pmtRadius",this);
75  fPmtRadiusCmd->SetGuidance("Set the radius of the PMTs.");
76  fPmtRadiusCmd->SetParameterName("radius",false);
80 
81  fNxCmd = new G4UIcmdWithAnInteger("/LXe/detector/nx",this);
82  fNxCmd->SetGuidance("Set the number of PMTs along the x-dimension.");
83  fNxCmd->SetParameterName("nx",false);
85  fNxCmd->SetToBeBroadcasted(false);
86 
87  fNyCmd = new G4UIcmdWithAnInteger("/LXe/detector/ny",this);
88  fNyCmd->SetGuidance("Set the number of PMTs along the y-dimension.");
89  fNyCmd->SetParameterName("ny",false);
91  fNyCmd->SetToBeBroadcasted(false);
92 
93  fNzCmd = new G4UIcmdWithAnInteger("/LXe/detector/nz",this);
94  fNzCmd->SetGuidance("Set the number of PMTs along the z-dimension.");
95  fNzCmd->SetParameterName("nz",false);
97  fNzCmd->SetToBeBroadcasted(false);
98 
99  fSphereCmd = new G4UIcmdWithABool("/LXe/detector/volumes/sphere",this);
100  fSphereCmd->SetGuidance("Enable/Disable the sphere.");
103 
104  fReflectivityCmd = new G4UIcmdWithADouble("/LXe/detector/reflectivity",this);
105  fReflectivityCmd->SetGuidance("Set the reflectivity of the housing.");
108 
109  fWlsCmd = new G4UIcmdWithABool("/LXe/detector/volumes/wls",this);
110  fWlsCmd->SetGuidance("Enable/Disable the WLS slab");
112  fWlsCmd->SetToBeBroadcasted(false);
113 
114  fLxeCmd = new G4UIcmdWithABool("/LXe/detector/volumes/lxe",this);
115  fLxeCmd->SetGuidance("Enable/Disable the main detector volume.");
117  fLxeCmd->SetToBeBroadcasted(false);
118 
119  fNFibersCmd = new G4UIcmdWithAnInteger("/LXe/detector/nfibers",this);
120  fNFibersCmd->SetGuidance("Set the number of WLS fibers in the WLS slab.");
123 
124  fDefaultsCmd = new G4UIcommand("/LXe/detector/defaults",this);
125  fDefaultsCmd->SetGuidance("Set all detector geometry values to defaults.");
128 
129  fMainScintYield=new G4UIcmdWithADouble("/LXe/detector/MainScintYield",this);
130  fMainScintYield->SetGuidance("Set scinitillation yield of main volume.");
131  fMainScintYield->SetGuidance("Specified in photons/MeV");
134 
135  fWLSScintYield = new G4UIcmdWithADouble("/LXe/detector/WLSScintYield",this);
136  fWLSScintYield->SetGuidance("Set scintillation yield of WLS Slab");
137  fWLSScintYield->SetGuidance("Specified in photons/MeV");
140 }
141 
142 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
143 
145 {
146  delete fDimensionsCmd;
147  delete fHousingThicknessCmd;
148  delete fPmtRadiusCmd;
149  delete fNxCmd;
150  delete fNyCmd;
151  delete fNzCmd;
152  delete fDetectorDir;
153  delete fVolumesDir;
154  delete fDefaultsCmd;
155  delete fSphereCmd;
156  delete fWlsCmd;
157  delete fLxeCmd;
158  delete fNFibersCmd;
159  delete fReflectivityCmd;
160  delete fMainScintYield;
161  delete fWLSScintYield;
162 }
163 
164 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
165 
167 {
168  if( command == fDimensionsCmd ){
170  }
171  else if (command == fHousingThicknessCmd){
173  ->GetNewDoubleValue(newValue));
174  }
175  else if (command == fPmtRadiusCmd){
177  }
178  else if (command == fNxCmd){
180  }
181  else if (command == fNyCmd){
183  }
184  else if (command == fNzCmd){
186  }
187  else if (command == fDefaultsCmd){
189  }
190  else if (command == fSphereCmd){
192  }
193  else if (command == fReflectivityCmd){
196  }
197  else if (command == fWlsCmd){
199  }
200  else if (command == fLxeCmd){
202  }
203  else if (command == fNFibersCmd){
205  }
206  else if (command == fMainScintYield){
208  }
209  else if (command == fWLSScintYield){
211  }
212 }
G4UIcmdWithABool * fLxeCmd
G4UIcmdWithAnInteger * fNFibersCmd
G4UIcmdWithAnInteger * fNyCmd
G4UIcmdWithADoubleAndUnit * fHousingThicknessCmd
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G4UIcmdWithAnInteger * fNxCmd
static G4int GetNewIntValue(const char *paramString)
G4UIcmdWith3VectorAndUnit * fDimensionsCmd
void SetDefaultUnit(const char *defUnit)
void SetToBeBroadcasted(G4bool val)
Definition: G4UIcommand.hh:184
static G4ThreeVector GetNew3VectorValue(const char *paramString)
Definition of the LXeDetectorConstruction class.
static G4double GetNewDoubleValue(const char *paramString)
void SetParameterName(const char *theNameX, const char *theNameY, const char *theNameZ, G4bool omittable, G4bool currentAsDefault=false)
static G4bool GetNewBoolValue(const char *paramString)
G4UIcmdWithABool * fWlsCmd
G4UIcmdWithAnInteger * fNzCmd
static G4double GetNewDoubleValue(const char *paramString)
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:239
G4UIcmdWithADouble * fReflectivityCmd
G4UIdirectory * fDetectorDir
void SetDefaultUnit(const char *defUnit)
G4UIcmdWithABool * fSphereCmd
G4UIcmdWithADouble * fWLSScintYield
LXeDetectorMessenger(LXeDetectorConstruction *)
G4UIcmdWithADouble * fMainScintYield
LXeDetectorConstruction * fLXeDetector
G4UIcmdWithADoubleAndUnit * fPmtRadiusCmd
Definition of the LXeDetectorMessenger class.
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
virtual void SetNewValue(G4UIcommand *, G4String)