00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 #include "G4NistMessenger.hh"
00045
00046 #include "G4NistManager.hh"
00047
00048 #include "G4UIdirectory.hh"
00049 #include "G4UIcmdWithAnInteger.hh"
00050 #include "G4UIcmdWithAString.hh"
00051 #include "G4IonisParamMat.hh"
00052 #include "G4DensityEffectData.hh"
00053
00054
00055
00056 G4NistMessenger::G4NistMessenger(G4NistManager* man)
00057 :manager(man)
00058 {
00059 matDir = new G4UIdirectory("/material/");
00060 matDir->SetGuidance("Commands for materials");
00061
00062 verCmd = new G4UIcmdWithAnInteger("/material/verbose",this);
00063 verCmd->SetGuidance("Set verbose level.");
00064
00065 nistDir = new G4UIdirectory("/material/nist/");
00066 nistDir->SetGuidance("Commands for the nist dataBase");
00067
00068 prtElmCmd = new G4UIcmdWithAString("/material/nist/printElement",this);
00069 prtElmCmd->SetGuidance("print element(s) in dataBase.");
00070 prtElmCmd->SetGuidance("symbol = element.");
00071 prtElmCmd->SetGuidance("all = all elements.");
00072 prtElmCmd->SetParameterName("symbol", true);
00073 prtElmCmd->SetDefaultValue("all");
00074
00075 przElmCmd = new G4UIcmdWithAnInteger("/material/nist/printElementZ",this);
00076 przElmCmd->SetGuidance("print element Z in dataBase.");
00077 przElmCmd->SetGuidance("0 = all elements.");
00078 przElmCmd->SetParameterName("Z", true);
00079 przElmCmd->SetDefaultValue(0);
00080 przElmCmd->SetRange("0<=Z && Z<108");
00081
00082 lisMatCmd = new G4UIcmdWithAString("/material/nist/listMaterials",this);
00083 lisMatCmd->SetGuidance("list materials in Geant4 dataBase.");
00084 lisMatCmd->SetGuidance("simple - simple NIST materials.");
00085 lisMatCmd->SetGuidance("compound - compound NIST materials.");
00086 lisMatCmd->SetGuidance("hep - HEP materials.");
00087 lisMatCmd->SetGuidance("biomedical - biomedical materials.");
00088 lisMatCmd->SetGuidance("all - list of all Geant4 materials.");
00089 lisMatCmd->SetParameterName("list", true);
00090 lisMatCmd->SetCandidates("simple compound hep all");
00091 lisMatCmd->SetDefaultValue("all");
00092
00093 g4Dir = new G4UIdirectory("/material/g4/");
00094 g4Dir->SetGuidance("Commands for G4MaterialTable");
00095
00096 g4ElmCmd = new G4UIcmdWithAString("/material/g4/printElement",this);
00097 g4ElmCmd->SetGuidance("print Element from G4ElementTable.");
00098 g4ElmCmd->SetGuidance("all - all elements.");
00099 g4ElmCmd->SetParameterName("elm", true);
00100 g4ElmCmd->SetDefaultValue("all");
00101
00102 g4MatCmd = new G4UIcmdWithAString("/material/g4/printMaterial",this);
00103 g4MatCmd->SetGuidance("print Material from G4MaterialTable.");
00104 g4MatCmd->SetGuidance("all - all materials");
00105 g4MatCmd->SetParameterName("mat", true);
00106 g4MatCmd->SetDefaultValue("all");
00107
00108 g4DensCmd = new G4UIcmdWithAString("/material/g4/printDensityEffParam",this);
00109 g4DensCmd->SetGuidance("print Material from G4DensityEffectData.");
00110 g4DensCmd->SetGuidance("all - all materials");
00111 g4DensCmd->SetParameterName("mat", true);
00112 g4DensCmd->SetDefaultValue("all");
00113 }
00114
00115
00116
00117 G4NistMessenger::~G4NistMessenger()
00118 {
00119 delete verCmd;
00120 delete prtElmCmd;
00121 delete przElmCmd;
00122 delete lisMatCmd;
00123 delete nistDir;
00124
00125 delete g4ElmCmd;
00126 delete g4MatCmd;
00127 delete g4DensCmd;
00128 delete g4Dir;
00129 delete matDir;
00130 }
00131
00132
00133
00134 void G4NistMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
00135 {
00136 if (command == verCmd)
00137 { manager->SetVerbose(verCmd->GetNewIntValue(newValue));}
00138
00139 else if (command == prtElmCmd)
00140 { manager->PrintElement(newValue);}
00141
00142 else if (command == przElmCmd) {
00143 G4int Z = przElmCmd->GetNewIntValue(newValue);
00144 if(Z >= 0 && Z < 108) { manager->PrintElement(Z); }
00145 }
00146
00147 else if (command == lisMatCmd)
00148 { manager->ListMaterials(newValue);}
00149
00150 else if (command == g4ElmCmd)
00151 { manager->PrintG4Element(newValue);}
00152
00153 else if (command == g4MatCmd)
00154 { manager->PrintG4Material(newValue);}
00155
00156 else if (command == g4DensCmd)
00157 { G4IonisParamMat::GetDensityEffectData()->PrintData(newValue); }
00158 }
00159
00160