ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
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
"
32
#include "
LXeDetectorConstruction.hh
"
33
34
#include "
G4UIcmdWithADoubleAndUnit.hh
"
35
#include "
G4UIcmdWith3VectorAndUnit.hh
"
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
47
LXeDetectorMessenger::LXeDetectorMessenger
(
LXeDetectorConstruction
* detector)
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
58
fDimensionsCmd
=
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
66
fHousingThicknessCmd
=
new
G4UIcmdWithADoubleAndUnit
67
(
"/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
74
fPmtRadiusCmd
=
new
G4UIcmdWithADoubleAndUnit
75
(
"/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
125
fMainScintYield
=
new
G4UIcmdWithADouble
(
"/LXe/detector/MainScintYield"
,
this
);
126
fMainScintYield
->
SetGuidance
(
"Set scinitillation yield of main volume."
);
127
fMainScintYield
->
SetGuidance
(
"Specified in photons/MeV"
);
128
fMainScintYield
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
129
fMainScintYield
->
SetToBeBroadcasted
(
false
);
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"
);
134
fWLSScintYield
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
135
fWLSScintYield
->
SetToBeBroadcasted
(
false
);
136
137
fSaveThresholdCmd
=
new
G4UIcmdWithAnInteger
(
"/LXe/saveThreshold"
,
this
);
138
fSaveThresholdCmd
->
139
SetGuidance
(
"Set the photon count threshold for saving the random number seed"
);
140
fSaveThresholdCmd
->
SetParameterName
(
"photons"
,
true
);
141
fSaveThresholdCmd
->
SetDefaultValue
(4500);
142
fSaveThresholdCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
143
144
fDefaultsCmd
=
new
G4UIcommand
(
"/LXe/detector/defaults"
,
this
);
145
fDefaultsCmd
->
SetGuidance
(
"Set all detector geometry values to defaults."
);
146
fDefaultsCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
147
fDefaultsCmd
->
SetToBeBroadcasted
(
false
);
148
}
149
150
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
151
152
LXeDetectorMessenger::~LXeDetectorMessenger
()
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
175
void
LXeDetectorMessenger::SetNewValue
(
G4UIcommand
* command,
G4String
newValue)
176
{
177
if
( command ==
fDimensionsCmd
){
178
fLXeDetector
->
SetDimensions
(
fDimensionsCmd
->
GetNew3VectorValue
(newValue));
179
}
180
else
if
(command ==
fHousingThicknessCmd
){
181
fLXeDetector
->
SetHousingThickness
(
fHousingThicknessCmd
182
->GetNewDoubleValue(newValue));
183
}
184
else
if
(command ==
fPmtRadiusCmd
){
185
fLXeDetector
->
SetPMTRadius
(
fPmtRadiusCmd
->
GetNewDoubleValue
(newValue));
186
}
187
else
if
(command ==
fNxCmd
){
188
fLXeDetector
->
SetNX
(
fNxCmd
->
GetNewIntValue
(newValue));
189
}
190
else
if
(command ==
fNyCmd
){
191
fLXeDetector
->
SetNY
(
fNyCmd
->
GetNewIntValue
(newValue));
192
}
193
else
if
(command ==
fNzCmd
){
194
fLXeDetector
->
SetNZ
(
fNzCmd
->
GetNewIntValue
(newValue));
195
}
196
else
if
(command ==
fSphereCmd
){
197
fLXeDetector
->
SetSphereOn
(
fSphereCmd
->
GetNewBoolValue
(newValue));
198
}
199
else
if
(command ==
fReflectivityCmd
){
200
fLXeDetector
201
->
SetHousingReflectivity
(
fReflectivityCmd
->
GetNewDoubleValue
(newValue));
202
}
203
else
if
(command ==
fWlsCmd
){
204
fLXeDetector
->
SetWLSSlabOn
(
fWlsCmd
->
GetNewBoolValue
(newValue));
205
}
206
else
if
(command ==
fLxeCmd
){
207
fLXeDetector
->
SetMainVolumeOn
(
fLxeCmd
->
GetNewBoolValue
(newValue));
208
}
209
else
if
(command ==
fNFibersCmd
){
210
fLXeDetector
->
SetNFibers
(
fNFibersCmd
->
GetNewIntValue
(newValue));
211
}
212
else
if
(command ==
fMainScintYield
){
213
fLXeDetector
->
214
SetMainScintYield(
fMainScintYield
->
GetNewDoubleValue
(newValue));
215
}
216
else
if
(command ==
fWLSScintYield
){
217
fLXeDetector
->
SetWLSScintYield
(
fWLSScintYield
->
GetNewDoubleValue
(newValue));
218
}
219
else
if
( command ==
fSaveThresholdCmd
){
220
fLXeDetector
->
SetSaveThreshold
(
fSaveThresholdCmd
->
GetNewIntValue
(newValue));
221
}
222
else
if
(command ==
fDefaultsCmd
){
223
fLXeDetector
->
SetDefaults
();
224
225
G4RunManager::GetRunManager
()->
ReinitializeGeometry
();
//Add here this line
226
}
227
}
geant4
tree
geant4-10.6-release
examples
extended
optical
LXe
src
LXeDetectorMessenger.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:08
using
1.8.2 with
ECCE GitHub integration