#include <DetectorDescription/Parser/src/DDLTubs.h>
Public Member Functions | |
DDLTubs () | |
Constructor. | |
void | processElement (const std::string &name, const std::string &nmspace) |
Processing the element. | |
~DDLTubs () | |
Destructor. |
DDLTubs.h - description ------------------- begin: Mon Oct 29 2001 email: case@ucdhep.ucdavis.edu
Tube and Tubs elements are handled by this processor.
Definition at line 24 of file DDLTubs.h.
DDLTubs::DDLTubs | ( | ) |
DDLTubs::~DDLTubs | ( | ) |
void DDLTubs::processElement | ( | const std::string & | name, | |
const std::string & | nmspace | |||
) | [virtual] |
Processing the element.
The processElement method completes any necessary work to process the XML element.
For example, this can be used to call the DDCore to make the geometry in memory. There is a default for this so that if not declared in the inheriting class, no processing is done.
Reimplemented from DDXMLElement.
Definition at line 48 of file DDLTubs.cc.
References DCOUT_V, ExprEvalInterface::eval(), DDXMLElement::getAttributeSet(), DDXMLElement::getDDName(), DDI::Singleton< I >::instance(), alivecheck_mergeAndRegister::msg, DDLSolid::setReference(), DDXMLElement::throwError(), DDSolidFactory::truncTubs(), and DDSolidFactory::tubs().
00049 { 00050 DCOUT_V('P', "DDLTubs::processElement started"); 00051 00052 ExprEvalInterface & ev = ExprEvalSingleton::instance(); 00053 DDXMLAttribute atts = getAttributeSet(); 00054 bool cutInside(false); 00055 00056 if (atts.find("cutInside") != atts.end()) { 00057 cutInside = (atts.find("cutInside")->second == "true") ? true : false; 00058 } 00059 00060 if (name == "Tubs") 00061 { 00062 DDSolid myTubs = DDSolidFactory::tubs (getDDName(nmspace) 00063 , ev.eval(nmspace, atts.find("dz")->second) 00064 , ev.eval(nmspace, atts.find("rMin")->second) 00065 , ev.eval(nmspace, atts.find("rMax")->second) 00066 , ev.eval(nmspace, atts.find("startPhi")->second) 00067 , ev.eval(nmspace, atts.find("deltaPhi")->second) 00068 ); 00069 } 00070 else if (name == "Tube") 00071 { 00072 DDSolid myTubs = DDSolidFactory::tubs (getDDName(nmspace) 00073 , ev.eval(nmspace, atts.find("dz")->second) 00074 , ev.eval(nmspace, atts.find("rMin")->second) 00075 , ev.eval(nmspace, atts.find("rMax")->second) 00076 , 0 00077 , 360*deg 00078 ); 00079 } 00080 else if (name == "TruncTubs") 00081 { 00082 DDSolid myTT = DDSolidFactory::truncTubs (getDDName(nmspace) 00083 , ev.eval(nmspace, atts.find("zHalf")->second) 00084 , ev.eval(nmspace, atts.find("rMin")->second) 00085 , ev.eval(nmspace, atts.find("rMax")->second) 00086 , ev.eval(nmspace, atts.find("startPhi")->second) //0. // startPhi 00087 , ev.eval(nmspace, atts.find("deltaPhi")->second) 00088 , ev.eval(nmspace, atts.find("cutAtStart")->second) 00089 , ev.eval(nmspace, atts.find("cutAtDelta")->second) 00090 , cutInside); // cutInside 00091 } 00092 else 00093 { 00094 std::string msg = "\nDDLTubs::processElement could not process element."; 00095 throwError(msg); 00096 } 00097 DDLSolid::setReference(nmspace); 00098 00099 DCOUT_V('P', "DDLTubs::processElement completed"); 00100 00101 }