#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. More...
|
|
G4double | GetHardCrossSection (G4double energy) const |
| Returns hard cross section at the given energy. More...
|
|
G4double | GetSoftStoppingPower (G4double energy) const |
| Returns the total stopping power due to soft collisions. More...
|
|
G4double | GetShellCrossSection (size_t shellID, G4double energy) const |
| Returns the hard cross section for the given shell (per molecule) More...
|
|
G4double | GetNormalizedShellCrossSection (size_t shellID, G4double energy) const |
| Returns the hard cross section for the given shell (normalized to 1) More...
|
|
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 72 of file G4PenelopeCrossSection.hh.
G4PenelopeCrossSection::G4PenelopeCrossSection |
( |
size_t |
nOfEnergyPoints, |
|
|
size_t |
nOfShells = 0 |
|
) |
| |
Definition at line 45 of file G4PenelopeCrossSection.cc.
46 numberOfEnergyPoints(nPointsE),numberOfShells(nShells),softCrossSections(0),
47 hardCrossSections(0),shellCrossSections(0),shellNormalizedCrossSections(0)
50 if (!numberOfEnergyPoints)
53 ed <<
"G4PenelopeCrossSection: invalid number of energy points " <<
G4endl;
54 G4Exception(
"G4PenelopeCrossSection::G4PenelopeCrossSection()",
68 for (
size_t i=0;i<3;i++)
79 for (
size_t i=0;i<3;i++)
89 for (
size_t i=0;i<numberOfShells;i++)
std::ostringstream G4ExceptionDescription
void push_back(G4PhysicsVector *)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4PenelopeCrossSection::~G4PenelopeCrossSection |
( |
| ) |
|
Definition at line 98 of file G4PenelopeCrossSection.cc.
101 if (shellCrossSections)
104 delete shellCrossSections;
106 if (shellNormalizedCrossSections)
109 delete shellNormalizedCrossSections;
111 if (softCrossSections)
114 delete softCrossSections;
116 if (hardCrossSections)
119 delete hardCrossSections;
Public interface for the master thread
Definition at line 124 of file G4PenelopeCrossSection.cc.
130 if (!softCrossSections || !hardCrossSections)
132 G4cout <<
"Something wrong in G4PenelopeCrossSection::AddCrossSectionPoint" <<
134 G4cout <<
"Trying to fill un-initialized tables" <<
G4endl;
141 if (binNumber >= numberOfEnergyPoints)
143 G4cout <<
"Something wrong in G4PenelopeCrossSection::AddCrossSectionPoint" <<
145 G4cout <<
"Trying to register more points than originally declared" <<
G4endl;
152 theVector->
PutValue(binNumber,logEne,val);
157 theVector->
PutValue(binNumber,logEne,val);
162 theVector->
PutValue(binNumber,logEne,val);
167 theVector->
PutValue(binNumber,logEne,val);
172 theVector->
PutValue(binNumber,logEne,val);
177 theVector->
PutValue(binNumber,logEne,val);
static constexpr double cm2
void PutValue(size_t index, G4double energy, G4double dataValue)
G4GLOB_DLL std::ostream G4cout
static constexpr double eV
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4double energy(const ThreeVector &p, const G4double m)
void G4PenelopeCrossSection::AddShellCrossSectionPoint |
( |
size_t |
binNumber, |
|
|
size_t |
shellID, |
|
|
G4double |
energy, |
|
|
G4double |
xs |
|
) |
| |
Definition at line 184 of file G4PenelopeCrossSection.cc.
189 if (!shellCrossSections)
191 G4cout <<
"Something wrong in G4PenelopeCrossSection::AddShellCrossSectionPoint" <<
193 G4cout <<
"Trying to fill un-initialized table" <<
G4endl;
197 if (shellID >= numberOfShells)
199 G4cout <<
"Something wrong in G4PenelopeCrossSection::AddShellCrossSectionPoint" <<
201 G4cout <<
"Trying to fill shell #" << shellID <<
" while the maximum is "
202 << numberOfShells-1 <<
G4endl;
209 if (binNumber >= numberOfEnergyPoints)
211 G4cout <<
"Something wrong in G4PenelopeCrossSection::AddShellCrossSectionPoint" <<
213 G4cout <<
"Trying to register more points than originally declared" <<
G4endl;
218 theVector->
PutValue(binNumber,logEne,val);
static constexpr double cm2
void PutValue(size_t index, G4double energy, G4double dataValue)
G4GLOB_DLL std::ostream G4cout
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4double energy(const ThreeVector &p, const G4double m)
Returns hard cross section at the given energy.
Definition at line 269 of file G4PenelopeCrossSection.cc.
273 if (!hardCrossSections)
275 G4cout <<
"Something wrong in G4PenelopeCrossSection::GetHardCrossSection" <<
277 G4cout <<
"Trying to retrieve from un-initialized tables" <<
G4endl;
284 G4cout <<
"Something wrong in G4PenelopeCrossSection::GetHardCrossSection" <<
286 G4cout <<
"Hard cross section table looks not filled" <<
G4endl;
291 result =
G4Exp(logXS);
G4double G4ParticleHPJENDLHEData::G4double result
size_t GetVectorLength() const
G4GLOB_DLL std::ostream G4cout
G4double Value(G4double theEnergy, size_t &lastidx) const
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4double energy(const ThreeVector &p, const G4double m)
G4double G4PenelopeCrossSection::GetNormalizedShellCrossSection |
( |
size_t |
shellID, |
|
|
G4double |
energy |
|
) |
| const |
Returns the hard cross section for the given shell (normalized to 1)
Definition at line 364 of file G4PenelopeCrossSection.cc.
367 if (!shellNormalizedCrossSections)
369 G4cout <<
"Something wrong in G4PenelopeCrossSection::GetShellCrossSection" <<
371 G4cout <<
"Trying to retrieve from un-initialized tables" <<
G4endl;
377 G4cout <<
"Something wrong in G4PenelopeCrossSection::GetShellCrossSection" <<
G4endl;
378 G4cout <<
"The table of normalized cross section is not initialized" <<
G4endl;
382 if (shellID >= numberOfShells)
384 G4cout <<
"Something wrong in G4PenelopeCrossSection::GetShellCrossSection" <<
386 G4cout <<
"Trying to retrieve shell #" << shellID <<
" while the maximum is "
387 << numberOfShells-1 <<
G4endl;
396 G4cout <<
"Something wrong in G4PenelopeCrossSection::GetShellCrossSection" <<
398 G4cout <<
"Shell cross section table looks not filled" <<
G4endl;
403 result =
G4Exp(logXS);
G4double G4ParticleHPJENDLHEData::G4double result
size_t GetVectorLength() const
G4GLOB_DLL std::ostream G4cout
G4double Value(G4double theEnergy, size_t &lastidx) const
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4double energy(const ThreeVector &p, const G4double m)
size_t G4PenelopeCrossSection::GetNumberOfShells |
( |
| ) |
const |
|
inline |
G4double G4PenelopeCrossSection::GetShellCrossSection |
( |
size_t |
shellID, |
|
|
G4double |
energy |
|
) |
| const |
Returns the hard cross section for the given shell (per molecule)
Definition at line 328 of file G4PenelopeCrossSection.cc.
331 if (!shellCrossSections)
333 G4cout <<
"Something wrong in G4PenelopeCrossSection::GetShellCrossSection" <<
335 G4cout <<
"Trying to retrieve from un-initialized tables" <<
G4endl;
338 if (shellID >= numberOfShells)
340 G4cout <<
"Something wrong in G4PenelopeCrossSection::GetShellCrossSection" <<
342 G4cout <<
"Trying to retrieve shell #" << shellID <<
" while the maximum is "
343 << numberOfShells-1 <<
G4endl;
351 G4cout <<
"Something wrong in G4PenelopeCrossSection::GetShellCrossSection" <<
353 G4cout <<
"Shell cross section table looks not filled" <<
G4endl;
358 result =
G4Exp(logXS);
G4double G4ParticleHPJENDLHEData::G4double result
size_t GetVectorLength() const
G4GLOB_DLL std::ostream G4cout
G4double Value(G4double theEnergy, size_t &lastidx) const
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4double energy(const ThreeVector &p, const G4double m)
Returns the total stopping power due to soft collisions.
Definition at line 299 of file G4PenelopeCrossSection.cc.
303 if (!softCrossSections)
305 G4cout <<
"Something wrong in G4PenelopeCrossSection::GetSoftStoppingPower" <<
307 G4cout <<
"Trying to retrieve from un-initialized tables" <<
G4endl;
314 G4cout <<
"Something wrong in G4PenelopeCrossSection::GetSoftStoppingPower" <<
316 G4cout <<
"Soft cross section table looks not filled" <<
G4endl;
321 result =
G4Exp(logXS);
G4double G4ParticleHPJENDLHEData::G4double result
size_t GetVectorLength() const
G4GLOB_DLL std::ostream G4cout
G4double Value(G4double theEnergy, size_t &lastidx) const
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4double energy(const ThreeVector &p, const G4double m)
Returns total cross section at the given energy.
Definition at line 225 of file G4PenelopeCrossSection.cc.
229 if (!softCrossSections || !hardCrossSections)
231 G4cout <<
"Something wrong in G4PenelopeCrossSection::GetTotalCrossSection" <<
233 G4cout <<
"Trying to retrieve from un-initialized tables" <<
G4endl;
241 G4cout <<
"Something wrong in G4PenelopeCrossSection::GetTotalCrossSection" <<
243 G4cout <<
"Soft cross section table looks not filled" <<
G4endl;
254 G4cout <<
"Something wrong in G4PenelopeCrossSection::GetTotalCrossSection" <<
256 G4cout <<
"Hard cross section table looks not filled" <<
G4endl;
259 logXS = theVector->
Value(logene);
262 result = hardXS + softXS;
G4double G4ParticleHPJENDLHEData::G4double result
size_t GetVectorLength() const
G4GLOB_DLL std::ostream G4cout
G4double Value(G4double theEnergy, size_t &lastidx) const
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4double energy(const ThreeVector &p, const G4double m)
void G4PenelopeCrossSection::NormalizeShellCrossSections |
( |
| ) |
|
Definition at line 412 of file G4PenelopeCrossSection.cc.
416 G4cout <<
"G4PenelopeCrossSection::NormalizeShellCrossSections()" <<
G4endl;
421 if (!shellNormalizedCrossSections)
423 G4cout <<
"Something wrong in G4PenelopeCrossSection::GetShellCrossSection" <<
425 G4cout <<
"Trying to retrieve from un-initialized tables" <<
G4endl;
429 for (
size_t i=0;i<numberOfEnergyPoints;i++)
436 for (
size_t shellID=0;shellID<numberOfShells;shellID++)
441 normFactor +=
G4Exp((*theVec)[i]);
443 G4double logNormFactor = std::log(normFactor);
445 for (
size_t shellID=0;shellID<numberOfShells;shellID++)
451 G4double previousValue = (*theFullVec)[i];
454 theVec->
PutValue(i,logEnergy,previousValue-logNormFactor);
void PutValue(size_t index, G4double energy, G4double dataValue)
G4double GetLowEdgeEnergy(size_t binNumber) const
G4GLOB_DLL std::ostream G4cout
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
The documentation for this class was generated from the following files: