Geant4-11
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes
G4NistMessenger Class Reference

#include <G4NistMessenger.hh>

Inheritance diagram for G4NistMessenger:
G4UImessenger

Public Member Functions

G4bool CommandsShouldBeInMaster () const
 
 G4NistMessenger (G4NistManager *)
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
G4bool operator!= (const G4UImessenger &messenger) const
 
G4bool operator== (const G4UImessenger &messenger) const
 
void SetNewValue (G4UIcommand *, G4String) final
 
 ~G4NistMessenger () override
 

Protected Member Functions

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

Protected Attributes

G4UIdirectorybaseDir = nullptr
 
G4String baseDirName = ""
 
G4bool commandsShouldBeInMaster = false
 

Private Attributes

G4UIcmdWithAStringadensCmd
 
G4UIcmdWithAStringdensCmd
 
G4UIcmdWithAStringg4DensCmd
 
G4UIdirectoryg4Dir
 
G4UIcmdWithAStringg4ElmCmd
 
G4UIcmdWithAStringg4MatCmd
 
G4UIcmdWithAStringlisMatCmd
 
G4NistManagermanager
 
G4UIdirectorymatDir
 
G4UIdirectorynistDir
 
G4UIcmdWithAStringprtElmCmd
 
G4UIcmdWithAnIntegerprzElmCmd
 
G4UIcmdWithAnIntegerverCmd
 

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);
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);
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");
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);
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);
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);
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);
123}
G4UIcmdWithAString * lisMatCmd
G4UIcmdWithAString * adensCmd
G4UIcmdWithAString * densCmd
G4UIdirectory * nistDir
G4UIdirectory * g4Dir
G4UIcmdWithAnInteger * verCmd
G4UIcmdWithAnInteger * przElmCmd
G4UIcmdWithAString * g4ElmCmd
G4UIcmdWithAString * g4DensCmd
G4UIdirectory * matDir
G4NistManager * manager
G4UIcmdWithAString * g4MatCmd
G4UIcmdWithAString * prtElmCmd
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:156
void SetRange(const char *rs)
Definition: G4UIcommand.hh:120

References adensCmd, densCmd, g4DensCmd, g4Dir, g4ElmCmd, g4MatCmd, lisMatCmd, matDir, nistDir, prtElmCmd, przElmCmd, G4UIcmdWithAString::SetDefaultValue(), G4UIcmdWithAnInteger::SetDefaultValue(), G4UIcommand::SetGuidance(), G4UIcmdWithAnInteger::SetParameterName(), G4UIcmdWithAString::SetParameterName(), G4UIcommand::SetRange(), and verCmd.

◆ ~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}

References adensCmd, densCmd, g4DensCmd, g4Dir, g4ElmCmd, g4MatCmd, lisMatCmd, matDir, nistDir, prtElmCmd, przElmCmd, and verCmd.

Member Function Documentation

◆ AddUIcommand()

void G4UImessenger::AddUIcommand ( G4UIcommand newCommand)
protectedinherited

Definition at line 149 of file G4UImessenger.cc.

150{
151 G4cerr << "Warning : Old style definition of G4UIcommand <"
152 << newCommand->GetCommandPath() << ">." << G4endl;
153}
G4GLOB_DLL std::ostream G4cerr
#define G4endl
Definition: G4ios.hh:57
const G4String & GetCommandPath() const
Definition: G4UIcommand.hh:136

References G4cerr, G4endl, and G4UIcommand::GetCommandPath().

◆ BtoS()

G4String G4UImessenger::BtoS ( G4bool  b)
protectedinherited

Definition at line 98 of file G4UImessenger.cc.

99{
100 G4String vl = "0";
101 if(b)
102 vl = "true";
103 return vl;
104}

◆ CommandsShouldBeInMaster()

G4bool G4UImessenger::CommandsShouldBeInMaster ( ) const
inlineinherited

Definition at line 77 of file G4UImessenger.hh.

78 {
80 }
G4bool commandsShouldBeInMaster

References G4UImessenger::commandsShouldBeInMaster.

Referenced by G4UIcommand::G4UIcommandCommonConstructorCode().

◆ CreateCommand()

template<typename T >
T * G4UImessenger::CreateCommand ( const G4String cname,
const G4String dsc 
)
protectedinherited

Definition at line 110 of file G4UImessenger.hh.

111{
112 G4String path;
113 if(cname[0] != '/')
114 {
115 path = baseDirName + cname;
116 if(path[0] != '/')
117 path = "/" + path;
118 }
119
120 T* command = new T(path.c_str(), this);
121 command->SetGuidance(dsc.c_str());
122
123 return command;
124}
G4String baseDirName

References G4UImessenger::baseDirName.

◆ CreateDirectory()

void G4UImessenger::CreateDirectory ( const G4String path,
const G4String dsc,
G4bool  commandsToBeBroadcasted = true 
)
protectedinherited

Definition at line 156 of file G4UImessenger.cc.

158{
160
161 G4String fullpath = path;
162 if(fullpath.back() != '/')
163 fullpath.append("/");
164
165 G4UIcommandTree* tree = ui->GetTree()->FindCommandTree(fullpath.c_str());
166 if(tree != nullptr)
167 {
168 baseDirName = tree->GetPathName();
169 }
170 else
171 {
172 baseDir = new G4UIdirectory(fullpath.c_str(), commandsToBeBroadcasted);
173 baseDirName = fullpath;
174 baseDir->SetGuidance(dsc.c_str());
175 }
176}
const G4String & GetPathName() const
G4UIcommandTree * FindCommandTree(const char *commandPath)
G4UIcommandTree * GetTree() const
Definition: G4UImanager.hh:186
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:77
G4UIdirectory * baseDir

References G4UImessenger::baseDir, G4UImessenger::baseDirName, G4UIcommandTree::FindCommandTree(), G4UIcommandTree::GetPathName(), G4UImanager::GetTree(), G4UImanager::GetUIpointer(), and G4UIcommand::SetGuidance().

Referenced by G4MoleculeShootMessenger::G4MoleculeShootMessenger(), and G4UImessenger::G4UImessenger().

◆ DtoS()

G4String G4UImessenger::DtoS ( G4double  a)
protectedinherited

Definition at line 90 of file G4UImessenger.cc.

91{
92 std::ostringstream os;
93 os << a;
94 return G4String(os.str());
95}

Referenced by G4ScoreQuantityMessenger::FilterCommands(), and G4UIcontrolMessenger::SetNewValue().

◆ GetCurrentValue()

G4String G4UImessenger::GetCurrentValue ( G4UIcommand command)
virtualinherited

Reimplemented in G4ScoreQuantityMessenger, G4VisCommandModelCreate< Factory >, G4VisCommandListManagerList< Manager >, G4VisCommandListManagerSelect< Manager >, G4VisCommandManagerMode< Manager >, G4ToolsAnalysisMessenger, G4ScoringMessenger, G4EvManMessenger, G4GeneralParticleSourceMessenger, G4ParticleGunMessenger, G4GeometryMessenger, G4GenericMessenger, G4UIcontrolMessenger, GFlashShowerModelMessenger, G4DecayTableMessenger, G4ParticleMessenger, G4ParticlePropertyMessenger, G4tgrMessenger, G4PersistencyCenterMessenger, G4ProductionCutsTableMessenger, G4SchedulerMessenger, G4VITSteppingVerbose, G4MoleculeShootMessenger, G4MoleculeGunMessenger, G4ProcessManagerMessenger, G4ProcessTableMessenger, G4MatScanMessenger, G4RunMessenger, G4UserPhysicsListMessenger, G4TrackingMessenger, G4GMocrenMessenger, G4HepRepMessenger, G4VisCommandAbortReviewKeptEvents, G4VisCommandDrawOnlyToBeKeptEvents, G4VisCommandEnable, G4VisCommandList, G4VisCommandReviewKeptEvents, G4VisCommandVerbose, G4VisCommandGeometryList, G4VisCommandGeometryRestore, G4VisCommandGeometrySetColour, G4VisCommandGeometrySetDaughtersInvisible, G4VisCommandGeometrySetForceAuxEdgeVisible, G4VisCommandGeometrySetForceCloud, G4VisCommandGeometrySetForceSolid, G4VisCommandGeometrySetForceLineSegmentsPerCircle, G4VisCommandGeometrySetForceWireframe, G4VisCommandGeometrySetLineStyle, G4VisCommandGeometrySetLineWidth, G4VisCommandGeometrySetVisibility, G4VisCommandSceneActivateModel, G4VisCommandSceneCreate, G4VisCommandSceneEndOfEventAction, G4VisCommandSceneEndOfRunAction, G4VisCommandSceneList, G4VisCommandSceneNotifyHandlers, G4VisCommandSceneRemoveModel, G4VisCommandSceneSelect, G4VisCommandSceneShowExtents, G4VisCommandSceneAddArrow, G4VisCommandSceneAddArrow2D, G4VisCommandSceneAddAxes, G4VisCommandSceneAddDate, G4VisCommandSceneAddDigis, G4VisCommandSceneAddEventID, G4VisCommandSceneAddExtent, G4VisCommandSceneAddElectricField, G4VisCommandSceneAddFrame, G4VisCommandSceneAddGPS, G4VisCommandSceneAddGhosts, G4VisCommandSceneAddHits, G4VisCommandSceneAddLine, G4VisCommandSceneAddLine2D, G4VisCommandSceneAddLocalAxes, G4VisCommandSceneAddLogicalVolume, G4VisCommandSceneAddLogo, G4VisCommandSceneAddLogo2D, G4VisCommandSceneAddMagneticField, G4VisCommandSceneAddPSHits, G4VisCommandSceneAddScale, G4VisCommandSceneAddText, G4VisCommandSceneAddText2D, G4VisCommandSceneAddTrajectories, G4VisCommandSceneAddUserAction, G4VisCommandSceneAddVolume, G4VisCommandSceneAddPlotter, G4VisCommandSceneHandlerAttach, G4VisCommandSceneHandlerCreate, G4VisCommandSceneHandlerList, G4VisCommandSceneHandlerSelect, G4VisCommandSetArrow3DLineSegmentsPerCircle, G4VisCommandSetColour, G4VisCommandSetExtentForField, G4VisCommandSetLineWidth, G4VisCommandSetTextColour, G4VisCommandSetTextLayout, G4VisCommandSetTextSize, G4VisCommandSetTouchable, G4VisCommandSetVolumeForField, G4VisCommandsTouchable, G4VisCommandsTouchableSet, G4VisCommandViewerAddCutawayPlane, G4VisCommandViewerCentreOn, G4VisCommandViewerChangeCutawayPlane, G4VisCommandViewerClear, G4VisCommandViewerClearCutawayPlanes, G4VisCommandViewerClearTransients, G4VisCommandViewerClearVisAttributesModifiers, G4VisCommandViewerClone, G4VisCommandViewerColourByDensity, G4VisCommandViewerCopyViewFrom, G4VisCommandViewerCreate, G4VisCommandViewerDolly, G4VisCommandViewerFlush, G4VisCommandViewerInterpolate, G4VisCommandViewerList, G4VisCommandViewerPan, G4VisCommandViewerReset, G4VisCommandViewerRefresh, G4VisCommandViewerRebuild, G4VisCommandViewerSave, G4VisCommandViewerScale, G4VisCommandViewerSelect, G4VisCommandViewerUpdate, G4VisCommandViewerZoom, G4VisCommandViewerDefaultHiddenEdge, G4VisCommandViewerDefaultStyle, G4VisCommandsViewerSet, G4VModelCommand< T >, G4VModelCommand< M >, G4RTMessenger, G4ASCIITreeMessenger, G4VtkMessenger, G4PolarizationMessenger, and G4DNAChemistryManager.

Definition at line 58 of file G4UImessenger.cc.

59{
60 G4String nullString;
61 return nullString;
62}

Referenced by G4UIcommand::DoIt(), and G4UIcommand::GetCurrentValue().

◆ ItoS()

G4String G4UImessenger::ItoS ( G4int  i)
protectedinherited

Definition at line 82 of file G4UImessenger.cc.

83{
84 std::ostringstream os;
85 os << i;
86 return G4String(os.str());
87}

Referenced by G4GenericMessenger::DeclareMethod(), and G4ParticleGunMessenger::GetCurrentValue().

◆ operator!=()

G4bool G4UImessenger::operator!= ( const G4UImessenger messenger) const
inherited

Definition at line 76 of file G4UImessenger.cc.

77{
78 return this != &messenger;
79}

◆ operator==()

G4bool G4UImessenger::operator== ( const G4UImessenger messenger) const
inherited

Definition at line 70 of file G4UImessenger.cc.

71{
72 return this == &messenger;
73}

◆ 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)

References adensCmd, densCmd, g4DensCmd, g4ElmCmd, g4MatCmd, G4IonisParamMat::GetDensityEffectData(), G4UIcmdWithAnInteger::GetNewIntValue(), lisMatCmd, G4NistManager::ListMaterials(), manager, G4DensityEffectData::PrintData(), G4NistManager::PrintElement(), G4NistManager::PrintG4Element(), G4NistManager::PrintG4Material(), prtElmCmd, przElmCmd, G4NistManager::SetDensityEffectCalculatorFlag(), G4NistManager::SetVerbose(), verCmd, and Z.

◆ StoB()

G4bool G4UImessenger::StoB ( G4String  s)
protectedinherited

Definition at line 137 of file G4UImessenger.cc.

138{
140 G4bool vl = false;
141 if(v == "Y" || v == "YES" || v == "1" || v == "T" || v == "TRUE")
142 {
143 vl = true;
144 }
145 return vl;
146}
bool G4bool
Definition: G4Types.hh:86
G4String to_upper_copy(G4String str)
Return uppercase copy of string.

References G4StrUtil::to_upper_copy().

Referenced by G4LocalThreadCoutMessenger::SetNewValue(), G4CascadeParamMessenger::SetNewValue(), G4ScoreQuantityMessenger::SetNewValue(), and G4ScoringMessenger::SetNewValue().

◆ StoD()

G4double G4UImessenger::StoD ( G4String  s)
protectedinherited

◆ StoI()

G4int G4UImessenger::StoI ( G4String  s)
protectedinherited

◆ StoL()

G4long G4UImessenger::StoL ( G4String  s)
protectedinherited

Definition at line 117 of file G4UImessenger.cc.

118{
119 G4long vl;
120 const char* t = str;
121 std::istringstream is(t);
122 is >> vl;
123 return vl;
124}
long G4long
Definition: G4Types.hh:87

Referenced by G4RunMessenger::SetNewValue().

Field Documentation

◆ adensCmd

G4UIcmdWithAString* G4NistMessenger::adensCmd
private

Definition at line 105 of file G4NistMessenger.hh.

Referenced by G4NistMessenger(), SetNewValue(), and ~G4NistMessenger().

◆ baseDir

G4UIdirectory* G4UImessenger::baseDir = nullptr
protectedinherited

◆ baseDirName

G4String G4UImessenger::baseDirName = ""
protectedinherited

◆ commandsShouldBeInMaster

G4bool G4UImessenger::commandsShouldBeInMaster = false
protectedinherited

◆ densCmd

G4UIcmdWithAString* G4NistMessenger::densCmd
private

Definition at line 104 of file G4NistMessenger.hh.

Referenced by G4NistMessenger(), SetNewValue(), and ~G4NistMessenger().

◆ g4DensCmd

G4UIcmdWithAString* G4NistMessenger::g4DensCmd
private

Definition at line 103 of file G4NistMessenger.hh.

Referenced by G4NistMessenger(), SetNewValue(), and ~G4NistMessenger().

◆ g4Dir

G4UIdirectory* G4NistMessenger::g4Dir
private

Definition at line 100 of file G4NistMessenger.hh.

Referenced by G4NistMessenger(), and ~G4NistMessenger().

◆ g4ElmCmd

G4UIcmdWithAString* G4NistMessenger::g4ElmCmd
private

Definition at line 101 of file G4NistMessenger.hh.

Referenced by G4NistMessenger(), SetNewValue(), and ~G4NistMessenger().

◆ g4MatCmd

G4UIcmdWithAString* G4NistMessenger::g4MatCmd
private

Definition at line 102 of file G4NistMessenger.hh.

Referenced by G4NistMessenger(), SetNewValue(), and ~G4NistMessenger().

◆ lisMatCmd

G4UIcmdWithAString* G4NistMessenger::lisMatCmd
private

Definition at line 98 of file G4NistMessenger.hh.

Referenced by G4NistMessenger(), SetNewValue(), and ~G4NistMessenger().

◆ manager

G4NistManager* G4NistMessenger::manager
private

Definition at line 90 of file G4NistMessenger.hh.

Referenced by SetNewValue().

◆ matDir

G4UIdirectory* G4NistMessenger::matDir
private

Definition at line 92 of file G4NistMessenger.hh.

Referenced by G4NistMessenger(), and ~G4NistMessenger().

◆ nistDir

G4UIdirectory* G4NistMessenger::nistDir
private

Definition at line 95 of file G4NistMessenger.hh.

Referenced by G4NistMessenger(), and ~G4NistMessenger().

◆ prtElmCmd

G4UIcmdWithAString* G4NistMessenger::prtElmCmd
private

Definition at line 96 of file G4NistMessenger.hh.

Referenced by G4NistMessenger(), SetNewValue(), and ~G4NistMessenger().

◆ przElmCmd

G4UIcmdWithAnInteger* G4NistMessenger::przElmCmd
private

Definition at line 97 of file G4NistMessenger.hh.

Referenced by G4NistMessenger(), SetNewValue(), and ~G4NistMessenger().

◆ verCmd

G4UIcmdWithAnInteger* G4NistMessenger::verCmd
private

Definition at line 93 of file G4NistMessenger.hh.

Referenced by G4NistMessenger(), SetNewValue(), and ~G4NistMessenger().


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