/DetectorDescription/Parser/src/DDLMaterial.cc
https://github.com/aivanov-cern/cmssw · C++ · 46 lines · 24 code · 8 blank · 14 comment · 1 complexity · a9b012a4deb42069b28ee82fb5cdd919 MD5 · raw file
- /***************************************************************************
- DDLMaterial.cc - description
- -------------------
- begin : Wed Oct 3 2002
- email : case@ucdhep.ucdavis.edu
- ***************************************************************************/
- /***************************************************************************
- * *
- * DDDParser sub-component of DDD *
- * *
- ***************************************************************************/
- #include "DetectorDescription/Parser/src/DDLMaterial.h"
- #include "DetectorDescription/Base/interface/DDdebug.h"
- DDLMaterial::DDLMaterial( DDLElementRegistry* myreg )
- : DDXMLElement( myreg )
- {}
- DDLMaterial::~DDLMaterial( void )
- {}
- void
- DDLMaterial::setReference( const std::string& nmspace, DDCompactView& cpv )
- {
- // in case it there were any rMaterials
- myRegistry_->getElement("rMaterial")->clear();
- // Attempt to make sure Material elements can be in LogicalPart elements.
- if (myRegistry_->getElement("LogicalPart")->size() > 0)
- {
- DDXMLElement* refmat = myRegistry_->getElement("rMaterial");
- std::vector<std::string> names;
- std::vector<std::string> values;
- names.push_back("name");
- DDXMLAttribute atts = getAttributeSet();
- values.push_back(atts.find("name")->second);
- refmat->loadAttributes("rMaterial", names, values, nmspace, cpv);
- }
- // clear THIS material's values.
- clear();
- DCOUT_V('P', "DDLMaterial::setReference completed");
- }