25#include "TGeoElement.h"
26#include "TGeoManager.h"
33 const std::string& name,
const std::string& symbol,
double z,
double a)
35 fElement(new TGeoElement(
36 name.data(), symbol.data(), z, a /
RootGM::
Units::AtomicWeight()))
53 :
VGM::IElement(), fElement(0)
62 if (!isotopes.size()) {
63 std::cerr <<
" RootGM::Element::Element: " << std::endl;
64 std::cerr <<
" No isotopes defined.";
65 std::cerr <<
"*** Error: Aborting execution ***" << std::endl;
70 if (isotopes.size() != relAbundances.size()) {
71 std::cerr <<
" RootGM::Element::Element: " << std::endl;
72 std::cerr <<
" Isotopes size and relAbundances size differ.";
73 std::cerr <<
"*** Error: Aborting execution ***" << std::endl;
78 fElement =
new TGeoElement(name.data(), symbol.data(), isotopes.size());
81 for (
unsigned int i = 0; i < isotopes.size(); i++) {
83 fElement->AddIsotope(tgeoIsotope, relAbundances[i]);
92 :
VGM::IElement(), fElement(geoElement)
112void RootGM::Element::CheckIndex(
int i)
const
114 if (i < 0 || i >= NofIsotopes()) {
115 std::cerr <<
" RootGM::Element::CheckIndex: " << std::endl;
116 std::cerr <<
" Index of isotope outside limits." << std::endl;
117 std::cerr <<
"*** Error: Aborting execution ***" << std::endl;
152 TGeoIsotope* tgeoIsotope = fElement->GetIsotope(i);
161 return fElement->GetRelativeAbundance(i);
void AddElement(VGM::IElement *, TGeoElement *)
static ElementMap * Instance()
virtual VGM::IIsotope * Isotope(int i) const
Return the i-th isotope constituing this element.
virtual int NofIsotopes() const
Return the number of isotopes constituing this element.
virtual double RelAbundance(int i) const
Return the relative abundance (the fraction of nb of atomes per volume) of the i-th isotope constitui...
virtual std::string Symbol() const
Return the symbol of this element.
Element(const std::string &name, const std::string &symbol, double z, double a)
virtual double N() const
Return the effective number of nucleons.
virtual double A() const
Return the effective effective mass of a mole in g/mole.
virtual std::string Name() const
Return the name of this element.
virtual double Z() const
Return the effective atomic number.
TGeoIsotope * GetIsotope(VGM::IIsotope *iIsotope) const
static IsotopeMap * Instance()
Conversion from Root physical units to VGM units.
static double AtomicWeight()
Return Root atomic weight unit in VGM units.
The VGM interface to elements.
VGM implementation for Root.
std::vector< double > RelAbundanceVector
std::vector< IIsotope * > IsotopeVector