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
G4ProductionCutsTableMessenger.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file G4ProductionCutsTableMessenger.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
//
27
//
28
//
29
//---------------------------------------------------------------
30
//
31
// G4ProductionCutsTableMessenger.cc
32
// ------------------------------------------------------------
33
// History
34
// first version 02 Mar. 2008 by H.Kurashige
35
//
36
37
#include "
G4ProductionCutsTableMessenger.hh
"
38
#include "
G4ProductionCutsTable.hh
"
39
40
#include "
G4UIdirectory.hh
"
41
#include "
G4UIcmdWithoutParameter.hh
"
42
#include "
G4UIcmdWithAnInteger.hh
"
43
#include "
G4UIcmdWithADoubleAndUnit.hh
"
44
#include "
G4UIcmdWithAString.hh
"
45
#include "
G4ios.hh
"
46
#include "
G4Tokenizer.hh
"
47
48
#include <sstream>
49
50
G4ProductionCutsTableMessenger::G4ProductionCutsTableMessenger
(
G4ProductionCutsTable
* pTable)
51
:theCutsTable(pTable)
52
{
53
// /cuts/ directory
54
theDirectory
=
new
G4UIdirectory
(
"/cuts/"
);
55
theDirectory
->
SetGuidance
(
"Commands for G4VUserPhysicsList."
);
56
57
// /cuts/verbose command
58
verboseCmd
=
new
G4UIcmdWithAnInteger
(
"/cuts/verbose"
,
this
);
59
verboseCmd
->
SetGuidance
(
"Set the Verbose level of G4ProductionCutsTable."
);
60
verboseCmd
->
SetGuidance
(
" 0 : Silent (default)"
);
61
verboseCmd
->
SetGuidance
(
" 1 : Display warning messages"
);
62
verboseCmd
->
SetGuidance
(
" 2 : Display more info"
);
63
verboseCmd
->
SetGuidance
(
" 2 : Display debug info"
);
64
verboseCmd
->
SetParameterName
(
"level"
,
true
);
65
verboseCmd
->
SetDefaultValue
(0);
66
verboseCmd
->
SetRange
(
"level >=0 && level <=3"
);
67
68
// /cuts/setLowEdge command
69
setLowEdgeCmd
=
new
G4UIcmdWithADoubleAndUnit
(
"/cuts/setLowEdge"
,
this
);
70
setLowEdgeCmd
->
SetGuidance
(
"Set low edge energy value "
);
71
setLowEdgeCmd
->
SetParameterName
(
"edge"
,
false
);
72
setLowEdgeCmd
->
SetDefaultValue
(0.99);
73
setLowEdgeCmd
->
SetRange
(
"edge >0.0"
);
74
setLowEdgeCmd
->
SetDefaultUnit
(
"keV"
);
75
setLowEdgeCmd
->
AvailableForStates
(
G4State_PreInit
);
76
77
// /cuts/setHighEdge command
78
setHighEdgeCmd
=
new
G4UIcmdWithADoubleAndUnit
(
"/cuts/setHighEdge"
,
this
);
79
setHighEdgeCmd
->
SetGuidance
(
"Set high edge energy value "
);
80
setHighEdgeCmd
->
SetParameterName
(
"edge"
,
false
);
81
setHighEdgeCmd
->
SetDefaultValue
(100.0);
82
setHighEdgeCmd
->
SetRange
(
"edge >0.0"
);
83
setHighEdgeCmd
->
SetDefaultUnit
(
"TeV"
);
84
setHighEdgeCmd
->
AvailableForStates
(
G4State_PreInit
);
85
86
// /cuts/setMaxCutEnergy command
87
setMaxEnergyCutCmd
=
new
G4UIcmdWithADoubleAndUnit
(
"/cuts/setMaxCutEnergy"
,
this
);
88
setMaxEnergyCutCmd
->
SetGuidance
(
"Set maximum of cut energy value "
);
89
setMaxEnergyCutCmd
->
SetParameterName
(
"cut"
,
false
);
90
setMaxEnergyCutCmd
->
SetDefaultValue
(10.0);
91
setMaxEnergyCutCmd
->
SetRange
(
"cut >0.0"
);
92
setMaxEnergyCutCmd
->
SetDefaultUnit
(
"GeV"
);
93
setMaxEnergyCutCmd
->
AvailableForStates
(
G4State_PreInit
);
94
95
// /cuts/dump command
96
dumpCmd
=
new
G4UIcmdWithoutParameter
(
"/cuts/dump"
,
this
);
97
dumpCmd
->
SetGuidance
(
"Dump cuplues in ProductuinCutsTable. "
);
98
99
}
100
101
G4ProductionCutsTableMessenger::~G4ProductionCutsTableMessenger
()
102
{
103
delete
dumpCmd
;
104
delete
setMaxEnergyCutCmd
;
105
delete
setHighEdgeCmd
;
106
delete
setLowEdgeCmd
;
107
delete
verboseCmd
;
108
delete
theDirectory
;
109
}
110
111
void
G4ProductionCutsTableMessenger::SetNewValue
(
G4UIcommand
* command,
112
G4String
newValue)
113
{
114
if
( command==
verboseCmd
) {
115
theCutsTable
->
SetVerboseLevel
(
verboseCmd
->
GetNewIntValue
(newValue));
116
117
}
else
if
( command==
dumpCmd
){
118
theCutsTable
-> DumpCouples();
119
120
}
else
if
( command==
setLowEdgeCmd
){
121
G4double
lowEdge =
setLowEdgeCmd
->
GetNewDoubleValue
(newValue);
122
G4double
highEdge =
theCutsTable
->
GetHighEdgeEnergy
();
123
theCutsTable
->
SetEnergyRange
(lowEdge, highEdge);
124
125
}
else
if
( command==
setHighEdgeCmd
){
126
G4double
highEdge =
setHighEdgeCmd
->
GetNewDoubleValue
(newValue);
127
G4double
lowEdge =
theCutsTable
->
GetLowEdgeEnergy
();
128
theCutsTable
->
SetEnergyRange
(lowEdge, highEdge);
129
130
}
else
if
( command==
setMaxEnergyCutCmd
){
131
G4double
cut =
setHighEdgeCmd
->
GetNewDoubleValue
(newValue);
132
theCutsTable
->
SetMaxEnergyCut
(cut);
133
134
}
135
}
136
137
G4String
G4ProductionCutsTableMessenger::GetCurrentValue
(
G4UIcommand
* command)
138
{
139
G4String
cv;
140
141
if
( command==
verboseCmd
){
142
cv =
verboseCmd
->
ConvertToString
(
theCutsTable
->
GetVerboseLevel
());
143
144
}
else
if
( command==
setLowEdgeCmd
){
145
G4double
lowEdge =
theCutsTable
->
GetLowEdgeEnergy
();
146
cv =
setLowEdgeCmd
->
ConvertToString
( lowEdge,
"keV"
);
147
148
}
else
if
( command==
setHighEdgeCmd
){
149
G4double
highEdge =
theCutsTable
->
GetHighEdgeEnergy
();
150
cv =
setHighEdgeCmd
->
ConvertToString
( highEdge,
"TeV"
);
151
152
}
else
if
( command==
setMaxEnergyCutCmd
){
153
G4double
cut =
theCutsTable
->
GetMaxEnergyCut
();
154
cv =
setMaxEnergyCutCmd
->
ConvertToString
( cut,
"GeV"
);
155
}
156
157
158
return
cv;
159
160
}
161
geant4
tree
geant4-10.6-release
source
processes
cuts
src
G4ProductionCutsTableMessenger.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:28
using
1.8.2 with
ECCE GitHub integration