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
F04FieldMessenger.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file F04FieldMessenger.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 "
F04FieldMessenger.hh
"
32
33
#include "
F04GlobalField.hh
"
34
#include "
G4UIdirectory.hh
"
35
#include "
G4UIcmdWithAString.hh
"
36
#include "
G4UIcmdWithAnInteger.hh
"
37
#include "
G4UIcmdWithADoubleAndUnit.hh
"
38
#include "
G4UIcmdWithoutParameter.hh
"
39
40
#include "
F04DetectorConstruction.hh
"
41
42
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
43
44
F04FieldMessenger::F04FieldMessenger
(
F04GlobalField
* pEMfield,
45
F04DetectorConstruction
* detector)
46
: fGlobalField(pEMfield)
47
{
48
fDetector
= detector;
49
50
fDetDir
=
new
G4UIdirectory
(
"/field/"
);
51
fDetDir
->
SetGuidance
(
" Field tracking control "
);
52
53
fCaptureB1Cmd
=
new
G4UIcmdWithADoubleAndUnit
(
"/field/SetCaptureB1"
,
this
);
54
fCaptureB1Cmd
->
SetGuidance
(
"Set B1 of the Capture Magnet"
);
55
fCaptureB1Cmd
->
SetParameterName
(
"CSizeB1"
,
false
,
false
);
56
fCaptureB1Cmd
->
SetDefaultUnit
(
"tesla"
);
57
fCaptureB1Cmd
->
SetRange
(
"CSizeB1>0."
);
58
fCaptureB1Cmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
59
60
fCaptureB2Cmd
=
new
G4UIcmdWithADoubleAndUnit
(
"/field/SetCaptureB2"
,
this
);
61
fCaptureB2Cmd
->
SetGuidance
(
"Set B2 of the Capture Magnet"
);
62
fCaptureB2Cmd
->
SetParameterName
(
"CSizeB2"
,
false
,
false
);
63
fCaptureB2Cmd
->
SetDefaultUnit
(
"tesla"
);
64
fCaptureB2Cmd
->
SetRange
(
"CSizeB2>0."
);
65
fCaptureB2Cmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
66
67
fTransferBCmd
=
new
G4UIcmdWithADoubleAndUnit
(
"/field/SetTransferB"
,
this
);
68
fTransferBCmd
->
SetGuidance
(
"Set B of the Transfer Magnet"
);
69
fTransferBCmd
->
SetParameterName
(
"TSizeB"
,
false
,
false
);
70
fTransferBCmd
->
SetDefaultUnit
(
"tesla"
);
71
fTransferBCmd
->
SetRange
(
"TSizeB>0."
);
72
fTransferBCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
73
74
fStepperCMD
=
new
G4UIcmdWithAnInteger
(
"/field/setStepperType"
,
this
);
75
fStepperCMD
->
SetGuidance
(
"Select stepper type for field"
);
76
fStepperCMD
->
SetParameterName
(
"choice"
,
true
);
77
fStepperCMD
->
SetDefaultValue
(4);
78
fStepperCMD
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
79
80
fMinStepCMD
=
new
G4UIcmdWithADoubleAndUnit
(
"/field/setMinStep"
,
this
);
81
fMinStepCMD
->
SetGuidance
(
"Define minimal step"
);
82
fMinStepCMD
->
SetParameterName
(
"min step"
,
false
,
false
);
83
fMinStepCMD
->
SetDefaultUnit
(
"mm"
);
84
fMinStepCMD
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
85
86
fDeltaChordCMD
=
new
G4UIcmdWithADoubleAndUnit
(
"/field/setDeltaChord"
,
this
);
87
fDeltaChordCMD
->
SetGuidance
(
"Define delta chord"
);
88
fDeltaChordCMD
->
SetParameterName
(
"delta chord"
,
false
,
false
);
89
fDeltaChordCMD
->
SetDefaultUnit
(
"mm"
);
90
fDeltaChordCMD
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
91
92
fDeltaOneStepCMD
=
93
new
G4UIcmdWithADoubleAndUnit
(
"/field/setDeltaOneStep"
,
this
);
94
fDeltaOneStepCMD
->
SetGuidance
(
"Define delta one step"
);
95
fDeltaOneStepCMD
->
SetParameterName
(
"delta one step"
,
false
,
false
);
96
fDeltaOneStepCMD
->
SetDefaultUnit
(
"mm"
);
97
fDeltaOneStepCMD
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
98
99
fDeltaIntersectionCMD
=
100
new
G4UIcmdWithADoubleAndUnit
(
"/field/setDeltaIntersection"
,
this
);
101
fDeltaIntersectionCMD
->
SetGuidance
(
"Define delta intersection"
);
102
fDeltaIntersectionCMD
->
SetParameterName
(
"delta intersection"
,
false
,
false
);
103
fDeltaIntersectionCMD
->
SetDefaultUnit
(
"mm"
);
104
fDeltaIntersectionCMD
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
105
106
fEpsMinCMD
=
new
G4UIcmdWithADoubleAndUnit
(
"/field/setEpsMin"
,
this
);
107
fEpsMinCMD
->
SetGuidance
(
"Define eps min"
);
108
fEpsMinCMD
->
SetParameterName
(
"eps min"
,
false
,
false
);
109
fEpsMinCMD
->
SetDefaultUnit
(
"mm"
);
110
fEpsMinCMD
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
111
112
fEpsMaxCMD
=
new
G4UIcmdWithADoubleAndUnit
(
"/field/setEpsMax"
,
this
);
113
fEpsMaxCMD
->
SetGuidance
(
"Define eps max"
);
114
fEpsMaxCMD
->
SetParameterName
(
"eps max"
,
false
,
false
);
115
fEpsMaxCMD
->
SetDefaultUnit
(
"mm"
);
116
fEpsMaxCMD
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
117
}
118
119
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
120
121
F04FieldMessenger::~F04FieldMessenger
()
122
{
123
delete
fDetDir
;
124
125
delete
fCaptureB1Cmd
;
126
delete
fCaptureB2Cmd
;
127
delete
fTransferBCmd
;
128
129
delete
fStepperCMD
;
130
delete
fMinStepCMD
;
131
delete
fDeltaChordCMD
;
132
delete
fDeltaOneStepCMD
;
133
delete
fDeltaIntersectionCMD
;
134
delete
fEpsMinCMD
;
135
delete
fEpsMaxCMD
;
136
}
137
138
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
139
140
void
F04FieldMessenger::SetNewValue
(
G4UIcommand
* command,
G4String
newValue)
141
{
142
143
if
( command ==
fCaptureB1Cmd
)
144
fDetector
->
SetCaptureMgntB1
(
fCaptureB1Cmd
->
GetNewDoubleValue
(newValue));
145
146
if
( command ==
fCaptureB2Cmd
)
147
fDetector
->
SetCaptureMgntB2
(
fCaptureB2Cmd
->
GetNewDoubleValue
(newValue));
148
149
if
( command ==
fTransferBCmd
)
150
fDetector
->
SetTransferMgntB
(
fTransferBCmd
->
GetNewDoubleValue
(newValue));
151
152
if
( command ==
fStepperCMD
)
153
{
154
fGlobalField
->
SetStepperType
(
fStepperCMD
->
GetNewIntValue
(newValue));
155
}
156
if
( command ==
fMinStepCMD
)
157
{
158
fGlobalField
->
SetMinStep
(
fMinStepCMD
->
GetNewDoubleValue
(newValue));
159
}
160
if
( command ==
fDeltaChordCMD
)
161
{
162
fGlobalField
->
SetDeltaChord
(
fDeltaChordCMD
->
GetNewDoubleValue
(newValue));
163
}
164
if
( command ==
fDeltaOneStepCMD
)
165
{
166
fGlobalField
->
167
SetDeltaOneStep(
fDeltaOneStepCMD
->
GetNewDoubleValue
(newValue));
168
}
169
if
( command ==
fDeltaIntersectionCMD
)
170
{
171
fGlobalField
->
172
SetDeltaIntersection(
fDeltaIntersectionCMD
->
GetNewDoubleValue
(newValue));
173
}
174
if
( command ==
fEpsMinCMD
)
175
{
176
fGlobalField
->
SetEpsMin
(
fEpsMinCMD
->
GetNewDoubleValue
(newValue));
177
}
178
if
( command ==
fEpsMaxCMD
)
179
{
180
fGlobalField
->
SetEpsMax
(
fEpsMaxCMD
->
GetNewDoubleValue
(newValue));
181
}
182
}
geant4
tree
geant4-10.6-release
examples
extended
field
field04
src
F04FieldMessenger.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:05
using
1.8.2 with
ECCE GitHub integration