Go to the documentation of this file.
65 throw cms::Exception(
"DDException") <<
"DDMaterial::addMaterial(..): name-clash\n trying to add material "
66 <<
m <<
" to itself! ";
68 rep().addMaterial(
m, fm);
69 return rep().noOfConstituents();
83 std::ostream &doStream(std::ostream &os,
const DDMaterial &mat,
int level) {
86 os <<
'[' << mat.
name() <<
']' <<
" z=" << mat.
z() <<
" a=" <<
convertUnitsTo(1._g_per_mole, mat.
a()) <<
"*g/mole"
91 os << std::endl <<
s <<
i + 1 <<
" : fm=" <<
f.second <<
" : ";
92 doStream(os,
f.first,
level);
95 os <<
"* material not declared * ";
DDName is used to identify DDD entities uniquely.
double density() const
returns the density
double z() const
retruns the atomic number
int noOfConstituents() const
returns the number of compound materials or 0 for elementary materials
FractionV::value_type constituent(int i) const
returns the i-th compound material and its fraction-mass
DDMaterial is used to define and access material information.
constexpr NumType convertUnitsTo(double desiredUnits, NumType val)
std::ostream & operator<<(std::ostream &os, const DDMaterial &mat)
const DDName & name() const
double a() const
returns the atomic mass
const DDI::rep_traits< DDName, std::unique_ptr< DDI::Material > >::reference rep() const
const DDName & ddname() const
DDMaterial()
Creates a uninitialized reference-object (see DDLogicalPart documentation for details on reference ob...
Container::value_type value_type
std::unique_ptr< T, impl::DeviceDeleter > unique_ptr
void create(const DDName &name, std::unique_ptr< DDI::Material > vals)
int addMaterial(const DDMaterial &m, double fm)
adds a material to the mixture proportional to its fraction-mass fm.