Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4MicroElecMaterialStructure Class Reference

#include <G4MicroElecMaterialStructure.hh>

Public Member Functions

 G4MicroElecMaterialStructure (const G4String &matName="")
 
virtual ~G4MicroElecMaterialStructure ()=default
 
void ReadMaterialFile ()
 
G4double Energy (G4int level)
 
G4int NumberOfLevels ()
 
G4double GetZ (G4int Shell)
 
G4double ConvertUnit (const G4String &unitName)
 
G4double GetEnergyGap ()
 
G4double GetInitialEnergy ()
 
G4int GetEADL_Enumerator (G4int shell)
 
G4double GetWorkFunction ()
 
G4String GetMaterialName ()
 
G4double GetLimitEnergy (G4int level)
 
G4double GetElasticModelLowLimit ()
 
G4double GetElasticModelHighLimit ()
 
G4double GetInelasticModelLowLimit (G4int pdg)
 
G4double GetInelasticModelHighLimit (G4int pdg)
 
G4bool IsShellWeaklyBound (G4int level)
 

Detailed Description

Definition at line 83 of file G4MicroElecMaterialStructure.hh.

Constructor & Destructor Documentation

◆ G4MicroElecMaterialStructure()

G4MicroElecMaterialStructure::G4MicroElecMaterialStructure ( const G4String & matName = "")

Definition at line 82 of file G4MicroElecMaterialStructure.cc.

83{
84 materialName = matName;
85 if (matName == "Vacuum" || matName == "uum") {
86 workFunction = 0;
87 initialEnergy = 0;
88 }
89 else {
91 }
92 nLevels = (G4int)energyConstant.size();
93}
int G4int
Definition G4Types.hh:85

◆ ~G4MicroElecMaterialStructure()

virtual G4MicroElecMaterialStructure::~G4MicroElecMaterialStructure ( )
virtualdefault

Member Function Documentation

◆ ConvertUnit()

G4double G4MicroElecMaterialStructure::ConvertUnit ( const G4String & unitName)

Definition at line 244 of file G4MicroElecMaterialStructure.cc.

245{
246 G4double unitValue = 0;
247 if(unitName == "meV")
248 {
249 unitValue = 1e-3 * CLHEP::eV;
250 }
251 else if(unitName == "eV")
252 {
253 unitValue = CLHEP::eV;
254 }
255 else if(unitName == "keV")
256 {
257 unitValue = CLHEP::keV;
258 }
259 else if(unitName == "MeV")
260 {
261 unitValue = CLHEP::MeV;
262 }
263 else if(unitName == "noUnit")
264 {
265 unitValue = 1;
266 }
267
268 return unitValue;
269}
double G4double
Definition G4Types.hh:83

Referenced by ReadMaterialFile().

◆ Energy()

G4double G4MicroElecMaterialStructure::Energy ( G4int level)

Definition at line 217 of file G4MicroElecMaterialStructure.cc.

218{
219 return (level >= 0 && level < nLevels) ? energyConstant[level] : 0.0;
220}

Referenced by G4MicroElecInelasticModel_new::CrossSectionPerVolume(), and G4MicroElecInelasticModel_new::SampleSecondaries().

◆ GetEADL_Enumerator()

G4int G4MicroElecMaterialStructure::GetEADL_Enumerator ( G4int shell)
inline

Definition at line 96 of file G4MicroElecMaterialStructure.hh.

96{ return EADL_Enumerator[shell]; };

Referenced by G4MicroElecInelasticModel_new::SampleSecondaries().

◆ GetElasticModelHighLimit()

G4double G4MicroElecMaterialStructure::GetElasticModelHighLimit ( )
inline

Definition at line 101 of file G4MicroElecMaterialStructure.hh.

101{ return flimitElastic[1]; }

Referenced by G4MicroElecElasticModel_new::Initialise().

◆ GetElasticModelLowLimit()

G4double G4MicroElecMaterialStructure::GetElasticModelLowLimit ( )
inline

Definition at line 100 of file G4MicroElecMaterialStructure.hh.

100{return flimitElastic[0];}

Referenced by G4MicroElecElasticModel_new::Initialise().

◆ GetEnergyGap()

G4double G4MicroElecMaterialStructure::GetEnergyGap ( )
inline

◆ GetInelasticModelHighLimit()

G4double G4MicroElecMaterialStructure::GetInelasticModelHighLimit ( G4int pdg)

Definition at line 298 of file G4MicroElecMaterialStructure.cc.

299{
300 G4double res = 0.0;
301 if(pdg == 11)
302 {
303 res = flimitInelastic[1];
304 }
305 else if(pdg == 2212)
306 {
307 res = flimitInelastic[3];
308 }
309 return res;
310}

Referenced by G4MicroElecInelasticModel_new::CrossSectionPerVolume(), and G4MicroElecInelasticModel_new::SampleSecondaries().

◆ GetInelasticModelLowLimit()

G4double G4MicroElecMaterialStructure::GetInelasticModelLowLimit ( G4int pdg)

Definition at line 282 of file G4MicroElecMaterialStructure.cc.

283{
284 G4double res = 0.0;
285 if(pdg == 11)
286 {
287 res = flimitInelastic[0];
288 }
289 else if(pdg == 2212)
290 {
291 res = flimitInelastic[2];
292 }
293 return res;
294}

Referenced by G4MicroElecInelasticModel_new::CrossSectionPerVolume(), and G4MicroElecInelasticModel_new::SampleSecondaries().

◆ GetInitialEnergy()

G4double G4MicroElecMaterialStructure::GetInitialEnergy ( )
inline

Definition at line 95 of file G4MicroElecMaterialStructure.hh.

95{ return initialEnergy; }

Referenced by G4MicroElecCapture::PostStepDoIt().

◆ GetLimitEnergy()

G4double G4MicroElecMaterialStructure::GetLimitEnergy ( G4int level)

Definition at line 273 of file G4MicroElecMaterialStructure.cc.

274{
275 G4double E = LimitEnergy[level];
276 if (IsShellWeaklyBound(level)) { E = energyGap+ initialEnergy; }
277 return E;
278}

Referenced by G4MicroElecInelasticModel_new::DifferentialCrossSection(), and G4MicroElecInelasticModel_new::SampleSecondaries().

◆ GetMaterialName()

G4String G4MicroElecMaterialStructure::GetMaterialName ( )
inline

Definition at line 98 of file G4MicroElecMaterialStructure.hh.

98{ return materialName; };

◆ GetWorkFunction()

G4double G4MicroElecMaterialStructure::GetWorkFunction ( )
inline

◆ GetZ()

G4double G4MicroElecMaterialStructure::GetZ ( G4int Shell)

Definition at line 224 of file G4MicroElecMaterialStructure.cc.

225{
226 if (Shell >= 0 && Shell < nLevels) {
227 if(!isCompound)
228 {
229 return Z;
230 }
231 else
232 {
233 return compoundShellZ[Shell];
234 }
235 }
236 else
237 {
238 return 0;
239 }
240}

Referenced by G4MicroElecInelasticModel_new::SampleSecondaries().

◆ IsShellWeaklyBound()

G4bool G4MicroElecMaterialStructure::IsShellWeaklyBound ( G4int level)

Definition at line 314 of file G4MicroElecMaterialStructure.cc.

315{
316 return isShellWeaklyBoundVector[level];
317}

Referenced by GetLimitEnergy(), and G4MicroElecInelasticModel_new::SampleSecondaries().

◆ NumberOfLevels()

G4int G4MicroElecMaterialStructure::NumberOfLevels ( )
inline

◆ ReadMaterialFile()

void G4MicroElecMaterialStructure::ReadMaterialFile ( )

Definition at line 97 of file G4MicroElecMaterialStructure.cc.

98{
99 const char* path = G4FindDataDir("G4LEDATA");
100
101 if (materialName[0] == 'G' && materialName[1] == '4') {
102 //in the case the NIST database is used
103 materialName.erase(0, 1);
104 materialName.erase(0, 1);
105 materialName.erase(0, 1);
106 }
107
108 std::ostringstream fileName;
109 fileName << path << "/microelec/Structure/Data_" + materialName + ".dat";
110 std::ifstream fichier(fileName.str().c_str());
111
112 int varLength = 0;
113 G4String nameParameter;
114
115 G4String unitName;
116 G4double unitValue;
117 G4double data;
118 G4String filler;
119 G4String type;
120
121 if (fichier)
122 {
123 fichier >> filler >> type;
124 materialName = filler;
125 if (type == "Compound") {isCompound = true; Z = 0; }
126 else { isCompound = false; Z = std::stoi(type); }
127 while(!fichier.eof()) {
128
129 getline(fichier, filler);
130 std::stringstream line(filler);
131
132 if (filler[0] == '#' || filler.empty()) {continue;}
133
134 line >> varLength;
135 line >> nameParameter;
136 line >> unitName;
137 unitValue = ConvertUnit(unitName);
138
139 for (int i = 0; i < varLength; i++)
140 {
141 line >> data; data = data*unitValue;
142
143 if(nameParameter == "WorkFunction")
144 {
145 workFunction = data;
146 }
147 if(nameParameter == "EnergyGap")
148 {
149 energyGap = data;
150 }
151
152 if(nameParameter == "EnergyPeak")
153 {
154 energyConstant.push_back(data);
155 }
156 if(nameParameter == "EnergyLimit")
157 {
158 LimitEnergy.push_back(data);
159 }
160 if(nameParameter == "EADL")
161 {
162 EADL_Enumerator.push_back(data);
163 }
164
165 if (nameParameter == "WeaklyBoundShell")
166 {if (data == 0) { isShellWeaklyBoundVector.push_back(false); }
167 else {isShellWeaklyBoundVector.push_back(true);}}
168
169 if(nameParameter == "WeaklyBoundInitialEnergy")
170 {
171 initialEnergy = data;
172 }
173
174 if(nameParameter == "ShellAtomicNumber")
175 {
176 compoundShellZ.push_back(data);
177 }
178
179 if(nameParameter == "DielectricModelLowEnergyLimit_e")
180 {
181 flimitInelastic[0] = data;
182 }
183 if(nameParameter == "DielectricModelHighEnergyLimit_e")
184 {
185 flimitInelastic[1] = data;
186 }
187 if(nameParameter == "DielectricModelLowEnergyLimit_p")
188 {
189 flimitInelastic[2] = data;
190 }
191 if(nameParameter == "DielectricModelHighEnergyLimit_p")
192 {
193 flimitInelastic[3] = data;
194 }
195
196 if(nameParameter == "ElasticModelLowEnergyLimit")
197 {
198 flimitElastic[0] = data;
199 }
200 if(nameParameter == "ElasticModelHighEnergyLimit")
201 {
202 flimitElastic[1] = data;
203 }
204 }
205 }
206 fichier.close(); // on ferme le fichier
207 }
208 else {
209 G4String str = "file ";
210 str += fileName.str() + " not found!";
211 G4Exception("G4MicroElecMaterialStructure::ReadMaterialFile", "em0002", FatalException, str);
212 }
213}
const char * G4FindDataDir(const char *)
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4double ConvertUnit(const G4String &unitName)

Referenced by G4MicroElecMaterialStructure().


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