#include <DetectorDescription/Parser/src/DDLTrapezoid.h>
Public Member Functions | |
DDLTrapezoid () | |
Constructor. | |
void | processElement (const std::string &name, const std::string &nmspace) |
Processing the element. | |
~DDLTrapezoid () | |
Destructor. |
DDLTrapezoid.h - description ------------------- begin: Mon Oct 29 2001 email: case@ucdhep.ucdavis.edu
Trapezoid processor processes Trapezoid and Trd1 DDL elements.
Definition at line 25 of file DDLTrapezoid.h.
DDLTrapezoid::DDLTrapezoid | ( | ) |
DDLTrapezoid::~DDLTrapezoid | ( | ) |
void DDLTrapezoid::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 44 of file DDLTrapezoid.cc.
References DCOUT_V, ExprEvalInterface::eval(), DDXMLElement::getAttributeSet(), DDXMLElement::getDDName(), DDI::Singleton< I >::instance(), alivecheck_mergeAndRegister::msg, phi, DDLSolid::setReference(), theta, DDXMLElement::throwError(), and DDSolidFactory::trap().
00045 { 00046 DCOUT_V('P', "DDLTrapezoid::processElement started"); 00047 00048 ExprEvalInterface & ev = ExprEvalSingleton::instance(); 00049 00050 DDXMLAttribute atts = getAttributeSet(); 00051 00052 double phi = 0.0; 00053 double theta = 0.0; 00054 double dy2 = 0.0; 00055 00056 if (atts.find("phi") != atts.end()) 00057 phi = ev.eval(nmspace, atts.find("phi")->second); 00058 00059 if (atts.find("theta") != atts.end()) 00060 theta = ev.eval(nmspace, atts.find("theta")->second); 00061 00062 if (atts.find("dy2") != atts.end()) 00063 dy2 = ev.eval(nmspace, atts.find("dy2")->second); 00064 else if (atts.find("dy1") != atts.end()) 00065 dy2 = ev.eval(nmspace, atts.find("dy1")->second); 00066 00067 if (name == "Trapezoid") 00068 { 00069 DDSolid myTrap = 00070 DDSolidFactory::trap(getDDName(nmspace) 00071 , ev.eval(nmspace, atts.find("dz")->second) 00072 , theta 00073 , phi 00074 , ev.eval(nmspace, atts.find("h1")->second) 00075 , ev.eval(nmspace, atts.find("bl1")->second) 00076 , ev.eval(nmspace, atts.find("tl1")->second) 00077 , ev.eval(nmspace, atts.find("alp1")->second) 00078 , ev.eval(nmspace, atts.find("h2")->second) 00079 , ev.eval(nmspace, atts.find("bl2")->second) 00080 , ev.eval(nmspace, atts.find("tl2")->second) 00081 , ev.eval(nmspace, atts.find("alp2")->second) 00082 ); 00083 00084 } 00085 else if (name == "Trd1") 00086 { 00087 DDSolid myTrd1 = 00088 DDSolidFactory::trap(getDDName(nmspace) 00089 , ev.eval(nmspace, atts.find("dz")->second) 00090 , 0 00091 , 0 00092 , ev.eval(nmspace, atts.find("dy1")->second) 00093 , ev.eval(nmspace, atts.find("dx1")->second) 00094 , ev.eval(nmspace, atts.find("dx1")->second) 00095 , 0 00096 , dy2 00097 , ev.eval(nmspace, atts.find("dx2")->second) 00098 , ev.eval(nmspace, atts.find("dx2")->second) 00099 , 0 00100 ); 00101 } 00102 else 00103 { 00104 std::string msg = "\nDDLTrapezoid::processElement failed to process element of name: " 00105 + name 00106 + ". It can only process Trapezoid and Trd1."; 00107 throwError(msg); 00108 } 00109 00110 DDLSolid::setReference(nmspace); 00111 00112 DCOUT_V('P', "DDLTrapezoid::processElement completed"); 00113 }