![]() |
![]() |
00001 /*************************************************************************** 00002 DDLReflectionSolid.cc - description 00003 ------------------- 00004 begin : Mon Mar 4, 2002 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 "DDLReflectionSolid.h" 00020 #include "DDLElementRegistry.h" 00021 #include "DDXMLElement.h" 00022 00023 // DDCore dependencies 00024 #include "DetectorDescription/Core/interface/DDName.h" 00025 #include "DetectorDescription/Core/interface/DDSolid.h" 00026 #include "DetectorDescription/Base/interface/DDdebug.h" 00027 #include "DetectorDescription/Base/interface/DDException.h" 00028 00029 #include "DetectorDescription/ExprAlgo/interface/ExprEvalSingleton.h" 00030 00031 #include <string> 00032 00033 // Default constructor 00034 DDLReflectionSolid::DDLReflectionSolid() 00035 { 00036 } 00037 00038 // Default desctructor 00039 DDLReflectionSolid::~DDLReflectionSolid() 00040 { 00041 } 00042 00043 // Upon starting a ReflectionSolid element, we need to clear all rSolids. 00044 void DDLReflectionSolid::preProcessElement(const std::string& name, const std::string& nmspace) 00045 { 00046 DDLElementRegistry::getElement("rSolid")->clear(); 00047 } 00048 00049 // Upon ending a ReflectionSolid element, call DDCore giving the solid name, and dimensions. 00050 void DDLReflectionSolid::processElement (const std::string& name, const std::string& nmspace) 00051 { 00052 DCOUT_V('P', "DDLReflectionSolid::processElement started"); 00053 00054 // get solid reference: 00055 DDXMLElement* myrSolid = DDLElementRegistry::getElement("rSolid"); 00056 00057 if (myrSolid->size() != 1) 00058 { 00059 std::cout << "WARNING: A ReflectionSolid had more than one rSolid. " 00060 << "The first one was used." << std::endl; 00061 std::cout << "The element to look for is " << getDDName(nmspace) << std::endl; 00062 } 00063 00064 DDSolid solid = DDSolid(myrSolid->getDDName(nmspace)); 00065 DDSolid ddreflsol = DDSolidFactory::reflection(getDDName(nmspace), solid); 00066 00067 DDLSolid::setReference(nmspace); 00068 00069 DCOUT_V('P', "DDLReflectionSolid::processElement completed"); 00070 }