10 std::string no_composites =
" NO-COMPOSITES ";
11 std::string no_density =
" NO-DENSITY ";
12 std::string costit_nok =
" CONSTITUENT NOK ";
13 std::string no_z =
" NO-Z ";
14 std::string no_a =
" NO-A ";
15 static int rlevel = 0;
17 std::string curr_err =
"";
22 curr_err +=
"material not declared; unknown material!";
24 result.first = curr_err;
30 curr_err +=
"material name=" + mip.
name().
ns() +
":" + mip.
name().
name()
31 +
" is declared but not defined";
32 result.first = curr_err;
46 curr_err += no_density;
58 curr_err += no_composites;
63 curr_err =
" NOT-DEFINED ";
67 result.first=curr_err;
74 for (; loop>=0; --
loop) {
75 std::pair<std::string,DDName> res(
"",
"");
82 curr_err = curr_err + std::string(
" constituents have errors:\n") + std::string(4*rlevel,
' ')
84 + std::string(
" ") + res.first;
85 result.first=curr_err;
95 bool DDCheckMaterials(std::ostream & os, std::vector<std::pair<std::string,DDName> > * res)
98 std::vector<std::pair<std::string,DDName> >
errors;
105 RegT::value_type::iterator
i = mr.begin();
107 for(; i != mr.end(); ++
i) {
108 std::pair<std::string,DDName>
error(
"",
"");
112 errors.push_back(error);
117 os <<
"[DDCore:Report] Materials " << std::endl;
118 os << s << mr.size() <<
" Materials declared" << std::endl;
119 os << s <<
"detected errors:" << errors.size() << std::endl;
120 std::vector<std::pair<std::string,DDName> >::iterator
j = errors.begin();
121 for (;j!=errors.end();++
j) {
122 os << std::endl << s << j->second <<
" " << j->first << std::endl;
double a() const
returns the atomic mass
def_type isDefined() const
DDMaterial is used to define and access material information.
bool DDCheckMaterial(DDMaterial &mip, std::pair< std::string, DDName > &result)
const std::string & ns() const
Returns the namespace.
double z() const
retruns the atomic number
FractionV::value_type constituent(int i) const
returns the i-th compound material and its fraction-mass
Container::value_type value_type
double density() const
returns the density
int noOfConstituents() const
returns the number of compound materials or 0 for elementary materials
bool DDCheckMaterials(std::ostream &, std::vector< std::pair< std::string, DDName > > *=0)
Checks all registered materials and sends a report /p os.
const std::string & name() const
Returns the name.