/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

  1. /***************************************************************************
  2. DDLMaterial.cc - description
  3. -------------------
  4. begin : Wed Oct 3 2002
  5. email : case@ucdhep.ucdavis.edu
  6. ***************************************************************************/
  7. /***************************************************************************
  8. * *
  9. * DDDParser sub-component of DDD *
  10. * *
  11. ***************************************************************************/
  12. #include "DetectorDescription/Parser/src/DDLMaterial.h"
  13. #include "DetectorDescription/Base/interface/DDdebug.h"
  14. DDLMaterial::DDLMaterial( DDLElementRegistry* myreg )
  15. : DDXMLElement( myreg )
  16. {}
  17. DDLMaterial::~DDLMaterial( void )
  18. {}
  19. void
  20. DDLMaterial::setReference( const std::string& nmspace, DDCompactView& cpv )
  21. {
  22. // in case it there were any rMaterials
  23. myRegistry_->getElement("rMaterial")->clear();
  24. // Attempt to make sure Material elements can be in LogicalPart elements.
  25. if (myRegistry_->getElement("LogicalPart")->size() > 0)
  26. {
  27. DDXMLElement* refmat = myRegistry_->getElement("rMaterial");
  28. std::vector<std::string> names;
  29. std::vector<std::string> values;
  30. names.push_back("name");
  31. DDXMLAttribute atts = getAttributeSet();
  32. values.push_back(atts.find("name")->second);
  33. refmat->loadAttributes("rMaterial", names, values, nmspace, cpv);
  34. }
  35. // clear THIS material's values.
  36. clear();
  37. DCOUT_V('P', "DDLMaterial::setReference completed");
  38. }