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
F02DetectorMessenger.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file F02DetectorMessenger.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
//
28
//
29
//
30
//
31
//
32
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
34
35
#include "
F02DetectorMessenger.hh
"
36
37
#include "
F02DetectorConstruction.hh
"
38
#include "
G4UIcmdWithAString.hh
"
39
#include "
G4UIcmdWithADoubleAndUnit.hh
"
40
#include "
G4UIcmdWithoutParameter.hh
"
41
42
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
43
44
F02DetectorMessenger::F02DetectorMessenger
(
F02DetectorConstruction
* det)
45
:
G4UImessenger
(),
46
fDetector(det),
47
fDetDir(0),
48
fAbsMaterCmd(0),
49
fAbsThickCmd(0),
50
fAbsRadCmd(0),
51
fAbsZposCmd(0),
52
fWorldMaterCmd(0),
53
fWorldZCmd(0),
54
fWorldRCmd(0)
55
{
56
fDetDir
=
new
G4UIdirectory
(
"/calor/"
);
57
fDetDir
->
SetGuidance
(
"F02 detector control."
);
58
59
fAbsMaterCmd
=
new
G4UIcmdWithAString
(
"/calor/setAbsMat"
,
this
);
60
fAbsMaterCmd
->
SetGuidance
(
"Select Material of the Absorber."
);
61
fAbsMaterCmd
->
SetParameterName
(
"choice"
,
true
);
62
fAbsMaterCmd
->
SetDefaultValue
(
"Lead"
);
63
fAbsMaterCmd
->
AvailableForStates
(
G4State_Idle
);
64
fAbsMaterCmd
->
SetToBeBroadcasted
(
false
);
65
66
fWorldMaterCmd
=
new
G4UIcmdWithAString
(
"/calor/setWorldMat"
,
this
);
67
fWorldMaterCmd
->
SetGuidance
(
"Select Material of the World."
);
68
fWorldMaterCmd
->
SetParameterName
(
"wchoice"
,
true
);
69
fWorldMaterCmd
->
SetDefaultValue
(
"Air"
);
70
fWorldMaterCmd
->
AvailableForStates
(
G4State_Idle
);
71
fWorldMaterCmd
->
SetToBeBroadcasted
(
false
);
72
73
fAbsThickCmd
=
new
G4UIcmdWithADoubleAndUnit
(
"/calor/setAbsThick"
,
this
);
74
fAbsThickCmd
->
SetGuidance
(
"Set Thickness of the Absorber"
);
75
fAbsThickCmd
->
SetParameterName
(
"SizeZ"
,
false
,
false
);
76
fAbsThickCmd
->
SetDefaultUnit
(
"mm"
);
77
fAbsThickCmd
->
SetRange
(
"SizeZ>0."
);
78
fAbsThickCmd
->
AvailableForStates
(
G4State_Idle
);
79
fAbsThickCmd
->
SetToBeBroadcasted
(
false
);
80
81
fAbsRadCmd
=
new
G4UIcmdWithADoubleAndUnit
(
"/calor/setAbsRad"
,
this
);
82
fAbsRadCmd
->
SetGuidance
(
"Set radius of the Absorber"
);
83
fAbsRadCmd
->
SetParameterName
(
"SizeR"
,
false
,
false
);
84
fAbsRadCmd
->
SetDefaultUnit
(
"mm"
);
85
fAbsRadCmd
->
SetRange
(
"SizeR>0."
);
86
fAbsRadCmd
->
AvailableForStates
(
G4State_Idle
);
87
fAbsRadCmd
->
SetToBeBroadcasted
(
false
);
88
89
fAbsZposCmd
=
new
G4UIcmdWithADoubleAndUnit
(
"/calor/setAbsZpos"
,
this
);
90
fAbsZposCmd
->
SetGuidance
(
"Set Z pos. of the Absorber"
);
91
fAbsZposCmd
->
SetParameterName
(
"Zpos"
,
false
,
false
);
92
fAbsZposCmd
->
SetDefaultUnit
(
"mm"
);
93
fAbsZposCmd
->
AvailableForStates
(
G4State_Idle
);
94
fAbsZposCmd
->
SetToBeBroadcasted
(
false
);
95
96
fWorldZCmd
=
new
G4UIcmdWithADoubleAndUnit
(
"/calor/setWorldZ"
,
this
);
97
fWorldZCmd
->
SetGuidance
(
"Set Z size of the World"
);
98
fWorldZCmd
->
SetParameterName
(
"WSizeZ"
,
false
,
false
);
99
fWorldZCmd
->
SetDefaultUnit
(
"mm"
);
100
fWorldZCmd
->
SetRange
(
"WSizeZ>0."
);
101
fWorldZCmd
->
AvailableForStates
(
G4State_Idle
);
102
fWorldZCmd
->
SetToBeBroadcasted
(
false
);
103
104
fWorldRCmd
=
new
G4UIcmdWithADoubleAndUnit
(
"/calor/setWorldR"
,
this
);
105
fWorldRCmd
->
SetGuidance
(
"Set R size of the World"
);
106
fWorldRCmd
->
SetParameterName
(
"WSizeR"
,
false
,
false
);
107
fWorldRCmd
->
SetDefaultUnit
(
"mm"
);
108
fWorldRCmd
->
SetRange
(
"WSizeR>0."
);
109
fWorldRCmd
->
AvailableForStates
(
G4State_Idle
);
110
fWorldRCmd
->
SetToBeBroadcasted
(
false
);
111
}
112
113
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
114
115
F02DetectorMessenger::~F02DetectorMessenger
()
116
{
117
delete
fAbsMaterCmd
;
118
delete
fAbsThickCmd
;
119
delete
fAbsRadCmd
;
120
delete
fAbsZposCmd
;
121
delete
fWorldMaterCmd
;
122
delete
fWorldZCmd
;
123
delete
fWorldRCmd
;
124
delete
fDetDir
;
125
}
126
127
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
128
129
void
F02DetectorMessenger::SetNewValue
(
G4UIcommand
* command,
G4String
newValue)
130
{
131
if
( command ==
fAbsMaterCmd
)
132
{
fDetector
->
SetAbsorberMaterial
(newValue);}
133
134
if
( command ==
fWorldMaterCmd
)
135
{
fDetector
->
SetWorldMaterial
(newValue);}
136
137
if
( command ==
fAbsThickCmd
)
138
{
fDetector
->
SetAbsorberThickness
(
fAbsThickCmd
->
GetNewDoubleValue
(newValue));}
139
140
if
( command ==
fAbsRadCmd
)
141
{
fDetector
->
SetAbsorberRadius
(
fAbsRadCmd
->
GetNewDoubleValue
(newValue));}
142
143
if
( command ==
fAbsZposCmd
)
144
{
fDetector
->
SetAbsorberZpos
(
fAbsZposCmd
->
GetNewDoubleValue
(newValue));}
145
146
if
( command ==
fWorldZCmd
)
147
{
fDetector
->
SetWorldSizeZ
(
fWorldZCmd
->
GetNewDoubleValue
(newValue));}
148
149
if
( command ==
fWorldRCmd
)
150
{
fDetector
->
SetWorldSizeR
(
fWorldRCmd
->
GetNewDoubleValue
(newValue));}
151
}
152
153
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
geant4
tree
geant4-10.6-release
examples
extended
field
field02
src
F02DetectorMessenger.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:05
using
1.8.2 with
ECCE GitHub integration