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
F01FieldMessenger.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file F01FieldMessenger.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 "
F01FieldMessenger.hh
"
36
37
#include "
F01FieldSetup.hh
"
38
#include "
G4UIcmdWithAnInteger.hh
"
39
#include "
G4UIcmdWithADoubleAndUnit.hh
"
40
#include "
G4UIcmdWith3VectorAndUnit.hh
"
41
#include "
G4UIcmdWithoutParameter.hh
"
42
43
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
44
45
F01FieldMessenger::F01FieldMessenger
(
F01FieldSetup
* fieldSetup)
46
:
G4UImessenger
(),
47
fEMfieldSetup(fieldSetup),
48
fFieldDir(0),
49
fStepperCmd(0),
50
fMagFieldZCmd(0),
51
fMagFieldCmd(0),
52
fMinStepCmd(0),
53
fUpdateCmd(0)
54
{
55
fFieldDir
=
new
G4UIdirectory
(
"/field/"
);
56
fFieldDir
->
SetGuidance
(
"F01 field tracking control."
);
57
58
fStepperCmd
=
new
G4UIcmdWithAnInteger
(
"/field/setStepperType"
,
this
);
59
fStepperCmd
->
SetGuidance
(
"Select stepper type for magnetic field"
);
60
fStepperCmd
->
SetParameterName
(
"choice"
,
true
);
61
fStepperCmd
->
SetDefaultValue
(4);
62
fStepperCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
63
64
fUpdateCmd
=
new
G4UIcmdWithoutParameter
(
"/field/update"
,
this
);
65
fUpdateCmd
->
SetGuidance
(
"Update calorimeter geometry."
);
66
fUpdateCmd
->
SetGuidance
(
"This command MUST be applied before \"beamOn\" "
);
67
fUpdateCmd
->
SetGuidance
(
"if you changed geometrical value(s)."
);
68
fUpdateCmd
->
AvailableForStates
(
G4State_Idle
);
69
70
fMagFieldZCmd
=
new
G4UIcmdWithADoubleAndUnit
(
"/field/setFieldZ"
,
this
);
71
fMagFieldZCmd
->
SetGuidance
(
"Define magnetic field."
);
72
fMagFieldZCmd
->
SetGuidance
(
"Magnetic field will be in Z direction."
);
73
fMagFieldZCmd
->
SetParameterName
(
"Bz"
,
false
,
false
);
74
fMagFieldZCmd
->
SetDefaultUnit
(
"tesla"
);
75
fMagFieldZCmd
->
AvailableForStates
(
G4State_Idle
);
76
77
fMagFieldCmd
=
new
G4UIcmdWith3VectorAndUnit
(
"/field/setField"
,
this
);
78
fMagFieldCmd
->
SetGuidance
(
"Define magnetic field."
);
79
fMagFieldCmd
->
SetParameterName
(
"Bx"
,
"By"
,
"Bz"
,
false
,
false
);
80
fMagFieldCmd
->
SetDefaultUnit
(
"tesla"
);
81
fMagFieldCmd
->
AvailableForStates
(
G4State_Idle
);
82
83
fMinStepCmd
=
new
G4UIcmdWithADoubleAndUnit
(
"/field/setMinStep"
,
this
);
84
fMinStepCmd
->
SetGuidance
(
"Define minimal step"
);
85
fMinStepCmd
->
SetGuidance
(
"Magnetic field will be in Z direction."
);
86
fMinStepCmd
->
SetParameterName
(
"min step"
,
false
,
false
);
87
fMinStepCmd
->
SetDefaultUnit
(
"mm"
);
88
fMinStepCmd
->
AvailableForStates
(
G4State_Idle
);
89
}
90
91
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
92
93
F01FieldMessenger::~F01FieldMessenger
()
94
{
95
delete
fStepperCmd
;
96
delete
fMagFieldZCmd
;
97
delete
fMagFieldCmd
;
98
delete
fMinStepCmd
;
99
delete
fFieldDir
;
100
delete
fUpdateCmd
;
101
}
102
103
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
104
105
void
F01FieldMessenger::SetNewValue
(
G4UIcommand
* command,
G4String
newValue)
106
{
107
if
( command ==
fStepperCmd
)
108
fEMfieldSetup
->
SetStepperType
(
fStepperCmd
->
GetNewIntValue
(newValue));
109
if
( command ==
fUpdateCmd
)
110
fEMfieldSetup
->
CreateStepperAndChordFinder
();
111
if
( command ==
fMagFieldZCmd
)
112
fEMfieldSetup
->
SetFieldZValue
(
fMagFieldZCmd
->
GetNewDoubleValue
(newValue));
113
if
( command ==
fMagFieldCmd
)
114
fEMfieldSetup
->
SetFieldValue
(
fMagFieldCmd
->
GetNew3VectorValue
(newValue));
115
if
( command ==
fMinStepCmd
)
116
fEMfieldSetup
->
SetMinStep
(
fMinStepCmd
->
GetNewDoubleValue
(newValue));
117
}
118
119
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
geant4
tree
geant4-10.6-release
examples
extended
field
field01
src
F01FieldMessenger.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:04
using
1.8.2 with
ECCE GitHub integration