Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
G4INCL::NaturalIsotopicDistributions Class Reference

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

#include <G4INCLNaturalIsotopicDistributions.hh>

Public Member Functions

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

Detailed Description

Class that stores isotopic abundances for a given element.

Definition at line 80 of file G4INCLNaturalIsotopicDistributions.hh.

Constructor & Destructor Documentation

G4INCL::NaturalIsotopicDistributions::NaturalIsotopicDistributions ( )

Constructor.

Definition at line 396 of file G4INCLNaturalIsotopicDistributions.cc.

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

Member Function Documentation

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

Draw a random isotope.

Parameters
Zthe element number

Definition at line 95 of file G4INCLNaturalIsotopicDistributions.cc.

95  {
97  }
IsotopicDistribution const & getIsotopicDistribution(G4int const Z) const
Get an isotopic distribution.
G4int drawRandomIsotope() const
Draw a random isotope based on the abundance vector.
IsotopicDistribution const & G4INCL::NaturalIsotopicDistributions::getIsotopicDistribution ( G4int const  Z) const

Get an isotopic distribution.

Parameters
Zthe element number

Definition at line 85 of file G4INCLNaturalIsotopicDistributions.cc.

References INCL_FATAL.

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

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