Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ProductionCutsTableMessenger Class Reference

#include <G4ProductionCutsTableMessenger.hh>

+ Inheritance diagram for G4ProductionCutsTableMessenger:

Public Member Functions

 G4ProductionCutsTableMessenger (G4ProductionCutsTable *pTable)
 
virtual ~G4ProductionCutsTableMessenger ()
 
virtual void SetNewValue (G4UIcommand *command, G4String newValues)
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
virtual void SetNewValue (G4UIcommand *command, G4String newValue)
 
G4bool operator== (const G4UImessenger &messenger) const
 

Protected Attributes

G4ProductionCutsTabletheCutsTable
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir
 
G4String baseDirName
 

Additional Inherited Members

- Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
 
G4String DtoS (G4double a)
 
G4String BtoS (G4bool b)
 
G4int StoI (G4String s)
 
G4double StoD (G4String s)
 
G4bool StoB (G4String s)
 
void AddUIcommand (G4UIcommand *newCommand)
 
void CreateDirectory (const G4String &path, const G4String &dsc)
 
template<typename T >
T * CreateCommand (const G4String &cname, const G4String &dsc)
 

Detailed Description

Definition at line 65 of file G4ProductionCutsTableMessenger.hh.

Constructor & Destructor Documentation

◆ G4ProductionCutsTableMessenger()

G4ProductionCutsTableMessenger::G4ProductionCutsTableMessenger ( G4ProductionCutsTable pTable)

Definition at line 51 of file G4ProductionCutsTableMessenger.cc.

52 :theCutsTable(pTable)
53{
54 // /cuts/ directory
55 theDirectory = new G4UIdirectory("/cuts/");
56 theDirectory->SetGuidance("Commands for G4VUserPhysicsList.");
57
58 // /cuts/verbose command
59 verboseCmd = new G4UIcmdWithAnInteger("/cuts/verbose",this);
60 verboseCmd->SetGuidance("Set the Verbose level of G4ProductionCutsTable.");
61 verboseCmd->SetGuidance(" 0 : Silent (default)");
62 verboseCmd->SetGuidance(" 1 : Display warning messages");
63 verboseCmd->SetGuidance(" 2 : Display more info");
64 verboseCmd->SetGuidance(" 2 : Display debug info");
65 verboseCmd->SetParameterName("level",true);
66 verboseCmd->SetDefaultValue(0);
67 verboseCmd->SetRange("level >=0 && level <=3");
68
69 // /cuts/setLowEdge command
70 setLowEdgeCmd = new G4UIcmdWithADoubleAndUnit("/cuts/setLowEdge",this);
71 setLowEdgeCmd->SetGuidance("Set low edge energy value ");
72 setLowEdgeCmd->SetParameterName("edge",false);
73 setLowEdgeCmd->SetDefaultValue(0.99);
74 setLowEdgeCmd->SetRange("edge >0.0");
75 setLowEdgeCmd->SetDefaultUnit("keV");
76 setLowEdgeCmd->AvailableForStates(G4State_PreInit);
77
78 // /cuts/setHighEdge command
79 setHighEdgeCmd = new G4UIcmdWithADoubleAndUnit("/cuts/setHighEdge",this);
80 setHighEdgeCmd->SetGuidance("Set high edge energy value ");
81 setHighEdgeCmd->SetParameterName("edge",false);
82 setHighEdgeCmd->SetDefaultValue(100.0);
83 setHighEdgeCmd->SetRange("edge >0.0");
84 setHighEdgeCmd->SetDefaultUnit("TeV");
85 setHighEdgeCmd->AvailableForStates(G4State_PreInit);
86
87 // /cuts/setMaxCutEnergy command
88 setMaxEnergyCutCmd = new G4UIcmdWithADoubleAndUnit("/cuts/setMaxCutEnergy",this);
89 setMaxEnergyCutCmd->SetGuidance("Set maximum of cut energy value ");
90 setMaxEnergyCutCmd->SetParameterName("cut",false);
91 setMaxEnergyCutCmd->SetDefaultValue(10.0);
92 setMaxEnergyCutCmd->SetRange("cut >0.0");
93 setMaxEnergyCutCmd->SetDefaultUnit("GeV");
94 setMaxEnergyCutCmd->AvailableForStates(G4State_PreInit);
95
96 // /cuts/dump command
97 dumpCmd = new G4UIcmdWithoutParameter("/cuts/dump",this);
98 dumpCmd->SetGuidance("Dump cuplues in ProductuinCutsTable. ");
99
100}
@ G4State_PreInit
void SetDefaultUnit(const char *defUnit)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(G4int defVal)
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:156
void SetRange(const char *rs)
Definition: G4UIcommand.hh:120
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:219

◆ ~G4ProductionCutsTableMessenger()

G4ProductionCutsTableMessenger::~G4ProductionCutsTableMessenger ( )
virtual

Definition at line 102 of file G4ProductionCutsTableMessenger.cc.

103{
104 delete dumpCmd;
105 delete setMaxEnergyCutCmd;
106 delete setHighEdgeCmd;
107 delete setLowEdgeCmd;
108 delete verboseCmd;
109 delete theDirectory;
110}

Member Function Documentation

◆ GetCurrentValue()

G4String G4ProductionCutsTableMessenger::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 138 of file G4ProductionCutsTableMessenger.cc.

139{
140 G4String cv;
141
142 if( command==verboseCmd ){
143 cv = verboseCmd->ConvertToString(theCutsTable->GetVerboseLevel());
144
145 } else if( command==setLowEdgeCmd ){
147 cv = setLowEdgeCmd->ConvertToString( lowEdge, "keV" );
148
149 } else if( command==setHighEdgeCmd ){
151 cv = setHighEdgeCmd->ConvertToString( highEdge, "TeV" );
152
153 } else if( command==setMaxEnergyCutCmd ){
155 cv = setMaxEnergyCutCmd->ConvertToString( cut, "GeV" );
156 }
157
158
159 return cv;
160
161}
double G4double
Definition: G4Types.hh:64
G4double GetLowEdgeEnergy() const
G4double GetHighEdgeEnergy() const
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:349

◆ SetNewValue()

void G4ProductionCutsTableMessenger::SetNewValue ( G4UIcommand command,
G4String  newValues 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 112 of file G4ProductionCutsTableMessenger.cc.

114{
115 if( command==verboseCmd ) {
116 theCutsTable->SetVerboseLevel(verboseCmd->GetNewIntValue(newValue));
117
118 } else if( command==dumpCmd ){
119 theCutsTable-> DumpCouples();
120
121 } else if( command==setLowEdgeCmd ){
122 G4double lowEdge = setLowEdgeCmd->GetNewDoubleValue(newValue);
124 theCutsTable->SetEnergyRange(lowEdge, highEdge);
125
126 } else if( command==setHighEdgeCmd ){
127 G4double highEdge = setHighEdgeCmd->GetNewDoubleValue(newValue);
129 theCutsTable->SetEnergyRange(lowEdge, highEdge);
130
131 } else if( command==setMaxEnergyCutCmd ){
132 G4double cut = setHighEdgeCmd->GetNewDoubleValue(newValue);
134
135 }
136}
void SetMaxEnergyCut(G4double value)
void SetVerboseLevel(G4int value)
void SetEnergyRange(G4double lowedge, G4double highedge)
static G4double GetNewDoubleValue(const char *paramString)
static G4int GetNewIntValue(const char *paramString)

Member Data Documentation

◆ theCutsTable

G4ProductionCutsTable* G4ProductionCutsTableMessenger::theCutsTable
protected

Definition at line 80 of file G4ProductionCutsTableMessenger.hh.

Referenced by GetCurrentValue(), and SetNewValue().


The documentation for this class was generated from the following files: