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
GammaRayTelDetectorMessenger.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file GammaRayTelDetectorMessenger.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
//
27
//
28
// ------------------------------------------------------------
29
// GEANT 4 class implementation file
30
// CERN Geneva Switzerland
31
//
32
//
33
// ------------ GammaRayTelDetectorMessenger ------
34
// by F.Longo, R.Giannitrapani & G.Santin (13 nov 2000)
35
//
36
// ************************************************************
37
38
#include "
GammaRayTelDetectorMessenger.hh
"
39
40
#include "
GammaRayTelDetectorConstruction.hh
"
41
#include "
G4UIdirectory.hh
"
42
#include "
G4UIcmdWithAString.hh
"
43
#include "
G4UIcmdWithAnInteger.hh
"
44
#include "
G4UIcmdWithADoubleAndUnit.hh
"
45
#include "
G4UIcmdWithoutParameter.hh
"
46
47
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
48
49
GammaRayTelDetectorMessenger::GammaRayTelDetectorMessenger
(
GammaRayTelDetectorConstruction
* GammaRayTelDet)
50
:GammaRayTelDetector(GammaRayTelDet)
51
52
{
53
GammaRayTeldetDir
=
new
G4UIdirectory
(
"/payload/"
);
54
GammaRayTeldetDir
->
SetGuidance
(
"GammaRayTel payload control."
);
55
56
// converter material command
57
58
ConverterMaterCmd
=
new
G4UIcmdWithAString
(
"/payload/setConvMat"
,
this
);
59
ConverterMaterCmd
->
SetGuidance
(
"Select Material of the Converter."
);
60
ConverterMaterCmd
->
SetParameterName
(
"choice"
,
false
);
61
ConverterMaterCmd
->
AvailableForStates
(
G4State_Idle
);
62
63
// converter thickness command
64
65
ConverterThickCmd
=
new
G4UIcmdWithADoubleAndUnit
66
(
"/payload/setConvThick"
,
this
);
67
ConverterThickCmd
->
SetGuidance
(
"Set Thickness of the Converter"
);
68
ConverterThickCmd
->
SetParameterName
(
"Size"
,
false
);
69
ConverterThickCmd
->
SetRange
(
"Size>=0."
);
70
ConverterThickCmd
->
SetUnitCategory
(
"Length"
);
71
ConverterThickCmd
->
AvailableForStates
(
G4State_Idle
);
72
73
// tracker silicon thickness command
74
75
SiliconThickCmd
=
new
G4UIcmdWithADoubleAndUnit
76
(
"/payload/setSiThick"
,
this
);
77
SiliconThickCmd
->
SetGuidance
(
"Set Thickness of the Silicon"
);
78
SiliconThickCmd
->
SetParameterName
(
"Size"
,
false
);
79
SiliconThickCmd
->
SetRange
(
"Size>=0."
);
80
SiliconThickCmd
->
SetUnitCategory
(
"Length"
);
81
SiliconThickCmd
->
AvailableForStates
(
G4State_Idle
);
82
83
// tracker silicon pitch command
84
85
SiliconPitchCmd
=
new
G4UIcmdWithADoubleAndUnit
86
(
"/payload/setSiPitch"
,
this
);
87
SiliconPitchCmd
->
SetGuidance
(
"Set Pitch of the Silicon Strips"
);
88
SiliconPitchCmd
->
SetParameterName
(
"Size"
,
false
);
89
SiliconPitchCmd
->
SetRange
(
"Size>=0."
);
90
SiliconPitchCmd
->
SetUnitCategory
(
"Length"
);
91
SiliconPitchCmd
->
AvailableForStates
(
G4State_Idle
);
92
93
// tracker silicon tile size command
94
95
SiliconTileXYCmd
=
new
G4UIcmdWithADoubleAndUnit
96
(
"/payload/setSiTileXY"
,
this
);
97
SiliconTileXYCmd
->
SetGuidance
(
"Set XY dimensions of Si Tile"
);
98
SiliconTileXYCmd
->
SetParameterName
(
"Size"
,
false
);
99
SiliconTileXYCmd
->
SetRange
(
"Size>=0."
);
100
SiliconTileXYCmd
->
SetUnitCategory
(
"Length"
);
101
SiliconTileXYCmd
->
AvailableForStates
(
G4State_Idle
);
102
103
// tracker number of silicon tiles
104
105
NbSiTilesCmd
=
new
G4UIcmdWithAnInteger
(
"/payload/setNbOfSiTiles"
,
this
);
106
NbSiTilesCmd
->
SetGuidance
(
"Set number of Si Tiles."
);
107
NbSiTilesCmd
->
SetParameterName
(
"NbSiTiles"
,
false
);
108
NbSiTilesCmd
->
SetRange
(
"NbSiTiles>0 && NbSiTiles<100"
);
109
NbSiTilesCmd
->
AvailableForStates
(
G4State_Idle
);
110
111
// tracker number of silicon layers
112
113
NbTKRLayersCmd
=
new
G4UIcmdWithAnInteger
(
"/payload/setNbOfTKRLayers"
,
this
);
114
NbTKRLayersCmd
->
SetGuidance
(
"Set number of TKR Layers."
);
115
NbTKRLayersCmd
->
SetParameterName
(
"NbTKRLayers"
,
false
);
116
NbTKRLayersCmd
->
SetRange
(
"NbTKRLayers>0 && NbTKRLayers<30"
);
117
NbTKRLayersCmd
->
AvailableForStates
(
G4State_Idle
);
118
119
// tracker layer distance
120
121
LayerDistanceCmd
=
new
G4UIcmdWithADoubleAndUnit
122
(
"/payload/setLayerDistance"
,
this
);
123
LayerDistanceCmd
->
SetGuidance
(
"Set distance between two layers"
);
124
LayerDistanceCmd
->
SetParameterName
(
"Size"
,
false
);
125
LayerDistanceCmd
->
SetRange
(
"Size>=0."
);
126
LayerDistanceCmd
->
SetUnitCategory
(
"Length"
);
127
LayerDistanceCmd
->
AvailableForStates
(
G4State_Idle
);
128
129
// tracker views distance
130
131
ViewsDistanceCmd
=
new
G4UIcmdWithADoubleAndUnit
132
(
"/payload/setViewsDistance"
,
this
);
133
ViewsDistanceCmd
->
SetGuidance
(
"Set distance between X and Y views"
);
134
ViewsDistanceCmd
->
SetParameterName
(
"Size"
,
false
);
135
ViewsDistanceCmd
->
SetRange
(
"Size>=0."
);
136
ViewsDistanceCmd
->
SetUnitCategory
(
"Length"
);
137
ViewsDistanceCmd
->
AvailableForStates
(
G4State_Idle
);
138
139
// calorimeter detector thickness
140
141
CALThickCmd
=
new
G4UIcmdWithADoubleAndUnit
142
(
"/payload/setCALThick"
,
this
);
143
CALThickCmd
->
SetGuidance
(
"Set thickness of CAL detectors"
);
144
CALThickCmd
->
SetParameterName
(
"Size"
,
false
);
145
CALThickCmd
->
SetRange
(
"Size>=0."
);
146
CALThickCmd
->
SetUnitCategory
(
"Length"
);
147
CALThickCmd
->
AvailableForStates
(
G4State_Idle
);
148
149
// number calorimeter detectors
150
151
NbCALBarsCmd
=
new
G4UIcmdWithAnInteger
(
"/payload/setNbOfCALBars"
,
this
);
152
NbCALBarsCmd
->
SetGuidance
(
"Set number of CsI Bars."
);
153
NbCALBarsCmd
->
SetParameterName
(
"NbSiTiles"
,
false
);
154
NbCALBarsCmd
->
SetRange
(
"NbSiTiles>0 && NbSiTiles<100"
);
155
NbCALBarsCmd
->
AvailableForStates
(
G4State_Idle
);
156
157
// number calorimeter layers
158
159
NbCALLayersCmd
=
new
G4UIcmdWithAnInteger
(
"/payload/setNbOfCALLayers"
,
this
);
160
NbCALLayersCmd
->
SetGuidance
(
"Set number of CAL Layers."
);
161
NbCALLayersCmd
->
SetParameterName
(
"NbCALLayers"
,
false
);
162
NbCALLayersCmd
->
SetRange
(
"NbCALLayers>0 && NbCALLayers<16"
);
163
NbCALLayersCmd
->
AvailableForStates
(
G4State_Idle
);
164
165
// calorimeter detector thickness
166
167
ACDThickCmd
=
new
G4UIcmdWithADoubleAndUnit
168
(
"/payload/setACDThick"
,
this
);
169
ACDThickCmd
->
SetGuidance
(
"Set thickness of ACD detectors"
);
170
ACDThickCmd
->
SetParameterName
(
"Size"
,
false
);
171
ACDThickCmd
->
SetRange
(
"Size>=0."
);
172
ACDThickCmd
->
SetUnitCategory
(
"Length"
);
173
ACDThickCmd
->
AvailableForStates
(
G4State_Idle
);
174
175
// update Payload
176
177
UpdateCmd
=
new
G4UIcmdWithoutParameter
(
"/payload/update"
,
this
);
178
UpdateCmd
->
SetGuidance
(
"Update payload geometry."
);
179
UpdateCmd
->
SetGuidance
(
"This command MUST be applied before \"beamOn\" "
);
180
UpdateCmd
->
SetGuidance
(
"if you changed geometrical value(s)."
);
181
UpdateCmd
->
AvailableForStates
(
G4State_Idle
);
182
183
// magnetic field
184
185
MagFieldCmd
=
new
G4UIcmdWithADoubleAndUnit
(
"/payload/setField"
,
this
);
186
MagFieldCmd
->
SetGuidance
(
"Define magnetic field."
);
187
MagFieldCmd
->
SetGuidance
(
"Magnetic field will be in Z direction."
);
188
MagFieldCmd
->
SetParameterName
(
"Bz"
,
false
);
189
MagFieldCmd
->
SetUnitCategory
(
"Magnetic flux density"
);
190
MagFieldCmd
->
AvailableForStates
(
G4State_Idle
);
191
}
192
193
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
194
195
GammaRayTelDetectorMessenger::~GammaRayTelDetectorMessenger
()
196
{
197
delete
ConverterMaterCmd
;
delete
ConverterThickCmd
;
198
delete
NbSiTilesCmd
;
delete
NbTKRLayersCmd
;
199
delete
SiliconTileXYCmd
;
delete
SiliconPitchCmd
;
200
delete
SiliconThickCmd
;
delete
LayerDistanceCmd
;
201
delete
ViewsDistanceCmd
;
delete
ACDThickCmd
;
202
delete
NbCALLayersCmd
;
delete
NbCALBarsCmd
;
203
delete
CALThickCmd
;
delete
UpdateCmd
;
204
delete
MagFieldCmd
;
delete
GammaRayTeldetDir
;
205
}
206
207
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
208
209
void
GammaRayTelDetectorMessenger::SetNewValue
(
G4UIcommand
* command,
G4String
newValue)
210
{
211
212
// converter
213
214
if
( command ==
ConverterMaterCmd
)
215
{
GammaRayTelDetector
->
SetConverterMaterial
(newValue);}
216
217
if
( command ==
ConverterThickCmd
)
218
{
GammaRayTelDetector
->
SetConverterThickness
(
ConverterThickCmd
->
GetNewDoubleValue
(newValue));}
219
220
// tracker
221
222
if
( command ==
SiliconTileXYCmd
)
223
{
GammaRayTelDetector
->
SetTKRTileSizeXY
(
SiliconTileXYCmd
->
GetNewDoubleValue
(newValue));}
224
225
if
( command ==
SiliconPitchCmd
)
226
{
GammaRayTelDetector
->
SetTKRSiliconPitch
(
SiliconPitchCmd
->
GetNewDoubleValue
(newValue));}
227
228
if
( command ==
SiliconThickCmd
)
229
{
GammaRayTelDetector
->
SetTKRSiliconThickness
(
SiliconThickCmd
->
GetNewDoubleValue
(newValue));}
230
231
if
( command ==
NbSiTilesCmd
)
232
{
GammaRayTelDetector
->
SetNbOfTKRTiles
(
NbSiTilesCmd
->
GetNewIntValue
(newValue));}
233
234
if
( command ==
NbTKRLayersCmd
)
235
{
GammaRayTelDetector
->
SetNbOfTKRLayers
(
NbTKRLayersCmd
->
GetNewIntValue
(newValue));}
236
237
if
( command ==
LayerDistanceCmd
)
238
{
GammaRayTelDetector
->
SetTKRLayerDistance
(
LayerDistanceCmd
->
GetNewDoubleValue
(newValue));}
239
240
if
( command ==
ViewsDistanceCmd
)
241
{
GammaRayTelDetector
->
SetTKRViewsDistance
(
ViewsDistanceCmd
->
GetNewDoubleValue
(newValue));}
242
243
// calorimeter
244
245
if
( command ==
NbCALLayersCmd
)
246
{
GammaRayTelDetector
->
SetNbOfCALLayers
(
NbCALLayersCmd
->
GetNewIntValue
(newValue));}
247
248
if
( command ==
NbCALBarsCmd
)
249
{
GammaRayTelDetector
->
SetNbOfCALBars
(
NbCALBarsCmd
->
GetNewIntValue
(newValue));}
250
251
if
( command ==
CALThickCmd
)
252
{
GammaRayTelDetector
->
SetCALBarThickness
(
CALThickCmd
->
GetNewDoubleValue
(newValue));}
253
254
// anticoincidence
255
256
if
( command ==
ACDThickCmd
)
257
{
GammaRayTelDetector
->
SetACDThickness
(
ACDThickCmd
->
GetNewDoubleValue
(newValue));}
258
259
if
( command ==
UpdateCmd
)
260
{
GammaRayTelDetector
->
UpdateGeometry
(); }
261
262
if
( command ==
MagFieldCmd
)
263
{
GammaRayTelDetector
->
SetMagField
(
MagFieldCmd
->
GetNewDoubleValue
(newValue));}
264
}
265
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
266
267
268
269
270
271
geant4
tree
geant4-10.6-release
examples
advanced
gammaray_telescope
src
GammaRayTelDetectorMessenger.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:58
using
1.8.2 with
ECCE GitHub integration