Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4NistMessenger.cc
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25
26// File name: G4NistMessenger
27//
28// Author: Vladimir Ivanchenko
29//
30// Creation date: 23.12.2004
31//
32// Modifications:
33//
34//
35// -------------------------------------------------------------------
36
37#include "G4NistMessenger.hh"
38
40#include "G4IonisParamMat.hh"
41#include "G4NistManager.hh"
42#include "G4UIcmdWithAString.hh"
44#include "G4UIdirectory.hh"
45
46//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
47
49{
50 matDir = new G4UIdirectory("/material/");
51 matDir->SetGuidance("Commands for materials");
52
53 verCmd = new G4UIcmdWithAnInteger("/material/verbose", this);
54 verCmd->SetGuidance("Set verbose level.");
55
56 nistDir = new G4UIdirectory("/material/nist/");
57 nistDir->SetGuidance("Commands for the nist dataBase");
58
59 prtElmCmd = new G4UIcmdWithAString("/material/nist/printElement", this);
60 prtElmCmd->SetGuidance("print element(s) in dataBase.");
61 prtElmCmd->SetGuidance("symbol = element.");
62 prtElmCmd->SetGuidance("all = all elements.");
63 prtElmCmd->SetParameterName("symbol", true);
64 prtElmCmd->SetDefaultValue("all");
65
66 przElmCmd = new G4UIcmdWithAnInteger("/material/nist/printElementZ", this);
67 przElmCmd->SetGuidance("print element Z in dataBase.");
68 przElmCmd->SetGuidance("0 = all elements.");
69 przElmCmd->SetParameterName("Z", true);
70 przElmCmd->SetDefaultValue(0);
71 przElmCmd->SetRange("0<=Z && Z<108");
72
73 lisMatCmd = new G4UIcmdWithAString("/material/nist/listMaterials", this);
74 lisMatCmd->SetGuidance("Materials in Geant4 dataBase.");
75 lisMatCmd->SetGuidance("simple - simple NIST materials.");
76 lisMatCmd->SetGuidance("compound - compound NIST materials.");
77 lisMatCmd->SetGuidance("hep - HEP materials.");
78 lisMatCmd->SetGuidance("bio - biomedical materials.");
79 lisMatCmd->SetGuidance("all - list of all Geant4 materials.");
80 lisMatCmd->SetParameterName("matlist", true);
81 // lisMatCmd->SetCandidates("simple compound hep bio all");
82 lisMatCmd->SetDefaultValue("all");
83
84 g4Dir = new G4UIdirectory("/material/g4/");
85 g4Dir->SetGuidance("Commands for G4MaterialTable");
86
87 g4ElmCmd = new G4UIcmdWithAString("/material/g4/printElement", this);
88 g4ElmCmd->SetGuidance("print Element from G4ElementTable.");
89 g4ElmCmd->SetGuidance("all - all elements.");
90 g4ElmCmd->SetParameterName("elm", true);
91 g4ElmCmd->SetDefaultValue("all");
92
93 g4MatCmd = new G4UIcmdWithAString("/material/g4/printMaterial", this);
94 g4MatCmd->SetGuidance("print Material from G4MaterialTable.");
95 g4MatCmd->SetGuidance("all - all materials");
96 g4MatCmd->SetParameterName("pmat", true);
97 g4MatCmd->SetDefaultValue("all");
98
99 g4DensCmd = new G4UIcmdWithAString("/material/g4/printDensityEffParam", this);
100 g4DensCmd->SetGuidance("print Material from G4DensityEffectData.");
101 g4DensCmd->SetGuidance("all - all materials");
102 g4DensCmd->SetParameterName("dmat", true);
103 g4DensCmd->SetDefaultValue("all");
104
105 densCmd = new G4UIcmdWithAString("/material/g4/enableDensityEffOnFly", this);
106 densCmd->SetGuidance("enable accurate computation of density effect.");
107 densCmd->SetGuidance("all - all materials.");
108 densCmd->SetParameterName("dens", true);
109 densCmd->SetDefaultValue("all");
110
111 adensCmd = new G4UIcmdWithAString("/material/g4/disableDensityEffOnFly", this);
112 adensCmd->SetGuidance("disable accurate computation of density effect.");
113 adensCmd->SetGuidance("all - all materials.");
114 adensCmd->SetParameterName("dens", true);
115 adensCmd->SetDefaultValue("all");
116}
117
118//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
119
121{
122 delete verCmd;
123 delete prtElmCmd;
124 delete przElmCmd;
125 delete lisMatCmd;
126 delete nistDir;
127
128 delete g4ElmCmd;
129 delete g4MatCmd;
130 delete g4DensCmd;
131 delete densCmd;
132 delete adensCmd;
133 delete g4Dir;
134 delete matDir;
135}
136
137//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
138
140{
141 // G4cout << "G4NistMessenger::SetNewValue <" << newValue << ">" << G4endl;
142 if (command == verCmd) {
143 manager->SetVerbose(verCmd->GetNewIntValue(newValue));
144 }
145 else if (command == prtElmCmd) {
146 manager->PrintElement(newValue);
147 }
148 else if (command == przElmCmd) {
149 G4int Z = przElmCmd->GetNewIntValue(newValue);
150 if (Z >= 0 && Z < 108) {
151 manager->PrintElement(Z);
152 }
153 }
154 else if (command == lisMatCmd) {
155 manager->ListMaterials(newValue);
156 }
157 else if (command == g4ElmCmd) {
158 manager->PrintG4Element(newValue);
159 }
160 else if (command == g4MatCmd) {
161 manager->PrintG4Material(newValue);
162 }
163 else if (command == g4DensCmd) {
165 }
166 else if (command == densCmd) {
167 manager->SetDensityEffectCalculatorFlag(newValue, true);
168 }
169 else if (command == adensCmd) {
170 manager->SetDensityEffectCalculatorFlag(newValue, false);
171 }
172}
int G4int
Definition G4Types.hh:85
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)
G4NistMessenger(G4NistManager *)
~G4NistMessenger() override
void SetNewValue(G4UIcommand *, G4String) final
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)
static G4int GetNewIntValue(const char *paramString)
void SetDefaultValue(G4int defVal)
void SetGuidance(const char *aGuidance)
void SetRange(const char *rs)