Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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//
27// File name: G4NistMessenger
28//
29// Author: Vladimir Ivanchenko
30//
31// Creation date: 23.12.2004
32//
33// Modifications:
34//
35//
36// -------------------------------------------------------------------
37//
38
39//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
40//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
41
42#include "G4NistMessenger.hh"
43
44#include "G4NistManager.hh"
45
46#include "G4UIdirectory.hh"
48#include "G4UIcmdWithAString.hh"
49#include "G4IonisParamMat.hh"
51
52//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
53
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}
124
125//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
126
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}
143
144//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
145
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}
170
171//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
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 *)
virtual void SetNewValue(G4UIcommand *, G4String) final
virtual ~G4NistMessenger()
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)
Definition: G4UIcommand.hh:156
void SetRange(const char *rs)
Definition: G4UIcommand.hh:120