CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Cylinder.h
Go to the documentation of this file.
1 #ifndef Geom_Cylinder_H
2 #define Geom_Cylinder_H
3 
20 
21 class Cylinder GCC11_FINAL : public Surface {
22 public:
23 
24  template<typename... Args>
26  Surface(std::forward<Args>(args)...), theRadius(radius){}
27 
28  Cylinder(const PositionType& pos, const RotationType& rot, SimpleCylinderBounds const & bounds) :
29  Surface(pos,rot, bounds.clone()), theRadius(computeRadius(bounds)){}
30 
31  // average Rmin Rmax...
32  static float computeRadius(Bounds const & bounds) {
33  return 0.5f*(bounds.width() - bounds.thickness());
34  }
35 
36 
41 
42 
46  /*
47  template<typename... Args>
48  static CylinderPointer build(Args&& ... args) {
49  return CylinderPointer(new Cylinder(std::forward<Args>(args)...));
50  }
51  */
52 
54  Scalar radius, Bounds* bounds=0) {
55  return CylinderPointer(new Cylinder(radius,pos,rot,bounds));
56  }
57 
59  Bounds* bounds=0) {
60  return CylinderPointer(new Cylinder(radius,pos,rot,bounds));
61  }
62 
64 
65 
66  // -- Extension of Surface interface for cylinder
67 
69  Scalar radius() const {return theRadius;}
70 
71  // -- Implementation of Surface interface
72 
73  using Surface::side;
74  virtual Side side( const LocalPoint& p, Scalar toler) const;
75 
77  virtual ReferenceCountingPointer<TangentPlane> tangentPlane (const GlobalPoint&) const;
79  virtual ReferenceCountingPointer<TangentPlane> tangentPlane (const LocalPoint&) const;
80 
82  Plane fastTangent(const GlobalPoint& aPoint) const{
83  GlobalVector yPlane(rotation().z());
84  GlobalVector xPlane(yPlane.cross(aPoint-position()));
85  return Plane(aPoint,RotationType(xPlane, yPlane));
86  }
87 
89  Plane fastTangent(const LocalPoint& aPoint) const {
90  return fastTangent(toGlobal(aPoint));
91  }
92 
93 private:
94 
96 
97 };
98 
99 #endif
TkRotation< Scalar > RotationType
Definition: Definitions.h:29
ReferenceCountingPointer< Cylinder > CylinderPointer
Definition: Cylinder.h:37
double Scalar
Definition: Definitions.h:27
GloballyPositioned< float >::GlobalPoint GlobalPoint
Definition: MagVolume.h:20
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, Bounds *bounds=0)
Definition: Cylinder.h:53
Base::Scalar Scalar
Plane fastTangent(const LocalPoint &aPoint) const
tangent plane to surface from local point
Definition: Cylinder.h:89
virtual Side side(const LocalPoint &p, Scalar tolerance=0) const =0
Definition: Plane.h:17
float float float z
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
static float computeRadius(Bounds const &bounds)
Definition: Cylinder.h:32
Scalar radius() const
Radius of the cylinder.
Definition: Cylinder.h:69
Point3DBase< Scalar, GlobalTag > PositionType
Definition: Definitions.h:30
virtual float thickness() const =0
Plane fastTangent(const GlobalPoint &aPoint) const
tangent plane to surface from global point
Definition: Cylinder.h:82
Cylinder(Scalar radius, Args &&...args)
Definition: Cylinder.h:25
Cylinder(const PositionType &pos, const RotationType &rot, SimpleCylinderBounds const &bounds)
Definition: Cylinder.h:28
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
ConstReferenceCountingPointer< Cylinder > ConstBoundCylinderPointer
Definition: Cylinder.h:40
GloballyPositioned< float >::GlobalVector GlobalVector
Definition: MagVolume.h:21
dictionary args
Scalar theRadius
Definition: Cylinder.h:95
Definition: Bounds.h:22
ReferenceCountingPointer< Cylinder > BoundCylinderPointer
Definition: Cylinder.h:39
virtual float width() const =0
static CylinderPointer build(Scalar radius, const PositionType &pos, const RotationType &rot, Bounds *bounds=0)
Definition: Cylinder.h:58
ConstReferenceCountingPointer< Cylinder > ConstCylinderPointer
Definition: Cylinder.h:38
Unlimited (trivial) bounds.