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

#include <G4HadronicEPTestMessenger.hh>

+ Inheritance diagram for G4HadronicEPTestMessenger:

Public Member Functions

 G4HadronicEPTestMessenger (G4HadronicProcessStore *theProcessStore)
 
 ~G4HadronicEPTestMessenger ()
 
void SetNewValue (G4UIcommand *command, G4String newValues)
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
virtual void SetNewValue (G4UIcommand *command, G4String newValue)
 
G4bool operator== (const G4UImessenger &messenger) const
 
G4bool operator!= (const G4UImessenger &messenger) const
 
G4bool CommandsShouldBeInMaster () const
 

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)
 
G4long StoL (G4String s)
 
G4double StoD (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)
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir = nullptr
 
G4String baseDirName = ""
 
G4bool commandsShouldBeInMaster = false
 

Detailed Description

Definition at line 50 of file G4HadronicEPTestMessenger.hh.

Constructor & Destructor Documentation

◆ G4HadronicEPTestMessenger()

G4HadronicEPTestMessenger::G4HadronicEPTestMessenger ( G4HadronicProcessStore theProcessStore)

Definition at line 35 of file G4HadronicEPTestMessenger.cc.

36 :theProcessStore(theStore)
37{
38 // Main directory for control of the e/p test
39 old_heptstDirectory = new G4UIdirectory("/heptst/"); // To be removed in G4 11.0
40 old_heptstDirectory->SetGuidance("Controls for the hadronic energy/momentum test");
41
42 heptstDirectory = new G4UIdirectory("/process/had/heptst/");
43 heptstDirectory->SetGuidance("Controls for the hadronic energy/momentum test");
44
45 // Command to set level of detail reported upon e/p non-conservation
46 old_reportLvlCmd = new G4UIcmdWithAnInteger("/heptst/reportLevel",this); // To be removed in G4 11.0
47 old_reportLvlCmd->SetGuidance("Set level of detail reported upon E/p non-conservation");
48 old_reportLvlCmd->SetGuidance(" 0 - (default) no reporting ");
49 old_reportLvlCmd->SetGuidance(" 1 - report only when E/p not conserved ");
50 old_reportLvlCmd->SetGuidance(" 2 - report regardless of E/p conservation ");
51 old_reportLvlCmd->SetGuidance(" 3 - report only when E/p not conserved, with names, limits ");
52 old_reportLvlCmd->SetGuidance(" 4 - report regardless of E/p conservation, with names, limits ");
53 old_reportLvlCmd->SetParameterName("OldReportLevel",true);
54 old_reportLvlCmd->SetDefaultValue(0);
55 old_reportLvlCmd->SetRange("OldReportLevel >= 0 && OldReportLevel < 5");
56
57 reportLvlCmd = new G4UIcmdWithAnInteger("/process/had/heptst/reportLevel",this);
58 reportLvlCmd->SetGuidance("Set level of detail reported upon E/p non-conservation");
59 reportLvlCmd->SetGuidance(" 0 - (default) no reporting ");
60 reportLvlCmd->SetGuidance(" 1 - report only when E/p not conserved ");
61 reportLvlCmd->SetGuidance(" 2 - report regardless of E/p conservation ");
62 reportLvlCmd->SetGuidance(" 3 - report only when E/p not conserved, with names, limits ");
63 reportLvlCmd->SetGuidance(" 4 - report regardless of E/p conservation, with names, limits ");
64 reportLvlCmd->SetParameterName("ReportLevel",true);
65 reportLvlCmd->SetDefaultValue(0);
66 reportLvlCmd->SetRange("ReportLevel >= 0 && ReportLevel < 5");
67
68 // Set the relative energy non-conservation level for the process
69 old_procRelLvlCmd = new G4UIcmdWithADouble("/heptst/processRelLevel",this); // To be removed in G4 11.0
70 old_procRelLvlCmd->SetGuidance("Set relative level of allowed energy non-conservation");
71 old_procRelLvlCmd->SetParameterName("OlProcessRelLevel",true);
72 old_procRelLvlCmd->SetDefaultValue(-1.0);
73
74 procRelLvlCmd = new G4UIcmdWithADouble("/process/had/heptst/processRelLevel",this);
75 procRelLvlCmd->SetGuidance("Set relative level of allowed energy non-conservation");
76 procRelLvlCmd->SetParameterName("ProcessRelLevel",true);
77 procRelLvlCmd->SetDefaultValue(-1.0);
78
79 // Set the absolute energy non-conservation level for the process
80 old_procAbsLvlCmd = new G4UIcmdWithADoubleAndUnit("/heptst/processAbsLevel",this); // To be removed in G4 11.0
81 old_procAbsLvlCmd->SetGuidance("Set absolute energy level (with unit) of allowed energy non-conservation");
82 old_procAbsLvlCmd->SetParameterName("OldProcessAbsLevel",true);
83 old_procAbsLvlCmd->SetDefaultValue(-1.0);
84 old_procAbsLvlCmd->SetUnitCategory("Energy");
85
86 procAbsLvlCmd = new G4UIcmdWithADoubleAndUnit("/process/had/heptst/processAbsLevel",this);
87 procAbsLvlCmd->SetGuidance("Set absolute energy level (with unit) of allowed energy non-conservation");
88 procAbsLvlCmd->SetParameterName("ProcessAbsLevel",true);
89 procAbsLvlCmd->SetDefaultValue(-1.0);
90 procAbsLvlCmd->SetUnitCategory("Energy");
91}
void SetUnitCategory(const char *unitCategory)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(G4double defVal)
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

◆ ~G4HadronicEPTestMessenger()

G4HadronicEPTestMessenger::~G4HadronicEPTestMessenger ( )

Definition at line 94 of file G4HadronicEPTestMessenger.cc.

95{
96 delete old_heptstDirectory; // To be removed in G4 11.0
97 delete heptstDirectory;
98 delete old_reportLvlCmd; // To be removed in G4 11.0
99 delete reportLvlCmd;
100 delete old_procRelLvlCmd; // To be removed in G4 11.0
101 delete procRelLvlCmd;
102 delete old_procAbsLvlCmd; // To be removed in G4 11.0
103 delete procAbsLvlCmd;
104}

Member Function Documentation

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 107 of file G4HadronicEPTestMessenger.cc.

108{
109 // Old commands to be removed in G4 11.0
110 if ( command == old_reportLvlCmd ) {
111 theProcessStore->SetEpReportLevel( old_reportLvlCmd->GetNewIntValue( newValue ) );
113 ed << "This command is valid but deprecated and will be replaced with the command:\n"
114 << "/process/had/heptst/reportLevel in the next major release, Geant4 version 11.0";
115 G4Exception( "G4HadronicEPTestMessenger", "hadEPTestMessenger001", JustWarning, ed );
116 } else if ( command == old_procRelLvlCmd ) {
117 theProcessStore->SetProcessRelLevel( old_procRelLvlCmd->GetNewDoubleValue( newValue ) );
119 ed << "This command is valid but deprecated and will be replaced with the command:\n"
120 << "/process/had/heptst/processRelLevel in the next major release, Geant4 version 11.0";
121 G4Exception( "G4HadronicEPTestMessenger", "hadEPTestMessenger002", JustWarning, ed );
122 } else if ( command == old_procAbsLvlCmd ) {
123 theProcessStore->SetProcessAbsLevel( old_procAbsLvlCmd->GetNewDoubleValue( newValue ) );
125 ed << "This command is valid but deprecated and will be replaced with the command:\n"
126 << "/process/had/heptst/processAbsLevel in the next major release, Geant4 version 11.0";
127 G4Exception( "G4HadronicEPTestMessenger", "hadEPTestMessenger003", JustWarning, ed );
128 }
129
130 // New commands
131 if ( command == reportLvlCmd ) {
132 theProcessStore->SetEpReportLevel( reportLvlCmd->GetNewIntValue( newValue ) );
133 } else if ( command == procRelLvlCmd ) {
134 theProcessStore->SetProcessRelLevel( procRelLvlCmd->GetNewDoubleValue( newValue ) );
135 } else if ( command == procAbsLvlCmd ) {
136 theProcessStore->SetProcessAbsLevel( procAbsLvlCmd->GetNewDoubleValue( newValue ) );
137 }
138}
@ JustWarning
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
void SetProcessAbsLevel(G4double absoluteLevel)
void SetProcessRelLevel(G4double relativeLevel)
void SetEpReportLevel(G4int level)
static G4double GetNewDoubleValue(const char *paramString)
static G4double GetNewDoubleValue(const char *paramString)
static G4int GetNewIntValue(const char *paramString)

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