CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
49 DDSolid::DDSolid() : DDBase<DDName, std::unique_ptr<Solid>>() {}
50 
51 DDSolid::DDSolid(const DDName& name) : DDBase<DDName, std::unique_ptr<Solid>>() { create(name); }
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 
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 
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 
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 
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 
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 
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>()); }
size
Write out results.
double zhalf(void) const
Definition: DDSolid.cc:410
DDPseudoTrap(void)=delete
DDExtrudedPolygon(void)=delete
Definition: DDBase.h:10
static DDSolid torus(const DDName &name, double rMin, double rMax, double rTorus, double startPhi, double deltaPhi)
Definition: DDSolid.cc:648
double startPhi(void) const
Definition: DDSolid.cc:313
double zhalf(void) const
Definition: DDSolid.cc:512
double cutAtStart(void) const
truncation at begin of the tube-section
Definition: DDSolid.cc:172
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:121
double halfZ(void) const
half of the z-Axis
Definition: DDSolid.cc:131
DDBox(void)=delete
def_type isDefined() const
Definition: DDBase.h:90
bool cutInside(void) const
true, if truncation is on the inner side of the tube-section
Definition: DDSolid.cc:176
double halfZ(void) const
Definition: DDSolid.cc:212
DDTorus(void)=delete
std::vector< double > rVec(void) const
Definition: DDSolid.cc:275
double x1(void) const
Half-length along x of the side at y=-pDy1 of the face at -pDz.
Definition: DDSolid.cc:139
double zHalf(void) const
half of the z-Axis
Definition: DDSolid.cc:162
const DDTranslation & t() const
Definition: Boolean.h:18
double y2(void) const
half length along y on +z
Definition: DDSolid.cc:194
auto zSectionsSize(void) const -> std::size_t
Definition: DDSolid.cc:361
double halfY(void) const
Definition: DDSolid.cc:210
double startTheta(void) const
Definition: DDSolid.cc:486
std::vector< double > rMaxVec(void) const
Definition: DDSolid.cc:338
double deltaPhi(void) const
angular span of the tube-section
Definition: DDSolid.cc:170
static DDSolid pseudoTrap(const DDName &name, double pDx1, double pDx2, double pDy1, double pDy2, double pDz, double radius, bool atMinusZ)
Definition: DDSolid.cc:611
double deltaPhi(void) const
Definition: DDSolid.cc:484
std::vector< double > rMaxVec(void) const
Definition: DDSolid.cc:296
Abstract class for DDPolycone and DDPolyhedra. Basically a common member function.
Definition: DDSolid.h:201
double phi(void) const
Azimuthal angle of the line joining the centres of the faces at -/+pDz.
Definition: DDSolid.cc:135
DDPolySolid(void)=delete
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
static DDSolid cons(const DDName &name, double zhalf, double rInMinusZ, double rOutMinusZ, double rInPlusZ, double rOutPlusZ, double phiFrom, double deltaPhi)
Definition: DDSolid.cc:636
std::array< double, 3 > highNorm(void) const
Definition: DDSolid.cc:526
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
double rTorus(void) const
Definition: DDSolid.cc:436
std::vector< double > rVec(void) const
Definition: DDSolid.cc:317
double cutAtDelta(void) const
truncation at end of the tube-section
Definition: DDSolid.cc:174
std::vector< double > yVec(void) const
Definition: DDSolid.cc:378
double phiFrom(void) const
Definition: DDSolid.cc:420
const DDI::rep_traits< N, C >::reference rep() const
Definition: DDBase.h:65
DDSphere(void)=delete
const std::string & ns() const
Returns the namespace.
Definition: DDName.cc:51
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
double rIn(void) const
inner radius
Definition: DDSolid.cc:164
const DDSolid & a() const
Definition: Boolean.h:16
double rOutMinusZ(void) const
Definition: DDSolid.cc:414
double rOutPlusZ(void) const
Definition: DDSolid.cc:418
std::vector< double > zyVec(void) const
Definition: DDSolid.cc:393
DDPolyhedra(void)=delete
const DDRotation & r() const
Definition: Boolean.h:19
DDTranslation translation(void) const
Definition: DDSolid.cc:464
DDIntersection(void)=delete
double innerRadius(void) const
Definition: DDSolid.cc:478
const DDI::BooleanSolid & boolean_
Definition: DDSolid.h:184
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
double y1(void) const
half length along y on -z
Definition: DDSolid.cc:192
DDSolid solidB(void) const
Definition: DDSolid.cc:468
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
DDTruncTubs(void)=delete
double rMax(void) const
Definition: DDSolid.cc:434
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
std::vector< double > xVec(void) const
Definition: DDSolid.cc:374
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
std::array< double, 3 > lowNorm(void) const
Definition: DDSolid.cc:522
double outerRadius(void) const
Definition: DDSolid.cc:480
DDTubs(void)=delete
static const char *const name(DDSolidShape s)
Definition: DDSolidShapes.h:32
auto xyPointsSize(void) const -> std::size_t
Definition: DDSolid.cc:353
DDPolycone(void)=delete
double x4(void) const
Half-length along x of the side at y=+pDy2 of the face at +pDz.
Definition: DDSolid.cc:149
static DDSolid intersection(const DDName &name, const DDSolid &a, const DDSolid &b, const DDTranslation &t, const DDRotation &r)
Definition: DDSolid.cc:590
DDRotation rotation(void) const
Definition: DDSolid.cc:462
bool atMinusZ(void) const
true, if cut-out or rounding is on the -z side
Definition: DDSolid.cc:198
double halfZ(void) const
half of the z-Axis
Definition: DDSolid.cc:186
std::vector< double > rMinVec(void) const
Definition: DDSolid.cc:289
double startPhi(void) const
Definition: DDSolid.cc:456
double startPhi(void) const
Definition: DDSolid.cc:271
double xSemiAxis(void) const
Definition: DDSolid.cc:498
static DDSolid sphere(const DDName &name, double innerRadius, double outerRadius, double startPhi, double deltaPhi, double startTheta, double deltaTheta)
Definition: DDSolid.cc:673
std::ostream & operator<<(std::ostream &os, const DDSolidShape s)
Definition: DDSolid.cc:29
const DDSolid & b() const
Definition: Boolean.h:17
double deltaPhi(void) const
Definition: DDSolid.cc:273
double startPhi(void) const
Definition: DDSolid.cc:482
double y1(void) const
Half-length along y of the face at -pDz.
Definition: DDSolid.cc:137
double rInMinusZ(void) const
Definition: DDSolid.cc:412
DDSolidShape shape(void) const
The type of the solid.
Definition: DDSolid.cc:119
double rOut(void) const
Definition: DDSolid.cc:516
double deltaTheta(void) const
Definition: DDSolid.cc:488
static DDSolid tubs(const DDName &name, double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
Definition: DDSolid.cc:653
double ySemiAxis(void) const
Definition: DDSolid.cc:500
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
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
double rMin(void) const
Definition: DDSolid.cc:432
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
std::vector< double > rMinVec(void) const
Definition: DDSolid.cc:331
double rOut(void) const
Definition: DDSolid.cc:454
double deltaPhi(void) const
Definition: DDSolid.cc:520
int sides(void) const
Definition: DDSolid.cc:311
DDSolid solidA(void) const
Definition: DDSolid.cc:466
double deltaPhi(void) const
Definition: DDSolid.cc:422
double deltaPhi(void) const
Definition: DDSolid.cc:458
double startPhi(void) const
Definition: DDSolid.cc:438
DDCutTubs(void)=delete
std::vector< double > zVec(void) const
Definition: DDSolid.cc:383
double halfX(void) const
Definition: DDSolid.cc:208
std::vector< double > zxVec(void) const
Definition: DDSolid.cc:388
static DDSolid ellipticalTube(const DDName &name, double xSemiAxis, double ySemiAxis, double zHeight)
Definition: DDSolid.cc:684
std::vector< double > zVec(void) const
Definition: DDSolid.cc:324
double deltaPhi(void) const
Definition: DDSolid.cc:440
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
static DDSolid subtraction(const DDName &name, const DDSolid &a, const DDSolid &b, const DDTranslation &t, const DDRotation &r)
Definition: DDSolid.cc:585
DDSolidShape
Definition: DDSolidShapes.h:6
double b
Definition: hdecay.h:118
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
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
double startPhi(void) const
angular start of the tube-section
Definition: DDSolid.cc:168
double x2(void) const
Half-length along x of the side at y=+pDy1 of the face at -pDz.
Definition: DDSolid.cc:141
double zhalf(void) const
Definition: DDSolid.cc:450
static DDSolid shapeless(const DDName &name)
Definition: DDSolid.cc:688
DDEllipticalTube(void)=delete
DDShapelessSolid(void)=delete
double zHeight(void) const
Definition: DDSolid.cc:502
double a
Definition: hdecay.h:119
DDUnion(void)=delete
double deltaPhi(void) const
Definition: DDSolid.cc:315
double y2(void) const
Half-length along y of the face at +pDz.
Definition: DDSolid.cc:145
std::pair< const N *, bool > def_type
Definition: DDBase.h:51
DDBooleanSolid(void)=delete
DDSubtraction(void)=delete
double rInPlusZ(void) const
Definition: DDSolid.cc:416
DDSolid(void)
Uninitialilzed solid reference-object; for further details on reference-objects see documentation of ...
Definition: DDSolid.cc:49
def which(cmd)
Definition: eostools.py:336
static DDSolid unionSolid(const DDName &name, const DDSolid &a, const DDSolid &b, const DDTranslation &t, const DDRotation &r)
Definition: DDSolid.cc:580
DDTrap(void)=delete
double x2(void) const
half length along x on +z
Definition: DDSolid.cc:190
double rIn(void) const
Definition: DDSolid.cc:514
double rIn(void) const
Definition: DDSolid.cc:452
double rOut(void) const
outer radius
Definition: DDSolid.cc:166
double theta(void) const
Polar angle of the line joining the centres of the faces at -/+pDz.
Definition: DDSolid.cc:133
std::vector< double > zscaleVec(void) const
Definition: DDSolid.cc:398
const std::string & name() const
Returns the name.
Definition: DDName.cc:40
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
def move(src, dest)
Definition: eostools.py:511
double x3(void) const
Half-length along x of the side at y=-pDy2 of the face at +pDz.
Definition: DDSolid.cc:147
double volume(void) const
Returns the volume of the given solid (does not work with boolean soids !)
Definition: DDSolid.cc:117
std::vector< double > zVec(void) const
Definition: DDSolid.cc:282
double x1(void) const
half length along x on -z
Definition: DDSolid.cc:188
double startPhi(void) const
Definition: DDSolid.cc:518
double radius(void) const
radius of the cut-out (neg.) or rounding (pos.)
Definition: DDSolid.cc:196
DDCons(void)=delete
void create(const DDName &name, std::unique_ptr< DDI::Solid > vals)
Definition: DDBase.h:96