DDLTubs processes Tubs elements. More...
#include <DDLTubs.h>
Public Member Functions | |
DDLTubs (DDLElementRegistry *myreg) | |
Constructor. | |
void | processElement (const std::string &name, const std::string &nmspace, DDCompactView &cpv) |
Processing the element. | |
~DDLTubs (void) | |
Destructor. |
DDLTubs processes Tubs elements.
DDLTubs.h - description ------------------- begin: Mon Oct 29 2001 email: case@ucdhep.ucdavis.edu
Tube and Tubs elements are handled by this processor.
DDLTubs::DDLTubs | ( | DDLElementRegistry * | myreg | ) |
DDLTubs::~DDLTubs | ( | void | ) |
void DDLTubs::processElement | ( | const std::string & | name, |
const std::string & | nmspace, | ||
DDCompactView & | cpv | ||
) | [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 31 of file DDLTubs.cc.
References DCOUT_V, ExprEvalInterface::eval(), DDXMLElement::getAttributeSet(), DDXMLElement::getDDName(), DDI::Singleton< I >::instance(), MatrixRunner::msg, DDLSolid::setReference(), DDXMLElement::throwError(), DDSolidFactory::truncTubs(), and DDSolidFactory::tubs().
{ DCOUT_V('P', "DDLTubs::processElement started"); ExprEvalInterface & ev = ExprEvalSingleton::instance(); DDXMLAttribute atts = getAttributeSet(); bool cutInside(false); if (atts.find("cutInside") != atts.end()) { cutInside = (atts.find("cutInside")->second == "true") ? true : false; } if (name == "Tubs") { DDSolid myTubs = DDSolidFactory::tubs( getDDName(nmspace), ev.eval(nmspace, atts.find("dz")->second), ev.eval(nmspace, atts.find("rMin")->second), ev.eval(nmspace, atts.find("rMax")->second), ev.eval(nmspace, atts.find("startPhi")->second), ev.eval(nmspace, atts.find("deltaPhi")->second)); } else if (name == "Tube") { DDSolid myTubs = DDSolidFactory::tubs( getDDName(nmspace), ev.eval(nmspace, atts.find("dz")->second), ev.eval(nmspace, atts.find("rMin")->second), ev.eval(nmspace, atts.find("rMax")->second), 0, 360*deg ); } else if (name == "TruncTubs") { DDSolid myTT = DDSolidFactory::truncTubs( getDDName(nmspace), ev.eval(nmspace, atts.find("zHalf")->second), ev.eval(nmspace, atts.find("rMin")->second), ev.eval(nmspace, atts.find("rMax")->second), ev.eval(nmspace, atts.find("startPhi")->second), //0. // startPhi ev.eval(nmspace, atts.find("deltaPhi")->second), ev.eval(nmspace, atts.find("cutAtStart")->second), ev.eval(nmspace, atts.find("cutAtDelta")->second), cutInside ); // cutInside } else { std::string msg = "\nDDLTubs::processElement could not process element."; throwError(msg); } DDLSolid::setReference(nmspace, cpv); DCOUT_V('P', "DDLTubs::processElement completed"); }