CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/DetectorDescription/Parser/src/DDLMaterial.cc

Go to the documentation of this file.
00001 /***************************************************************************
00002                           DDLMaterial.cc  -  description
00003                              -------------------
00004     begin                : Wed Oct 3 2002
00005     email                : case@ucdhep.ucdavis.edu
00006  ***************************************************************************/
00007 
00008 /***************************************************************************
00009  *                                                                         *
00010  *           DDDParser sub-component of DDD                                *
00011  *                                                                         *
00012  ***************************************************************************/
00013 
00014 #include "DetectorDescription/Parser/src/DDLMaterial.h"
00015 
00016 #include "DetectorDescription/Base/interface/DDdebug.h"
00017 
00018 DDLMaterial::DDLMaterial(  DDLElementRegistry* myreg )
00019   : DDXMLElement( myreg )
00020 {}
00021 
00022 DDLMaterial::~DDLMaterial( void )
00023 {}
00024 
00025 void
00026 DDLMaterial::setReference( const std::string& nmspace, DDCompactView& cpv )
00027 {
00028   // in case it there were any rMaterials
00029   myRegistry_->getElement("rMaterial")->clear();
00030 
00031   // Attempt to make sure Material elements can be in LogicalPart elements.
00032   if (myRegistry_->getElement("LogicalPart")->size() > 0)
00033     {
00034       DDXMLElement* refmat = myRegistry_->getElement("rMaterial");
00035       std::vector<std::string> names;
00036       std::vector<std::string> values;
00037       names.push_back("name");
00038       DDXMLAttribute atts = getAttributeSet();
00039       values.push_back(atts.find("name")->second);
00040       refmat->loadAttributes("rMaterial", names, values, nmspace, cpv);
00041     }
00042   // clear THIS material's values.
00043   clear();
00044 
00045   DCOUT_V('P', "DDLMaterial::setReference completed");
00046 }