00001 /*************************************************************************** 00002 DDLElementaryMaterial.cc - description 00003 ------------------- 00004 begin : Wed Oct 31 2001 00005 email : case@ucdhep.ucdavis.edu 00006 ***************************************************************************/ 00007 00008 /*************************************************************************** 00009 * * 00010 * DDDParser sub-component of DDD * 00011 * * 00012 ***************************************************************************/ 00013 00014 00015 00016 // ------------------------------------------------------------------------- 00017 // Includes 00018 // ------------------------------------------------------------------------- 00019 #include "DDLElementaryMaterial.h" 00020 #include "DDLElementRegistry.h" 00021 00022 // DDCore dependencies 00023 #include "DetectorDescription/Core/interface/DDLogicalPart.h" 00024 #include "DetectorDescription/Core/interface/DDName.h" 00025 #include "DetectorDescription/Base/interface/DDdebug.h" 00026 #include "DetectorDescription/Core/interface/DDMaterial.h" 00027 00028 #include "DetectorDescription/ExprAlgo/interface/ExprEvalSingleton.h" 00029 00030 #include <string> 00031 #include <iostream> 00032 00033 // Default constructor. 00034 DDLElementaryMaterial::DDLElementaryMaterial() 00035 { 00036 } 00037 00038 // Default destructor. 00039 DDLElementaryMaterial::~DDLElementaryMaterial() 00040 { 00041 } 00042 00043 // Upon encountering an end of an ElementaryMaterial element, we call DDCore 00044 void DDLElementaryMaterial::processElement (const std::string& type, const std::string& nmspace) 00045 { 00046 DCOUT_V('P', "DDLElementaryMaterial::processElement started"); 00047 00048 ExprEvalInterface & ev = ExprEvalSingleton::instance(); 00049 DDXMLAttribute atts = getAttributeSet(); 00050 00051 DDMaterial mat = DDMaterial(getDDName(nmspace) 00052 , ev.eval(nmspace, atts.find("atomicNumber")->second) 00053 , ev.eval(nmspace, atts.find("atomicWeight")->second) 00054 , ev.eval(nmspace, atts.find("density")->second)); 00055 00056 DDLMaterial::setReference(nmspace); 00057 clear(); 00058 00059 DCOUT_V('P', "DDLElementaryMaterial::processElement completed."); 00060 }