Go to the documentation of this file.
33 mat =
DDMaterial(ddn,
ev.eval(nmspace, atts.find(
"density")->second));
52 if (myMF->size() != myrMaterial->size()) {
53 std::string msg =
"/nDDLCompositeMaterial::processElement found that the ";
54 msg +=
"number of MaterialFractions does not match the number ";
55 msg +=
"of rMaterial names for ";
59 for (
size_t i = 0;
i < myrMaterial->size(); ++
i) {
60 atts = myMF->getAttributeSet(
i);
61 mat.
addMaterial(myrMaterial->getDDName(nmspace,
"name",
i),
ev.eval(nmspace, atts.find(
"fraction")->second));
virtual void clear(void)
clear this element's contents.
void throwError(const std::string &keyMessage) const
format std::string for throw an error.
DDName is used to identify DDD entities uniquely.
The main class for processing parsed elements.
void preProcessElement(const std::string &name, const std::string &nmspace, DDCompactView &cpv) override
Called by loadAttributes AFTER attributes are loaded.
virtual const DDXMLAttribute & getAttributeSet(size_t aIndex=0) const
Get a "row" of attributes, i.e. one attribute set.
ClhepEvaluator & evaluator()
DDMaterial is used to define and access material information.
Compact representation of the geometrical detector hierarchy.
std::map< std::string, std::string > DDXMLAttribute
const std::string & name() const
Returns the name.
virtual void setReference(const std::string &nmspace, DDCompactView &cpv)
const virtual DDName getDDName(const std::string &defaultNS, const std::string &attname=std::string("name"), size_t aIndex=0)
std::shared_ptr< DDXMLElement > getElement(const std::string &name)
THE most important part. Getting the pointer to a given element type.
const std::string & ns() const
Returns the namespace.
DDLCompositeMaterial(DDLElementRegistry *myreg)
void processElement(const std::string &name, const std::string &nmspace, DDCompactView &cpv) override
Processing the element.
DDLElementRegistry * myRegistry_
int addMaterial(const DDMaterial &m, double fm)
adds a material to the mixture proportional to its fraction-mass fm.
DDLMaterial processes Box elements.