Loading...
Searching...
No Matches
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//
27/// \file optical/LXe/src/LXeDetectorMessenger.cc
28/// \brief Implementation of the LXeDetectorMessenger class
29//
30//
32
34
35#include "G4RunManager.hh"
36#include "G4Scintillation.hh"
37#include "G4UIcmdWithABool.hh"
38#include "G4UIcmdWithADouble.hh"
39#include "G4UIcmdWithADoubleAndUnit.hh"
40#include "G4UIcmdWithAnInteger.hh"
41#include "G4UIcmdWith3VectorAndUnit.hh"
42#include "G4UIcommand.hh"
43#include "G4UIdirectory.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);
62 fDimensionsCmd->SetDefaultUnit("cm");
63 fDimensionsCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
64 fDimensionsCmd->SetToBeBroadcasted(false);
65
67 new G4UIcmdWithADoubleAndUnit("/LXe/detector/housingThickness", this);
68 fHousingThicknessCmd->SetGuidance("Set the thickness of the housing.");
69 fHousingThicknessCmd->SetParameterName("d_mtl", false);
70 fHousingThicknessCmd->SetDefaultUnit("cm");
71 fHousingThicknessCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
72 fHousingThicknessCmd->SetToBeBroadcasted(false);
73
75 new G4UIcmdWithADoubleAndUnit("/LXe/detector/pmtRadius", this);
76 fPmtRadiusCmd->SetGuidance("Set the radius of the PMTs.");
77 fPmtRadiusCmd->SetParameterName("radius", false);
78 fPmtRadiusCmd->SetDefaultUnit("cm");
79 fPmtRadiusCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
80 fPmtRadiusCmd->SetToBeBroadcasted(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);
85 fNxCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
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);
91 fNyCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
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);
97 fNzCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
98 fNzCmd->SetToBeBroadcasted(false);
99
100 fSphereCmd = new G4UIcmdWithABool("/LXe/detector/volumes/sphere", this);
101 fSphereCmd->SetGuidance("Enable/Disable the sphere.");
102 fSphereCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
103 fSphereCmd->SetToBeBroadcasted(false);
104
105 fReflectivityCmd = new G4UIcmdWithADouble("/LXe/detector/reflectivity", this);
106 fReflectivityCmd->SetGuidance("Set the reflectivity of the housing.");
107 fReflectivityCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
108 fReflectivityCmd->SetToBeBroadcasted(false);
109
110 fWlsCmd = new G4UIcmdWithABool("/LXe/detector/volumes/wls", this);
111 fWlsCmd->SetGuidance("Enable/Disable the WLS slab");
112 fWlsCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
113 fWlsCmd->SetToBeBroadcasted(false);
114
115 fLxeCmd = new G4UIcmdWithABool("/LXe/detector/volumes/lxe", this);
116 fLxeCmd->SetGuidance("Enable/Disable the main detector volume.");
117 fLxeCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
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.");
122 fNFibersCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
123 fNFibersCmd->SetToBeBroadcasted(false);
124
126 new G4UIcmdWithADouble("/LXe/detector/MainScintYield", this);
127 fMainScintYield->SetGuidance("Set scinitillation yield of main volume.");
128 fMainScintYield->SetGuidance("Specified in photons/MeV");
129 fMainScintYield->AvailableForStates(G4State_PreInit, G4State_Idle);
130 fMainScintYield->SetToBeBroadcasted(false);
131
132 fWLSScintYield = new G4UIcmdWithADouble("/LXe/detector/WLSScintYield", this);
133 fWLSScintYield->SetGuidance("Set scintillation yield of WLS Slab");
134 fWLSScintYield->SetGuidance("Specified in photons/MeV");
135 fWLSScintYield->AvailableForStates(G4State_PreInit, G4State_Idle);
136 fWLSScintYield->SetToBeBroadcasted(false);
137
138 fSaveThresholdCmd = new G4UIcmdWithAnInteger("/LXe/saveThreshold", this);
139 fSaveThresholdCmd->SetGuidance(
140 "Set the photon count threshold for saving the random number seed");
141 fSaveThresholdCmd->SetParameterName("photons", true);
142 fSaveThresholdCmd->SetDefaultValue(4500);
143 fSaveThresholdCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
144
145 fDefaultsCmd = new G4UIcommand("/LXe/detector/defaults", this);
146 fDefaultsCmd->SetGuidance("Set all detector geometry values to defaults.");
147 fDefaultsCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
148 fDefaultsCmd->SetToBeBroadcasted(false);
149}
150
151//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
152
154{
155 delete fDimensionsCmd;
157 delete fPmtRadiusCmd;
158 delete fNxCmd;
159 delete fNyCmd;
160 delete fNzCmd;
161 delete fSphereCmd;
162 delete fWlsCmd;
163 delete fLxeCmd;
164 delete fNFibersCmd;
165 delete fReflectivityCmd;
166 delete fMainScintYield;
167 delete fWLSScintYield;
168 delete fSaveThresholdCmd;
169 delete fDefaultsCmd;
170 delete fDetectorDir;
171 delete fVolumesDir;
172}
173
174//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
175
177{
178 if(command == fDimensionsCmd)
179 {
180 fLXeDetector->SetDimensions(fDimensionsCmd->GetNew3VectorValue(newValue));
181 }
182 else if(command == fHousingThicknessCmd)
183 {
185 fHousingThicknessCmd->GetNewDoubleValue(newValue));
186 }
187 else if(command == fPmtRadiusCmd)
188 {
189 fLXeDetector->SetPMTRadius(fPmtRadiusCmd->GetNewDoubleValue(newValue));
190 }
191 else if(command == fNxCmd)
192 {
193 fLXeDetector->SetNX(fNxCmd->GetNewIntValue(newValue));
194 }
195 else if(command == fNyCmd)
196 {
197 fLXeDetector->SetNY(fNyCmd->GetNewIntValue(newValue));
198 }
199 else if(command == fNzCmd)
200 {
201 fLXeDetector->SetNZ(fNzCmd->GetNewIntValue(newValue));
202 }
203 else if(command == fSphereCmd)
204 {
205 fLXeDetector->SetSphereOn(fSphereCmd->GetNewBoolValue(newValue));
206 }
207 else if(command == fReflectivityCmd)
208 {
210 fReflectivityCmd->GetNewDoubleValue(newValue));
211 }
212 else if(command == fWlsCmd)
213 {
214 fLXeDetector->SetWLSSlabOn(fWlsCmd->GetNewBoolValue(newValue));
215 }
216 else if(command == fLxeCmd)
217 {
218 fLXeDetector->SetMainVolumeOn(fLxeCmd->GetNewBoolValue(newValue));
219 }
220 else if(command == fNFibersCmd)
221 {
222 fLXeDetector->SetNFibers(fNFibersCmd->GetNewIntValue(newValue));
223 }
224 else if(command == fMainScintYield)
225 {
227 fMainScintYield->GetNewDoubleValue(newValue));
228 }
229 else if(command == fWLSScintYield)
230 {
231 fLXeDetector->SetWLSScintYield(fWLSScintYield->GetNewDoubleValue(newValue));
232 }
233 else if(command == fSaveThresholdCmd)
234 {
235 fLXeDetector->SetSaveThreshold(fSaveThresholdCmd->GetNewIntValue(newValue));
236 }
237 else if(command == fDefaultsCmd)
238 {
240 G4RunManager::GetRunManager()->ReinitializeGeometry();
241 }
242}
Definition of the LXeDetectorConstruction class.
Definition of the LXeDetectorMessenger class.
G4UIcmdWithAnInteger * fSaveThresholdCmd
LXeDetectorMessenger(LXeDetectorConstruction *)
G4UIcmdWithADouble * fMainScintYield
G4UIcmdWithABool * fLxeCmd
G4UIcmdWithADoubleAndUnit * fPmtRadiusCmd
LXeDetectorConstruction * fLXeDetector
G4UIcmdWithADouble * fReflectivityCmd
G4UIcmdWithAnInteger * fNyCmd
G4UIcmdWithABool * fSphereCmd
G4UIcmdWithADouble * fWLSScintYield
G4UIcmdWithAnInteger * fNxCmd
void SetNewValue(G4UIcommand *, G4String) override
G4UIcmdWith3VectorAndUnit * fDimensionsCmd
G4UIcmdWithAnInteger * fNFibersCmd
G4UIcmdWithADoubleAndUnit * fHousingThicknessCmd
G4UIcmdWithABool * fWlsCmd
G4UIcmdWithAnInteger * fNzCmd

Applications | User Support | Publications | Collaboration