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
ExN02DetectorMessenger.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file ExN02DetectorMessenger.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
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33
34
#include "
ExN02DetectorMessenger.hh
"
35
36
#include "
ExN02DetectorConstruction.hh
"
37
#include "
G4UIdirectory.hh
"
38
#include "
G4UIcmdWithAString.hh
"
39
#include "
G4UIcmdWithADoubleAndUnit.hh
"
40
#include "
globals.hh
"
41
42
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
43
44
ExN02DetectorMessenger::ExN02DetectorMessenger
(
ExN02DetectorConstruction
* myDet)
45
:myDetector(myDet)
46
{
47
N02Dir
=
new
G4UIdirectory
(
"/N02/"
);
48
N02Dir
->
SetGuidance
(
"UI commands specific to this example."
);
49
50
detDir
=
new
G4UIdirectory
(
"/N02/det/"
);
51
detDir
->
SetGuidance
(
"detector control."
);
52
53
TargMatCmd
=
new
G4UIcmdWithAString
(
"/N02/det/setTargetMate"
,
this
);
54
TargMatCmd
->
SetGuidance
(
"Select Material of the Target."
);
55
TargMatCmd
->
SetParameterName
(
"choice"
,
false
);
56
TargMatCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
57
58
ChamMatCmd
=
new
G4UIcmdWithAString
(
"/N02/det/setChamberMate"
,
this
);
59
ChamMatCmd
->
SetGuidance
(
"Select Material of the Target."
);
60
ChamMatCmd
->
SetParameterName
(
"choice"
,
false
);
61
ChamMatCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
62
63
FieldCmd
=
new
G4UIcmdWithADoubleAndUnit
(
"/N02/det/setField"
,
this
);
64
FieldCmd
->
SetGuidance
(
"Define magnetic field."
);
65
FieldCmd
->
SetGuidance
(
"Magnetic field will be in X direction."
);
66
FieldCmd
->
SetParameterName
(
"Bx"
,
false
);
67
FieldCmd
->
SetUnitCategory
(
"Magnetic flux density"
);
68
FieldCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
69
70
StepMaxCmd
=
new
G4UIcmdWithADoubleAndUnit
(
"/N02/det/stepMax"
,
this
);
71
StepMaxCmd
->
SetGuidance
(
"Define a step max"
);
72
StepMaxCmd
->
SetParameterName
(
"stepMax"
,
false
);
73
StepMaxCmd
->
SetUnitCategory
(
"Length"
);
74
StepMaxCmd
->
AvailableForStates
(
G4State_Idle
);
75
}
76
77
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
78
79
ExN02DetectorMessenger::~ExN02DetectorMessenger
()
80
{
81
delete
TargMatCmd
;
82
delete
ChamMatCmd
;
83
delete
FieldCmd
;
84
delete
StepMaxCmd
;
85
delete
detDir
;
86
delete
N02Dir
;
87
}
88
89
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
90
91
void
ExN02DetectorMessenger::SetNewValue
(
G4UIcommand
* command,
G4String
newValue)
92
{
93
if
( command ==
TargMatCmd
)
94
{
myDetector
->
setTargetMaterial
(newValue);}
95
96
if
( command ==
ChamMatCmd
)
97
{
myDetector
->
setChamberMaterial
(newValue);}
98
99
if
( command ==
FieldCmd
)
100
{
myDetector
->
SetMagField
(
FieldCmd
->
GetNewDoubleValue
(newValue));}
101
102
if
( command ==
StepMaxCmd
)
103
{
myDetector
->
SetMaxStep
(
StepMaxCmd
->
GetNewDoubleValue
(newValue));}
104
}
105
106
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
geant4
tree
geant4-10.6-release
examples
extended
parallel
TopC
ParN02
src
ExN02DetectorMessenger.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:09
using
1.8.2 with
ECCE GitHub integration