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
//
26
// This example is provided by the Geant4-DNA collaboration
27
// Any report or published results obtained using the Geant4-DNA software
28
// shall cite the following Geant4-DNA collaboration publications:
29
// Med. Phys. 37 (2010) 4692-4708
30
// Phys. Med. 31 (2015) 861-874
31
// The Geant4-DNA web site is available at http://geant4-dna.org
32
//
35
36
#include "DetectorMessenger.hh"
37
38
#include "DetectorConstruction.hh"
39
#include "
G4UIdirectory.hh
"
40
#include "
G4UIcmdWithAString.hh
"
41
#include "
G4UIcmdWithAnInteger.hh
"
42
#include "
G4UIcmdWithADoubleAndUnit.hh
"
43
44
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
45
46
DetectorMessenger::DetectorMessenger
(
DetectorConstruction
* Det)
47
:
G4UImessenger
(),fDetector(Det),
48
fTestemDir(0),
49
fDetDir(0),
50
fMaterWorldCmd(0),
51
fMaterCytoCmd(0),
52
fMaterNuclCmd(0),
53
fNuclRadiusCmd(0),
54
fCytoThicknessCmd(0),
55
fTrackingCutCmd(0)
56
{
57
fTestemDir
=
new
G4UIdirectory
(
"/svalue/"
);
58
fTestemDir
->
SetGuidance
(
" detector control."
);
59
60
fDetDir
=
new
G4UIdirectory
(
"/svalue/det/"
);
61
fDetDir
->
SetGuidance
(
"detector construction commands"
);
62
63
fMaterWorldCmd
=
new
G4UIcmdWithAString
(
"/svalue/det/setWorldMat"
,
this
);
64
fMaterWorldCmd
->
SetGuidance
(
"Select material of the World"
);
65
fMaterWorldCmd
->
SetParameterName
(
"choice"
,
false
);
66
fMaterWorldCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
67
fMaterWorldCmd
->
SetToBeBroadcasted
(
false
);
68
69
fMaterNuclCmd
=
new
G4UIcmdWithAString
(
"/svalue/det/setNuclMat"
,
this
);
70
fMaterNuclCmd
->
SetGuidance
(
"Select material of the nucleus"
);
71
fMaterNuclCmd
->
SetParameterName
(
"choice"
,
false
);
72
fMaterNuclCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
73
fMaterNuclCmd
->
SetToBeBroadcasted
(
false
);
74
75
fMaterCytoCmd
=
new
G4UIcmdWithAString
(
"/svalue/det/setCytoMat"
,
this
);
76
fMaterCytoCmd
->
SetGuidance
(
"Select material of the cytoplasm"
);
77
fMaterCytoCmd
->
SetParameterName
(
"choice"
,
false
);
78
fMaterCytoCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
79
fMaterCytoCmd
->
SetToBeBroadcasted
(
false
);
80
81
fNuclRadiusCmd
=
new
G4UIcmdWithADoubleAndUnit
(
"/svalue/det/setNuclRadius"
,
this
);
82
fNuclRadiusCmd
->
SetGuidance
(
"Set radius of the nucleus"
);
83
fNuclRadiusCmd
->
SetParameterName
(
"Radius"
,
false
);
84
fNuclRadiusCmd
->
SetRange
(
"Radius>0."
);
85
fNuclRadiusCmd
->
SetUnitCategory
(
"Length"
);
86
fNuclRadiusCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
87
fNuclRadiusCmd
->
SetToBeBroadcasted
(
false
);
88
89
fCytoThicknessCmd
=
new
G4UIcmdWithADoubleAndUnit
(
"/svalue/det/setCytoThickness"
,
this
);
90
fCytoThicknessCmd
->
SetGuidance
(
"Set thickness of the cytoplasm"
);
91
fCytoThicknessCmd
->
SetParameterName
(
"Thickness"
,
false
);
92
fCytoThicknessCmd
->
SetRange
(
"Thickness>0."
);
93
fCytoThicknessCmd
->
SetUnitCategory
(
"Length"
);
94
fCytoThicknessCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
95
fCytoThicknessCmd
->
SetToBeBroadcasted
(
false
);
96
97
fTrackingCutCmd
=
98
new
G4UIcmdWithADoubleAndUnit
(
"/svalue/det/setTrackingCut"
,
this
);
99
fTrackingCutCmd
->
SetGuidance
(
"Set tracking cut in the absorber"
);
100
fTrackingCutCmd
->
SetParameterName
(
"Cut"
,
false
);
101
fTrackingCutCmd
->
SetRange
(
"Cut>0."
);
102
fTrackingCutCmd
->
SetUnitCategory
(
"Energy"
);
103
fTrackingCutCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
104
fTrackingCutCmd
->
SetToBeBroadcasted
(
false
);
105
}
106
107
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
108
109
DetectorMessenger::~DetectorMessenger
()
110
{
111
delete
fMaterWorldCmd
;
112
delete
fMaterCytoCmd
;
113
delete
fMaterNuclCmd
;
114
delete
fNuclRadiusCmd
;
115
delete
fCytoThicknessCmd
;
116
delete
fTrackingCutCmd
;
117
delete
fDetDir
;
118
delete
fTestemDir
;
119
}
120
121
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
122
123
void
DetectorMessenger::SetNewValue
(
G4UIcommand
* command,
G4String
newValue)
124
{
125
if
( command ==
fMaterWorldCmd
)
126
{
fDetector
->
SetWorldMaterial
(newValue);}
127
128
if
( command ==
fMaterCytoCmd
)
129
{
fDetector
->
SetCytoMaterial
(newValue);}
130
131
if
( command ==
fMaterNuclCmd
)
132
{
fDetector
->
SetNuclMaterial
(newValue);}
133
134
if
( command ==
fNuclRadiusCmd
)
135
{
fDetector
->
SetNuclRadius
(
fNuclRadiusCmd
->
GetNewDoubleValue
(newValue));}
136
137
if
( command ==
fCytoThicknessCmd
)
138
{
fDetector
->
SetCytoThickness
(
fCytoThicknessCmd
->
GetNewDoubleValue
(newValue));}
139
140
if
( command ==
fTrackingCutCmd
)
141
{
fDetector
->
SetTrackingCut
(
fTrackingCutCmd
->
GetNewDoubleValue
(newValue));}
142
}
143
geant4
tree
geant4-10.6-release
examples
extended
medical
dna
svalue
src
DetectorMessenger.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:50
using
1.8.2 with
ECCE GitHub integration