#include <G4INCLNaturalIsotopicDistributions.hh>
Public Member Functions | |
NaturalIsotopicDistributions () | |
Constructor. | |
G4int | drawRandomIsotope (G4int const Z) const |
Draw a random isotope. | |
IsotopicDistribution const & | getIsotopicDistribution (G4int const Z) const |
Get an isotopic distribution. |
Definition at line 80 of file G4INCLNaturalIsotopicDistributions.hh.
G4INCL::NaturalIsotopicDistributions::NaturalIsotopicDistributions | ( | ) |
Constructor.
Definition at line 396 of file G4INCLNaturalIsotopicDistributions.cc.
00396 { 00397 G4int oldZ = -1; 00398 IsotopeVector aVector; 00399 for(unsigned int i=0; i<sizeOfArray(theRawDistributions); ++i) { 00400 std::pair<G4int, Isotope> const &aPair = theRawDistributions[i]; 00401 if(aPair.first == oldZ) { 00402 aVector.push_back(aPair.second); 00403 } else { 00404 if(oldZ!=-1) 00405 theDistributions.insert(std::pair<G4int, IsotopicDistribution>(oldZ, IsotopicDistribution(aVector))); 00406 oldZ = aPair.first; 00407 aVector.clear(); 00408 aVector.push_back(aPair.second); 00409 } 00410 } 00411 // last element 00412 theDistributions.insert(std::pair<G4int, IsotopicDistribution>(oldZ, IsotopicDistribution(aVector))); 00413 }
Draw a random isotope.
Z | the element number |
Definition at line 95 of file G4INCLNaturalIsotopicDistributions.cc.
References G4INCL::IsotopicDistribution::drawRandomIsotope(), and getIsotopicDistribution().
00095 { 00096 return getIsotopicDistribution(Z).drawRandomIsotope(); 00097 }
IsotopicDistribution const & G4INCL::NaturalIsotopicDistributions::getIsotopicDistribution | ( | G4int const | Z | ) | const |
Get an isotopic distribution.
Z | the element number |
Definition at line 85 of file G4INCLNaturalIsotopicDistributions.cc.
References FATAL.
Referenced by drawRandomIsotope().
00085 { 00086 std::map<G4int, IsotopicDistribution>::const_iterator i = theDistributions.find(Z); 00087 if(i!=theDistributions.end()) 00088 return i->second; 00089 else { 00090 FATAL("Requested natural isotopic distribution for synthetic element Z = " << Z << std::endl); 00091 return theDistributions.begin()->second; 00092 } 00093 }