ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LXeDetectorMessenger.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file LXeDetectorMessenger.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 "LXeDetectorMessenger.hh"
33 
36 #include "G4UIcmdWithAnInteger.hh"
37 #include "G4UIcommand.hh"
38 #include "G4UIdirectory.hh"
39 #include "G4UIcmdWithABool.hh"
40 #include "G4UIcmdWithADouble.hh"
41 #include "G4Scintillation.hh"
42 
43 #include "G4RunManager.hh"
44 
45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
46 
48  : fLXeDetector(detector)
49 {
50  //Setup a command directory for detector controls with guidance
51  fDetectorDir = new G4UIdirectory("/LXe/detector/");
52  fDetectorDir->SetGuidance("Detector geometry control");
53 
54  fVolumesDir = new G4UIdirectory("/LXe/detector/volumes/");
55  fVolumesDir->SetGuidance("Enable/disable volumes");
56 
57  //Various commands for modifying detector geometry
59  new G4UIcmdWith3VectorAndUnit("/LXe/detector/dimensions",this);
60  fDimensionsCmd->SetGuidance("Set the dimensions of the detector volume.");
61  fDimensionsCmd->SetParameterName("scint_x","scint_y","scint_z",false);
65 
67  ("/LXe/detector/housingThickness",this);
68  fHousingThicknessCmd->SetGuidance("Set the thickness of the housing.");
69  fHousingThicknessCmd->SetParameterName("d_mtl",false);
73 
75  ("/LXe/detector/pmtRadius",this);
76  fPmtRadiusCmd->SetGuidance("Set the radius of the PMTs.");
77  fPmtRadiusCmd->SetParameterName("radius",false);
81 
82  fNxCmd = new G4UIcmdWithAnInteger("/LXe/detector/nx",this);
83  fNxCmd->SetGuidance("Set the number of PMTs along the x-dimension.");
84  fNxCmd->SetParameterName("nx",false);
86  fNxCmd->SetToBeBroadcasted(false);
87 
88  fNyCmd = new G4UIcmdWithAnInteger("/LXe/detector/ny",this);
89  fNyCmd->SetGuidance("Set the number of PMTs along the y-dimension.");
90  fNyCmd->SetParameterName("ny",false);
92  fNyCmd->SetToBeBroadcasted(false);
93 
94  fNzCmd = new G4UIcmdWithAnInteger("/LXe/detector/nz",this);
95  fNzCmd->SetGuidance("Set the number of PMTs along the z-dimension.");
96  fNzCmd->SetParameterName("nz",false);
98  fNzCmd->SetToBeBroadcasted(false);
99 
100  fSphereCmd = new G4UIcmdWithABool("/LXe/detector/volumes/sphere",this);
101  fSphereCmd->SetGuidance("Enable/Disable the sphere.");
104 
105  fReflectivityCmd = new G4UIcmdWithADouble("/LXe/detector/reflectivity",this);
106  fReflectivityCmd->SetGuidance("Set the reflectivity of the housing.");
109 
110  fWlsCmd = new G4UIcmdWithABool("/LXe/detector/volumes/wls",this);
111  fWlsCmd->SetGuidance("Enable/Disable the WLS slab");
113  fWlsCmd->SetToBeBroadcasted(false);
114 
115  fLxeCmd = new G4UIcmdWithABool("/LXe/detector/volumes/lxe",this);
116  fLxeCmd->SetGuidance("Enable/Disable the main detector volume.");
118  fLxeCmd->SetToBeBroadcasted(false);
119 
120  fNFibersCmd = new G4UIcmdWithAnInteger("/LXe/detector/nfibers",this);
121  fNFibersCmd->SetGuidance("Set the number of WLS fibers in the WLS slab.");
124 
125  fMainScintYield=new G4UIcmdWithADouble("/LXe/detector/MainScintYield",this);
126  fMainScintYield->SetGuidance("Set scinitillation yield of main volume.");
127  fMainScintYield->SetGuidance("Specified in photons/MeV");
130 
131  fWLSScintYield = new G4UIcmdWithADouble("/LXe/detector/WLSScintYield",this);
132  fWLSScintYield->SetGuidance("Set scintillation yield of WLS Slab");
133  fWLSScintYield->SetGuidance("Specified in photons/MeV");
136 
137  fSaveThresholdCmd = new G4UIcmdWithAnInteger("/LXe/saveThreshold",this);
139 SetGuidance("Set the photon count threshold for saving the random number seed");
140  fSaveThresholdCmd->SetParameterName("photons",true);
143 
144  fDefaultsCmd = new G4UIcommand("/LXe/detector/defaults",this);
145  fDefaultsCmd->SetGuidance("Set all detector geometry values to defaults.");
148 }
149 
150 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
151 
153 {
154  delete fDimensionsCmd;
155  delete fHousingThicknessCmd;
156  delete fPmtRadiusCmd;
157  delete fNxCmd;
158  delete fNyCmd;
159  delete fNzCmd;
160  delete fDetectorDir;
161  delete fVolumesDir;
162  delete fSphereCmd;
163  delete fWlsCmd;
164  delete fLxeCmd;
165  delete fNFibersCmd;
166  delete fReflectivityCmd;
167  delete fMainScintYield;
168  delete fWLSScintYield;
169  delete fSaveThresholdCmd;
170  delete fDefaultsCmd;
171 }
172 
173 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
174 
176 {
177  if( command == fDimensionsCmd ){
179  }
180  else if (command == fHousingThicknessCmd){
182  ->GetNewDoubleValue(newValue));
183  }
184  else if (command == fPmtRadiusCmd){
186  }
187  else if (command == fNxCmd){
189  }
190  else if (command == fNyCmd){
192  }
193  else if (command == fNzCmd){
195  }
196  else if (command == fSphereCmd){
198  }
199  else if (command == fReflectivityCmd){
202  }
203  else if (command == fWlsCmd){
205  }
206  else if (command == fLxeCmd){
208  }
209  else if (command == fNFibersCmd){
211  }
212  else if (command == fMainScintYield){
213  fLXeDetector->
214  SetMainScintYield(fMainScintYield->GetNewDoubleValue(newValue));
215  }
216  else if (command == fWLSScintYield){
218  }
219  else if( command == fSaveThresholdCmd ){
221  }
222  else if (command == fDefaultsCmd){
224 
225  G4RunManager::GetRunManager()->ReinitializeGeometry(); //Add here this line
226  }
227 }