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
WLSDetectorMessenger.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file WLSDetectorMessenger.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 "
WLSDetectorMessenger.hh
"
32
33
#include "
G4UIdirectory.hh
"
34
#include "
G4UIcmdWithABool.hh
"
35
#include "
G4UIcmdWithAString.hh
"
36
#include "
G4UIcmdWithADouble.hh
"
37
#include "
G4UIcmdWithAnInteger.hh
"
38
#include "
G4UIcmdWithADoubleAndUnit.hh
"
39
#include "
G4UIcmdWithoutParameter.hh
"
40
41
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
42
43
WLSDetectorMessenger::WLSDetectorMessenger
(
WLSDetectorConstruction
* det)
44
: fDetector(det)
45
{
46
fDetDir
=
new
G4UIdirectory
(
"/WLS/"
);
47
fDetDir
->
SetGuidance
(
" Geometry Setup "
);
48
49
fSetPhotonDetGeometryCmd
=
50
new
G4UIcmdWithAString
(
"/WLS/setPhotonDetGeometry"
,
this
);
51
fSetPhotonDetGeometryCmd
->
52
SetGuidance(
"Select the geometry of the PhotonDet detector"
);
53
fSetPhotonDetGeometryCmd
->
SetGuidance
(
"Only Accepts 'Circle' and 'Square'"
);
54
fSetPhotonDetGeometryCmd
->
SetCandidates
(
"Circle Square"
);
55
fSetPhotonDetGeometryCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
56
fSetPhotonDetGeometryCmd
->
SetToBeBroadcasted
(
false
);
57
58
fSetNumOfCladLayersCmd
=
59
new
G4UIcmdWithAnInteger
(
"/WLS/setNumOfLayers"
,
this
);
60
fSetNumOfCladLayersCmd
->
SetGuidance
(
"Select the number of cladding layers"
);
61
fSetNumOfCladLayersCmd
->
SetGuidance
(
"Maximum number is 2"
);
62
fSetNumOfCladLayersCmd
->
SetParameterName
(
"numberOfLayers"
,
false
);
63
fSetNumOfCladLayersCmd
->
SetRange
(
"numberOfLayers>=0 && numberOfLayers<=2"
);
64
fSetNumOfCladLayersCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
65
fSetNumOfCladLayersCmd
->
SetToBeBroadcasted
(
false
);
66
67
fSetSurfaceRoughnessCmd
=
68
new
G4UIcmdWithADouble
(
"/WLS/setSurfaceRoughness"
,
this
);
69
fSetSurfaceRoughnessCmd
->
70
SetGuidance(
"Set the roughness between Clad1 and WLS Fiber"
);
71
fSetSurfaceRoughnessCmd
->
SetParameterName
(
"roughness"
,
false
);
72
fSetSurfaceRoughnessCmd
->
SetRange
(
"roughness>0 && roughness<=1"
);
73
fSetSurfaceRoughnessCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
74
fSetSurfaceRoughnessCmd
->
SetToBeBroadcasted
(
false
);
75
76
fSetXYRatioCmd
=
new
G4UIcmdWithADouble
(
"/WLS/setXYRatio"
,
this
);
77
fSetXYRatioCmd
->
SetGuidance
(
"Set the ratio between x and y axis (x/y)"
);
78
fSetXYRatioCmd
->
SetParameterName
(
"ratio"
,
false
);
79
fSetXYRatioCmd
->
SetRange
(
"ratio>0 && ratio<=1"
);
80
fSetXYRatioCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
81
fSetXYRatioCmd
->
SetToBeBroadcasted
(
false
);
82
83
fSetMirrorPolishCmd
=
new
G4UIcmdWithADouble
(
"/WLS/setMirrorPolish"
,
this
);
84
fSetMirrorPolishCmd
->
SetGuidance
(
"Set the polish of the mirror"
);
85
fSetMirrorPolishCmd
->
SetParameterName
(
"polish"
,
false
);
86
fSetMirrorPolishCmd
->
SetRange
(
"polish>0 && polish<=1"
);
87
fSetMirrorPolishCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
88
fSetMirrorPolishCmd
->
SetToBeBroadcasted
(
false
);
89
90
fSetMirrorReflectivityCmd
=
91
new
G4UIcmdWithADouble
(
"/WLS/setMirrorReflectivity"
,
this
);
92
fSetMirrorReflectivityCmd
->
SetGuidance
(
"Set the reflectivity of the mirror"
);
93
fSetMirrorReflectivityCmd
->
SetParameterName
(
"reflectivity"
,
false
);
94
fSetMirrorReflectivityCmd
->
SetRange
(
"reflectivity>=0 && reflectivity<=1"
);
95
fSetMirrorReflectivityCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
96
fSetMirrorReflectivityCmd
->
SetToBeBroadcasted
(
false
);
97
98
fSetPhotonDetPolishCmd
=
99
new
G4UIcmdWithADouble
(
"/WLS/setPhotonDetPolish"
,
this
);
100
fSetPhotonDetPolishCmd
->
SetGuidance
(
"Set the polish of the mirror"
);
101
fSetPhotonDetPolishCmd
->
SetParameterName
(
"polish"
,
false
);
102
fSetPhotonDetPolishCmd
->
SetRange
(
"polish>0 && polish<=1"
);
103
fSetPhotonDetPolishCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
104
fSetPhotonDetPolishCmd
->
SetToBeBroadcasted
(
false
);
105
106
fSetPhotonDetReflectivityCmd
=
107
new
G4UIcmdWithADouble
(
"/WLS/setPhotonDetReflectivity"
,
this
);
108
fSetPhotonDetReflectivityCmd
->
109
SetGuidance(
"Set the reflectivity of the mirror"
);
110
fSetPhotonDetReflectivityCmd
->
SetParameterName
(
"reflectivity"
,
false
);
111
fSetPhotonDetReflectivityCmd
->
SetRange
(
"reflectivity>=0 && reflectivity<=1"
);
112
fSetPhotonDetReflectivityCmd
->
AvailableForStates
(
G4State_PreInit
);
113
fSetPhotonDetReflectivityCmd
->
SetToBeBroadcasted
(
false
);
114
115
fSetWLSLengthCmd
=
new
G4UIcmdWithADoubleAndUnit
(
"/WLS/setWLSLength"
,
this
);
116
fSetWLSLengthCmd
->
SetGuidance
(
"Set the half length of the WLS fiber"
);
117
fSetWLSLengthCmd
->
SetParameterName
(
"length"
,
false
);
118
fSetWLSLengthCmd
->
SetRange
(
"length>0."
);
119
fSetWLSLengthCmd
->
SetUnitCategory
(
"Length"
);
120
fSetWLSLengthCmd
->
SetDefaultUnit
(
"mm"
);
121
fSetWLSLengthCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
122
fSetWLSLengthCmd
->
SetToBeBroadcasted
(
false
);
123
124
fSetWLSRadiusCmd
=
new
G4UIcmdWithADoubleAndUnit
(
"/WLS/setWLSRadius"
,
this
);
125
fSetWLSRadiusCmd
->
SetGuidance
(
"Set the radius of the WLS fiber"
);
126
fSetWLSRadiusCmd
->
SetParameterName
(
"radius"
,
false
);
127
fSetWLSRadiusCmd
->
SetRange
(
"radius>0."
);
128
fSetWLSRadiusCmd
->
SetUnitCategory
(
"Length"
);
129
fSetWLSRadiusCmd
->
SetDefaultUnit
(
"mm"
);
130
fSetWLSRadiusCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
131
fSetWLSRadiusCmd
->
SetToBeBroadcasted
(
false
);
132
133
fSetClad1RadiusCmd
=
134
new
G4UIcmdWithADoubleAndUnit
(
"/WLS/setClad1Radius"
,
this
);
135
fSetClad1RadiusCmd
->
SetGuidance
(
"Set the radius of Cladding 1"
);
136
fSetClad1RadiusCmd
->
SetParameterName
(
"radius"
,
false
);
137
fSetClad1RadiusCmd
->
SetRange
(
"radius>0."
);
138
fSetClad1RadiusCmd
->
SetUnitCategory
(
"Length"
);
139
fSetClad1RadiusCmd
->
SetDefaultUnit
(
"mm"
);
140
fSetClad1RadiusCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
141
fSetClad1RadiusCmd
->
SetToBeBroadcasted
(
false
);
142
143
fSetClad2RadiusCmd
=
144
new
G4UIcmdWithADoubleAndUnit
(
"/WLS/setClad2Radius"
,
this
);
145
fSetClad2RadiusCmd
->
SetGuidance
(
"Set the radius of Cladding 2"
);
146
fSetClad2RadiusCmd
->
SetParameterName
(
"radius"
,
false
);
147
fSetClad2RadiusCmd
->
SetRange
(
"radius>0."
);
148
fSetClad2RadiusCmd
->
SetUnitCategory
(
"Length"
);
149
fSetClad2RadiusCmd
->
SetDefaultUnit
(
"mm"
);
150
fSetClad2RadiusCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
151
fSetClad2RadiusCmd
->
SetToBeBroadcasted
(
false
);
152
153
fSetPhotonDetHalfLengthCmd
=
154
new
G4UIcmdWithADoubleAndUnit
(
"/WLS/setPhotonDetHalfLength"
,
this
);
155
fSetPhotonDetHalfLengthCmd
->
156
SetGuidance(
"Set the half length of PhotonDet detector"
);
157
fSetPhotonDetHalfLengthCmd
->
SetParameterName
(
"halfL"
,
false
);
158
fSetPhotonDetHalfLengthCmd
->
SetRange
(
"halfL>0."
);
159
fSetPhotonDetHalfLengthCmd
->
SetUnitCategory
(
"Length"
);
160
fSetPhotonDetHalfLengthCmd
->
SetDefaultUnit
(
"mm"
);
161
fSetPhotonDetHalfLengthCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
162
fSetPhotonDetHalfLengthCmd
->
SetToBeBroadcasted
(
false
);
163
164
fSetGapCmd
=
new
G4UIcmdWithADoubleAndUnit
(
"/WLS/setGap"
,
this
);
165
fSetGapCmd
->
SetGuidance
(
"Set the distance between PhotonDet and fiber end"
);
166
fSetGapCmd
->
SetParameterName
(
"theta"
,
false
);
167
fSetGapCmd
->
SetUnitCategory
(
"Length"
);
168
fSetGapCmd
->
SetDefaultUnit
(
"mm"
);
169
fSetGapCmd
->
SetRange
(
"theta>=0."
);
170
fSetGapCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
171
fSetGapCmd
->
SetToBeBroadcasted
(
false
);
172
173
fSetPhotonDetAlignmentCmd
=
174
new
G4UIcmdWithADoubleAndUnit
(
"/WLS/setAlignment"
,
this
);
175
fSetPhotonDetAlignmentCmd
->
176
SetGuidance(
"Set the deviation of PhotonDet from z axis"
);
177
fSetPhotonDetAlignmentCmd
->
SetParameterName
(
"theta"
,
false
);
178
fSetPhotonDetAlignmentCmd
->
SetUnitCategory
(
"Angle"
);
179
fSetPhotonDetAlignmentCmd
->
SetDefaultUnit
(
"deg"
);
180
fSetPhotonDetAlignmentCmd
->
SetRange
(
"theta>-90. && theta<90."
);
181
fSetPhotonDetAlignmentCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
182
fSetPhotonDetAlignmentCmd
->
SetToBeBroadcasted
(
false
);
183
184
fSetMirrorCmd
=
new
G4UIcmdWithABool
(
"/WLS/setMirror"
,
this
);
185
fSetMirrorCmd
->
SetGuidance
(
"Place a mirror at the end of the fiber"
);
186
fSetMirrorCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
187
fSetMirrorCmd
->
SetToBeBroadcasted
(
false
);
188
189
fSetBarLengthCmd
=
new
G4UIcmdWithADoubleAndUnit
(
"/WLS/setBarLength"
,
this
);
190
fSetBarLengthCmd
->
SetGuidance
(
"Set the length of the scintillator bar"
);
191
fSetBarLengthCmd
->
SetParameterName
(
"length"
,
false
);
192
fSetBarLengthCmd
->
SetRange
(
"length>0."
);
193
fSetBarLengthCmd
->
SetUnitCategory
(
"Length"
);
194
fSetBarLengthCmd
->
SetDefaultUnit
(
"mm"
);
195
fSetBarLengthCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
196
fSetBarLengthCmd
->
SetToBeBroadcasted
(
false
);
197
198
fSetBarBaseCmd
=
new
G4UIcmdWithADoubleAndUnit
(
"/WLS/setBarBase"
,
this
);
199
fSetBarBaseCmd
->
SetGuidance
(
"Set the side length of the scintillator bar"
);
200
fSetBarBaseCmd
->
SetParameterName
(
"length"
,
false
);
201
fSetBarBaseCmd
->
SetRange
(
"length>0."
);
202
fSetBarBaseCmd
->
SetUnitCategory
(
"Length"
);
203
fSetBarBaseCmd
->
SetDefaultUnit
(
"mm"
);
204
fSetBarBaseCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
205
fSetBarBaseCmd
->
SetToBeBroadcasted
(
false
);
206
207
fSetHoleRadiusCmd
=
new
G4UIcmdWithADoubleAndUnit
(
"/WLS/setHoleRadius"
,
this
);
208
fSetHoleRadiusCmd
->
SetGuidance
(
"Set the radius of the fiber hole"
);
209
fSetHoleRadiusCmd
->
SetParameterName
(
"radius"
,
false
);
210
fSetHoleRadiusCmd
->
SetRange
(
"radius>0."
);
211
fSetHoleRadiusCmd
->
SetUnitCategory
(
"Length"
);
212
fSetHoleRadiusCmd
->
SetDefaultUnit
(
"mm"
);
213
fSetHoleRadiusCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
214
fSetHoleRadiusCmd
->
SetToBeBroadcasted
(
false
);
215
216
fSetCoatingThicknessCmd
=
217
new
G4UIcmdWithADoubleAndUnit
(
"/WLS/setCoatingThickness"
,
this
);
218
fSetCoatingThicknessCmd
->
219
SetGuidance(
"Set thickness of the coating on the bars"
);
220
fSetCoatingThicknessCmd
->
SetParameterName
(
"thick"
,
false
);
221
fSetCoatingThicknessCmd
->
SetUnitCategory
(
"Length"
);
222
fSetCoatingThicknessCmd
->
SetDefaultUnit
(
"mm"
);
223
fSetCoatingThicknessCmd
->
SetRange
(
"thick>=0."
);
224
fSetCoatingThicknessCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
225
fSetCoatingThicknessCmd
->
SetToBeBroadcasted
(
false
);
226
227
fSetCoatingRadiusCmd
=
228
new
G4UIcmdWithADoubleAndUnit
(
"/WLS/setCoatingRadius"
,
this
);
229
fSetCoatingRadiusCmd
->
230
SetGuidance(
"Set inner radius of the corner bar coating"
);
231
fSetCoatingRadiusCmd
->
SetParameterName
(
"cradius"
,
false
);
232
fSetCoatingRadiusCmd
->
SetUnitCategory
(
"Length"
);
233
fSetCoatingRadiusCmd
->
SetDefaultUnit
(
"mm"
);
234
fSetCoatingRadiusCmd
->
SetRange
(
"cradius>=0."
);
235
fSetCoatingRadiusCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
236
fSetCoatingRadiusCmd
->
SetToBeBroadcasted
(
false
);
237
}
238
239
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
240
241
WLSDetectorMessenger::~WLSDetectorMessenger
()
242
{
243
delete
fDetDir
;
244
245
delete
fSetPhotonDetGeometryCmd
;
246
delete
fSetNumOfCladLayersCmd
;
247
delete
fSetWLSLengthCmd
;
248
delete
fSetWLSRadiusCmd
;
249
delete
fSetClad1RadiusCmd
;
250
delete
fSetClad2RadiusCmd
;
251
delete
fSetPhotonDetHalfLengthCmd
;
252
delete
fSetGapCmd
;
253
delete
fSetPhotonDetAlignmentCmd
;
254
delete
fSetSurfaceRoughnessCmd
;
255
delete
fSetMirrorPolishCmd
;
256
delete
fSetMirrorReflectivityCmd
;
257
delete
fSetXYRatioCmd
;
258
delete
fSetMirrorCmd
;
259
delete
fSetBarLengthCmd
;
260
delete
fSetBarBaseCmd
;
261
delete
fSetHoleRadiusCmd
;
262
delete
fSetCoatingThicknessCmd
;
263
delete
fSetCoatingRadiusCmd
;
264
}
265
266
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
267
268
void
WLSDetectorMessenger::SetNewValue
(
G4UIcommand
* command,
G4String
val)
269
{
270
if
( command ==
fSetPhotonDetGeometryCmd
) {
271
272
fDetector
->
SetPhotonDetGeometry
(val);
273
}
274
else
if
( command ==
fSetNumOfCladLayersCmd
) {
275
276
fDetector
->
SetNumberOfCladding
(
G4UIcmdWithAnInteger::GetNewIntValue
(val));
277
}
278
else
if
( command ==
fSetSurfaceRoughnessCmd
) {
279
280
fDetector
->
SetSurfaceRoughness
(
G4UIcmdWithADouble::GetNewDoubleValue
(val));
281
}
282
else
if
( command ==
fSetXYRatioCmd
) {
283
284
fDetector
->
SetXYRatio
(
G4UIcmdWithADouble::GetNewDoubleValue
(val));
285
}
286
else
if
( command ==
fSetMirrorPolishCmd
) {
287
288
fDetector
->
SetMirrorPolish
(
G4UIcmdWithADouble::GetNewDoubleValue
(val));
289
}
290
else
if
( command ==
fSetMirrorReflectivityCmd
) {
291
292
fDetector
->
293
SetMirrorReflectivity(
G4UIcmdWithADouble::GetNewDoubleValue
(val));
294
}
295
else
if
( command ==
fSetPhotonDetPolishCmd
) {
296
297
fDetector
->
SetPhotonDetPolish
(
G4UIcmdWithADouble::GetNewDoubleValue
(val));
298
}
299
else
if
( command ==
fSetPhotonDetReflectivityCmd
) {
300
301
fDetector
->
302
SetPhotonDetReflectivity(
G4UIcmdWithADouble::GetNewDoubleValue
(val));
303
}
304
else
if
( command ==
fSetWLSLengthCmd
) {
305
306
fDetector
->
SetWLSLength
(
G4UIcmdWithADoubleAndUnit::GetNewDoubleValue
(val));
307
}
308
else
if
( command ==
fSetWLSRadiusCmd
) {
309
310
fDetector
->
SetWLSRadius
(
G4UIcmdWithADoubleAndUnit::GetNewDoubleValue
(val));
311
}
312
else
if
( command ==
fSetClad1RadiusCmd
) {
313
314
fDetector
->
315
SetClad1Radius(
G4UIcmdWithADoubleAndUnit::GetNewDoubleValue
(val));
316
}
317
else
if
( command ==
fSetClad2RadiusCmd
) {
318
319
fDetector
->
320
SetClad2Radius(
G4UIcmdWithADoubleAndUnit::GetNewDoubleValue
(val));
321
}
322
else
if
( command ==
fSetPhotonDetHalfLengthCmd
) {
323
324
fDetector
->
325
SetPhotonDetHalfLength(
G4UIcmdWithADoubleAndUnit::GetNewDoubleValue
(val));
326
}
327
else
if
( command ==
fSetGapCmd
) {
328
329
fDetector
->
SetGap
(
G4UIcmdWithADoubleAndUnit::GetNewDoubleValue
(val));
330
}
331
else
if
( command ==
fSetPhotonDetAlignmentCmd
) {
332
333
fDetector
->
334
SetPhotonDetAlignment(
G4UIcmdWithADoubleAndUnit::GetNewDoubleValue
(val));
335
}
336
else
if
( command ==
fSetMirrorCmd
) {
337
338
fDetector
->
SetMirror
(
G4UIcmdWithABool::GetNewBoolValue
(val));
339
}
340
else
if
( command ==
fSetBarLengthCmd
) {
341
342
fDetector
->
SetBarLength
(
G4UIcmdWithABool::GetNewBoolValue
(val));
343
}
344
else
if
( command ==
fSetBarBaseCmd
) {
345
346
fDetector
->
SetBarBase
(
G4UIcmdWithABool::GetNewBoolValue
(val));
347
}
348
else
if
( command ==
fSetHoleRadiusCmd
) {
349
350
fDetector
->
SetHoleRadius
(
G4UIcmdWithABool::GetNewBoolValue
(val));
351
}
352
else
if
( command ==
fSetCoatingThicknessCmd
) {
353
354
fDetector
->
SetCoatingThickness
(
G4UIcmdWithABool::GetNewBoolValue
(val));
355
}
356
else
if
( command ==
fSetCoatingRadiusCmd
) {
357
358
fDetector
->
SetCoatingRadius
(
G4UIcmdWithABool::GetNewBoolValue
(val));
359
}
360
}
geant4
tree
geant4-10.6-release
examples
extended
optical
wls
src
WLSDetectorMessenger.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:08
using
1.8.2 with
ECCE GitHub integration