CMS 3D CMS Logo

DDLTubs.cc
Go to the documentation of this file.
8 
9 #include <map>
10 #include <utility>
11 
12 class DDCompactView;
13 
14 using namespace geant_units::operators;
15 
17 
18 // Upon encountering the end of a Tubs element, call DDCore.
22  bool cutInside(false);
23 
24  if (atts.find("cutInside") != atts.end()) {
25  cutInside = (atts.find("cutInside")->second == "true") ? true : false;
26  }
27 
28  if (name == "Tubs") {
29  DDSolid myTubs = DDSolidFactory::tubs(getDDName(nmspace),
30  ev.eval(nmspace, atts.find("dz")->second),
31  ev.eval(nmspace, atts.find("rMin")->second),
32  ev.eval(nmspace, atts.find("rMax")->second),
33  ev.eval(nmspace, atts.find("startPhi")->second),
34  ev.eval(nmspace, atts.find("deltaPhi")->second));
35  } else if (name == "Tube") {
36  DDSolid myTubs = DDSolidFactory::tubs(getDDName(nmspace),
37  ev.eval(nmspace, atts.find("dz")->second),
38  ev.eval(nmspace, atts.find("rMin")->second),
39  ev.eval(nmspace, atts.find("rMax")->second),
40  0_deg,
41  360_deg);
42  } else if (name == "TruncTubs") {
44  ev.eval(nmspace, atts.find("zHalf")->second),
45  ev.eval(nmspace, atts.find("rMin")->second),
46  ev.eval(nmspace, atts.find("rMax")->second),
47  ev.eval(nmspace, atts.find("startPhi")->second), //0. // startPhi
48  ev.eval(nmspace, atts.find("deltaPhi")->second),
49  ev.eval(nmspace, atts.find("cutAtStart")->second),
50  ev.eval(nmspace, atts.find("cutAtDelta")->second),
51  cutInside); // cutInside
52  } else if (name == "CutTubs") {
53  DDSolid myTubs = DDSolidFactory::cuttubs(getDDName(nmspace),
54  ev.eval(nmspace, atts.find("dz")->second),
55  ev.eval(nmspace, atts.find("rMin")->second),
56  ev.eval(nmspace, atts.find("rMax")->second),
57  ev.eval(nmspace, atts.find("startPhi")->second),
58  ev.eval(nmspace, atts.find("deltaPhi")->second),
59  ev.eval(nmspace, atts.find("lx")->second),
60  ev.eval(nmspace, atts.find("ly")->second),
61  ev.eval(nmspace, atts.find("lz")->second),
62  ev.eval(nmspace, atts.find("tx")->second),
63  ev.eval(nmspace, atts.find("ty")->second),
64  ev.eval(nmspace, atts.find("tz")->second));
65  } else {
66  std::string msg = "\nDDLTubs::processElement could not process element.";
67  throwError(msg);
68  }
69  DDLSolid::setReference(nmspace, cpv);
70 }
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
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
DDLTubs::DDLTubs
DDLTubs(DDLElementRegistry *myreg)
Definition: DDLTubs.cc:16
geant_units::operators
Definition: GeantUnits.h:18
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
DDSolidFactory::truncTubs
static DDSolid truncTubs(const DDName &name, double zHalf, double rIn, double rOut, double startPhi, double deltaPhi, double cutAtStart, double cutAtDelta, bool cutInside)
Definition: DDSolid.cc:623
DDCompactView
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
DDSolidFactory::tubs
static DDSolid tubs(const DDName &name, double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
Definition: DDSolid.cc:653
DDSolid.h
DDXMLAttribute
std::map< std::string, std::string > DDXMLAttribute
Definition: DDXMLElement.h:45
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
GeantUnits.h
DDLTubs::processElement
void processElement(const std::string &name, const std::string &nmspace, DDCompactView &cpv) override
Processing the element.
Definition: DDLTubs.cc:19
DDLTubs.h
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
DDSolidFactory::cuttubs
static DDSolid cuttubs(const DDName &name, double zhalf, double rIn, double rOut, double startPhi, double deltaPhi, double lx, double ly, double lz, double tx, double ty, double tz)
Definition: DDSolid.cc:658
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