PageRenderTime 19ms CodeModel.GetById 9ms app.highlight 7ms RepoModel.GetById 2ms app.codeStats 0ms

/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 *                                                                         *
10 *           DDDParser sub-component of DDD                                *
11 *                                                                         *
12 ***************************************************************************/
13
14#include "DetectorDescription/Parser/src/DDLMaterial.h"
15
16#include "DetectorDescription/Base/interface/DDdebug.h"
17
18DDLMaterial::DDLMaterial(  DDLElementRegistry* myreg )
19  : DDXMLElement( myreg )
20{}
21
22DDLMaterial::~DDLMaterial( void )
23{}
24
25void
26DDLMaterial::setReference( const std::string& nmspace, DDCompactView& cpv )
27{
28  // in case it there were any rMaterials
29  myRegistry_->getElement("rMaterial")->clear();
30
31  // Attempt to make sure Material elements can be in LogicalPart elements.
32  if (myRegistry_->getElement("LogicalPart")->size() > 0)
33    {
34      DDXMLElement* refmat = myRegistry_->getElement("rMaterial");
35      std::vector<std::string> names;
36      std::vector<std::string> values;
37      names.push_back("name");
38      DDXMLAttribute atts = getAttributeSet();
39      values.push_back(atts.find("name")->second);
40      refmat->loadAttributes("rMaterial", names, values, nmspace, cpv);
41    }
42  // clear THIS material's values.
43  clear();
44
45  DCOUT_V('P', "DDLMaterial::setReference completed");
46}