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
DetectorMessenger.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file DetectorMessenger.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
//
31
//
32
// TestEm8: Gaseous detector
33
//
34
// Created: 31.08.2010 V.Ivanchenko
35
//
36
// Modified:
37
//
39
//
40
41
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
42
43
#include "DetectorMessenger.hh"
44
45
#include "DetectorConstruction.hh"
46
#include "
G4UIdirectory.hh
"
47
#include "
G4UIcmdWithAString.hh
"
48
#include "
G4UIcmdWithADoubleAndUnit.hh
"
49
#include "
G4UIcmdWithoutParameter.hh
"
50
51
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
52
53
DetectorMessenger::DetectorMessenger
(
DetectorConstruction
* det)
54
:
G4UImessenger
(),fDetector(det)
55
{
56
fDetDir
=
new
G4UIdirectory
(
"/testem/"
);
57
fDetDir
->
SetGuidance
(
"Detector control."
);
58
59
fGasMaterCmd
=
new
G4UIcmdWithAString
(
"/testem/setGasMat"
,
this
);
60
fGasMaterCmd
->
SetGuidance
(
"Select material of the detector."
);
61
fGasMaterCmd
->
SetParameterName
(
"gmat"
,
true
);
62
fGasMaterCmd
->
SetDefaultValue
(
"Argon"
);
63
fGasMaterCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
64
65
fWindowMaterCmd
=
new
G4UIcmdWithAString
(
"/testem/setWindowMat"
,
this
);
66
fWindowMaterCmd
->
SetGuidance
(
"Select material of the window."
);
67
fWindowMaterCmd
->
SetParameterName
(
"wmat"
,
true
);
68
fWindowMaterCmd
->
SetDefaultValue
(
"Mylar"
);
69
fWindowMaterCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
70
71
fWorldMaterCmd
=
new
G4UIcmdWithAString
(
"/testem/setWorldMat"
,
this
);
72
fWorldMaterCmd
->
SetGuidance
(
"Select material of the world."
);
73
fWorldMaterCmd
->
SetParameterName
(
"worldmat"
,
true
);
74
fWorldMaterCmd
->
SetDefaultValue
(
"empty"
);
75
fWorldMaterCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
76
77
fGasThickCmd
=
new
G4UIcmdWithADoubleAndUnit
(
"/testem/setGasThick"
,
this
);
78
fGasThickCmd
->
SetGuidance
(
"Set thickness of the detector"
);
79
fGasThickCmd
->
SetParameterName
(
"SizeZ"
,
false
,
false
);
80
fGasThickCmd
->
SetUnitCategory
(
"Length"
);
81
fGasThickCmd
->
SetDefaultUnit
(
"mm"
);
82
fGasThickCmd
->
SetRange
(
"SizeZ>0."
);
83
fGasThickCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
84
85
fGasRadCmd
=
new
G4UIcmdWithADoubleAndUnit
(
"/testem/setGasRad"
,
this
);
86
fGasRadCmd
->
SetGuidance
(
"Set radius of the detector"
);
87
fGasRadCmd
->
SetParameterName
(
"SizeR"
,
false
,
false
);
88
fGasRadCmd
->
SetUnitCategory
(
"Length"
);
89
fGasRadCmd
->
SetDefaultUnit
(
"mm"
);
90
fGasRadCmd
->
SetRange
(
"SizeR>0."
);
91
fGasRadCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
92
93
fWinThickCmd
=
new
G4UIcmdWithADoubleAndUnit
(
"/testem/setWindowThick"
,
this
);
94
fWinThickCmd
->
SetGuidance
(
"Set thickness of the window"
);
95
fWinThickCmd
->
SetParameterName
(
"delta"
,
false
,
false
);
96
fWinThickCmd
->
SetUnitCategory
(
"Length"
);
97
fWinThickCmd
->
SetDefaultUnit
(
"mm"
);
98
fWinThickCmd
->
SetRange
(
"delta>0."
);
99
fWinThickCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
100
101
fIonCmd
=
new
G4UIcmdWithADoubleAndUnit
(
"/testem/setPairEnergy"
,
this
);
102
fIonCmd
->
SetGuidance
(
"Set energy per electron-ion pair for detector"
);
103
fIonCmd
->
SetParameterName
(
"en"
,
false
,
false
);
104
fIonCmd
->
SetUnitCategory
(
"Energy"
);
105
fIonCmd
->
SetDefaultUnit
(
"MeV"
);
106
fIonCmd
->
SetRange
(
"en>0."
);
107
fIonCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
108
109
fStepMaxCmd
=
new
G4UIcmdWithADoubleAndUnit
(
"/testem/stepMax"
,
this
);
110
fStepMaxCmd
->
SetGuidance
(
"Set max allowed step length for charged particles"
);
111
fStepMaxCmd
->
SetParameterName
(
"mxStep"
,
false
);
112
fStepMaxCmd
->
SetRange
(
"mxStep>0."
);
113
fStepMaxCmd
->
SetUnitCategory
(
"Length"
);
114
fStepMaxCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
115
}
116
117
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
118
119
DetectorMessenger::~DetectorMessenger
()
120
{
121
delete
fGasMaterCmd
;
122
delete
fGasThickCmd
;
123
delete
fGasRadCmd
;
124
delete
fWinThickCmd
;
125
delete
fWindowMaterCmd
;
126
delete
fWorldMaterCmd
;
127
delete
fIonCmd
;
128
delete
fStepMaxCmd
;
129
delete
fDetDir
;
130
}
131
132
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
133
134
void
DetectorMessenger::SetNewValue
(
G4UIcommand
* command,
G4String
newValue)
135
{
136
if
( command ==
fGasMaterCmd
) {
137
fDetector
->
SetGasMaterial
(newValue);
138
}
else
if
( command ==
fWindowMaterCmd
) {
139
fDetector
->
SetContainerMaterial
(newValue);
140
}
else
if
( command ==
fWorldMaterCmd
) {
141
fDetector
->
SetWorldMaterial
(newValue);
142
}
else
if
( command ==
fGasThickCmd
) {
143
fDetector
->
SetGasThickness
(
fGasThickCmd
->
GetNewDoubleValue
(newValue));
144
}
else
if
( command ==
fGasRadCmd
) {
145
fDetector
->
SetGasRadius
(
fGasRadCmd
->
GetNewDoubleValue
(newValue));
146
}
else
if
( command ==
fWinThickCmd
) {
147
fDetector
->
SetContainerThickness
(
fWinThickCmd
->
GetNewDoubleValue
(newValue));
148
}
else
if
( command ==
fStepMaxCmd
) {
149
fDetector
->
SetMaxChargedStep
(
fStepMaxCmd
->
GetNewDoubleValue
(newValue));
150
}
else
if
( command ==
fIonCmd
) {
151
fDetector
->
SetPairEnergy
(
fIonCmd
->
GetNewDoubleValue
(newValue));
152
}
153
}
154
155
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
geant4
tree
geant4-10.6-release
examples
extended
electromagnetic
TestEm8
src
DetectorMessenger.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:50
using
1.8.2 with
ECCE GitHub integration