Geant4 11.2.2
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 ()
 
 G4ProductionCutsTableMessenger (const G4ProductionCutsTableMessenger &)=delete
 
G4ProductionCutsTableMessengeroperator= (const G4ProductionCutsTableMessenger &)=delete
 
virtual void SetNewValue (G4UIcommand *command, G4String newValues)
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()=default
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
G4bool CommandsShouldBeInMaster () const
 

Protected Attributes

G4ProductionCutsTabletheCutsTable = nullptr
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir = nullptr
 
G4String baseDirName = ""
 
G4bool commandsShouldBeInMaster = false
 

Additional Inherited Members

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

Detailed Description

Definition at line 57 of file G4ProductionCutsTableMessenger.hh.

Constructor & Destructor Documentation

◆ G4ProductionCutsTableMessenger() [1/2]

G4ProductionCutsTableMessenger::G4ProductionCutsTableMessenger ( G4ProductionCutsTable * pTable)

Definition at line 45 of file G4ProductionCutsTableMessenger.cc.

47 : theCutsTable(pTable)
48{
49 // /cuts/ directory
50 theDirectory = new G4UIdirectory("/cuts/");
51 theDirectory->SetGuidance("Commands for G4VUserPhysicsList.");
52
53 // /cuts/verbose command
54 verboseCmd = new G4UIcmdWithAnInteger("/cuts/verbose",this);
55 verboseCmd->SetGuidance("Set the Verbose level of G4ProductionCutsTable.");
56 verboseCmd->SetGuidance(" 0 : Silent (default)");
57 verboseCmd->SetGuidance(" 1 : Display warning messages");
58 verboseCmd->SetGuidance(" 2 : Display more info");
59 verboseCmd->SetGuidance(" 2 : Display debug info");
60 verboseCmd->SetParameterName("level",true);
61 verboseCmd->SetDefaultValue(0);
62 verboseCmd->SetRange("level >=0 && level <=3");
63
64 // /cuts/setLowEdge command
65 setLowEdgeCmd = new G4UIcmdWithADoubleAndUnit("/cuts/setLowEdge",this);
66 setLowEdgeCmd->SetGuidance("Set low edge energy value ");
67 setLowEdgeCmd->SetParameterName("edge",false);
68 setLowEdgeCmd->SetDefaultValue(0.99);
69 setLowEdgeCmd->SetRange("edge >0.0");
70 setLowEdgeCmd->SetDefaultUnit("keV");
71 setLowEdgeCmd->AvailableForStates(G4State_PreInit);
72
73 // /cuts/setHighEdge command
74 setHighEdgeCmd = new G4UIcmdWithADoubleAndUnit("/cuts/setHighEdge",this);
75 setHighEdgeCmd->SetGuidance("Set high edge energy value ");
76 setHighEdgeCmd->SetParameterName("edge",false);
77 setHighEdgeCmd->SetDefaultValue(100.0);
78 setHighEdgeCmd->SetRange("edge >0.0");
79 setHighEdgeCmd->SetDefaultUnit("TeV");
80 setHighEdgeCmd->AvailableForStates(G4State_PreInit);
81
82 // /cuts/setMaxCutEnergy command
83 setMaxEnergyCutCmd = new G4UIcmdWithADoubleAndUnit("/cuts/setMaxCutEnergy",this);
84 setMaxEnergyCutCmd->SetGuidance("Set maximum of cut energy value ");
85 setMaxEnergyCutCmd->SetParameterName("cut",false);
86 setMaxEnergyCutCmd->SetDefaultValue(10.0);
87 setMaxEnergyCutCmd->SetRange("cut >0.0");
88 setMaxEnergyCutCmd->SetDefaultUnit("GeV");
89 setMaxEnergyCutCmd->AvailableForStates(G4State_PreInit);
90
91 // /cuts/dump command
92 dumpCmd = new G4UIcmdWithoutParameter("/cuts/dump",this);
93 dumpCmd->SetGuidance("Dump couples in G4ProductionCutsTable. ");
94}
@ 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)
void SetRange(const char *rs)
void AvailableForStates(G4ApplicationState s1)

◆ ~G4ProductionCutsTableMessenger()

G4ProductionCutsTableMessenger::~G4ProductionCutsTableMessenger ( )
virtual

Definition at line 97 of file G4ProductionCutsTableMessenger.cc.

98{
99 delete dumpCmd;
100 delete setMaxEnergyCutCmd;
101 delete setHighEdgeCmd;
102 delete setLowEdgeCmd;
103 delete verboseCmd;
104 delete theDirectory;
105}

◆ G4ProductionCutsTableMessenger() [2/2]

G4ProductionCutsTableMessenger::G4ProductionCutsTableMessenger ( const G4ProductionCutsTableMessenger & )
delete

Member Function Documentation

◆ GetCurrentValue()

G4String G4ProductionCutsTableMessenger::GetCurrentValue ( G4UIcommand * command)
virtual

Reimplemented from G4UImessenger.

Definition at line 139 of file G4ProductionCutsTableMessenger.cc.

140{
141 G4String cv;
142
143 if( command==verboseCmd )
144 {
145 cv = verboseCmd->ConvertToString(theCutsTable->GetVerboseLevel());
146 }
147 else if( command==setLowEdgeCmd )
148 {
150 cv = setLowEdgeCmd->ConvertToString( lowEdge, "keV" );
151 }
152 else if( command==setHighEdgeCmd )
153 {
155 cv = setHighEdgeCmd->ConvertToString( highEdge, "TeV" );
156 }
157 else if( command==setMaxEnergyCutCmd )
158 {
160 cv = setMaxEnergyCutCmd->ConvertToString( cut, "GeV" );
161 }
162
163 return cv;
164}
double G4double
Definition G4Types.hh:83
static G4String ConvertToString(G4bool boolVal)

◆ operator=()

G4ProductionCutsTableMessenger & G4ProductionCutsTableMessenger::operator= ( const G4ProductionCutsTableMessenger & )
delete

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 108 of file G4ProductionCutsTableMessenger.cc.

110{
111 if( command==verboseCmd )
112 {
113 theCutsTable->SetVerboseLevel(verboseCmd->GetNewIntValue(newValue));
114 }
115 else if( command==dumpCmd )
116 {
117 theCutsTable-> DumpCouples();
118 }
119 else if( command==setLowEdgeCmd )
120 {
121 G4double lowEdge = setLowEdgeCmd->GetNewDoubleValue(newValue);
123 theCutsTable->SetEnergyRange(lowEdge, highEdge);
124 }
125 else if( command==setHighEdgeCmd )
126 {
127 G4double highEdge = setHighEdgeCmd->GetNewDoubleValue(newValue);
129 theCutsTable->SetEnergyRange(lowEdge, highEdge);
130 }
131 else if( command==setMaxEnergyCutCmd )
132 {
133 G4double cut = setHighEdgeCmd->GetNewDoubleValue(newValue);
135 }
136}
void SetMaxEnergyCut(G4double 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 = nullptr
protected

Definition at line 73 of file G4ProductionCutsTableMessenger.hh.

Referenced by GetCurrentValue(), and SetNewValue().


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