CMS 3D CMS Logo

DDSolid.cc
Go to the documentation of this file.
3 
4 #include <ostream>
5 #include <string>
6 #include <array>
7 
26 
27 using DDI::Solid;
28 
29 std::ostream& operator<<(std::ostream& os, const DDSolidShape s) {
30  return os << "DDSolidShape index:" << static_cast<int>(s) << ", name: " << DDSolidShapesName::name(s);
31 }
32 
33 std::ostream& operator<<(std::ostream& os, const DDSolid& solid) {
35  if (defined.first) {
36  os << *(defined.first) << " ";
37  if (defined.second) {
38  os << " " << DDSolidShapesName::name(solid.shape()) << ": ";
39  solid.rep().stream(os);
40  } else {
41  os << "* solid not defined * ";
42  }
43  } else {
44  os << "* solid not declared * ";
45  }
46  return os;
47 }
48 
50 
52 
53 DDSolid::DDSolid(const DDName& name, std::unique_ptr<Solid> solid) : DDBase<DDName, std::unique_ptr<Solid>>() {
54  create(name, std::move(solid));
55 }
56 
57 DDSolid::DDSolid(const DDName& name, DDSolidShape shape, const std::vector<double>& pars) {
58  std::unique_ptr<DDI::Solid> solid(nullptr);
59  std::vector<double> dummy;
60  switch (shape) {
62  solid = std::make_unique<DDI::Box>(0, 0, 0);
63  break;
65  solid = std::make_unique<DDI::Tubs>(0, 0, 0, 0, 0);
66  break;
68  solid = std::make_unique<DDI::Cons>(0, 0, 0, 0, 0, 0, 0);
69  break;
71  solid = std::make_unique<DDI::PseudoTrap>(0, 0, 0, 0, 0, 0, false);
72  break;
74  solid = std::make_unique<DDI::Shapeless>();
75  break;
77  solid = std::make_unique<DDI::Trap>(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
78  break;
80  solid = std::make_unique<DDI::Polyhedra>(0, 0, 0, dummy, dummy);
81  break;
83  solid = std::make_unique<DDI::Polyhedra>(0, 0, 0, dummy, dummy, dummy);
84  break;
86  solid = std::make_unique<DDI::Polycone>(0, 0, dummy, dummy);
87  break;
89  solid = std::make_unique<DDI::Polycone>(0, 0, dummy, dummy, dummy);
90  break;
92  solid = std::make_unique<DDI::TruncTubs>(0, 0, 0, 0, 0, 0, 0, false);
93  break;
95  solid = std::make_unique<DDI::Torus>(0, 0, 0, 0, 0);
96  break;
98  solid = std::make_unique<DDI::Sphere>(0, 0, 0, 0, 0, 0);
99  break;
101  solid = std::make_unique<DDI::EllipticalTube>(0, 0, 0);
102  break;
104  solid = std::make_unique<DDI::CutTubs>(0., 0., 0., 0., 0., 0., 0., 1., 0., 0., -1.);
105  break;
107  solid = std::make_unique<DDI::ExtrudedPolygon>(dummy, dummy, dummy, dummy, dummy, dummy);
108  break;
109  default:
110  throw cms::Exception("DDException")
111  << "DDSolid::DDSolid( DDName, DDSolidShape, std::vector<double> ): wrong shape.";
112  }
113  solid->setParameters(pars);
114  create(name, std::move(solid));
115 }
116 
117 double DDSolid::volume() const { return rep().volume(); }
118 
119 DDSolidShape DDSolid::shape() const { return rep().shape(); }
120 
121 const std::vector<double>& DDSolid::parameters() const { return rep().parameters(); }
122 
124  if (s.shape() != DDSolidShape::ddtrap) {
125  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is no DDTrap.\n";
126  ex = ex + "Use a different solid interface!";
127  throw cms::Exception("DDException") << ex;
128  }
129 }
130 
131 double DDTrap::halfZ() const { return rep().parameters()[0]; }
132 
133 double DDTrap::theta() const { return rep().parameters()[1]; }
134 
135 double DDTrap::phi() const { return rep().parameters()[2]; }
136 
137 double DDTrap::y1() const { return rep().parameters()[3]; }
138 
139 double DDTrap::x1() const { return rep().parameters()[4]; }
140 
141 double DDTrap::x2() const { return rep().parameters()[5]; }
142 
143 double DDTrap::alpha1() const { return rep().parameters()[6]; }
144 
145 double DDTrap::y2() const { return rep().parameters()[7]; }
146 
147 double DDTrap::x3() const { return rep().parameters()[8]; }
148 
149 double DDTrap::x4() const { return rep().parameters()[9]; }
150 
151 double DDTrap::alpha2() const { return rep().parameters()[10]; }
152 
154  if (s.shape() != DDSolidShape::ddtrunctubs) {
155  edm::LogError("DDSolid") << "s.shape()=" << s.shape() << " " << s.name() << std::endl;
156  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is no DDTruncTubs\n";
157  ex = ex + "Use a different solid interface!";
158  throw cms::Exception("DDException") << ex;
159  }
160 }
161 
162 double DDTruncTubs::zHalf() const { return rep().parameters()[0]; }
163 
164 double DDTruncTubs::rIn() const { return rep().parameters()[1]; }
165 
166 double DDTruncTubs::rOut() const { return rep().parameters()[2]; }
167 
168 double DDTruncTubs::startPhi() const { return rep().parameters()[3]; }
169 
170 double DDTruncTubs::deltaPhi() const { return rep().parameters()[4]; }
171 
172 double DDTruncTubs::cutAtStart() const { return rep().parameters()[5]; }
173 
174 double DDTruncTubs::cutAtDelta() const { return rep().parameters()[6]; }
175 
176 bool DDTruncTubs::cutInside() const { return bool(rep().parameters()[7]); }
177 
179  if (s.shape() != DDSolidShape::ddpseudotrap) {
180  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is no DDPseudoTrap\n";
181  ex = ex + "Use a different solid interface!";
182  throw cms::Exception("DDException") << ex;
183  }
184 }
185 
186 double DDPseudoTrap::halfZ() const { return rep().parameters()[4]; }
187 
188 double DDPseudoTrap::x1() const { return rep().parameters()[0]; }
189 
190 double DDPseudoTrap::x2() const { return rep().parameters()[1]; }
191 
192 double DDPseudoTrap::y1() const { return rep().parameters()[2]; }
193 
194 double DDPseudoTrap::y2() const { return rep().parameters()[3]; }
195 
196 double DDPseudoTrap::radius() const { return rep().parameters()[5]; }
197 
198 bool DDPseudoTrap::atMinusZ() const { return rep().parameters()[6]; }
199 
201  if (s.shape() != DDSolidShape::ddbox) {
202  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is not a DDBox.\n";
203  ex = ex + "Use a different solid interface!";
204  throw cms::Exception("DDException") << ex;
205  }
206 }
207 
208 double DDBox::halfX() const { return rep().parameters()[0]; }
209 
210 double DDBox::halfY() const { return rep().parameters()[1]; }
211 
212 double DDBox::halfZ() const { return rep().parameters()[2]; }
213 
215  if (s.shape() != DDSolidShape::ddshapeless) {
216  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is not a DDShapelessSolid.\n";
217  ex = ex + "Use a different solid interface!";
218  throw cms::Exception("DDException") << ex;
219  }
220 }
221 
223  if (s.shape() != DDSolidShape::ddunion) {
224  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is not a DDUnion.\n";
225  ex = ex + "Use a different solid interface!";
226  throw cms::Exception("DDException") << ex;
227  }
228 }
229 
231  if (s.shape() != DDSolidShape::ddunion) {
232  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is not a DDIntersection.\n";
233  ex = ex + "Use a different solid interface!";
234  throw cms::Exception("DDException") << ex;
235  }
236 }
237 
239  if (s.shape() != DDSolidShape::ddsubtraction) {
240  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is no DDSubtraction.\n";
241  ex = ex + "Use a different solid interface!";
242  throw cms::Exception("DDException") << ex;
243  }
244 }
245 
247 
248 std::vector<double> DDPolySolid::getVec(const size_t& which, const size_t& offset, const size_t& numVecs) const {
249  // which: first second or third std::vector
250  // offset: number of non-std::vector components before std::vectors start
251  if ((rep().parameters().size() - offset) % numVecs != 0) {
252  edm::LogError("DDSolid") << "Could not find equal sized components of std::vectors in a PolySolid description."
253  << "rep().parameters().size()=" << rep().parameters().size() << " numVecs=" << numVecs
254  << " offset=" << offset << std::endl;
255  }
256  std::vector<double> tvec;
257  for (size_t i = offset + which; i < rep().parameters().size(); i = i + numVecs) {
258  tvec.emplace_back(rep().parameters()[i]);
259  }
260  return tvec;
261 }
262 
264  if (s.shape() != DDSolidShape::ddpolycone_rz && s.shape() != DDSolidShape::ddpolycone_rrz) {
265  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is not a DDPolycone.\n";
266  ex = ex + "Use a different solid interface!";
267  throw cms::Exception("DDException") << ex;
268  }
269 }
270 
271 double DDPolycone::startPhi() const { return rep().parameters()[0]; }
272 
273 double DDPolycone::deltaPhi() const { return rep().parameters()[1]; }
274 
275 std::vector<double> DDPolycone::rVec() const {
276  std::vector<double> tvec;
278  tvec = getVec(1, 2, 2);
279  return tvec;
280 }
281 
282 std::vector<double> DDPolycone::zVec() const {
284  return getVec(0, 2, 2);
285  else // (shape() == DDSolidShape::ddpolycone_rrz)
286  return getVec(0, 2, 3);
287 }
288 
289 std::vector<double> DDPolycone::rMinVec() const {
290  std::vector<double> tvec;
292  tvec = getVec(1, 2, 3);
293  return tvec;
294 }
295 
296 std::vector<double> DDPolycone::rMaxVec() const {
297  std::vector<double> tvec;
299  tvec = getVec(2, 2, 3);
300  return tvec;
301 }
302 
304  if (s.shape() != DDSolidShape::ddpolyhedra_rz && s.shape() != DDSolidShape::ddpolyhedra_rrz) {
305  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is not a DDPolyhedra.\n";
306  ex = ex + "Use a different solid interface!";
307  throw cms::Exception("DDException") << ex;
308  }
309 }
310 
311 int DDPolyhedra::sides() const { return int(rep().parameters()[0]); }
312 
313 double DDPolyhedra::startPhi() const { return rep().parameters()[1]; }
314 
315 double DDPolyhedra::deltaPhi() const { return rep().parameters()[2]; }
316 
317 std::vector<double> DDPolyhedra::rVec() const {
318  std::vector<double> tvec;
320  tvec = getVec(1, 3, 2);
321  return tvec;
322 }
323 
324 std::vector<double> DDPolyhedra::zVec() const {
326  return getVec(0, 3, 2);
327  else // (shape() == ddpolycone_rrz)
328  return getVec(0, 3, 3);
329 }
330 
331 std::vector<double> DDPolyhedra::rMinVec() const {
332  std::vector<double> tvec;
334  tvec = getVec(1, 3, 3);
335  return tvec;
336 }
337 
338 std::vector<double> DDPolyhedra::rMaxVec() const {
339  std::vector<double> tvec;
341  tvec = getVec(2, 3, 3);
342  return tvec;
343 }
344 
346  if (s.shape() != DDSolidShape::ddextrudedpolygon) {
347  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is not a DDExtrudedPolygon.\n";
348  ex = ex + "Use a different solid interface!";
349  throw cms::Exception("DDException") << ex;
350  }
351 }
352 
353 auto DDExtrudedPolygon::xyPointsSize(void) const -> std::size_t {
354  // Compute the size of the X and Y coordinate vectors
355  // which define the vertices of the outlined polygon
356  // defined in clock-wise order
357 
358  return (rep().parameters().size() - 4 * zSectionsSize()) * 0.5;
359 }
360 
361 auto DDExtrudedPolygon::zSectionsSize(void) const -> std::size_t {
362  // The first parameters element stores a size of the four equal size vectors
363  // which form the ExtrudedPolygon shape Z sections:
364  //
365  // * first: Z coordinate of the XY polygone plane,
366  // * second and third: x and y offset of the polygone in the XY plane,
367  // * fourth: the polygone scale in each XY plane
368  //
369  // The Z sections defined by the z position in an increasing order.
370 
371  return rep().parameters()[0];
372 }
373 
374 std::vector<double> DDExtrudedPolygon::xVec(void) const {
375  return std::vector<double>(rep().parameters().begin() + 1, rep().parameters().begin() + 1 + xyPointsSize());
376 }
377 
378 std::vector<double> DDExtrudedPolygon::yVec(void) const {
379  return std::vector<double>(rep().parameters().begin() + 1 + xyPointsSize(),
380  rep().parameters().begin() + 1 + 2 * xyPointsSize());
381 }
382 
383 std::vector<double> DDExtrudedPolygon::zVec(void) const {
384  return std::vector<double>(rep().parameters().end() - 4 * zSectionsSize(),
385  rep().parameters().end() - 3 * zSectionsSize());
386 }
387 
388 std::vector<double> DDExtrudedPolygon::zxVec(void) const {
389  return std::vector<double>(rep().parameters().end() - 3 * zSectionsSize(),
390  rep().parameters().end() - 2 * zSectionsSize());
391 }
392 
393 std::vector<double> DDExtrudedPolygon::zyVec(void) const {
394  return std::vector<double>(rep().parameters().end() - 2 * zSectionsSize(),
395  rep().parameters().end() - zSectionsSize());
396 }
397 
398 std::vector<double> DDExtrudedPolygon::zscaleVec(void) const {
399  return std::vector<double>(rep().parameters().end() - zSectionsSize(), rep().parameters().end());
400 }
401 
403  if (s.shape() != DDSolidShape::ddcons) {
404  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is not a DDCons.\n";
405  ex = ex + "Use a different solid interface!";
406  throw cms::Exception("DDException") << ex;
407  }
408 }
409 
410 double DDCons::zhalf() const { return rep().parameters()[0]; }
411 
412 double DDCons::rInMinusZ() const { return rep().parameters()[1]; }
413 
414 double DDCons::rOutMinusZ() const { return rep().parameters()[2]; }
415 
416 double DDCons::rInPlusZ() const { return rep().parameters()[3]; }
417 
418 double DDCons::rOutPlusZ() const { return rep().parameters()[4]; }
419 
420 double DDCons::phiFrom() const { return rep().parameters()[5]; }
421 
422 double DDCons::deltaPhi() const { return rep().parameters()[6]; }
423 
425  if (s.shape() != DDSolidShape::ddtorus) {
426  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is not a DDTorus.\n";
427  ex = ex + "Use a different solid interface!";
428  throw cms::Exception("DDException") << ex;
429  }
430 }
431 
432 double DDTorus::rMin() const { return rep().parameters()[0]; }
433 
434 double DDTorus::rMax() const { return rep().parameters()[1]; }
435 
436 double DDTorus::rTorus() const { return rep().parameters()[2]; }
437 
438 double DDTorus::startPhi() const { return rep().parameters()[3]; }
439 
440 double DDTorus::deltaPhi() const { return rep().parameters()[4]; }
441 
443  if (s.shape() != DDSolidShape::ddtubs) {
444  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is not a DDTubs.\n";
445  ex = ex + "Use a different solid interface!";
446  throw cms::Exception("DDException") << ex;
447  }
448 }
449 
450 double DDTubs::zhalf() const { return rep().parameters()[0]; }
451 
452 double DDTubs::rIn() const { return rep().parameters()[1]; }
453 
454 double DDTubs::rOut() const { return rep().parameters()[2]; }
455 
456 double DDTubs::startPhi() const { return rep().parameters()[3]; }
457 
458 double DDTubs::deltaPhi() const { return rep().parameters()[4]; }
459 
460 DDBooleanSolid::DDBooleanSolid(const DDSolid& s) : DDSolid(s), boolean_(static_cast<DDI::BooleanSolid&>(s.rep())) {}
461 
463 
465 
467 
469 
471  if (s.shape() != DDSolidShape::ddsphere) {
472  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is not a DDSphere (or sphere section).\n";
473  ex = ex + "Use a different solid interface!";
474  throw cms::Exception("DDException") << ex;
475  }
476 }
477 
478 double DDSphere::innerRadius() const { return rep().parameters()[0]; }
479 
480 double DDSphere::outerRadius() const { return rep().parameters()[1]; }
481 
482 double DDSphere::startPhi() const { return rep().parameters()[2]; }
483 
484 double DDSphere::deltaPhi() const { return rep().parameters()[3]; }
485 
486 double DDSphere::startTheta() const { return rep().parameters()[4]; }
487 
488 double DDSphere::deltaTheta() const { return rep().parameters()[5]; }
489 
491  if (s.shape() != DDSolidShape::ddellipticaltube) {
492  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is not a DDEllipticalTube.\n";
493  ex = ex + "Use a different solid interface!";
494  throw cms::Exception("DDException") << ex;
495  }
496 }
497 
498 double DDEllipticalTube::xSemiAxis() const { return rep().parameters()[0]; }
499 
500 double DDEllipticalTube::ySemiAxis() const { return rep().parameters()[1]; }
501 
502 double DDEllipticalTube::zHeight() const { return rep().parameters()[2]; }
503 
505  if (s.shape() != DDSolidShape::ddcuttubs) {
506  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is not a DDCutTubs.\n";
507  ex = ex + "Use a different solid interface!";
508  throw cms::Exception("DDException") << ex;
509  }
510 }
511 
512 double DDCutTubs::zhalf() const { return rep().parameters()[0]; }
513 
514 double DDCutTubs::rIn() const { return rep().parameters()[1]; }
515 
516 double DDCutTubs::rOut() const { return rep().parameters()[2]; }
517 
518 double DDCutTubs::startPhi() const { return rep().parameters()[3]; }
519 
520 double DDCutTubs::deltaPhi() const { return rep().parameters()[4]; }
521 
522 std::array<double, 3> DDCutTubs::lowNorm(void) const {
523  return std::array<double, 3>{{rep().parameters()[5], rep().parameters()[6], rep().parameters()[7]}};
524 }
525 
526 std::array<double, 3> DDCutTubs::highNorm(void) const {
527  return std::array<double, 3>{{rep().parameters()[8], rep().parameters()[9], rep().parameters()[10]}};
528 }
529 
530 // =================================================================================
531 // =========================SolidFactory============================================
532 
533 DDSolid DDSolidFactory::box(const DDName& name, double xHalf, double yHalf, double zHalf) {
534  return DDSolid(name, std::make_unique<DDI::Box>(xHalf, yHalf, zHalf));
535 }
536 
538  double startPhi,
539  double deltaPhi,
540  const std::vector<double>& z,
541  const std::vector<double>& rmin,
542  const std::vector<double>& rmax) {
543  return DDSolid(name, std::make_unique<DDI::Polycone>(startPhi, deltaPhi, z, rmin, rmax));
544 }
545 
547  const DDName& name, double startPhi, double deltaPhi, const std::vector<double>& z, const std::vector<double>& r) {
548  return DDSolid(name, std::make_unique<DDI::Polycone>(startPhi, deltaPhi, z, r));
549 }
550 
552  int sides,
553  double startPhi,
554  double deltaPhi,
555  const std::vector<double>& z,
556  const std::vector<double>& rmin,
557  const std::vector<double>& rmax) {
558  return DDSolid(name, std::make_unique<DDI::Polyhedra>(sides, startPhi, deltaPhi, z, rmin, rmax));
559 }
560 
562  int sides,
563  double startPhi,
564  double deltaPhi,
565  const std::vector<double>& z,
566  const std::vector<double>& r) {
567  return DDSolid(name, std::make_unique<DDI::Polyhedra>(sides, startPhi, deltaPhi, z, r));
568 }
569 
571  const std::vector<double>& x,
572  const std::vector<double>& y,
573  const std::vector<double>& z,
574  const std::vector<double>& zx,
575  const std::vector<double>& zy,
576  const std::vector<double>& zscale) {
577  return DDSolid(name, std::make_unique<DDI::ExtrudedPolygon>(x, y, z, zx, zy, zscale));
578 }
579 
581  const DDName& name, const DDSolid& a, const DDSolid& b, const DDTranslation& t, const DDRotation& r) {
582  return DDSolid(name, std::make_unique<DDI::Union>(a, b, t, r));
583 }
584 
586  const DDName& name, const DDSolid& a, const DDSolid& b, const DDTranslation& t, const DDRotation& r) {
587  return DDSolid(name, std::make_unique<DDI::Subtraction>(a, b, t, r));
588 }
589 
591  const DDName& name, const DDSolid& a, const DDSolid& b, const DDTranslation& t, const DDRotation& r) {
592  return DDSolid(name, std::make_unique<DDI::Intersection>(a, b, t, r));
593 }
594 
596  double pDz,
597  double pTheta,
598  double pPhi,
599  double pDy1,
600  double pDx1,
601  double pDx2,
602  double pAlp1,
603  double pDy2,
604  double pDx3,
605  double pDx4,
606  double pAlp2) {
607  return DDSolid(name,
608  std::make_unique<DDI::Trap>(pDz, pTheta, pPhi, pDy1, pDx1, pDx2, pAlp1, pDy2, pDx3, pDx4, pAlp2));
609 }
610 
612  double pDx1,
613  double pDx2,
614  double pDy1,
615  double pDy2,
616  double pDz,
617  double radius,
618  bool atMinusZ
619 ) {
620  return DDSolid(name, std::make_unique<DDI::PseudoTrap>(pDx1, pDx2, pDy1, pDy2, pDz, radius, atMinusZ));
621 }
622 
624  double zHalf,
625  double rIn,
626  double rOut,
627  double startPhi,
628  double deltaPhi,
629  double cutAtStart,
630  double cutAtDelta,
631  bool cutInside) {
632  return DDSolid(
633  name, std::make_unique<DDI::TruncTubs>(zHalf, rIn, rOut, startPhi, deltaPhi, cutAtStart, cutAtDelta, cutInside));
634 }
635 
637  double zhalf,
638  double rInMinusZ,
639  double rOutMinusZ,
640  double rInPlusZ,
641  double rOutPlusZ,
642  double phiFrom,
643  double deltaPhi) {
644  return DDSolid(name,
645  std::make_unique<DDI::Cons>(zhalf, rInMinusZ, rOutMinusZ, rInPlusZ, rOutPlusZ, phiFrom, deltaPhi));
646 }
647 
649  const DDName& name, double rMin, double rMax, double rTorus, double startPhi, double deltaPhi) {
650  return DDSolid(name, std::make_unique<DDI::Torus>(rMin, rMax, rTorus, startPhi, deltaPhi));
651 }
652 
654  const DDName& name, double zhalf, double rIn, double rOut, double phiFrom, double deltaPhi) {
655  return DDSolid(name, std::make_unique<DDI::Tubs>(zhalf, rIn, rOut, phiFrom, deltaPhi));
656 }
657 
659  double zhalf,
660  double rIn,
661  double rOut,
662  double phiFrom,
663  double deltaPhi,
664  double lx,
665  double ly,
666  double lz,
667  double tx,
668  double ty,
669  double tz) {
670  return DDSolid(name, std::make_unique<DDI::CutTubs>(zhalf, rIn, rOut, phiFrom, deltaPhi, lx, ly, lz, tx, ty, tz));
671 }
672 
674  double innerRadius,
675  double outerRadius,
676  double startPhi,
677  double deltaPhi,
678  double startTheta,
679  double deltaTheta) {
680  return DDSolid(name,
681  std::make_unique<DDI::Sphere>(innerRadius, outerRadius, startPhi, deltaPhi, startTheta, deltaTheta));
682 }
683 
684 DDSolid DDSolidFactory::ellipticalTube(const DDName& name, double xSemiAxis, double ySemiAxis, double zHeight) {
685  return DDSolid(name, std::make_unique<DDI::EllipticalTube>(xSemiAxis, ySemiAxis, zHeight));
686 }
687 
688 DDSolid DDSolidFactory::shapeless(const DDName& name) { return DDSolid(name, std::make_unique<DDI::Shapeless>()); }
DDSolidShapes.h
DDBooleanSolid::solidB
DDSolid solidB(void) const
Definition: DDSolid.cc:468
PseudoTrap.h
DDTubs::zhalf
double zhalf(void) const
Definition: DDSolid.cc:450
DDPseudoTrap::radius
double radius(void) const
radius of the cut-out (neg.) or rounding (pos.)
Definition: DDSolid.cc:196
DDAxes::y
photonAnalyzer_cfi.rMax
rMax
Definition: photonAnalyzer_cfi.py:91
DDBase::def_type
std::pair< const N *, bool > def_type
Definition: DDBase.h:51
DDPseudoTrap::DDPseudoTrap
DDPseudoTrap(void)=delete
BeamSpotPI::parameters
parameters
Definition: BeamSpotPayloadInspectorHelper.h:29
DDI
Definition: DDCompactView.h:25
electrons_cff.bool
bool
Definition: electrons_cff.py:393
mps_fire.i
i
Definition: mps_fire.py:428
DDPolyhedra::rMaxVec
std::vector< double > rMaxVec(void) const
Definition: DDSolid.cc:338
DDTrap::phi
double phi(void) const
Azimuthal angle of the line joining the centres of the faces at -/+pDz.
Definition: DDSolid.cc:135
DDSolidShape
DDSolidShape
Definition: DDSolidShapes.h:6
MessageLogger.h
DDExtrudedPolygon::DDExtrudedPolygon
DDExtrudedPolygon(void)=delete
DDTrap::halfZ
double halfZ(void) const
half of the z-Axis
Definition: DDSolid.cc:131
DDTruncTubs::startPhi
double startPhi(void) const
angular start of the tube-section
Definition: DDSolid.cc:168
DDTrap::x4
double x4(void) const
Half-length along x of the side at y=+pDy2 of the face at +pDz.
Definition: DDSolid.cc:149
DDSolidShape::ddtrap
DDSolidShape::ddtorus
TruncTubs.h
DDPseudoTrap::y2
double y2(void) const
half length along y on +z
Definition: DDSolid.cc:194
DDExtrudedPolygon::yVec
std::vector< double > yVec(void) const
Definition: DDSolid.cc:378
DDCons::deltaPhi
double deltaPhi(void) const
Definition: DDSolid.cc:422
Sphere.h
DDSphere::DDSphere
DDSphere(void)=delete
DDTrap::x2
double x2(void) const
Half-length along x of the side at y=+pDy1 of the face at -pDz.
Definition: DDSolid.cc:141
DDPseudoTrap::atMinusZ
bool atMinusZ(void) const
true, if cut-out or rounding is on the -z side
Definition: DDSolid.cc:198
detailsBasic3DVector::z
float float float z
Definition: extBasic3DVector.h:14
DDName
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
DDTorus::rMin
double rMin(void) const
Definition: DDSolid.cc:432
DDBase::isDefined
def_type isDefined() const
Definition: DDBase.h:90
DDCons::DDCons
DDCons(void)=delete
DDPolyhedra::zVec
std::vector< double > zVec(void) const
Definition: DDSolid.cc:324
Tubs.h
Torus.h
DDBox::halfZ
double halfZ(void) const
Definition: DDSolid.cc:212
DDSolidShape::ddpseudotrap
DDSphere::startPhi
double startPhi(void) const
Definition: DDSolid.cc:482
DDSolidShape::ddpolyhedra_rrz
DDSphere::innerRadius
double innerRadius(void) const
Definition: DDSolid.cc:478
DDTorus::rMax
double rMax(void) const
Definition: DDSolid.cc:434
Cons.h
DDSubtraction::DDSubtraction
DDSubtraction(void)=delete
DDPolycone::deltaPhi
double deltaPhi(void) const
Definition: DDSolid.cc:273
DDPseudoTrap::x2
double x2(void) const
half length along x on +z
Definition: DDSolid.cc:190
interestingEgammaIsoDetIdsSequence_cff.outerRadius
outerRadius
Definition: interestingEgammaIsoDetIdsSequence_cff.py:14
DDTruncTubs::DDTruncTubs
DDTruncTubs(void)=delete
DDBooleanSolid::rotation
DDRotation rotation(void) const
Definition: DDSolid.cc:462
DDPolyhedra::rMinVec
std::vector< double > rMinVec(void) const
Definition: DDSolid.cc:331
DDPolyhedra::DDPolyhedra
DDPolyhedra(void)=delete
DDExtrudedPolygon::xVec
std::vector< double > xVec(void) const
Definition: DDSolid.cc:374
Trap.h
CutTubs.h
DDTubs::DDTubs
DDTubs(void)=delete
DDSolidFactory::cons
static DDSolid cons(const DDName &name, double zhalf, double rInMinusZ, double rOutMinusZ, double rInPlusZ, double rOutPlusZ, double phiFrom, double deltaPhi)
Definition: DDSolid.cc:636
DDAxes::x
DDCutTubs::deltaPhi
double deltaPhi(void) const
Definition: DDSolid.cc:520
DDCons::phiFrom
double phiFrom(void) const
Definition: DDSolid.cc:420
DDCons::rInMinusZ
double rInMinusZ(void) const
Definition: DDSolid.cc:412
DDTruncTubs::cutAtStart
double cutAtStart(void) const
truncation at begin of the tube-section
Definition: DDSolid.cc:172
DDExtrudedPolygon::xyPointsSize
auto xyPointsSize(void) const -> std::size_t
Definition: DDSolid.cc:353
DDI::BooleanSolid::r
const DDRotation & r() const
Definition: Boolean.h:19
DDExtrudedPolygon::zVec
std::vector< double > zVec(void) const
Definition: DDSolid.cc:383
Boolean.h
DDCons::rInPlusZ
double rInPlusZ(void) const
Definition: DDSolid.cc:416
DDTorus::startPhi
double startPhi(void) const
Definition: DDSolid.cc:438
DDSphere::deltaTheta
double deltaTheta(void) const
Definition: DDSolid.cc:488
DDCutTubs::rOut
double rOut(void) const
Definition: DDSolid.cc:516
ExtrudedPolygon.h
DDCutTubs::zhalf
double zhalf(void) const
Definition: DDSolid.cc:512
DDTruncTubs::cutInside
bool cutInside(void) const
true, if truncation is on the inner side of the tube-section
Definition: DDSolid.cc:176
DDBooleanSolid
Definition: DDSolid.h:173
DDPolySolid::getVec
virtual std::vector< double > getVec(const size_t &which, const size_t &offset=0, const size_t &nVecs=1) const
note defaults please.
Definition: DDSolid.cc:248
DDTorus::deltaPhi
double deltaPhi(void) const
Definition: DDSolid.cc:440
Polycone.h
DDTruncTubs::zHalf
double zHalf(void) const
half of the z-Axis
Definition: DDSolid.cc:162
Solid.h
DDSolid::shape
DDSolidShape shape(void) const
The type of the solid.
Definition: DDSolid.cc:119
DDEllipticalTube::DDEllipticalTube
DDEllipticalTube(void)=delete
DDBooleanSolid::translation
DDTranslation translation(void) const
Definition: DDSolid.cc:464
alignCSCRings.s
s
Definition: alignCSCRings.py:92
DDSolidFactory::subtraction
static DDSolid subtraction(const DDName &name, const DDSolid &a, const DDSolid &b, const DDTranslation &t, const DDRotation &r)
Definition: DDSolid.cc:585
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
DDIntersection::DDIntersection
DDIntersection(void)=delete
DDI::BooleanSolid::a
const DDSolid & a() const
Definition: Boolean.h:16
DDPolyhedra::sides
int sides(void) const
Definition: DDSolid.cc:311
DDCons::rOutMinusZ
double rOutMinusZ(void) const
Definition: DDSolid.cc:414
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
DDSolidShape::ddtubs
DDSolidFactory::polyhedra
static DDSolid polyhedra(const DDName &name, int sides, double startPhi, double deltaPhi, const std::vector< double > &z, const std::vector< double > &rmin, const std::vector< double > &rmax)
Creates a polyhedra (refere to Geant3 or Geant4 documentation)
Definition: DDSolid.cc:551
SiPixelRawToDigiRegional_cfi.deltaPhi
deltaPhi
Definition: SiPixelRawToDigiRegional_cfi.py:9
DDTrap::DDTrap
DDTrap(void)=delete
DDTrap::y1
double y1(void) const
Half-length along y of the face at -pDz.
Definition: DDSolid.cc:137
DDTorus::rTorus
double rTorus(void) const
Definition: DDSolid.cc:436
DDEllipticalTube::zHeight
double zHeight(void) const
Definition: DDSolid.cc:502
DDSphere::startTheta
double startTheta(void) const
Definition: DDSolid.cc:486
DDTrap::theta
double theta(void) const
Polar angle of the line joining the centres of the faces at -/+pDz.
Definition: DDSolid.cc:133
DDSolidShape::ddtrunctubs
DDSolidShape::ddpolyhedra_rz
DDBase< DDName, std::unique_ptr< DDI::Solid > >::name
const DDName & name() const
Definition: DDBase.h:59
DDAxes::z
DDPolycone::zVec
std::vector< double > zVec(void) const
Definition: DDSolid.cc:282
DDBase< DDName, std::unique_ptr< DDI::Solid > >::end
static auto end()
Definition: DDBase.h:52
DDSolidFactory::tubs
static DDSolid tubs(const DDName &name, double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
Definition: DDSolid.cc:653
DDSolid.h
DDBase::rep
const DDI::rep_traits< N, C >::reference rep() const
Definition: DDBase.h:65
DDEllipticalTube::xSemiAxis
double xSemiAxis(void) const
Definition: DDSolid.cc:498
DDShapelessSolid::DDShapelessSolid
DDShapelessSolid(void)=delete
DDPolycone::rMaxVec
std::vector< double > rMaxVec(void) const
Definition: DDSolid.cc:296
DDPolySolid
Abstract class for DDPolycone and DDPolyhedra. Basically a common member function.
Definition: DDSolid.h:201
b
double b
Definition: hdecay.h:118
DDCutTubs::DDCutTubs
DDCutTubs(void)=delete
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DDPseudoTrap::y1
double y1(void) const
half length along y on -z
Definition: DDSolid.cc:192
DDTorus::DDTorus
DDTorus(void)=delete
DDSolidShapesName::name
static const char *const name(DDSolidShape s)
Definition: DDSolidShapes.h:32
DDCutTubs::lowNorm
std::array< double, 3 > lowNorm(void) const
Definition: DDSolid.cc:522
DDTubs::rIn
double rIn(void) const
Definition: DDSolid.cc:452
DDTubs::deltaPhi
double deltaPhi(void) const
Definition: DDSolid.cc:458
DDSolidShape::ddellipticaltube
DDSolidFactory::intersection
static DDSolid intersection(const DDName &name, const DDSolid &a, const DDSolid &b, const DDTranslation &t, const DDRotation &r)
Definition: DDSolid.cc:590
a
double a
Definition: hdecay.h:119
DDSolidFactory::extrudedpolygon
static DDSolid extrudedpolygon(const DDName &name, const std::vector< double > &x, const std::vector< double > &y, const std::vector< double > &z, const std::vector< double > &zx, const std::vector< double > &zy, const std::vector< double > &zscale)
Definition: DDSolid.cc:570
DDEllipticalTube::ySemiAxis
double ySemiAxis(void) const
Definition: DDSolid.cc:500
DDSolidShape::ddsphere
DDSolidFactory::ellipticalTube
static DDSolid ellipticalTube(const DDName &name, double xSemiAxis, double ySemiAxis, double zHeight)
Definition: DDSolid.cc:684
DDTruncTubs::rIn
double rIn(void) const
inner radius
Definition: DDSolid.cc:164
DDCutTubs::highNorm
std::array< double, 3 > highNorm(void) const
Definition: DDSolid.cc:526
DDTubs::rOut
double rOut(void) const
Definition: DDSolid.cc:454
interestingEgammaIsoDetIdsSequence_cff.innerRadius
innerRadius
Definition: interestingEgammaIsoDetIdsSequence_cff.py:15
DDSolidShape::ddcons
DDSphere::outerRadius
double outerRadius(void) const
Definition: DDSolid.cc:480
createfilelist.int
int
Definition: createfilelist.py:10
DDExtrudedPolygon::zxVec
std::vector< double > zxVec(void) const
Definition: DDSolid.cc:388
DDPseudoTrap::x1
double x1(void) const
half length along x on -z
Definition: DDSolid.cc:188
DDBox::halfX
double halfX(void) const
Definition: DDSolid.cc:208
cuy.rep
rep
Definition: cuy.py:1190
DDTubs::startPhi
double startPhi(void) const
Definition: DDSolid.cc:456
DDI::BooleanSolid::b
const DDSolid & b() const
Definition: Boolean.h:17
DDI::BooleanSolid::t
const DDTranslation & t() const
Definition: Boolean.h:18
DDBox::halfY
double halfY(void) const
Definition: DDSolid.cc:210
DDI::Solid
Definition: Solid.h:10
DDSolidFactory::polycone
static DDSolid polycone(const DDName &name, double startPhi, double deltaPhi, const std::vector< double > &z, const std::vector< double > &rmin, const std::vector< double > &rmax)
Creates a polycone (refere to Geant3 or Geant4 documentation)
Definition: DDSolid.cc:537
Shapeless.h
DDPolycone::rVec
std::vector< double > rVec(void) const
Definition: DDSolid.cc:275
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
DDPolycone::DDPolycone
DDPolycone(void)=delete
DDSolidFactory::shapeless
static DDSolid shapeless(const DDName &name)
Definition: DDSolid.cc:688
DDExtrudedPolygon::zyVec
std::vector< double > zyVec(void) const
Definition: DDSolid.cc:393
DDSolidFactory::unionSolid
static DDSolid unionSolid(const DDName &name, const DDSolid &a, const DDSolid &b, const DDTranslation &t, const DDRotation &r)
Definition: DDSolid.cc:580
DDUnion::DDUnion
DDUnion(void)=delete
DDBase< DDName, std::unique_ptr< DDI::Solid > >::begin
static auto begin()
Definition: DDBase.h:53
alignCSCRings.r
r
Definition: alignCSCRings.py:93
cms::cuda::device::unique_ptr
std::unique_ptr< T, impl::DeviceDeleter > unique_ptr
Definition: device_unique_ptr.h:33
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
DDPolyhedra::deltaPhi
double deltaPhi(void) const
Definition: DDSolid.cc:315
DDPseudoTrap::halfZ
double halfZ(void) const
half of the z-Axis
Definition: DDSolid.cc:186
DDSolidFactory::torus
static DDSolid torus(const DDName &name, double rMin, double rMax, double rTorus, double startPhi, double deltaPhi)
Definition: DDSolid.cc:648
DDTrap::y2
double y2(void) const
Half-length along y of the face at +pDz.
Definition: DDSolid.cc:145
DDPolycone::startPhi
double startPhi(void) const
Definition: DDSolid.cc:271
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
DDSolidShape::ddbox
DDTruncTubs::deltaPhi
double deltaPhi(void) const
angular span of the tube-section
Definition: DDSolid.cc:170
DDCutTubs::startPhi
double startPhi(void) const
Definition: DDSolid.cc:518
Polyhedra.h
DDSolidFactory::pseudoTrap
static DDSolid pseudoTrap(const DDName &name, double pDx1, double pDx2, double pDy1, double pDy2, double pDz, double radius, bool atMinusZ)
Definition: DDSolid.cc:611
DDTruncTubs::cutAtDelta
double cutAtDelta(void) const
truncation at end of the tube-section
Definition: DDSolid.cc:174
DDBase< DDName, std::unique_ptr< DDI::Solid > >::create
void create(const DDName &name, std::unique_ptr< DDI::Solid > vals)
Definition: DDBase.h:96
DDExtrudedPolygon::zSectionsSize
auto zSectionsSize(void) const -> std::size_t
Definition: DDSolid.cc:361
Exception
Definition: hltDiff.cc:246
genVertex_cff.x
x
Definition: genVertex_cff.py:12
detailsBasic3DVector::y
float float y
Definition: extBasic3DVector.h:14
CosmicsPD_Skims.radius
radius
Definition: CosmicsPD_Skims.py:135
DDSolid::parameters
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:121
DDSolidShape::ddextrudedpolygon
DDTruncTubs::rOut
double rOut(void) const
outer radius
Definition: DDSolid.cc:166
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
DDSolidShape::ddshapeless
DDSolid
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
DDRotation
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
Exception.h
DDTrap::x1
double x1(void) const
Half-length along x of the side at y=-pDy1 of the face at -pDz.
Definition: DDSolid.cc:139
DDSolidFactory::sphere
static DDSolid sphere(const DDName &name, double innerRadius, double outerRadius, double startPhi, double deltaPhi, double startTheta, double deltaTheta)
Definition: DDSolid.cc:673
Box.h
DDBooleanSolid::solidA
DDSolid solidA(void) const
Definition: DDSolid.cc:466
DDSolidShape::ddcuttubs
photonAnalyzer_cfi.rMin
rMin
Definition: photonAnalyzer_cfi.py:90
DDCons::rOutPlusZ
double rOutPlusZ(void) const
Definition: DDSolid.cc:418
DDBooleanSolid::boolean_
const DDI::BooleanSolid & boolean_
Definition: DDSolid.h:184
DDSolidShape::ddpolycone_rrz
DDCons::zhalf
double zhalf(void) const
Definition: DDSolid.cc:410
DDTrap::alpha1
double alpha1(void) const
Angle with respect to the y axis from the centre of the side at y=-pDy1 to the centre at y=+pDy1 of t...
Definition: DDSolid.cc:143
DDPolyhedra::startPhi
double startPhi(void) const
Definition: DDSolid.cc:313
dummy
Definition: DummySelector.h:38
DDBase
Definition: DDBase.h:10
DDTrap::alpha2
double alpha2(void) const
Angle with respect to the y axis from the centre of the side at y=-pDy2 to the centre at y=+pDy2 of t...
Definition: DDSolid.cc:151
DDSolidFactory::box
static DDSolid box(const DDName &name, double xHalf, double yHalf, double zHalf)
Creates a box with side length 2*xHalf, 2*yHalf, 2*zHalf.
Definition: DDSolid.cc:533
DDBooleanSolid::DDBooleanSolid
DDBooleanSolid(void)=delete
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
DDPolycone::rMinVec
std::vector< double > rMinVec(void) const
Definition: DDSolid.cc:289
DDSolidShape::ddsubtraction
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
eostools.which
def which(cmd)
Definition: eostools.py:336
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
DDSphere::deltaPhi
double deltaPhi(void) const
Definition: DDSolid.cc:484
DDSolidShape::ddunion
DDSolidShape::ddpolycone_rz
DDCutTubs::rIn
double rIn(void) const
Definition: DDSolid.cc:514
DDPolyhedra::rVec
std::vector< double > rVec(void) const
Definition: DDSolid.cc:317
operator<<
std::ostream & operator<<(std::ostream &os, const DDSolidShape s)
Definition: DDSolid.cc:29
DDSolid::DDSolid
DDSolid(void)
Uninitialilzed solid reference-object; for further details on reference-objects see documentation of ...
Definition: DDSolid.cc:49
DDTrap::x3
double x3(void) const
Half-length along x of the side at y=-pDy2 of the face at +pDz.
Definition: DDSolid.cc:147
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
DDBox::DDBox
DDBox(void)=delete
EllipticalTube.h
DDSolid::volume
double volume(void) const
Returns the volume of the given solid (does not work with boolean soids !)
Definition: DDSolid.cc:117
DDPolySolid::DDPolySolid
DDPolySolid(void)=delete
DDExtrudedPolygon::zscaleVec
std::vector< double > zscaleVec(void) const
Definition: DDSolid.cc:398