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
ECCE @ EIC Software
Deprecated List
Modules
Namespaces
Classes
Files
File List
acts
analysis
coresoftware
Doxygen_Assist
ecce-detectors
fun4all_eicdetectors
geant4
tree
geant4-10.6-release
config
environments
examples
advanced
basic
extended
analysis
biasing
common
electromagnetic
errorpropagation
eventgenerator
exoticphysics
field
g3tog4
geometry
hadronic
medical
DICOM
DICOM2
dna
chem1
chem2
chem3
chem4
chem5
clustering
dnadamage1
dnaphysics
icsd
mfp
microdosimetry
microprox
microyz
neuron
pdb4dna
range
include
src
ActionInitialization.cc
DetectorConstruction.cc
DetectorMessenger.cc
HistoManager.cc
PhysicsList.cc
PhysicsListMessenger.cc
PrimaryGeneratorAction.cc
Run.cc
RunAction.cc
SteppingAction.cc
SteppingVerbose.cc
TrackingAction.cc
plot.C
range.cc
slowing
splitting
spower
svalue
wholeNuclearDNA
wvalue
electronScattering
electronScattering2
fanoCavity
fanoCavity2
GammaTherapy
optical
parallel
parameterisations
persistency
physicslists
polarisation
radioactivedecay
runAndEvent
visualization
source
macros
online_distribution
tutorials
doxygen_mainpage.h
File Members
External Links
•
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
#include "DetectorMessenger.hh"
30
31
#include "DetectorConstruction.hh"
32
#include "
G4UIdirectory.hh
"
33
#include "
G4UIcmdWithAString.hh
"
34
#include "
G4UIcmdWithAnInteger.hh
"
35
#include "
G4UIcmdWithADoubleAndUnit.hh
"
36
37
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
38
39
DetectorMessenger::DetectorMessenger
(
DetectorConstruction
* Det)
40
:
G4UImessenger
(),fDetector(Det),
41
fTestemDir(0),
42
fDetDir(0),
43
fMaterCmd(0),
44
fRadiusCmd(0),
45
fTrackingCutCmd(0)
46
{
47
fTestemDir
=
new
G4UIdirectory
(
"/range/"
);
48
fTestemDir
->
SetGuidance
(
"Detector control."
);
49
50
fDetDir
=
new
G4UIdirectory
(
"/range/det/"
);
51
fDetDir
->
SetGuidance
(
"Detector construction commands"
);
52
53
fMaterCmd
=
new
G4UIcmdWithAString
(
"/range/det/setMat"
,
this
);
54
fMaterCmd
->
SetGuidance
(
"Select material of the sphere."
);
55
fMaterCmd
->
SetParameterName
(
"choice"
,
false
);
56
fMaterCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
57
fMaterCmd
->
SetToBeBroadcasted
(
false
);
58
59
fRadiusCmd
=
new
G4UIcmdWithADoubleAndUnit
(
"/range/det/setRadius"
,
this
);
60
fRadiusCmd
->
SetGuidance
(
"Set radius of the absorber"
);
61
fRadiusCmd
->
SetParameterName
(
"Radius"
,
false
);
62
fRadiusCmd
->
SetRange
(
"Radius>0."
);
63
fRadiusCmd
->
SetUnitCategory
(
"Length"
);
64
fRadiusCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
65
fRadiusCmd
->
SetToBeBroadcasted
(
false
);
66
67
fTrackingCutCmd
=
68
new
G4UIcmdWithADoubleAndUnit
(
"/range/det/setTrackingCut"
,
this
);
69
fTrackingCutCmd
->
SetGuidance
(
"Set tracking cut in the absorber"
);
70
fTrackingCutCmd
->
SetParameterName
(
"Cut"
,
false
);
71
fTrackingCutCmd
->
SetRange
(
"Cut>0."
);
72
fTrackingCutCmd
->
SetUnitCategory
(
"Energy"
);
73
fTrackingCutCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
74
fTrackingCutCmd
->
SetToBeBroadcasted
(
false
);
75
}
76
77
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
78
79
DetectorMessenger::~DetectorMessenger
()
80
{
81
delete
fMaterCmd
;
82
delete
fRadiusCmd
;
83
delete
fTrackingCutCmd
;
84
delete
fDetDir
;
85
delete
fTestemDir
;
86
}
87
88
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
89
90
void
DetectorMessenger::SetNewValue
(
G4UIcommand
* command,
G4String
newValue)
91
{
92
if
( command ==
fMaterCmd
)
93
{
fDetector
->
SetMaterial
(newValue);}
94
95
if
( command ==
fRadiusCmd
)
96
{
fDetector
->
SetRadius
(
fRadiusCmd
->
GetNewDoubleValue
(newValue));}
97
98
if
( command ==
fTrackingCutCmd
)
99
{
fDetector
->
SetTrackingCut
(
fTrackingCutCmd
->
GetNewDoubleValue
(newValue));}
100
}
101
geant4
tree
geant4-10.6-release
examples
extended
medical
dna
range
src
DetectorMessenger.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:50
using
1.8.2 with
ECCE GitHub integration