#include <G4PenelopeCrossSection.hh>
|
| G4PenelopeCrossSection (size_t nOfEnergyPoints, size_t nOfShells=0) |
|
| ~G4PenelopeCrossSection () |
|
G4double | GetTotalCrossSection (G4double energy) const |
| Returns total cross section at the given energy.
|
|
G4double | GetHardCrossSection (G4double energy) const |
| Returns hard cross section at the given energy.
|
|
G4double | GetSoftStoppingPower (G4double energy) const |
| Returns the total stopping power due to soft collisions.
|
|
G4double | GetShellCrossSection (size_t shellID, G4double energy) const |
| Returns the hard cross section for the given shell (per molecule)
|
|
G4double | GetNormalizedShellCrossSection (size_t shellID, G4double energy) const |
| Returns the hard cross section for the given shell (normalized to 1)
|
|
size_t | GetNumberOfShells () const |
|
void | AddCrossSectionPoint (size_t binNumber, G4double energy, G4double XH0, G4double XH1, G4double XH2, G4double XS0, G4double XS1, G4double XS2) |
|
void | AddShellCrossSectionPoint (size_t binNumber, size_t shellID, G4double energy, G4double xs) |
|
void | NormalizeShellCrossSections () |
|
Definition at line 71 of file G4PenelopeCrossSection.hh.
◆ G4PenelopeCrossSection()
G4PenelopeCrossSection::G4PenelopeCrossSection |
( |
size_t |
nOfEnergyPoints, |
|
|
size_t |
nOfShells = 0 |
|
) |
| |
Definition at line 44 of file G4PenelopeCrossSection.cc.
44 :
45 numberOfEnergyPoints(nPointsE),numberOfShells(nShells),softCrossSections(0),
46 hardCrossSections(0),shellCrossSections(0),shellNormalizedCrossSections(0)
47{
48
49 if (!numberOfEnergyPoints)
50 {
52 ed <<
"G4PenelopeCrossSection: invalid number of energy points " <<
G4endl;
53 G4Exception(
"G4PenelopeCrossSection::G4PenelopeCrossSection()",
55 }
56
57 isNormalized = false;
58
59
61
62
63
64
65
66
67 for (size_t i=0;i<3;i++)
69
70
72
73
74
75
76
77
78 for (size_t i=0;i<3;i++)
80
81
82 if (numberOfShells)
83 {
86
87
88 for (size_t i=0;i<numberOfShells;i++)
89 {
92 }
93 }
94}
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
void push_back(G4PhysicsVector *)
◆ ~G4PenelopeCrossSection()
G4PenelopeCrossSection::~G4PenelopeCrossSection |
( |
| ) |
|
Definition at line 97 of file G4PenelopeCrossSection.cc.
98{
99
100 if (shellCrossSections)
101 {
102
103 delete shellCrossSections;
104 }
105 if (shellNormalizedCrossSections)
106 {
107
108 delete shellNormalizedCrossSections;
109 }
110 if (softCrossSections)
111 {
112
113 delete softCrossSections;
114 }
115 if (hardCrossSections)
116 {
117
118 delete hardCrossSections;
119 }
120}
◆ AddCrossSectionPoint()
Public interface for the master thread
Definition at line 123 of file G4PenelopeCrossSection.cc.
128{
129 if (!softCrossSections || !hardCrossSections)
130 {
131 G4cout <<
"Something wrong in G4PenelopeCrossSection::AddCrossSectionPoint" <<
133 G4cout <<
"Trying to fill un-initialized tables" <<
G4endl;
134 return;
135 }
136
137
139
140 if (binNumber >= numberOfEnergyPoints)
141 {
142 G4cout <<
"Something wrong in G4PenelopeCrossSection::AddCrossSectionPoint" <<
144 G4cout <<
"Trying to register more points than originally declared" <<
G4endl;
145 return;
146 }
148
149
151 theVector->
PutValue(binNumber,logEne,val);
152
153
155 val =
G4Log(std::max(XS1,1e-42*eV*cm2));
156 theVector->
PutValue(binNumber,logEne,val);
157
158
160 val =
G4Log(std::max(XS2,1e-42*eV*eV*cm2));
161 theVector->
PutValue(binNumber,logEne,val);
162
163
165 val =
G4Log(std::max(XH0,1e-42*cm2));
166 theVector->
PutValue(binNumber,logEne,val);
167
168
170 val =
G4Log(std::max(XH1,1e-42*eV*cm2));
171 theVector->
PutValue(binNumber,logEne,val);
172
173
175 val =
G4Log(std::max(XH2,1e-42*eV*eV*cm2));
176 theVector->
PutValue(binNumber,logEne,val);
177
178 return;
179}
G4double G4Log(G4double x)
G4GLOB_DLL std::ostream G4cout
void PutValue(std::size_t index, G4double energy, G4double dValue)
Referenced by G4PenelopeIonisationXSHandler::BuildXSTable().
◆ AddShellCrossSectionPoint()
void G4PenelopeCrossSection::AddShellCrossSectionPoint |
( |
size_t |
binNumber, |
|
|
size_t |
shellID, |
|
|
G4double |
energy, |
|
|
G4double |
xs |
|
) |
| |
Definition at line 183 of file G4PenelopeCrossSection.cc.
187{
188 if (!shellCrossSections)
189 {
190 G4cout <<
"Something wrong in G4PenelopeCrossSection::AddShellCrossSectionPoint" <<
192 G4cout <<
"Trying to fill un-initialized table" <<
G4endl;
193 return;
194 }
195
196 if (shellID >= numberOfShells)
197 {
198 G4cout <<
"Something wrong in G4PenelopeCrossSection::AddShellCrossSectionPoint" <<
200 G4cout <<
"Trying to fill shell #" << shellID <<
" while the maximum is "
201 << numberOfShells-1 <<
G4endl;
202 return;
203 }
204
205
207
208 if (binNumber >= numberOfEnergyPoints)
209 {
210 G4cout <<
"Something wrong in G4PenelopeCrossSection::AddShellCrossSectionPoint" <<
212 G4cout <<
"Trying to register more points than originally declared" <<
G4endl;
213 return;
214 }
217 theVector->
PutValue(binNumber,logEne,val);
218
219 return;
220}
Referenced by G4PenelopeIonisationXSHandler::BuildXSTable().
◆ GetHardCrossSection()
Returns hard cross section at the given energy.
Definition at line 268 of file G4PenelopeCrossSection.cc.
269{
271
272 if (!hardCrossSections)
273 {
274 G4cout <<
"Something wrong in G4PenelopeCrossSection::GetHardCrossSection" <<
276 G4cout <<
"Trying to retrieve from un-initialized tables" <<
G4endl;
277 return result;
278 }
279
282 {
283 G4cout <<
"Something wrong in G4PenelopeCrossSection::GetHardCrossSection" <<
285 G4cout <<
"Hard cross section table looks not filled" <<
G4endl;
286 return result;
287 }
290 result =
G4Exp(logXS);
291
292 return result;
293}
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4double Value(G4double theEnergy, std::size_t &lastidx) const
std::size_t GetVectorLength() const
Referenced by G4PenelopeBremsstrahlungModel::CrossSectionPerVolume(), and G4PenelopeIonisationModel::CrossSectionPerVolume().
◆ GetNormalizedShellCrossSection()
G4double G4PenelopeCrossSection::GetNormalizedShellCrossSection |
( |
size_t |
shellID, |
|
|
G4double |
energy |
|
) |
| const |
Returns the hard cross section for the given shell (normalized to 1)
Definition at line 363 of file G4PenelopeCrossSection.cc.
364{
366 if (!shellNormalizedCrossSections)
367 {
368 G4cout <<
"Something wrong in G4PenelopeCrossSection::GetShellCrossSection" <<
370 G4cout <<
"Trying to retrieve from un-initialized tables" <<
G4endl;
371 return result;
372 }
373
374 if (!isNormalized)
375 {
376 G4cout <<
"Something wrong in G4PenelopeCrossSection::GetShellCrossSection" <<
G4endl;
377 G4cout <<
"The table of normalized cross section is not initialized" <<
G4endl;
378 }
379
380
381 if (shellID >= numberOfShells)
382 {
383 G4cout <<
"Something wrong in G4PenelopeCrossSection::GetShellCrossSection" <<
385 G4cout <<
"Trying to retrieve shell #" << shellID <<
" while the maximum is "
386 << numberOfShells-1 <<
G4endl;
387 return result;
388 }
389
392
394 {
395 G4cout <<
"Something wrong in G4PenelopeCrossSection::GetShellCrossSection" <<
397 G4cout <<
"Shell cross section table looks not filled" <<
G4endl;
398 return result;
399 }
402 result =
G4Exp(logXS);
403
404 return result;
405}
◆ GetNumberOfShells()
size_t G4PenelopeCrossSection::GetNumberOfShells |
( |
| ) |
const |
|
inline |
◆ GetShellCrossSection()
G4double G4PenelopeCrossSection::GetShellCrossSection |
( |
size_t |
shellID, |
|
|
G4double |
energy |
|
) |
| const |
Returns the hard cross section for the given shell (per molecule)
Definition at line 327 of file G4PenelopeCrossSection.cc.
328{
330 if (!shellCrossSections)
331 {
332 G4cout <<
"Something wrong in G4PenelopeCrossSection::GetShellCrossSection" <<
334 G4cout <<
"Trying to retrieve from un-initialized tables" <<
G4endl;
335 return result;
336 }
337 if (shellID >= numberOfShells)
338 {
339 G4cout <<
"Something wrong in G4PenelopeCrossSection::GetShellCrossSection" <<
341 G4cout <<
"Trying to retrieve shell #" << shellID <<
" while the maximum is "
342 << numberOfShells-1 <<
G4endl;
343 return result;
344 }
345
347
349 {
350 G4cout <<
"Something wrong in G4PenelopeCrossSection::GetShellCrossSection" <<
352 G4cout <<
"Shell cross section table looks not filled" <<
G4endl;
353 return result;
354 }
357 result =
G4Exp(logXS);
358
359 return result;
360}
Referenced by G4PenelopeIonisationCrossSection::CrossSection().
◆ GetSoftStoppingPower()
◆ GetTotalCrossSection()
Returns total cross section at the given energy.
Definition at line 224 of file G4PenelopeCrossSection.cc.
225{
227
228 if (!softCrossSections || !hardCrossSections)
229 {
230 G4cout <<
"Something wrong in G4PenelopeCrossSection::GetTotalCrossSection" <<
232 G4cout <<
"Trying to retrieve from un-initialized tables" <<
G4endl;
233 return result;
234 }
235
236
239 {
240 G4cout <<
"Something wrong in G4PenelopeCrossSection::GetTotalCrossSection" <<
242 G4cout <<
"Soft cross section table looks not filled" <<
G4endl;
243 return result;
244 }
248
249
252 {
253 G4cout <<
"Something wrong in G4PenelopeCrossSection::GetTotalCrossSection" <<
255 G4cout <<
"Hard cross section table looks not filled" <<
G4endl;
256 return result;
257 }
258 logXS = theVector->
Value(logene);
260
261 result = hardXS + softXS;
262 return result;
263
264}
Referenced by G4PenelopeIonisationModel::CrossSectionPerVolume().
◆ NormalizeShellCrossSections()
void G4PenelopeCrossSection::NormalizeShellCrossSections |
( |
| ) |
|
Definition at line 411 of file G4PenelopeCrossSection.cc.
412{
413 if (isNormalized)
414 {
415 G4cout <<
"G4PenelopeCrossSection::NormalizeShellCrossSections()" <<
G4endl;
417 return;
418 }
419
420 if (!shellNormalizedCrossSections)
421 {
422 G4cout <<
"Something wrong in G4PenelopeCrossSection::GetShellCrossSection" <<
424 G4cout <<
"Trying to retrieve from un-initialized tables" <<
G4endl;
425 return;
426 }
427
428 for (size_t i=0;i<numberOfEnergyPoints;i++)
429 {
430
431
432
433
435 for (size_t shellID=0;shellID<numberOfShells;shellID++)
436 {
439
440 normFactor +=
G4Exp((*theVec)[i]);
441 }
443
444 for (size_t shellID=0;shellID<numberOfShells;shellID++)
445 {
450 G4double previousValue = (*theFullVec)[i];
452
453 theVec->
PutValue(i,logEnergy,previousValue-logNormFactor);
454 }
455 }
456
457 isNormalized = true;
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475 return;
476}
G4double GetLowEdgeEnergy(std::size_t binNumber) const
Referenced by G4PenelopeIonisationXSHandler::BuildXSTable().
The documentation for this class was generated from the following files: