83 materialName = matName;
84 if (matName ==
"Vacuum" || matName ==
"uum") {
91 nLevels = energyConstant.size();
103 char *path = std::getenv(
"G4LEDATA");
105 if (materialName(0) ==
'G' && materialName(1) ==
'4') {
107 materialName.erase(0, 1);
108 materialName.erase(0, 1);
109 materialName.erase(0, 1);
112 std::ostringstream fileName;
113 fileName << path <<
"/microelec/Structure/Data_" + materialName +
".dat";
114 std::ifstream fichier(fileName.str().c_str());
127 fichier >> filler >> type;
128 materialName = filler;
129 if (type ==
"Compound") {isCompound =
true; Z = 0; }
130 else { isCompound =
false; Z = std::stoi(type); }
131 while(!fichier.eof()) {
133 getline(fichier, filler);
134 std::stringstream line(filler);
136 if (filler(0) ==
'#' || filler.empty()) {
continue;}
139 line >> nameParameter;
143 for (
int i = 0; i < varLength; i++)
145 line >> data; data = data*unitValue;
147 if (nameParameter ==
"WorkFunction") workFunction = data;
148 if (nameParameter ==
"EnergyGap") energyGap = data;
150 if (nameParameter ==
"EnergyPeak") energyConstant.push_back(data);
151 if (nameParameter ==
"EnergyLimit") LimitEnergy.push_back(data);
152 if (nameParameter ==
"EADL") EADL_Enumerator.push_back(data);
154 if (nameParameter ==
"WeaklyBoundShell")
155 {
if (data == 0) { isShellWeaklyBoundVector.push_back(
false); }
156 else {isShellWeaklyBoundVector.push_back(
true);}}
158 if (nameParameter ==
"WeaklyBoundInitialEnergy") initialEnergy = data;
160 if (nameParameter ==
"ShellAtomicNumber") compoundShellZ.push_back(data);
162 if (nameParameter ==
"DielectricModelLowEnergyLimit_e") limitInelastic[0]=data;
163 if (nameParameter ==
"DielectricModelHighEnergyLimit_e") limitInelastic[1] = data;
164 if (nameParameter ==
"DielectricModelLowEnergyLimit_p") limitInelastic[2] = data;
165 if (nameParameter ==
"DielectricModelHighEnergyLimit_p") limitInelastic[3] = data;
167 if (nameParameter ==
"ElasticModelLowEnergyLimit") limitElastic[0] = data;
168 if (nameParameter ==
"ElasticModelHighEnergyLimit") limitElastic[1] = data;
175 str += fileName.str() +
" not found!";
184 return (level >= 0 && level < nLevels) ? energyConstant[level] : 0.0;
191 if (Shell >= 0 && Shell < nLevels) {
192 if (!isCompound)
return Z;
193 else return compoundShellZ[Shell];
203 if (unitName ==
"meV") unitValue = 1e-3*CLHEP::eV;
204 else if (unitName ==
"eV") unitValue = CLHEP::eV;
205 else if (unitName ==
"keV") unitValue = CLHEP::keV;
206 else if (unitName ==
"MeV") unitValue = CLHEP::MeV;
207 else if (unitName ==
"noUnit") unitValue = 1;
226 if (pdg == 11) res = limitInelastic[0];
227 else if (pdg == 2212) res = limitInelastic[2];
236 if (pdg == 11) res = limitInelastic[1];
237 else if (pdg == 2212) res = limitInelastic[3];
245 return isShellWeaklyBoundVector[level];
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4double GetInelasticModelHighLimit(G4int pdg)
virtual ~G4MicroElecMaterialStructure()
G4bool IsShellWeaklyBound(G4int level)
G4double GetLimitEnergy(G4int level)
G4double GetZ(G4int Shell)
G4double ConvertUnit(const G4String &unitName)
G4MicroElecMaterialStructure(const G4String &matName="")
G4double Energy(G4int level)
G4double GetInelasticModelLowLimit(G4int pdg)