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
ExGflashMessenger.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file ExGflashMessenger.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
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
31
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32
33
#include "
ExGflashMessenger.hh
"
34
#include "
ExGflashDetectorConstruction.hh
"
35
36
#include "
G4UIdirectory.hh
"
37
#include "
G4UIcmdWithAString.hh
"
38
#include "
G4UIcmdWithAnInteger.hh
"
39
#include "
G4UIcmdWith3Vector.hh
"
40
#include "
G4UIcmdWithADoubleAndUnit.hh
"
41
#include "
G4UIcmdWithoutParameter.hh
"
42
43
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
44
45
ExGflashMessenger::ExGflashMessenger
(
ExGflashDetectorConstruction
* Det)
46
:
G4UImessenger
(),fDetector(Det)
47
{
48
fExGflashDir
=
new
G4UIdirectory
(
"/exgflash/"
);
49
fExGflashDir
->
SetGuidance
(
" Gflash example commands."
);
50
51
fVerbose
=
new
G4UIcmdWithAnInteger
(
"/exgflash/verbose"
,
this
);
52
fVerbose
->
SetGuidance
(
"set exglash verbosity"
);
53
fVerbose
->
SetGuidance
(
"0- silent, 1 - on exit, 2 - run , 3 - event"
);
54
fVerbose
->
SetParameterName
(
"ver"
,
false
);
55
fVerbose
->
SetRange
(
"ver >= 0"
);
56
fVerbose
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
57
fVerbose
->
SetToBeBroadcasted
(
false
);
58
59
fDetDir
=
new
G4UIdirectory
(
"/exgflash/det/"
);
60
fDetDir
->
SetGuidance
(
"detector construction commands"
);
61
62
fMaterCmd
=
new
G4UIcmdWithAString
(
"/exgflash/det/setMat"
,
this
);
63
fMaterCmd
->
SetGuidance
(
"Select Material."
);
64
fMaterCmd
->
SetParameterName
(
"material"
,
false
);
65
fMaterCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
66
fMaterCmd
->
SetToBeBroadcasted
(
false
);
67
68
fLBinCmd
=
new
G4UIcmdWith3Vector
(
"/exgflash/det/setLbin"
,
this
);
69
fLBinCmd
->
SetGuidance
(
"set longitudinal bining"
);
70
fLBinCmd
->
SetGuidance
(
"nb of bins; bin thickness (in radl)"
);
71
// must have omitable==true we use 2 values only
72
fLBinCmd
->
SetParameterName
(
"nLtot"
,
"dLradl"
,
" "
,
true
);
73
fLBinCmd
->
SetRange
(
"nLtot>=1 && dLradl>0"
);
74
fLBinCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
75
fLBinCmd
->
SetToBeBroadcasted
(
false
);
76
77
fRBinCmd
=
new
G4UIcmdWith3Vector
(
"/exgflash/det/setRbin"
,
this
);
78
fRBinCmd
->
SetGuidance
(
"set radial bining"
);
79
fRBinCmd
->
SetGuidance
(
"nb of bins; bin thickness (in radl)"
);
80
fRBinCmd
->
SetParameterName
(
"nRtot"
,
"dRradl"
,
" "
,
true
);
81
fRBinCmd
->
SetRange
(
"nRtot>=1 && dRradl>0"
);
82
fRBinCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
83
fRBinCmd
->
SetToBeBroadcasted
(
false
);
84
}
85
86
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
87
88
ExGflashMessenger::~ExGflashMessenger
()
89
{
90
delete
fRBinCmd
;
91
delete
fLBinCmd
;
92
delete
fMaterCmd
;
93
delete
fDetDir
;
94
delete
fVerbose
;
95
delete
fExGflashDir
;
96
}
97
98
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
99
100
void
ExGflashMessenger::SetNewValue
(
G4UIcommand
* command,
G4String
newValue)
101
{
102
if
( command ==
fMaterCmd
)
103
{
fDetector
->
SetMaterial
(newValue);}
104
105
if
( command ==
fVerbose
)
106
{
fDetector
->
SetVerbose
(
fVerbose
->
GetNewIntValue
(newValue));}
107
108
if
( command ==
fLBinCmd
)
109
{
fDetector
->
SetLBining
(
fLBinCmd
->
GetNew3VectorValue
(newValue));}
110
111
if
( command ==
fRBinCmd
)
112
{
fDetector
->
SetRBining
(
fRBinCmd
->
GetNew3VectorValue
(newValue));}
113
}
114
115
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
geant4
tree
geant4-10.6-release
examples
extended
parameterisations
gflash
gflasha
src
ExGflashMessenger.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:09
using
1.8.2 with
ECCE GitHub integration