26#include "G4Element.hh"
30 const std::string& name,
const std::string& symbol,
double z,
double a)
33 new G4Element(name, symbol, z, a /
ClhepVGM::Units::AtomicWeight()))
50 :
VGM::IElement(), fElement(0)
59 if (!isotopes.size()) {
60 std::cerr <<
" Geant4GM::Element::Element: " << std::endl;
61 std::cerr <<
" No isotopes defined.";
62 std::cerr <<
"*** Error: Aborting execution ***" << std::endl;
67 if (isotopes.size() != relAbundances.size()) {
68 std::cerr <<
" Geant4GM::Element::Element: " << std::endl;
69 std::cerr <<
" Isotopes size and relAbundances size differ.";
70 std::cerr <<
"*** Error: Aborting execution ***" << std::endl;
75 fElement =
new G4Element(name, symbol, isotopes.size());
78 for (
unsigned int i = 0; i < isotopes.size(); i++) {
80 fElement->AddIsotope(g4Isotope, relAbundances[i]);
89 :
VGM::IElement(), fElement(element)
120void Geant4GM::Element::CheckIndex(
int i)
const
122 if (i < 0 || i >= NofIsotopes()) {
123 std::cerr <<
" Geant4GM::Element::CheckIndex: " << std::endl;
124 std::cerr <<
" Index of isotope outside limits." << std::endl;
125 std::cerr <<
"*** Error: Aborting execution ***" << std::endl;
155 return fElement->GetNumberOfIsotopes();
163 const G4Isotope* g4Isotope = fElement->GetIsotope(i);
172 return fElement->GetRelativeAbundanceVector()[i];
static double AtomicWeight()
Return CLHEP default atomic weight unit in VGM units.
void AddElement(VGM::IElement *, G4Element *)
static ElementMap * Instance()
VGM implementation for Geant4 element.
virtual double N() const
Return the effective number of nucleons.
virtual int NofIsotopes() const
Return the number of isotopes constituing this element.
virtual double Z() const
Return the effective atomic number.
virtual VGM::IIsotope * Isotope(int i) const
Return the i-th isotope constituing this element.
virtual std::string Symbol() const
Return the symbol of this element.
virtual std::string Name() const
Return the name of this element.
virtual double A() const
Return the effective effective mass of a mole in g/mole.
virtual double RelAbundance(int i) const
Return the relative abundance (the fraction of nb of atomes per volume) of the i-th isotope constitui...
static IsotopeMap * Instance()
G4Isotope * GetIsotope(VGM::IIsotope *iIsotope) const
The VGM interface to elements.
std::vector< double > RelAbundanceVector
std::vector< IIsotope * > IsotopeVector