DD4hep - The AIDA detector description toolkit for high energy physics experiments
DD4hep  Rev:Unversioneddirectory
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Shapes.h
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation for LCD
3 //--------------------------------------------------------------------------
4 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5 // All rights reserved.
6 //
7 // For the licensing terms see $DD4hepINSTALL/LICENSE.
8 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9 //
10 // Author : M.Frank
11 //
12 //==========================================================================
13 
14 #ifndef DD4HEP_GEOMETRY_SOLIDS_H
15 #define DD4HEP_GEOMETRY_SOLIDS_H
16 
17 // Framework include files
18 #include "DD4hep/Handle.h"
19 #include "DD4hep/Objects.h"
20 
21 // C/C++ include files
22 #include <vector>
23 
24 
25 #ifdef __GNUC__
26 #pragma GCC diagnostic push
27 #pragma GCC diagnostic ignored "-Wdeprecated" // Code that causes warning goes here
28 #endif
29 // ROOT include files
30 #include "TGeoCone.h"
31 #include "TGeoParaboloid.h"
32 #include "TGeoPgon.h"
33 #include "TGeoPcon.h"
34 #include "TGeoSphere.h"
35 #include "TGeoArb8.h"
36 #include "TGeoTrd2.h"
37 #include "TGeoTube.h"
38 #include "TGeoEltu.h"
39 #include "TGeoHype.h"
40 #include "TGeoTorus.h"
41 #include "TGeoHalfSpace.h"
42 #include "TGeoCompositeShape.h"
43 #ifdef __GNUC__
44 #pragma GCC diagnostic pop
45 #endif
46 
48 namespace DD4hep {
49 
51  namespace Geometry {
52 
53  // Forward declarations
54 
56  std::string toStringSolid(const TGeoShape* shape, int precision=2);
57 
59 
69  template <typename T> class Solid_type: public Handle<T> {
70  protected:
71  typedef T Implementation;
72  void _setDimensions(double* param);
74  void _assign(T* n, const std::string& nam, const std::string& tit, bool cbbox);
75 
76  public:
77 
79  Solid_type() = default;
81  Solid_type(const Solid_type& e) = default;
83  Solid_type(T* p) : Handle<T>(p) { }
85  Solid_type(const Handle<T>& e) : Handle<T>(e) { }
87  template <typename Q> Solid_type(const Handle<Q>& e) : Handle<T>(e) { }
89  Solid_type& operator=(const Solid_type& copy) = default;
90 
92  const char* name() const;
94  const char* type() const;
96  operator T*() const {
97  return this->m_element;
98  }
100  T* operator->() const {
101  return this->m_element;
102  }
104  std::string toString(int precision=2) const {
105  return toStringSolid(this->m_element,precision);
106  }
107  };
109 
111 
120  class Box: public Solid_type<TGeoBBox> {
121  protected:
123  void make(double x_val, double y_val, double z_val);
124 
125  public:
127  Box() = default;
129  Box(const Box& e) = default;
131  template <typename Q> Box(const Q* p) : Solid_type<TGeoBBox>(p) { }
133  template <typename Q> Box(const Handle<Q>& e) : Solid_type<TGeoBBox>(e) { }
135  Box(double x_val, double y_val, double z_val) { make(x_val, y_val, z_val); }
137  template <typename X, typename Y, typename Z>
138  Box(const X& x_val, const Y& y_val, const Z& z_val) {
139  make(_toDouble(x_val), _toDouble(y_val), _toDouble(z_val));
140  }
142  Box& operator=(const Box& copy) = default;
144  Box& setDimensions(double x_val, double y_val, double z_val);
146  double x() const;
148  double y() const;
150  double z() const;
151  };
152 
154 
163  class HalfSpace: public Solid_type<TGeoHalfSpace> {
164  protected:
166  void make(const double* const point, const double* const normal);
167 
168  public:
170  HalfSpace() = default;
172  HalfSpace(const HalfSpace& e) = default;
174  template <typename Q> HalfSpace(const Q* p) : Solid_type<TGeoHalfSpace>(p) { }
176  template <typename Q> HalfSpace(const Handle<Q>& e) : Solid_type<TGeoHalfSpace>(e) { }
178  HalfSpace(const double* const point, const double* const normal) { make(point,normal); }
180  HalfSpace& operator=(const HalfSpace& copy) = default;
181  };
182 
184 
201  class Polycone: public Solid_type<TGeoPcon> {
202  public:
204  Polycone() = default;
206  Polycone(const Polycone& e) = default;
208  template <typename Q> Polycone(const Q* p) : Solid_type<TGeoPcon>(p) { }
210  template <typename Q> Polycone(const Handle<Q>& e) : Solid_type<TGeoPcon>(e) { }
212  Polycone(double start, double delta);
213 
215  Polycone(double start, double delta, const std::vector<double>& rmin, const std::vector<double>& rmax,
216  const std::vector<double>& z);
218  Polycone& operator=(const Polycone& copy) = default;
219 
221  void addZPlanes(const std::vector<double>& rmin, const std::vector<double>& rmax, const std::vector<double>& z);
222  };
223 
225 
236  class ConeSegment: public Solid_type<TGeoConeSeg> {
237  public:
239  ConeSegment() = default;
241  ConeSegment(const ConeSegment& e) = default;
243  template <typename Q> ConeSegment(const Q* p) : Solid_type<TGeoConeSeg>(p) { }
245  template <typename Q> ConeSegment(const Handle<Q>& e) : Solid_type<TGeoConeSeg>(e) { }
247  ConeSegment(double dz, double rmin1, double rmax1, double rmin2, double rmax2, double phi1 = 0.0, double phi2 = 2.0 * M_PI);
249  ConeSegment& operator=(const ConeSegment& copy) = default;
250 
252  ConeSegment& setDimensions(double dz, double rmin1, double rmax1,
253  double rmin2, double rmax2, double phi1 = 0.0, double phi2 = 2.0 * M_PI);
254  };
255 
257  class MyConeSeg: public TGeoConeSeg {
258  public:
260  virtual ~MyConeSeg() { }
261  double GetRmin() const { return GetRmin1(); }
262  double GetRmax() const { return GetRmax1(); }
263  };
264 
266 
277  class Tube: public Solid_type< /*TGeoTubeSeg */MyConeSeg> {
278  protected:
280  void make(const std::string& nam, double rmin, double rmax, double z, double startPhi, double deltaPhi);
281 
282  public:
284  Tube() = default;
286  Tube(const Tube& e) = default;
288  template <typename Q> Tube(const Q* p) : Solid_type<MyConeSeg>(p) { }
290  template <typename Q> Tube(const Handle<Q>& e) : Solid_type<MyConeSeg>(e) { }
292  Tube(double rmin, double rmax, double z)
293  { make("", rmin, rmax, z, 0, 2*M_PI); }
295  Tube(double rmin, double rmax, double z, double deltaPhi)
296  { make("", rmin, rmax, z, 0, deltaPhi); }
298  Tube(double rmin, double rmax, double z, double startPhi, double deltaPhi)
299  { make("", rmin, rmax, z, startPhi, deltaPhi); }
301  Tube(const std::string& nam, double rmin, double rmax, double z)
302  { make(nam, rmin, rmax, z, 0, 2*M_PI); }
304  Tube(const std::string& nam, double rmin, double rmax, double z, double deltaPhi)
305  { make(nam, rmin, rmax, z, 0, deltaPhi); }
307  template <typename RMIN, typename RMAX, typename Z, typename DELTAPHI>
308  Tube(const RMIN& rmin, const RMAX& rmax, const Z& z, const DELTAPHI& deltaPhi)
309  { make("", _toDouble(rmin), _toDouble(rmax), _toDouble(z), 0, _toDouble(deltaPhi)); }
311  Tube& operator=(const Tube& copy) = default;
313  Tube& setDimensions(double rmin, double rmax, double z, double startPhi=0.0, double deltaPhi=2*M_PI);
314  };
315 
317 
328  class EllipticalTube: public Solid_type<TGeoEltu> {
329  protected:
331  void make(double a, double b, double dz);
332 
333  public:
335  EllipticalTube() = default;
337  EllipticalTube(const EllipticalTube& e) = default;
339  template <typename Q> EllipticalTube(const Q* p) : Solid_type<TGeoEltu>(p) { }
341  template <typename Q> EllipticalTube(const Handle<Q>& e) : Solid_type<TGeoEltu>(e) { }
343  EllipticalTube(double a, double b, double dz) { make(a, b, dz); }
345  template <typename A, typename B, typename DZ>
346  EllipticalTube(const A& a, const B& b, const DZ& dz)
347  { make(_toDouble(a), _toDouble(b), _toDouble(dz)); }
349  EllipticalTube& operator=(const EllipticalTube& copy) = default;
351  EllipticalTube& setDimensions(double a, double b, double dz);
352  };
353 
355 
363  class Cone: public Solid_type<TGeoCone> {
364  protected:
366  void make(double z, double rmin1, double rmax1, double rmin2, double rmax2);
367  public:
369  Cone() = default;
371  Cone(const Cone& e) = default;
373  template <typename Q> Cone(const Q* p) : Solid_type<TGeoCone>(p) { }
375  template <typename Q> Cone(const Handle<Q>& e) : Solid_type<TGeoCone>(e) { }
377  Cone(double z, double rmin1, double rmax1, double rmin2, double rmax2)
378  { make(z, rmin1, rmax1, rmin2, rmax2); }
379  template <typename Z, typename RMIN1, typename RMAX1, typename RMIN2, typename RMAX2>
380  Cone(const Z& z, const RMIN1& rmin1, const RMAX1& rmax1, const RMIN2& rmin2, const RMAX2& rmax2)
381  { make(_toDouble(z), _toDouble(rmin1), _toDouble(rmax1), _toDouble(rmin2), _toDouble(rmax2)); }
383  Cone& operator=(const Cone& copy) = default;
385  Cone& setDimensions(double z, double rmin1, double rmax1, double rmin2, double rmax2);
386  };
387 
389 
397  class Trap: public Solid_type<TGeoTrap> {
398  private:
400  void make(double pz, double py, double px, double pLTX);
401  public:
403  Trap() = default;
405  Trap(const Trap& e) = default;
407  template <typename Q> Trap(const Q* p) : Solid_type<TGeoTrap>(p) { }
409  template <typename Q> Trap(const Handle<Q>& e) : Solid_type<TGeoTrap>(e) { }
411  Trap(double z, double theta, double phi,
412  double y1, double x1, double x2, double alpha1,
413  double y2, double x3, double x4, double alpha2);
415  Trap(double pz, double py, double px, double pLTX) { make(pz,py,px,pLTX); }
417  template <typename PZ,typename PY,typename PX,typename PLTX> Trap(PZ pz, PY py, PX px, PLTX pLTX)
418  { make(_toDouble(pz),_toDouble(py),_toDouble(px),_toDouble(pLTX)); }
420  Trap& operator=(const Trap& copy) = default;
422  Trap& setDimensions(double z, double theta, double phi,
423  double y1, double x1, double x2, double alpha1,
424  double y2, double x3, double x4, double alpha2);
425  };
426 
428 
437  class Trapezoid: public Solid_type<TGeoTrd2> {
438  private:
440  void make(double x1, double x2, double y1, double y2, double z);
441 
442  public:
444  Trapezoid() = default;
446  Trapezoid(const Trapezoid& e) = default;
448  template <typename Q> Trapezoid(const Q* p) : Solid_type<TGeoTrd2>(p) { }
450  template <typename Q> Trapezoid(const Handle<Q>& e) : Solid_type<TGeoTrd2>(e) { }
452  Trapezoid(double x1, double x2, double y1, double y2, double z);
454  template <typename X1,typename X2,typename Y1,typename Y2,typename Z>
455  Trapezoid(X1 x1, X2 x2, Y1 y1, Y2 y2, Z z)
456  { make(_toDouble(x1),_toDouble(x2),_toDouble(y1),_toDouble(y2),_toDouble(z)); }
458  Trapezoid& operator=(const Trapezoid& copy) = default;
460  Trapezoid& setDimensions(double x1, double x2, double y1, double y2, double z);
461  };
462 
464 
472  class Torus: public Solid_type<TGeoTorus> {
473  private:
475  void make(double r, double rmin, double rmax, double phi, double delta_phi);
476  public:
478  Torus() = default;
480  Torus(const Torus& e) = default;
482  template <typename Q> Torus(const Q* p) : Solid_type<TGeoTorus>(p) { }
484  template <typename Q> Torus(const Handle<Q>& e) : Solid_type<TGeoTorus>(e) { }
486  template<typename R, typename RMIN, typename RMAX, typename PHI, typename DELTA_PHI>
487  Torus(R r, RMIN rmin, RMAX rmax, PHI phi=M_PI, DELTA_PHI delta_phi = 2.*M_PI)
488  { make(_toDouble(r),_toDouble(rmin),_toDouble(rmax),_toDouble(phi),_toDouble(delta_phi)); }
490  Torus(double r, double rmin, double rmax, double phi=M_PI, double delta_phi = 2.*M_PI)
491  { make(r,rmin,rmax,phi,delta_phi); }
493  Torus& operator=(const Torus& copy) = default;
495  Torus& setDimensions(double r, double rmin, double rmax, double phi, double delta_phi);
496  };
497 
499 
508  class Sphere: public Solid_type<TGeoSphere> {
509  public:
511  Sphere() = default;
513  Sphere(const Sphere& e) = default;
515  template <typename Q> Sphere(const Q* p) : Solid_type<TGeoSphere>(p) { }
517  template <typename Q> Sphere(const Handle<Q>& e) : Solid_type<TGeoSphere>(e) { }
519  Sphere(double rmin, double rmax, double theta = 0., double delta_theta = M_PI, double phi = 0.0, double delta_phi = 2. * M_PI);
521  Sphere& operator=(const Sphere& copy) = default;
523  Sphere& setDimensions(double rmin, double rmax, double theta, double delta_theta, double phi, double delta_phi);
524  };
525 
527 
536  class Paraboloid: public Solid_type<TGeoParaboloid> {
537  public:
539  Paraboloid() = default;
541  Paraboloid(const Paraboloid& e) = default;
543  template <typename Q> Paraboloid(const Q* p) : Solid_type<TGeoParaboloid>(p) { }
545  template <typename Q> Paraboloid(const Handle<Q>& e) : Solid_type<TGeoParaboloid>(e) { }
547  Paraboloid(double r_low, double r_high, double delta_z);
549  Paraboloid& operator=(const Paraboloid& copy) = default;
551  Paraboloid& setDimensions(double r_low, double r_high, double delta_z);
552  };
553 
555 
564  class Hyperboloid: public Solid_type<TGeoHype> {
565  public:
567  Hyperboloid() = default;
569  Hyperboloid(const Hyperboloid& e) = default;
571  template <typename Q> Hyperboloid(const Q* p) : Solid_type<TGeoHype>(p) { }
573  template <typename Q> Hyperboloid(const Handle<Q>& e) : Solid_type<TGeoHype>(e) { }
575  Hyperboloid(double rin, double stin, double rout, double stout, double dz);
577  Hyperboloid& operator=(const Hyperboloid& copy) = default;
579  Hyperboloid& setDimensions(double rin, double stin, double rout, double stout, double dz);
580  };
581 
583 
591  class PolyhedraRegular: public Solid_type<TGeoPgon> {
592  protected:
594  void _create(int nsides, double rmin, double rmax, double zpos, double zneg, double start, double delta);
595  public:
597  PolyhedraRegular() = default;
599  PolyhedraRegular(const PolyhedraRegular& e) = default;
601  template <typename Q> PolyhedraRegular(const Q* p) : Solid_type<TGeoPgon>(p) { }
603  template <typename Q> PolyhedraRegular(const Handle<Q>& e) : Solid_type<TGeoPgon>(e) { }
605  PolyhedraRegular(int nsides, double rmin, double rmax, double zlen);
607  PolyhedraRegular(int nsides, double rmin, double rmax, double zplanes[2]);
609  PolyhedraRegular(int nsides, double phi_start, double rmin, double rmax, double zlen);
611  PolyhedraRegular& operator=(const PolyhedraRegular& copy) = default;
612  };
613 
615 
623  class EightPointSolid: public Solid_type<TGeoArb8> {
624  private:
626  void make(double dz, const double* vtx);
627  public:
629  EightPointSolid() = default;
631  EightPointSolid(const EightPointSolid& e) = default;
633  template <typename Q> EightPointSolid(const Q* p) : Solid_type<TGeoArb8>(p) { }
635  template <typename Q> EightPointSolid(const Handle<Q>& e) : Solid_type<TGeoArb8>(e) {}
637  EightPointSolid(double dz, const double* vertices) { make(dz,vertices); }
639  EightPointSolid& operator=(const EightPointSolid& copy) = default;
640  };
641 
643 
651  class BooleanSolid: public Solid_type<TGeoCompositeShape> {
652  protected:
654  BooleanSolid() = default;
656  BooleanSolid(const BooleanSolid& b) = default;
657 
658  public:
660  template <typename Q>
661  BooleanSolid(const Handle<Q>& e) : Solid_type<TGeoCompositeShape>(e) { }
663  BooleanSolid& operator=(const BooleanSolid& copy) = default;
664  };
665 
667 
677  public:
679  SubtractionSolid() = default;
681  SubtractionSolid(const SubtractionSolid& e) = default;
683  template <typename Q> SubtractionSolid(const Handle<Q>& e) : BooleanSolid(e) { }
685  SubtractionSolid(const Solid& shape1, const Solid& shape2);
687  SubtractionSolid(const Solid& shape1, const Solid& shape2, const Position& pos);
689  SubtractionSolid(const Solid& shape1, const Solid& shape2, const RotationZYX& rot);
691  SubtractionSolid(const Solid& shape1, const Solid& shape2, const Rotation3D& rot);
693  SubtractionSolid(const Solid& shape1, const Solid& shape2, const Transform3D& pos);
695  SubtractionSolid& operator=(const SubtractionSolid& copy) = default;
696  };
697 
699 
708  class UnionSolid: public BooleanSolid {
709  public:
711  UnionSolid() = default;
713  UnionSolid(const UnionSolid& e) = default;
715  template <typename Q> UnionSolid(const Handle<Q>& e) : BooleanSolid(e) { }
717  UnionSolid(const Solid& shape1, const Solid& shape2);
719  UnionSolid(const Solid& shape1, const Solid& shape2, const Position& pos);
721  UnionSolid(const Solid& shape1, const Solid& shape2, const RotationZYX& rot);
723  UnionSolid(const Solid& shape1, const Solid& shape2, const Rotation3D& rot);
725  UnionSolid(const Solid& shape1, const Solid& shape2, const Transform3D& pos);
727  UnionSolid& operator=(const UnionSolid& copy) = default;
728  };
729 
731 
741  public:
743  IntersectionSolid() = default;
745  IntersectionSolid(const IntersectionSolid& e) = default;
747  template <typename Q> IntersectionSolid(const Handle<Q>& e) : BooleanSolid(e) { }
749  IntersectionSolid(const Solid& shape1, const Solid& shape2);
751  IntersectionSolid(const Solid& shape1, const Solid& shape2, const Position& pos);
753  IntersectionSolid(const Solid& shape1, const Solid& shape2, const RotationZYX& rot);
755  IntersectionSolid(const Solid& shape1, const Solid& shape2, const Rotation3D& rot);
757  IntersectionSolid(const Solid& shape1, const Solid& shape2, const Transform3D& pos);
760  };
761 
762  } /* End namespace Geometry */
763 } /* End namespace DD4hep */
764 #endif /* DD4HEP_GEOMETRY_SOLIDS_H */
Paraboloid & setDimensions(double r_low, double r_high, double delta_z)
Set the Paraboloid dimensions.
Definition: Shapes.cpp:341
Trap(double pz, double py, double px, double pLTX)
Constructor to create a new anonymous object for right angular wedge from STEP (Se G4 manual for deta...
Definition: Shapes.h:415
Class of the ROOT toolkit. See http://root.cern.ch/root/htmldoc/ClassIndex.html.
Definition: ROOTClasses.h:14
EllipticalTube(const Q *p)
Constructor to be used with an existing object.
Definition: Shapes.h:339
Tube(const std::string &nam, double rmin, double rmax, double z)
Legacy: Constructor to create a new identifiable tube object with attribute initialization.
Definition: Shapes.h:301
ConeSegment(const Handle< Q > &e)
Constructor to be used when reading the already parsed ConeSegment object.
Definition: Shapes.h:245
double z() const
Access half "depth" of the box.
Definition: Shapes.cpp:205
void make(double x_val, double y_val, double z_val)
Internal helper method to support object construction.
Definition: Shapes.cpp:183
Sphere(const Q *p)
Constructor to be used with an existing object.
Definition: Shapes.h:515
Polycone(const Handle< Q > &e)
Constructor to be used when reading the already parsed polycone object.
Definition: Shapes.h:210
EightPointSolid & operator=(const EightPointSolid &copy)=default
Assignment operator.
ConeSegment & setDimensions(double dz, double rmin1, double rmax1, double rmin2, double rmax2, double phi1=0.0, double phi2=2.0 *M_PI)
Set the cone segment dimensions.
Definition: Shapes.cpp:270
IntersectionSolid(const Handle< Q > &e)
Constructor to be used when passing an already created object.
Definition: Shapes.h:747
Torus(double r, double rmin, double rmax, double phi=M_PI, double delta_phi=2.*M_PI)
Constructor to create a new anonymous object with attribute initialization.
Definition: Shapes.h:490
Torus(const Handle< Q > &e)
Constructor to be used when passing an already created object.
Definition: Shapes.h:484
EllipticalTube(double a, double b, double dz)
Constructor to create a new anonymous tube object with attribute initialization.
Definition: Shapes.h:343
Class describing a Torus shape.
Definition: Shapes.h:472
Class describing a Hyperboloid shape.
Definition: Shapes.h:564
void make(double z, double rmin1, double rmax1, double rmin2, double rmax2)
Internal helper method to support object construction.
Definition: Shapes.cpp:308
Paraboloid()=default
Default constructor.
Hyperboloid & operator=(const Hyperboloid &copy)=default
Assignment operator.
#define M_PI
Definition: Handle.h:39
void make(double r, double rmin, double rmax, double phi, double delta_phi)
Internal helper method to support object construction.
Definition: Shapes.cpp:372
ConeSegment & operator=(const ConeSegment &copy)=default
Assignment operator.
Torus & setDimensions(double r, double rmin, double rmax, double phi, double delta_phi)
Set the Torus dimensions.
Definition: Shapes.cpp:377
Solid_type(T *p)
Direct assignment using the implementation pointer.
Definition: Shapes.h:83
IntersectionSolid & operator=(const IntersectionSolid &copy)=default
Assignment operator.
Tube & setDimensions(double rmin, double rmax, double z, double startPhi=0.0, double deltaPhi=2 *M_PI)
Set the tube dimensions.
Definition: Shapes.cpp:287
SubtractionSolid & operator=(const SubtractionSolid &copy)=default
Assignment operator.
Box & operator=(const Box &copy)=default
Assignment operator.
Box(const Handle< Q > &e)
Constructor to be used with an existing object.
Definition: Shapes.h:133
Class describing a cone segment shape.
Definition: Shapes.h:236
Class describing boolean subtraction solid.
Definition: Shapes.h:676
EllipticalTube & operator=(const EllipticalTube &copy)=default
Assignment operator.
Tube(double rmin, double rmax, double z, double startPhi, double deltaPhi)
Constructor to create a new anonymous tube object with attribute initialization.
Definition: Shapes.h:298
Trapezoid(const Handle< Q > &e)
Constructor to be used when passing an already created object.
Definition: Shapes.h:450
EllipticalTube(const A &a, const B &b, const DZ &dz)
Constructor to create a new anonymous tube object with attribute initialization.
Definition: Shapes.h:346
Class describing a elliptical tube shape of a section of a tube.
Definition: Shapes.h:328
void _setDimensions(double *param)
Definition: Shapes.cpp:157
IntersectionSolid()=default
Default constructor.
Hyperboloid()=default
Default constructor.
void _assign(T *n, const std::string &nam, const std::string &tit, bool cbbox)
Assign pointrs and register solid to geometry.
Definition: Shapes.cpp:164
HalfSpace()=default
Default constructor.
Trap(const Q *p)
Constructor to be used with an existing object.
Definition: Shapes.h:407
Class describing half-space.
Definition: Shapes.h:163
Trap(const Handle< Q > &e)
Constructor to be used when passing an already created object.
Definition: Shapes.h:409
void make(double x1, double x2, double y1, double y2, double z)
Internal helper method to support object construction.
Definition: Shapes.cpp:324
Torus()=default
Default constructor.
BooleanSolid & operator=(const BooleanSolid &copy)=default
Assignment operator.
SubtractionSolid()=default
Default constructor.
EightPointSolid(const Handle< Q > &e)
Constructor to be used when passing an already created object.
Definition: Shapes.h:635
void copy(Alignment from, Alignment to)
Copy alignment object from source object.
Class describing a regular polyhedron shape.
Definition: Shapes.h:591
void make(double a, double b, double dz)
Internal helper method to support object construction.
Definition: Shapes.cpp:295
Class describing a box shape.
Definition: Shapes.h:120
return e
Definition: Volumes.cpp:297
PolyhedraRegular(const Handle< Q > &e)
Constructor to be used when passing an already created object.
Definition: Shapes.h:603
Trap & operator=(const Trap &copy)=default
Assignment operator.
Class describing a trap shape.
Definition: Shapes.h:397
Trapezoid & operator=(const Trapezoid &copy)=default
Assignment operator.
EightPointSolid()=default
Default constructor.
BooleanSolid(const Handle< Q > &e)
Constructor to be used when passing an already created object.
Definition: Shapes.h:661
UnionSolid()=default
Default constructor.
Polycone & operator=(const Polycone &copy)=default
Assignment operator.
Cone(const Z &z, const RMIN1 &rmin1, const RMAX1 &rmax1, const RMIN2 &rmin2, const RMAX2 &rmax2)
Definition: Shapes.h:380
Cone(double z, double rmin1, double rmax1, double rmin2, double rmax2)
Constructor to create a new anonymous object with attribute initialization.
Definition: Shapes.h:377
Hyperboloid & setDimensions(double rin, double stin, double rout, double stout, double dz)
Set the Hyperboloid dimensions.
Definition: Shapes.cpp:353
PolyhedraRegular(const Q *p)
Constructor to be used with an existing object.
Definition: Shapes.h:601
Polycone(const Q *p)
Constructor to be used with an existing object.
Definition: Shapes.h:208
void make(double pz, double py, double px, double pLTX)
Internal helper method to support object construction.
Definition: Shapes.cpp:390
Cone & operator=(const Cone &copy)=default
Assignment operator.
Class describing an arbitray solid defined by 8 vertices.
Definition: Shapes.h:623
void make(const double *const point, const double *const normal)
Internal helper method to support object construction.
Definition: Shapes.cpp:210
Trapezoid & setDimensions(double x1, double x2, double y1, double y2, double z)
Set the Trapezoid dimensions.
Definition: Shapes.cpp:329
Box & setDimensions(double x_val, double y_val, double z_val)
Set the box dimensions.
Definition: Shapes.cpp:188
void make(double dz, const double *vtx)
Internal helper method to support object construction.
Definition: Shapes.cpp:436
std::string toString(int precision=2) const
Conversion to string for pretty print.
Definition: Shapes.h:104
ROOT::Math::RotationZYX RotationZYX
Definition: Objects.h:98
Paraboloid(const Handle< Q > &e)
Constructor to be used when passing an already created object.
Definition: Shapes.h:545
void _create(int nsides, double rmin, double rmax, double zpos, double zneg, double start, double delta)
Helper function to create the polyhedron.
Definition: Shapes.cpp:410
Base class describing boolean (=union,intersection,subtraction) solids.
Definition: Shapes.h:651
Trap & setDimensions(double z, double theta, double phi, double y1, double x1, double x2, double alpha1, double y2, double x3, double x4, double alpha2)
Set the trap dimensions.
Definition: Shapes.cpp:402
Cone(const Handle< Q > &e)
Constructor to be used when passing an already created object.
Definition: Shapes.h:375
Paraboloid & operator=(const Paraboloid &copy)=default
Assignment operator.
HalfSpace(const double *const point, const double *const normal)
Constructor to create an new halfspace object from a point on a plane and the plane normal...
Definition: Shapes.h:178
ROOT::Math::Rotation3D Rotation3D
Definition: Objects.h:106
Tube & operator=(const Tube &copy)=default
Assignment operator.
Solid_type & operator=(const Solid_type &copy)=default
Assignment operator.
Class describing a Paraboloid shape.
Definition: Shapes.h:536
Box(const X &x_val, const Y &y_val, const Z &z_val)
Constructor to create an anonymous new box object (retrieves name from volume)
Definition: Shapes.h:138
Trapezoid()=default
Default constructor.
HalfSpace & operator=(const HalfSpace &copy)=default
Assignment operator.
Base class for Solid (shape) objects.
Definition: Shapes.h:69
Tube()=default
Default constructor.
const char * name() const
Access to shape name.
Definition: Shapes.cpp:171
void addZPlanes(const std::vector< double > &rmin, const std::vector< double > &rmax, const std::vector< double > &z)
Add Z-planes to the Polycone.
Definition: Shapes.cpp:238
Cone & setDimensions(double z, double rmin1, double rmax1, double rmin2, double rmax2)
Set the box dimensions.
Definition: Shapes.cpp:312
Tube(double rmin, double rmax, double z, double deltaPhi)
Constructor to create a new anonymous tube object with attribute initialization.
Definition: Shapes.h:295
UnionSolid & operator=(const UnionSolid &copy)=default
Assignment operator.
HalfSpace(const Q *p)
Constructor to be used with an existing object.
Definition: Shapes.h:174
PolyhedraRegular & operator=(const PolyhedraRegular &copy)=default
Assignment operator.
UnionSolid(const Handle< Q > &e)
Constructor to be used when passing an already created object.
Definition: Shapes.h:715
Sphere & operator=(const Sphere &copy)=default
Assignment operator.
ROOT::Math::XYZVector Position
Definition: Objects.h:75
Tube(const Q *p)
Constructor to be used with an existing object.
Definition: Shapes.h:288
Solid_type< TGeoShape > Solid
Definition: Shapes.h:108
Intermediate class to overcome drawing probles with the TGeoTubeSeg.
Definition: Shapes.h:257
ConeSegment()=default
Default constructor.
double GetRmin() const
Definition: Shapes.h:261
Class describing boolean intersection solid.
Definition: Shapes.h:740
void make(const std::string &nam, double rmin, double rmax, double z, double startPhi, double deltaPhi)
Internal helper method to support object construction.
Definition: Shapes.cpp:280
Torus(const Q *p)
Constructor to be used with an existing object.
Definition: Shapes.h:482
T * operator->() const
Overloaded operator -> to access underlying object.
Definition: Shapes.h:100
EllipticalTube & setDimensions(double a, double b, double dz)
Set the tube dimensions.
Definition: Shapes.cpp:301
EightPointSolid(double dz, const double *vertices)
Constructor to create a new anonymous object with attribute initialization.
Definition: Shapes.h:637
Box(const Q *p)
Constructor to be used with an existing object.
Definition: Shapes.h:131
Trapezoid(const Q *p)
Constructor to be used with an existing object.
Definition: Shapes.h:448
double x() const
Access half "length" of the box.
Definition: Shapes.cpp:195
Paraboloid(const Q *p)
Constructor to be used with an existing object.
Definition: Shapes.h:543
Class describing boolean union solid.
Definition: Shapes.h:708
ConeSegment(const Q *p)
Constructor to be used with an existing object.
Definition: Shapes.h:243
Torus & operator=(const Torus &copy)=default
Assignment operator.
Solid_type(const Handle< T > &e)
Constructor to be used when passing an already created object.
Definition: Shapes.h:85
Torus(R r, RMIN rmin, RMAX rmax, PHI phi=M_PI, DELTA_PHI delta_phi=2.*M_PI)
Constructor to create a new anonymous object with attribute initialization.
Definition: Shapes.h:487
Tube(double rmin, double rmax, double z)
Constructor to create a new anonymous tube object with attribute initialization.
Definition: Shapes.h:292
Trap()=default
Default constructor.
Hyperboloid(const Handle< Q > &e)
Constructor to be used when passing an already created object.
Definition: Shapes.h:573
double _toDouble(const std::string &value)
String conversions: string to double value.
Definition: Handle.cpp:103
BooleanSolid()=default
Default constructor.
Class describing a sphere shape.
Definition: Shapes.h:508
Class describing a cone shape.
Definition: Shapes.h:363
Handle: a templated class like a shared pointer, which allows specialized access to tgeometry objects...
Definition: Handle.h:87
Solid_type(const Handle< Q > &e)
Constructor to be used when passing an already created object: need to check pointers.
Definition: Shapes.h:87
Box()=default
Default constructor.
Class describing a Polycone shape.
Definition: Shapes.h:201
Polycone()=default
Default constructor.
std::string toStringSolid(const TGeoShape *shape, int precision=2)
Pretty print of solid attributes.
Definition: Shapes.cpp:48
Trapezoid(X1 x1, X2 x2, Y1 y1, Y2 y2, Z z)
Constructor to create a new anonymous object with attribute initialization.
Definition: Shapes.h:455
double GetRmax() const
Definition: Shapes.h:262
Tube(const RMIN &rmin, const RMAX &rmax, const Z &z, const DELTAPHI &deltaPhi)
Constructor to create a new anonymous tube object with attribute initialization.
Definition: Shapes.h:308
HalfSpace(const Handle< Q > &e)
Constructor to be used with an existing object.
Definition: Shapes.h:176
Sphere & setDimensions(double rmin, double rmax, double theta, double delta_theta, double phi, double delta_phi)
Set the Sphere dimensions.
Definition: Shapes.cpp:365
EightPointSolid(const Q *p)
Constructor to be used with an existing object.
Definition: Shapes.h:633
Box(double x_val, double y_val, double z_val)
Constructor to create an anonymous new box object (retrieves name from volume)
Definition: Shapes.h:135
Tube(const Handle< Q > &e)
Constructor to assign an object.
Definition: Shapes.h:290
T * m_element
Single and only data member: Reference to the actual element.
Definition: Handle.h:96
SubtractionSolid(const Handle< Q > &e)
Constructor to be used when passing an already created object.
Definition: Shapes.h:683
double y() const
Access half "width" of the box.
Definition: Shapes.cpp:200
Cone(const Q *p)
Constructor to be used with an existing object.
Definition: Shapes.h:373
Cone()=default
Default constructor.
Sphere()=default
Default constructor.
ROOT::Math::Transform3D Transform3D
Definition: Objects.h:110
Trap(PZ pz, PY py, PX px, PLTX pLTX)
Constructor to create a new anonymous object with attribute initialization.
Definition: Shapes.h:417
PolyhedraRegular()=default
Default constructor.
Class describing a Trapezoid shape.
Definition: Shapes.h:437
Solid_type()=default
Default constructor for uninitialized object.
Hyperboloid(const Q *p)
Constructor to be used with an existing object.
Definition: Shapes.h:571
Tube(const std::string &nam, double rmin, double rmax, double z, double deltaPhi)
Legacy: Constructor to create a new identifiable tube object with attribute initialization.
Definition: Shapes.h:304
EllipticalTube()=default
Default constructor.
const char * type() const
Access to shape type (The TClass name of the ROOT implementation)
Definition: Shapes.cpp:176
Sphere(const Handle< Q > &e)
Constructor to be used when passing an already created object.
Definition: Shapes.h:517
Class describing a tube shape of a section of a tube.
Definition: Shapes.h:277
EllipticalTube(const Handle< Q > &e)
Constructor to assign an object.
Definition: Shapes.h:341