CMS 3D CMS Logo

DDSolid.cc
Go to the documentation of this file.
2 
3 #include <ostream>
4 #include <string>
5 #include <array>
6 
30 
31 using DDI::Solid;
32 
33 std::ostream &
34 operator<<(std::ostream & os, const DDSolid & solid)
35 {
37  if (defined.first) {
38  os << *(defined.first) << " ";
39  if (defined.second) {
40  os << " " << DDSolidShapesName::name(solid.shape()) << ": ";
41  solid.rep().stream(os);
42  }
43  else {
44  os << "* solid not defined * ";
45  }
46  }
47  else {
48  os << "* solid not declared * ";
49  }
50  return os;
51 }
52 
54 
56 {
57  prep_ = StoreT::instance().create(n);
58 }
59 
61 {
62  prep_ = StoreT::instance().create(n,s);
63 }
64 
65 DDSolid::DDSolid( const DDName & n, DDSolidShape s, const std::vector<double> & p )
66 {
67  DDI::Solid * solid(0);
68  std::vector<double> dummy;
69  switch(s) {
70  case ddbox:
71  solid = new DDI::Box(0,0,0);
72  break;
73  case ddtubs:
74  solid = new DDI::Tubs(0,0,0,0,0);
75  break;
76  case ddcons:
77  solid = new DDI::Cons(0,0,0,0,0,0,0);
78  break;
79  case ddpseudotrap:
80  solid = new DDI::PseudoTrap(0,0,0,0,0,0,0);
81  break;
82  case ddshapeless:
83  solid = new DDI::Shapeless();
84  break;
85  case ddtrap:
86  solid = new DDI::Trap(0,0,0,0,0,0,0,0,0,0,0);
87  break;
88  case ddpolyhedra_rz:
89  solid = new DDI::Polyhedra(0,0,0,dummy,dummy);
90  break;
91  case ddpolyhedra_rrz:
92  solid = new DDI::Polyhedra(0,0,0,dummy,dummy,dummy);
93  break;
94  case ddpolycone_rz:
95  solid = new DDI::Polycone(0,0,dummy,dummy);
96  break;
97  case ddpolycone_rrz:
98  solid = new DDI::Polycone(0,0,dummy,dummy,dummy);
99  break;
100  case ddtrunctubs:
101  solid = new DDI::TruncTubs(0,0,0,0,0,0,0,0);
102  break;
103  case ddtorus:
104  solid = new DDI::Torus(0,0,0,0,0);
105  break;
106  case ddsphere:
107  solid = new DDI::Sphere(0,0,0,0,0,0);
108  break;
109  case ddorb:
110  solid = new DDI::Orb(0);
111  break;
112  case ddellipticaltube:
113  solid = new DDI::EllipticalTube(0,0,0);
114  break;
115  case ddellipsoid:
116  solid = new DDI::Ellipsoid(0,0,0,0,0);
117  break;
118  case ddparallelepiped:
119  solid = new DDI::Parallelepiped(0,0,0,0,0,0);
120  break;
121  case ddcuttubs:
122  solid = new DDI::CutTubs(0.,0.,0.,0.,0.,0.,0.,1.,0.,0.,-1.);
123  break;
124  case ddextrudedpolygon:
125  solid = new DDI::ExtrudedPolygon( dummy, dummy, dummy, dummy, dummy, dummy );
126  default:
127  throw cms::Exception("DDException") << "DDSolid::DDSolid(DDName,DDSolidShape,std::vector<double>: wrong shape";
128  }
129  solid->setParameters(p);
130  prep_ = StoreT::instance().create(n,solid);
131 }
132 
133 double
135 {
136  return rep().volume();
137 }
138 
141 {
142  return rep().shape();
143 }
144 
145 const std::vector<double> &
147 {
148  return rep().parameters();
149 }
150 
152 {
153  if (s.shape() != ddtrap) {
154  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is no DDTrap.\n";
155  ex = ex + "Use a different solid interface!";
156  throw cms::Exception("DDException") << ex;
157  }
158 }
159 
160 double
161 DDTrap::halfZ() const { return rep().parameters()[0]; }
162 
163 double
164 DDTrap::theta() const { return rep().parameters()[1]; }
165 
166 double
167 DDTrap::phi() const { return rep().parameters()[2]; }
168 
169 double
170 DDTrap::y1() const { return rep().parameters()[3]; }
171 
172 double
173 DDTrap::x1() const { return rep().parameters()[4]; }
174 
175 double
176 DDTrap::x2() const { return rep().parameters()[5]; }
177 
178 double
179 DDTrap::alpha1() const { return rep().parameters()[6]; }
180 
181 double
182 DDTrap::y2() const { return rep().parameters()[7]; }
183 
184 double
185 DDTrap::x3() const { return rep().parameters()[8]; }
186 
187 double
188 DDTrap::x4() const { return rep().parameters()[9]; }
189 
190 double
191 DDTrap::alpha2() const { return rep().parameters()[10]; }
192 
194 {
195  if (s.shape() != ddtrunctubs) {
196  edm::LogError ("DDSolid") << "s.shape()=" << s.shape() << " " << s << std::endl;
197  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is no DDTruncTubs\n";
198  ex = ex + "Use a different solid interface!";
199  throw cms::Exception("DDException") << ex;
200  }
201 }
202 
203 double
204 DDTruncTubs::zHalf() const { return rep().parameters()[0];}
205 
206 double
207 DDTruncTubs::rIn() const { return rep().parameters()[1];}
208 
209 double
210 DDTruncTubs::rOut() const { return rep().parameters()[2];}
211 
212 double
213 DDTruncTubs::startPhi() const { return rep().parameters()[3];}
214 
215 double
216 DDTruncTubs::deltaPhi() const { return rep().parameters()[4];}
217 
218 double
219 DDTruncTubs::cutAtStart() const { return rep().parameters()[5];}
220 
221 double
222 DDTruncTubs::cutAtDelta() const { return rep().parameters()[6];}
223 
224 bool
225 DDTruncTubs::cutInside() const { return bool(rep().parameters()[7]);}
226 
228 {
229  if (s.shape() != ddpseudotrap) {
230  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is no DDPseudoTrap\n";
231  ex = ex + "Use a different solid interface!";
232  throw cms::Exception("DDException") << ex;
233  }
234 }
235 
236 double
237 DDPseudoTrap::halfZ() const { return rep().parameters()[4]; }
238 
239 double
240 DDPseudoTrap::x1() const { return rep().parameters()[0]; }
241 
242 double
243 DDPseudoTrap::x2() const { return rep().parameters()[1]; }
244 
245 double
246 DDPseudoTrap::y1() const { return rep().parameters()[2]; }
247 
248 double
249 DDPseudoTrap::y2() const { return rep().parameters()[3]; }
250 
251 double
252 DDPseudoTrap::radius() const { return rep().parameters()[5]; }
253 
254 bool
255 DDPseudoTrap::atMinusZ() const { return rep().parameters()[6]; }
256 
258  : DDSolid(s)
259 {
260  if (s.shape() != ddbox) {
261  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is not a DDBox.\n";
262  ex = ex + "Use a different solid interface!";
263  throw cms::Exception("DDException") << ex;
264  }
265 }
266 
267 double
269 { return rep().parameters()[0]; }
270 
271 double
273 { return rep().parameters()[1]; }
274 
275 double
277 { return rep().parameters()[2]; }
278 
280  : DDSolid(s), reflected_(0)
281 {
282  //FIXME: exception handling!
283  reflected_ = dynamic_cast<DDI::Reflection*>(&s.rep());
284 }
285 
286 DDSolid
288 { return reflected_->solid();}
289 
291 {
292  if (s.shape() != ddshapeless) {
293  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is not a DDShapelessSolid.\n";
294  ex = ex + "Use a different solid interface!";
295  throw cms::Exception("DDException") << ex;
296  }
297 }
298 
300  : DDBooleanSolid(s)
301 {
302  if (s.shape() != ddunion) {
303  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is not a DDUnion.\n";
304  ex = ex + "Use a different solid interface!";
305  throw cms::Exception("DDException") << ex;
306  }
307 }
308 
310  : DDBooleanSolid(s)
311 {
312  if (s.shape() != ddunion) {
313  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is not a DDIntersection.\n";
314  ex = ex + "Use a different solid interface!";
315  throw cms::Exception("DDException") << ex;
316  }
317 }
318 
320  : DDBooleanSolid(s)
321 {
322  if (s.shape() != ddsubtraction) {
323  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is no DDSubtraction.\n";
324  ex = ex + "Use a different solid interface!";
325  throw cms::Exception("DDException") << ex;
326  }
327 }
328 
330  : DDSolid(s)
331 { }
332 
333 std::vector<double>
334 DDPolySolid::getVec (const size_t& which,
335  const size_t& offset,
336  const size_t& numVecs) const {
337 
338  // which: first second or third std::vector
339  // offset: number of non-std::vector components before std::vectors start
340  std::string locErr;
341  std::vector<double> tvec;
342  if(( rep().parameters().size() - offset) % numVecs != 0 ) {
343  locErr = std::string("Could not find equal sized components of std::vectors in a PolySolid description.");
344  edm::LogError ("DDSolid") << "rep().parameters().size()=" << rep().parameters().size() << " numVecs=" << numVecs
345  << " offset=" << offset << std::endl;
346  }
347  for( size_t i = offset + which; i < rep().parameters().size(); i = i + numVecs ) {
348  tvec.emplace_back( rep().parameters()[i]);
349  }
350  return tvec;
351 }
352 
354  : DDPolySolid(s)
355 {
356  if( s.shape() != ddpolycone_rz && s.shape() != ddpolycone_rrz ) {
357  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is not a DDPolycone.\n";
358  ex = ex + "Use a different solid interface!";
359  throw cms::Exception("DDException") << ex;
360  }
361 }
362 
363 double
364 DDPolycone::startPhi() const { return rep().parameters()[0]; }
365 
366 double
367 DDPolycone::deltaPhi() const { return rep().parameters()[1]; }
368 
369 std::vector<double> DDPolycone::rVec() const {
370  std::vector<double> tvec;
371  if (shape() == ddpolycone_rz)
372  tvec = getVec(1, 2, 2);
373  return tvec;
374 }
375 
376 std::vector<double>
378  if (shape() == ddpolycone_rz)
379  return getVec(0, 2, 2);
380  else // (shape() == ddpolycone_rrz)
381  return getVec(0, 2, 3);
382 }
383 
384 std::vector<double>
386  std::vector<double> tvec;
387  if (shape() == ddpolycone_rrz)
388  tvec = getVec(1, 2, 3);
389  return tvec;
390 }
391 
392 std::vector<double>
394  std::vector<double> tvec;
395  if (shape() == ddpolycone_rrz)
396  tvec = getVec(2, 2, 3);
397  return tvec;
398 }
399 
401  : DDPolySolid(s)
402 {
403  if (s.shape() != ddpolyhedra_rz && s.shape() != ddpolyhedra_rrz) {
404  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is not a DDPolyhedra.\n";
405  ex = ex + "Use a different solid interface!";
406  throw cms::Exception("DDException") << ex;
407  }
408 }
409 
410 int
411 DDPolyhedra::sides() const { return int(rep().parameters()[0]); }
412 
413 double
414 DDPolyhedra::startPhi() const { return rep().parameters()[1]; }
415 
416 double
417 DDPolyhedra::deltaPhi() const { return rep().parameters()[2]; }
418 
419 std::vector<double>
421  std::vector<double> tvec;
422  if (shape() == ddpolyhedra_rz)
423  tvec = getVec(1, 3, 2);
424  return tvec;
425 }
426 
427 std::vector<double>
429  if (shape() == ddpolyhedra_rz)
430  return getVec(0, 3, 2);
431  else // (shape() == ddpolycone_rrz)
432  return getVec(0, 3, 3);
433 }
434 
435 std::vector<double>
437  std::vector<double> tvec;
438  if (shape() == ddpolyhedra_rrz)
439  tvec = getVec(1, 3, 3);
440  return tvec;
441 }
442 
443 std::vector<double>
445  std::vector<double> tvec;
446  if (shape() == ddpolyhedra_rrz)
447  tvec = getVec(2, 3, 3);
448  return tvec;
449 }
450 
452  : DDSolid(s) {
453  if (s.shape() != ddcons) {
454  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is not a DDCons.\n";
455  ex = ex + "Use a different solid interface!";
456  throw cms::Exception("DDException") << ex;
457  }
458 }
459 
460 double
461 DDCons::zhalf() const { return rep().parameters()[0]; }
462 
463 double
464 DDCons::rInMinusZ() const { return rep().parameters()[1]; }
465 
466 double
467 DDCons::rOutMinusZ () const { return rep().parameters()[2]; }
468 
469 double
470 DDCons::rInPlusZ() const { return rep().parameters()[3]; }
471 
472 double
473 DDCons::rOutPlusZ() const { return rep().parameters()[4]; }
474 
475 double
476 DDCons::phiFrom() const { return rep().parameters()[5]; }
477 
478 double
479 DDCons::deltaPhi() const { return rep().parameters()[6]; }
480 
482  : DDSolid(s) {
483  if (s.shape() != ddtorus) {
484  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is not a DDTorus.\n";
485  ex = ex + "Use a different solid interface!";
486  throw cms::Exception("DDException") << ex;
487  }
488 }
489 
490 double
491 DDTorus::rMin() const { return rep().parameters()[0]; }
492 
493 double
494 DDTorus::rMax() const { return rep().parameters()[1]; }
495 
496 double
497 DDTorus::rTorus () const { return rep().parameters()[2]; }
498 
499 double
500 DDTorus::startPhi() const { return rep().parameters()[3]; }
501 
502 double
503 DDTorus::deltaPhi() const { return rep().parameters()[4]; }
504 
506  : DDSolid(s) {
507  if (s.shape() != ddtubs) {
508  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is not a DDTubs.\n";
509  ex = ex + "Use a different solid interface!";
510  throw cms::Exception("DDException") << ex;
511  }
512 }
513 
514 double
515 DDTubs::zhalf() const { return rep().parameters()[0]; }
516 
517 double
518 DDTubs::rIn() const { return rep().parameters()[1]; }
519 
520 double
521 DDTubs::rOut() const { return rep().parameters()[2]; }
522 
523 double
524 DDTubs::startPhi() const { return rep().parameters()[3]; }
525 
526 double
527 DDTubs::deltaPhi() const { return rep().parameters()[4]; }
528 
530  : DDSolid(s), boolean_(0)
531 {
532  boolean_ = dynamic_cast<DDI::BooleanSolid*>(&s.rep());
533 }
534 
537 {
538  return boolean_->r();
539 }
540 
543 {
544  return boolean_->t();
545 }
546 
547 DDSolid
549 {
550  return boolean_->a();
551 }
552 
553 DDSolid
555 {
556  return boolean_->b();
557 }
558 
560  : DDSolid(s) {
561  if (s.shape() != ddsphere) {
562  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is not a DDSphere (or sphere section).\n";
563  ex = ex + "Use a different solid interface!";
564  throw cms::Exception("DDException") << ex;
565  }
566 }
567 
568 double
569 DDSphere::innerRadius() const { return rep().parameters()[0]; }
570 
571 double
572 DDSphere::outerRadius() const { return rep().parameters()[1]; }
573 
574 double
575 DDSphere::startPhi () const { return rep().parameters()[2]; }
576 
577 double
578 DDSphere::deltaPhi() const { return rep().parameters()[3]; }
579 
580 double
581 DDSphere::startTheta() const { return rep().parameters()[4]; }
582 
583 double
584 DDSphere::deltaTheta() const { return rep().parameters()[5]; }
585 
587  : DDSolid(s) {
588  if (s.shape() != ddorb) {
589  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is not a DDOrb.\n";
590  ex = ex + "Use a different solid interface!";
591  throw cms::Exception("DDException") << ex;
592  }
593 }
594 
595 double
596 DDOrb::radius() const { return rep().parameters()[0]; }
597 
599  : DDSolid(s) {
600  if (s.shape() != ddellipticaltube) {
601  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is not a DDEllipticalTube.\n";
602  ex = ex + "Use a different solid interface!";
603  throw cms::Exception("DDException") << ex;
604  }
605 }
606 
607 double
608 DDEllipticalTube::xSemiAxis() const { return rep().parameters()[0]; }
609 
610 double
611 DDEllipticalTube::ySemiAxis() const { return rep().parameters()[1]; }
612 
613 double
614 DDEllipticalTube::zHeight() const { return rep().parameters()[2]; }
615 
617  : DDSolid(s) {
618  if (s.shape() != ddellipsoid) {
619  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is not a DDEllipsoid (or truncated ellipsoid).\n";
620  ex = ex + "Use a different solid interface!";
621  throw cms::Exception("DDException") << ex;
622  }
623 }
624 
625 double
626 DDEllipsoid::xSemiAxis() const { return rep().parameters()[0]; }
627 
628 double
629 DDEllipsoid::ySemiAxis() const { return rep().parameters()[1]; }
630 
631 double
632 DDEllipsoid::zSemiAxis() const { return rep().parameters()[2]; }
633 
634 double
635 DDEllipsoid::zBottomCut() const { return rep().parameters()[3]; }
636 
637 double
638 DDEllipsoid::zTopCut() const { return rep().parameters()[4]; }
639 
641  : DDSolid(s) {
642  if (s.shape() != ddparallelepiped) {
643  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is not a DDParallelepiped.\n";
644  ex = ex + "Use a different solid interface!";
645  throw cms::Exception("DDException") << ex;
646  }
647 }
648 
649 double
650 DDParallelepiped::xHalf() const { return rep().parameters()[0]; }
651 
652 double
653 DDParallelepiped::yHalf() const { return rep().parameters()[1]; }
654 
655 double
656 DDParallelepiped::zHalf () const { return rep().parameters()[2]; }
657 
658 double
659 DDParallelepiped::alpha() const { return rep().parameters()[3]; }
660 
661 double
662 DDParallelepiped::theta() const { return rep().parameters()[4]; }
663 
664 double
665 DDParallelepiped::phi() const { return rep().parameters()[5]; }
666 
668  : DDSolid(s) {
669  if (s.shape() != ddcuttubs) {
670  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is not a DDCutTubs.\n";
671  ex = ex + "Use a different solid interface!";
672  throw cms::Exception("DDException") << ex;
673  }
674 }
675 
676 double
677 DDCutTubs::zhalf() const { return rep().parameters()[0]; }
678 
679 double
680 DDCutTubs::rIn() const { return rep().parameters()[1]; }
681 
682 double
683 DDCutTubs::rOut() const { return rep().parameters()[2]; }
684 
685 double
686 DDCutTubs::startPhi() const { return rep().parameters()[3]; }
687 
688 double
689 DDCutTubs::deltaPhi() const { return rep().parameters()[4]; }
690 
691 std::array<double, 3>
692 DDCutTubs::lowNorm( void ) const {
693  return std::array<double, 3>{{rep().parameters()[5],rep().parameters()[6],rep().parameters()[7]}};
694 }
695 
696 std::array<double, 3>
697 DDCutTubs::highNorm( void ) const {
698  return std::array<double, 3>{{rep().parameters()[8],rep().parameters()[9],rep().parameters()[10]}};
699 }
700 
701 // =================================================================================
702 // =========================SolidFactory============================================
703 
704 DDSolid
706  double xHalf,
707  double yHalf,
708  double zHalf )
709 {
710  return DDSolid(name, new DDI::Box(xHalf, yHalf, zHalf ));
711 }
712 
713 DDSolid
715  const std::vector<double> & z,
716  const std::vector<double> & rmin,
717  const std::vector<double> & rmax)
718 {
719  return DDSolid(name, new DDI::Polycone(startPhi, deltaPhi, z, rmin, rmax));
720 }
721 
722 DDSolid
724  const std::vector<double> & z,
725  const std::vector<double> & r)
726 {
727  return DDSolid(name, new DDI::Polycone(startPhi, deltaPhi, z, r));
728 }
729 
730 
731 DDSolid
733  int sides,
734  double startPhi,
735  double deltaPhi,
736  const std::vector<double> & z,
737  const std::vector<double> & rmin,
738  const std::vector<double> & rmax)
739 {
740  return DDSolid(name, new DDI::Polyhedra( sides, startPhi, deltaPhi, z, rmin, rmax ));
741 }
742 
743 DDSolid
745  int sides,
746  double startPhi,
747  double deltaPhi,
748  const std::vector<double> & z,
749  const std::vector<double> & r)
750 {
751  return DDSolid(name, new DDI::Polyhedra( sides, startPhi, deltaPhi, z, r ));
752 }
753 
754 DDSolid
756  const std::vector<double> & x,
757  const std::vector<double> & y,
758  const std::vector<double> & z,
759  const std::vector<double> & zx,
760  const std::vector<double> & zy,
761  const std::vector<double> & zscale )
762 {
763  return DDSolid( name, new DDI::ExtrudedPolygon( x, y, z, zx, zy, zscale ));
764 }
765 
766 DDSolid
768  const DDSolid & a, const DDSolid & b,
769  const DDTranslation & t,
770  const DDRotation & r)
771 {
772  return DDSolid(name, new DDI::Union(a,b,t,r));
773 }
774 
775 DDSolid
777  const DDSolid & a, const DDSolid & b,
778  const DDTranslation & t,
779  const DDRotation & r)
780 {
781  return DDSolid(name, new DDI::Subtraction(a,b,t,r));
782 }
783 
784 DDSolid
786  const DDSolid & a, const DDSolid & b,
787  const DDTranslation & t,
788  const DDRotation & r)
789 {
790  return DDSolid(name, new DDI::Intersection(a,b,t,r));
791 }
792 
793 DDSolid
795  double pDz,
796  double pTheta, double pPhi,
797  double pDy1, double pDx1, double pDx2,
798  double pAlp1,
799  double pDy2, double pDx3, double pDx4,
800  double pAlp2)
801 {
802  return DDSolid(name, new DDI::Trap(pDz, pTheta, pPhi,
803  pDy1, pDx1, pDx2, pAlp1,
804  pDy2, pDx3, pDx4, pAlp2));
805 }
806 
807 DDSolid
809  double pDx1,
810  double pDx2,
811  double pDy1,
812  double pDy2,
813  double pDz,
814  double radius,
815  bool atMinusZ
816  )
817 {
818  return DDSolid(name, new DDI::PseudoTrap(pDx1, pDx2, pDy1, pDy2, pDz, radius, atMinusZ));
819 }
820 
821 DDSolid
823  double zHalf,
824  double rIn,
825  double rOut,
826  double startPhi,
827  double deltaPhi,
828  double cutAtStart,
829  double cutAtDelta,
830  bool cutInside )
831 {
832  return DDSolid(name, new DDI::TruncTubs(zHalf,rIn,rOut,startPhi,deltaPhi,cutAtStart,cutAtDelta,cutInside));
833 }
834 
835 DDSolid
837  double zhalf,
838  double rInMinusZ,
839  double rOutMinusZ,
840  double rInPlusZ,
841  double rOutPlusZ,
842  double phiFrom,
843  double deltaPhi)
844 {
845  return DDSolid(name, new DDI::Cons(zhalf,
846  rInMinusZ, rOutMinusZ,
847  rInPlusZ, rOutPlusZ,
848  phiFrom, deltaPhi));
849 }
850 
851 DDSolid
853  double rMin,
854  double rMax,
855  double rTorus,
856  double startPhi,
857  double deltaPhi)
858 {
859  return DDSolid(name, new DDI::Torus(rMin, rMax, rTorus, startPhi, deltaPhi));
860 }
861 
862 DDSolid
864  double zhalf,
865  double rIn, double rOut,
866  double phiFrom, double deltaPhi)
867 {
868  return DDSolid(name, new DDI::Tubs(zhalf,rIn,rOut,phiFrom,deltaPhi));
869 }
870 
871 DDSolid
873  double zhalf,
874  double rIn, double rOut,
875  double phiFrom, double deltaPhi,
876  double lx, double ly, double lz,
877  double tx, double ty, double tz)
878 {
879  return DDSolid(name, new DDI::CutTubs(zhalf,rIn,rOut,phiFrom,deltaPhi,lx,ly,lz,tx,ty,tz));
880 }
881 
882 DDSolid
884  double innerRadius,
885  double outerRadius,
886  double startPhi,
887  double deltaPhi,
888  double startTheta,
889  double deltaTheta)
890 {
891  return DDSolid(name, new DDI::Sphere(innerRadius, outerRadius,
892  startPhi, deltaPhi,
893  startTheta, deltaTheta));
894 }
895 
896 DDSolid
898 {
899  return DDSolid(name, new DDI::Orb(radius));
900 }
901 
902 DDSolid
904  double xSemiAxis, double ySemiAxis, double zHeight)
905 {
906  return DDSolid(name, new DDI::EllipticalTube(xSemiAxis, ySemiAxis, zHeight));
907 }
908 
909 DDSolid
911  double xSemiAxis,
912  double ySemiAxis,
913  double zSemiAxis,
914  double zBottomCut,
915  double zTopCut
916  )
917 {
918  return DDSolid(name, new DDI::Ellipsoid( xSemiAxis,
919  ySemiAxis,
920  zSemiAxis,
921  zBottomCut,
922  zTopCut
923  ));
924 }
925 
926 DDSolid
928  double xHalf, double yHalf, double zHalf,
929  double alpha, double theta, double phi)
930 {
931  return DDSolid(name, new DDI::Parallelepiped(xHalf, yHalf, zHalf,
932  alpha, theta, phi));
933 }
934 
935 DDSolid
937 {
938  return DDSolid(name, new DDI::Shapeless());
939 }
940 
941 DDSolid
943  const DDSolid & s)
944 {
945  return DDSolid(name, new DDI::Reflection(s));
946 }
double zhalf(void) const
Definition: DDSolid.cc:461
Definition: DDBase.h:10
static DDSolid torus(const DDName &name, double rMin, double rMax, double rTorus, double startPhi, double deltaPhi)
Definition: DDSolid.cc:852
double startPhi(void) const
Definition: DDSolid.cc:414
double zhalf(void) const
Definition: DDSolid.cc:677
double cutAtStart(void) const
truncation at begin of the tube-section
Definition: DDSolid.cc:219
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:146
const DDI::rep_traits< N, C >::reference rep() const
Definition: DDBase.h:84
double xHalf(void) const
Definition: DDSolid.cc:650
double xSemiAxis(void) const
Definition: DDSolid.cc:626
float alpha
Definition: AMPTWrapper.h:95
double phi(void) const
Definition: DDSolid.cc:665
double halfZ(void) const
half of the z-Axis
Definition: DDSolid.cc:161
def_type isDefined() const
Definition: DDBase.h:110
bool cutInside(void) const
true, if truncation is on the inner side of the tube-section
Definition: DDSolid.cc:225
double halfZ(void) const
Definition: DDSolid.cc:276
std::vector< double > rVec(void) const
Definition: DDSolid.cc:369
double theta(void) const
Definition: DDSolid.cc:662
double x1(void) const
Half-length along x of the side at y=-pDy1 of the face at -pDz.
Definition: DDSolid.cc:173
const N & name() const
Definition: DDBase.h:78
double zHalf(void) const
half of the z-Axis
Definition: DDSolid.cc:204
const DDTranslation & t() const
Definition: Boolean.h:21
double y2(void) const
half length along y on +z
Definition: DDSolid.cc:249
double halfY(void) const
Definition: DDSolid.cc:272
double startTheta(void) const
Definition: DDSolid.cc:581
std::vector< double > rMaxVec(void) const
Definition: DDSolid.cc:444
double deltaPhi(void) const
angular span of the tube-section
Definition: DDSolid.cc:216
static DDSolid pseudoTrap(const DDName &name, double pDx1, double pDx2, double pDy1, double pDy2, double pDz, double radius, bool atMinusZ)
Definition: DDSolid.cc:808
Definition: Trap.h:9
double deltaPhi(void) const
Definition: DDSolid.cc:578
std::vector< double > rMaxVec(void) const
Definition: DDSolid.cc:393
static DDSolid parallelepiped(const DDName &name, double xHalf, double yHalf, double zHalf, double alpha, double theta, double phi)
Definition: DDSolid.cc:927
Abstract class for DDPolycone and DDPolyhedra. Basically a common member function.
Definition: DDSolid.h:212
double phi(void) const
Azimuthal angle of the line joining the centres of the faces at -/+pDz.
Definition: DDSolid.cc:167
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:334
static DDSolid cons(const DDName &name, double zhalf, double rInMinusZ, double rOutMinusZ, double rInPlusZ, double rOutPlusZ, double phiFrom, double deltaPhi)
Definition: DDSolid.cc:836
std::array< double, 3 > highNorm(void) const
Definition: DDSolid.cc:697
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:714
double rTorus(void) const
Definition: DDSolid.cc:497
DDSolidShape
Definition: DDSolidShapes.h:6
std::vector< double > rVec(void) const
Definition: DDSolid.cc:420
double cutAtDelta(void) const
truncation at end of the tube-section
Definition: DDSolid.cc:222
double phiFrom(void) const
Definition: DDSolid.cc:476
Geom::Theta< T > theta() const
double zTopCut(void) const
Definition: DDSolid.cc:638
const std::string & ns() const
Returns the namespace.
Definition: DDName.cc:104
DDTorus(void)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:16
double radius(void) const
Definition: DDSolid.cc:596
double rIn(void) const
inner radius
Definition: DDSolid.cc:207
const DDSolid & a() const
Definition: Boolean.h:19
double rOutMinusZ(void) const
Definition: DDSolid.cc:467
double rOutPlusZ(void) const
Definition: DDSolid.cc:473
const DDRotation & r() const
Definition: Boolean.h:22
DDTranslation translation(void) const
Definition: DDSolid.cc:542
double ySemiAxis(void) const
Definition: DDSolid.cc:629
double innerRadius(void) const
Definition: DDSolid.cc:569
Definition: Tubs.h:9
A DDSolid represents the shape of a part.
Definition: DDSolid.h:37
DDPseudoTrap(void)
double y1(void) const
half length along y on -z
Definition: DDSolid.cc:246
DDSolid solidB(void) const
Definition: DDSolid.cc:554
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
double rMax(void) const
Definition: DDSolid.cc:494
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:64
DDTubs(void)
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:872
std::array< double, 3 > lowNorm(void) const
Definition: DDSolid.cc:692
void setParameters(std::vector< double > const &p)
Definition: Solid.h:28
static value_type & instance()
Definition: Orb.h:13
double outerRadius(void) const
Definition: DDSolid.cc:572
DDUnion(void)
static const char *const name(DDSolidShape s)
Definition: DDSolidShapes.h:22
DDSolid unreflected(void) const
Definition: DDSolid.cc:287
double x4(void) const
Half-length along x of the side at y=+pDy2 of the face at +pDz.
Definition: DDSolid.cc:188
static size_t size()
Definition: DDBase.h:69
DDI::BooleanSolid * boolean_
Definition: DDSolid.h:208
static DDSolid intersection(const DDName &name, const DDSolid &a, const DDSolid &b, const DDTranslation &t, const DDRotation &r)
Definition: DDSolid.cc:785
DDRotation rotation(void) const
Definition: DDSolid.cc:536
std::ostream & operator<<(std::ostream &os, const DDSolid &solid)
Definition: DDSolid.cc:34
double yHalf(void) const
Definition: DDSolid.cc:653
bool atMinusZ(void) const
true, if cut-out or rounding is on the -z side
Definition: DDSolid.cc:255
double halfZ(void) const
half of the z-Axis
Definition: DDSolid.cc:237
std::vector< double > rMinVec(void) const
Definition: DDSolid.cc:385
double startPhi(void) const
Definition: DDSolid.cc:524
double startPhi(void) const
Definition: DDSolid.cc:364
double xSemiAxis(void) const
Definition: DDSolid.cc:608
static DDSolid sphere(const DDName &name, double innerRadius, double outerRadius, double startPhi, double deltaPhi, double startTheta, double deltaTheta)
Definition: DDSolid.cc:883
static DDSolid orb(const DDName &name, double radius)
Definition: DDSolid.cc:897
const DDSolid & b() const
Definition: Boolean.h:20
DDI::Reflection * reflected_
Definition: DDSolid.h:194
double deltaPhi(void) const
Definition: DDSolid.cc:367
static DDSolid ellipsoid(const DDName &name, double xSemiAxis, double ySemiAxis, double zSemiAxis, double zBottomCut=0., double zTopCut=0.)
Definition: DDSolid.cc:910
double startPhi(void) const
Definition: DDSolid.cc:575
double alpha(void) const
Definition: DDSolid.cc:659
double y1(void) const
Half-length along y of the face at -pDz.
Definition: DDSolid.cc:170
double rInMinusZ(void) const
Definition: DDSolid.cc:464
DDSolidShape shape(void) const
The type of the solid.
Definition: DDSolid.cc:140
double rOut(void) const
Definition: DDSolid.cc:683
double deltaTheta(void) const
Definition: DDSolid.cc:584
static DDSolid tubs(const DDName &name, double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
Definition: DDSolid.cc:863
double ySemiAxis(void) const
Definition: DDSolid.cc:611
DDPolySolid(void)
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:822
DDTrap(void)
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:794
double rMin(void) const
Definition: DDSolid.cc:491
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:705
std::vector< double > rMinVec(void) const
Definition: DDSolid.cc:436
double rOut(void) const
Definition: DDSolid.cc:521
double deltaPhi(void) const
Definition: DDSolid.cc:689
DDPolycone(void)
DDOrb(void)
DDCutTubs(void)
int sides(void) const
Definition: DDSolid.cc:411
DDSolid solidA(void) const
Definition: DDSolid.cc:548
double deltaPhi(void) const
Definition: DDSolid.cc:479
DDTruncTubs(void)
double deltaPhi(void) const
Definition: DDSolid.cc:527
double startPhi(void) const
Definition: DDSolid.cc:500
double halfX(void) const
Definition: DDSolid.cc:268
DDPolyhedra(void)
static DDSolid ellipticalTube(const DDName &name, double xSemiAxis, double ySemiAxis, double zHeight)
Definition: DDSolid.cc:903
std::vector< double > zVec(void) const
Definition: DDSolid.cc:428
double deltaPhi(void) const
Definition: DDSolid.cc:503
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:755
DDIntersection(void)
static DDSolid subtraction(const DDName &name, const DDSolid &a, const DDSolid &b, const DDTranslation &t, const DDRotation &r)
Definition: DDSolid.cc:776
double b
Definition: hdecay.h:120
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:179
DDSphere(void)
DDSubtraction(void)
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:191
DDBooleanSolid(void)
double startPhi(void) const
angular start of the tube-section
Definition: DDSolid.cc:213
double zBottomCut(void) const
Definition: DDSolid.cc:635
Definition: Cons.h:9
double x2(void) const
Half-length along x of the side at y=+pDy1 of the face at -pDz.
Definition: DDSolid.cc:176
double zhalf(void) const
Definition: DDSolid.cc:515
static DDSolid reflection(const DDName &name, const DDSolid &s)
Definition: DDSolid.cc:942
static DDSolid shapeless(const DDName &name)
Definition: DDSolid.cc:936
DDBox(void)
DDEllipsoid(void)
double zHeight(void) const
Definition: DDSolid.cc:614
double a
Definition: hdecay.h:121
double zSemiAxis(void) const
Definition: DDSolid.cc:632
double deltaPhi(void) const
Definition: DDSolid.cc:417
double y2(void) const
Half-length along y of the face at +pDz.
Definition: DDSolid.cc:182
double rInPlusZ(void) const
Definition: DDSolid.cc:470
Definition: Box.h:13
DDSolid(void)
Uninitialilzed solid reference-object; for further details on reference-objects see documentation of ...
Definition: DDSolid.cc:53
def which(cmd)
Definition: eostools.py:335
double zHalf(void) const
Definition: DDSolid.cc:656
static DDSolid unionSolid(const DDName &name, const DDSolid &a, const DDSolid &b, const DDTranslation &t, const DDRotation &r)
Definition: DDSolid.cc:767
double x2(void) const
half length along x on +z
Definition: DDSolid.cc:243
const DDSolid & solid() const
Definition: Reflection.h:16
double rIn(void) const
Definition: DDSolid.cc:680
double rIn(void) const
Definition: DDSolid.cc:518
double rOut(void) const
outer radius
Definition: DDSolid.cc:210
double theta(void) const
Polar angle of the line joining the centres of the faces at -/+pDz.
Definition: DDSolid.cc:164
const std::string & name() const
Returns the name.
Definition: DDName.cc:90
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:732
double x3(void) const
Half-length along x of the side at y=-pDy2 of the face at +pDz.
Definition: DDSolid.cc:185
double volume(void) const
Returns the volume of the given solid (does not work with boolean soids !)
Definition: DDSolid.cc:134
std::vector< double > zVec(void) const
Definition: DDSolid.cc:377
double x1(void) const
half length along x on -z
Definition: DDSolid.cc:240
DDCons(void)
double startPhi(void) const
Definition: DDSolid.cc:686
double radius(void) const
radius of the cut-out (neg.) or rounding (pos.)
Definition: DDSolid.cc:252