CMS 3D CMS Logo

DDLTrapezoid.cc
Go to the documentation of this file.
7 
8 #include <map>
9 #include <utility>
10 
11 class DDCompactView;
12 
14 
15 // Upon encountering an end of the tag, call DDCore's Trap.
18 
20 
21  double phi = 0.0;
22  double theta = 0.0;
23  double dy2 = 0.0;
24 
25  if (atts.find("phi") != atts.end())
26  phi = ev.eval(nmspace, atts.find("phi")->second);
27 
28  if (atts.find("theta") != atts.end())
29  theta = ev.eval(nmspace, atts.find("theta")->second);
30 
31  if (atts.find("dy2") != atts.end())
32  dy2 = ev.eval(nmspace, atts.find("dy2")->second);
33  else if (atts.find("dy1") != atts.end())
34  dy2 = ev.eval(nmspace, atts.find("dy1")->second);
35 
36  if (name == "Trapezoid") {
37  DDSolid myTrap = DDSolidFactory::trap(getDDName(nmspace),
38  ev.eval(nmspace, atts.find("dz")->second),
39  theta,
40  phi,
41  ev.eval(nmspace, atts.find("h1")->second),
42  ev.eval(nmspace, atts.find("bl1")->second),
43  ev.eval(nmspace, atts.find("tl1")->second),
44  ev.eval(nmspace, atts.find("alp1")->second),
45  ev.eval(nmspace, atts.find("h2")->second),
46  ev.eval(nmspace, atts.find("bl2")->second),
47  ev.eval(nmspace, atts.find("tl2")->second),
48  ev.eval(nmspace, atts.find("alp2")->second));
49  } else if (name == "Trd1") {
50  DDSolid myTrd1 = DDSolidFactory::trap(getDDName(nmspace),
51  ev.eval(nmspace, atts.find("dz")->second),
52  0,
53  0,
54  ev.eval(nmspace, atts.find("dy1")->second),
55  ev.eval(nmspace, atts.find("dx1")->second),
56  ev.eval(nmspace, atts.find("dx1")->second),
57  0,
58  dy2,
59  ev.eval(nmspace, atts.find("dx2")->second),
60  ev.eval(nmspace, atts.find("dx2")->second),
61  0);
62  } else {
63  std::string msg = "\nDDLTrapezoid::processElement failed to process element of name: " + name +
64  ". It can only process Trapezoid and Trd1.";
65  throwError(msg);
66  }
67 
68  DDLSolid::setReference(nmspace, cpv);
69 }
DDXMLElement::throwError
void throwError(const std::string &keyMessage) const
format std::string for throw an error.
Definition: DDXMLElement.cc:209
DDLSolid::setReference
void setReference(const std::string &nmspace, DDCompactView &cpv)
Definition: DDLSolid.cc:13
DDLSolid
DDLSolid processes Box elements.
Definition: DDLSolid.h:30
DDLTrapezoid.h
ClhepEvaluator.h
DDLElementRegistry
The main class for processing parsed elements.
Definition: DDLElementRegistry.h:23
ClhepEvaluator
Definition: ClhepEvaluator.h:8
mps_check.msg
tuple msg
Definition: mps_check.py:285
DDXMLElement::getAttributeSet
virtual const DDXMLAttribute & getAttributeSet(size_t aIndex=0) const
Get a "row" of attributes, i.e. one attribute set.
Definition: DDXMLElement.cc:54
DDLElementRegistry::evaluator
ClhepEvaluator & evaluator()
Definition: DDLElementRegistry.h:42
DDLTrapezoid::processElement
void processElement(const std::string &name, const std::string &nmspace, DDCompactView &cpv) override
Processing the element.
Definition: DDLTrapezoid.cc:16
DDCompactView
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
DDSolid.h
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
DDXMLAttribute
std::map< std::string, std::string > DDXMLAttribute
Definition: DDXMLElement.h:45
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DDLTrapezoid::DDLTrapezoid
DDLTrapezoid(DDLElementRegistry *myreg)
Definition: DDLTrapezoid.cc:13
DDLElementRegistry.h
DDLSolid.h
DDXMLElement::getDDName
const virtual DDName getDDName(const std::string &defaultNS, const std::string &attname=std::string("name"), size_t aIndex=0)
Definition: DDXMLElement.cc:56
DDAxes::phi
DDXMLElement.h
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
DDSolid
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
DDXMLElement::myRegistry_
DDLElementRegistry * myRegistry_
Definition: DDXMLElement.h:173
DDSolidFactory::trap
static DDSolid trap(const DDName &name, double pDz, double pTheta, double pPhi, double pDy1, double pDx1, double pDx2, double pAlp1, double pDy2, double pDx3, double pDx4, double pAlp2)
Definition: DDSolid.cc:595