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

#include <G4NistMessenger.hh>

+ Inheritance diagram for G4NistMessenger:

Public Member Functions

 G4NistMessenger (G4NistManager *)
 
 ~G4NistMessenger () override
 
void SetNewValue (G4UIcommand *, G4String) final
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()=default
 
 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 (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)
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir = nullptr
 
G4String baseDirName = ""
 
G4bool commandsShouldBeInMaster = false
 

Detailed Description

Definition at line 79 of file G4NistMessenger.hh.

Constructor & Destructor Documentation

◆ G4NistMessenger()

G4NistMessenger::G4NistMessenger ( G4NistManager man)
explicit

Definition at line 54 of file G4NistMessenger.cc.

55 : manager(man)
56{
57 matDir = new G4UIdirectory("/material/");
58 matDir->SetGuidance("Commands for materials");
59
60 verCmd = new G4UIcmdWithAnInteger("/material/verbose",this);
61 verCmd->SetGuidance("Set verbose level.");
62
63 nistDir = new G4UIdirectory("/material/nist/");
64 nistDir->SetGuidance("Commands for the nist dataBase");
65
66 prtElmCmd = new G4UIcmdWithAString("/material/nist/printElement",this);
67 prtElmCmd->SetGuidance("print element(s) in dataBase.");
68 prtElmCmd->SetGuidance("symbol = element.");
69 prtElmCmd->SetGuidance("all = all elements.");
70 prtElmCmd->SetParameterName("symbol", true);
71 prtElmCmd->SetDefaultValue("all");
72
73 przElmCmd = new G4UIcmdWithAnInteger("/material/nist/printElementZ",this);
74 przElmCmd->SetGuidance("print element Z in dataBase.");
75 przElmCmd->SetGuidance("0 = all elements.");
76 przElmCmd->SetParameterName("Z", true);
77 przElmCmd->SetDefaultValue(0);
78 przElmCmd->SetRange("0<=Z && Z<108");
79
80 lisMatCmd = new G4UIcmdWithAString("/material/nist/listMaterials",this);
81 lisMatCmd->SetGuidance("Materials in Geant4 dataBase.");
82 lisMatCmd->SetGuidance("simple - simple NIST materials.");
83 lisMatCmd->SetGuidance("compound - compound NIST materials.");
84 lisMatCmd->SetGuidance("hep - HEP materials.");
85 lisMatCmd->SetGuidance("bio - biomedical materials.");
86 lisMatCmd->SetGuidance("all - list of all Geant4 materials.");
87 lisMatCmd->SetParameterName("matlist", true);
88 // lisMatCmd->SetCandidates("simple compound hep bio all");
89 lisMatCmd->SetDefaultValue("all");
90
91 g4Dir = new G4UIdirectory("/material/g4/");
92 g4Dir->SetGuidance("Commands for G4MaterialTable");
93
94 g4ElmCmd = new G4UIcmdWithAString("/material/g4/printElement",this);
95 g4ElmCmd->SetGuidance("print Element from G4ElementTable.");
96 g4ElmCmd->SetGuidance("all - all elements.");
97 g4ElmCmd->SetParameterName("elm", true);
98 g4ElmCmd->SetDefaultValue("all");
99
100 g4MatCmd = new G4UIcmdWithAString("/material/g4/printMaterial",this);
101 g4MatCmd->SetGuidance("print Material from G4MaterialTable.");
102 g4MatCmd->SetGuidance("all - all materials");
103 g4MatCmd->SetParameterName("pmat", true);
104 g4MatCmd->SetDefaultValue("all");
105
106 g4DensCmd = new G4UIcmdWithAString("/material/g4/printDensityEffParam",this);
107 g4DensCmd->SetGuidance("print Material from G4DensityEffectData.");
108 g4DensCmd->SetGuidance("all - all materials");
109 g4DensCmd->SetParameterName("dmat", true);
110 g4DensCmd->SetDefaultValue("all");
111
112 densCmd = new G4UIcmdWithAString("/material/g4/enableDensityEffOnFly",this);
113 densCmd->SetGuidance("enable accurate computation of density effect.");
114 densCmd->SetGuidance("all - all materials.");
115 densCmd->SetParameterName("dens", true);
116 densCmd->SetDefaultValue("all");
117
118 adensCmd = new G4UIcmdWithAString("/material/g4/disableDensityEffOnFly",this);
119 adensCmd->SetGuidance("disable accurate computation of density effect.");
120 adensCmd->SetGuidance("all - all materials.");
121 adensCmd->SetParameterName("dens", true);
122 adensCmd->SetDefaultValue("all");
123}
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(const char *defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(G4int defVal)
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:157
void SetRange(const char *rs)
Definition: G4UIcommand.hh:121

◆ ~G4NistMessenger()

G4NistMessenger::~G4NistMessenger ( )
override

Definition at line 127 of file G4NistMessenger.cc.

128{
129 delete verCmd;
130 delete prtElmCmd;
131 delete przElmCmd;
132 delete lisMatCmd;
133 delete nistDir;
134
135 delete g4ElmCmd;
136 delete g4MatCmd;
137 delete g4DensCmd;
138 delete densCmd;
139 delete adensCmd;
140 delete g4Dir;
141 delete matDir;
142}

Member Function Documentation

◆ SetNewValue()

void G4NistMessenger::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
finalvirtual

Reimplemented from G4UImessenger.

Definition at line 146 of file G4NistMessenger.cc.

147{
148 //G4cout << "G4NistMessenger::SetNewValue <" << newValue << ">" << G4endl;
149 if (command == verCmd)
150 { manager->SetVerbose(verCmd->GetNewIntValue(newValue));}
151 else if (command == prtElmCmd)
152 { manager->PrintElement(newValue); }
153 else if (command == przElmCmd) {
154 G4int Z = przElmCmd->GetNewIntValue(newValue);
155 if(Z >= 0 && Z < 108) { manager->PrintElement(Z); }
156 }
157 else if (command == lisMatCmd)
158 { manager->ListMaterials(newValue); }
159 else if (command == g4ElmCmd)
160 { manager->PrintG4Element(newValue); }
161 else if (command == g4MatCmd)
162 { manager->PrintG4Material(newValue); }
163 else if (command == g4DensCmd)
165 else if (command == densCmd)
166 { manager->SetDensityEffectCalculatorFlag(newValue,true); }
167 else if (command == adensCmd)
168 { manager->SetDensityEffectCalculatorFlag(newValue,false); }
169}
int G4int
Definition: G4Types.hh:85
const G4int Z[17]
void PrintData(const G4String &matName) const
static G4DensityEffectData * GetDensityEffectData()
void PrintElement(G4int Z) const
void SetDensityEffectCalculatorFlag(const G4String &, G4bool)
void ListMaterials(const G4String &) const
void PrintG4Material(const G4String &) const
void PrintG4Element(const G4String &) const
void SetVerbose(G4int)
static G4int GetNewIntValue(const char *paramString)

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