Geant4-11
Public Member Functions | Private Attributes
G4INCL::NaturalIsotopicDistributions Class Reference

Class that stores isotopic abundances for a given element. More...

#include <G4INCLNaturalIsotopicDistributions.hh>

Public Member Functions

G4int drawRandomIsotope (G4int const Z) const
 Draw a random isotope. More...
 
IsotopicDistribution const & getIsotopicDistribution (G4int const Z) const
 Get an isotopic distribution. More...
 
 NaturalIsotopicDistributions ()
 Constructor. More...
 

Private Attributes

std::map< G4int, IsotopicDistributiontheDistributions
 

Detailed Description

Class that stores isotopic abundances for a given element.

Definition at line 81 of file G4INCLNaturalIsotopicDistributions.hh.

Constructor & Destructor Documentation

◆ NaturalIsotopicDistributions()

G4INCL::NaturalIsotopicDistributions::NaturalIsotopicDistributions ( )

Constructor.

Definition at line 398 of file G4INCLNaturalIsotopicDistributions.cc.

398 {
399 G4int oldZ = -1;
400 IsotopeVector aVector;
401 for(unsigned int i=0; i<sizeOfArray(theRawDistributions); ++i) {
402 std::pair<G4int, Isotope> const &aPair = theRawDistributions[i];
403 if(aPair.first == oldZ) {
404 aVector.push_back(aPair.second);
405 } else {
406 if(oldZ!=-1)
407 theDistributions.insert(std::pair<G4int, IsotopicDistribution>(oldZ, IsotopicDistribution(aVector)));
408 oldZ = aPair.first;
409 aVector.clear();
410 aVector.push_back(aPair.second);
411 }
412 }
413 // last element
414 theDistributions.insert(std::pair<G4int, IsotopicDistribution>(oldZ, IsotopicDistribution(aVector)));
415 }
int G4int
Definition: G4Types.hh:85
std::map< G4int, IsotopicDistribution > theDistributions
std::vector< Isotope > IsotopeVector

References G4INCL::anonymous_namespace{G4INCLNaturalIsotopicDistributions.cc}::sizeOfArray(), theDistributions, and G4INCL::anonymous_namespace{G4INCLNaturalIsotopicDistributions.cc}::theRawDistributions.

Member Function Documentation

◆ drawRandomIsotope()

G4int G4INCL::NaturalIsotopicDistributions::drawRandomIsotope ( G4int const  Z) const

Draw a random isotope.

Parameters
Zthe element number

Definition at line 97 of file G4INCLNaturalIsotopicDistributions.cc.

97 {
99 }
const G4int Z[17]
G4int drawRandomIsotope() const
Draw a random isotope based on the abundance vector.
IsotopicDistribution const & getIsotopicDistribution(G4int const Z) const
Get an isotopic distribution.

References G4INCL::IsotopicDistribution::drawRandomIsotope(), getIsotopicDistribution(), and Z.

Referenced by G4INCL::ParticleTable::drawRandomNaturalIsotope().

◆ getIsotopicDistribution()

IsotopicDistribution const & G4INCL::NaturalIsotopicDistributions::getIsotopicDistribution ( G4int const  Z) const

Get an isotopic distribution.

Parameters
Zthe element number

Definition at line 87 of file G4INCLNaturalIsotopicDistributions.cc.

87 {
88 std::map<G4int, IsotopicDistribution>::const_iterator i = theDistributions.find(Z);
89 if(i!=theDistributions.end())
90 return i->second;
91 else {
92 INCL_FATAL("Requested natural isotopic distribution for synthetic element Z = " << Z << '\n');
93 return theDistributions.begin()->second;
94 }
95 }
#define INCL_FATAL(x)

References INCL_FATAL, theDistributions, and Z.

Referenced by drawRandomIsotope(), and G4INCL::ParticleTable::getNaturalIsotopicDistribution().

Field Documentation

◆ theDistributions

std::map<G4int, IsotopicDistribution> G4INCL::NaturalIsotopicDistributions::theDistributions
private

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