00001 /*************************************************************************** 00002 DDLNumeric.cc - description 00003 ------------------- 00004 begin : Friday Nov. 21, 2003 00005 email : case@ucdhep.ucdavis.edu 00006 ***************************************************************************/ 00007 00008 00009 00010 00011 // Parser parts 00012 #include "DDLNumeric.h" 00013 #include "DDLElementRegistry.h" 00014 00015 // other DD parts 00016 #include "DetectorDescription/Core/interface/DDNumeric.h" 00017 #include "DetectorDescription/Base/interface/DDdebug.h" 00018 #include "DetectorDescription/Base/interface/DDException.h" 00019 #include "CLHEP/Units/SystemOfUnits.h" 00020 #include "DetectorDescription/ExprAlgo/interface/ExprEvalSingleton.h" 00021 00022 #include <map> 00023 #include <string> 00024 00025 DDLNumeric::DDLNumeric() 00026 { 00027 } 00028 00029 DDLNumeric::~DDLNumeric() 00030 { 00031 } 00032 00033 void DDLNumeric::preProcessElement (const std::string& name, const std::string& nmspace) 00034 { 00035 } 00036 00037 void DDLNumeric::processElement (const std::string& name, const std::string& nmspace) 00038 { 00039 DCOUT_V('P', "DDLNumeric::processElement started"); 00040 00041 if (parent() == "ConstantsSection" || parent() == "DDDefinition") 00042 { 00043 DDNumeric ddnum ( getDDName(nmspace), new double(ExprEvalSingleton::instance().eval(nmspace, getAttributeSet().find("value")->second)) ); 00044 clear(); 00045 } // else, save it, don't clear it, because some other element (parent node) will use it. 00046 00047 DCOUT_V('P', "DDLNumeric::processElement completed"); 00048 } 00049