CMS 3D CMS Logo

Cylinder.h
Go to the documentation of this file.
1 #ifndef Geom_Cylinder_H
2 #define Geom_Cylinder_H
3 
18 
19 class Cylinder final : public Surface {
20 public:
21  template <typename... Args>
22  Cylinder(Scalar radius, Args&&... args) : Surface(std::forward<Args>(args)...), theRadius(radius) {}
23 
26 
27  // average Rmin Rmax...
28  static float computeRadius(Bounds const& bounds) { return 0.5f * (bounds.width() - bounds.thickness()); }
29 
34 
38  /*
39  template<typename... Args>
40  static CylinderPointer build(Args&& ... args) {
41  return CylinderPointer(new Cylinder(std::forward<Args>(args)...));
42  }
43  */
44 
46  const RotationType& rot,
47  Scalar radius,
48  Bounds* bounds = nullptr) {
49  return CylinderPointer(new Cylinder(radius, pos, rot, bounds));
50  }
51 
53  const PositionType& pos,
54  const RotationType& rot,
55  Bounds* bounds = nullptr) {
56  return CylinderPointer(new Cylinder(radius, pos, rot, bounds));
57  }
58 
59  ~Cylinder() override {}
60 
61  // -- Extension of Surface interface for cylinder
62 
64  Scalar radius() const { return theRadius; }
65 
66  // -- Implementation of Surface interface
67 
68  using Surface::side;
69  Side side(const LocalPoint& p, Scalar toler) const override;
70 
75 
77  Plane fastTangent(const GlobalPoint& aPoint) const {
78  GlobalVector yPlane(rotation().z());
79  GlobalVector xPlane(yPlane.cross(aPoint - position()));
80  return Plane(aPoint, RotationType(xPlane, yPlane));
81  }
82 
84  Plane fastTangent(const LocalPoint& aPoint) const { return fastTangent(toGlobal(aPoint)); }
85 
86 private:
88 };
89 
90 #endif
Vector3DBase
Definition: Vector3DBase.h:8
writedatasetfile.args
args
Definition: writedatasetfile.py:18
TkRotation< float >
Bounds::width
virtual float width() const =0
Cylinder::radius
Scalar radius() const
Radius of the cylinder.
Definition: Cylinder.h:64
Cylinder::side
Side side(const LocalPoint &p, Scalar toler) const override
Definition: Cylinder.cc:9
Surface::Side
SurfaceOrientation::Side Side
Definition: Surface.h:38
Cylinder::BoundCylinderPointer
ReferenceCountingPointer< Cylinder > BoundCylinderPointer
Definition: Cylinder.h:32
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
Cylinder::fastTangent
Plane fastTangent(const GlobalPoint &aPoint) const
tangent plane to surface from global point
Definition: Cylinder.h:77
Cylinder::fastTangent
Plane fastTangent(const LocalPoint &aPoint) const
tangent plane to surface from local point
Definition: Cylinder.h:84
pos
Definition: PixelAliasList.h:18
SimpleCylinderBounds.h
Bounds
Definition: Bounds.h:18
ConstReferenceCountingPointer< Cylinder >
Surface
Definition: Surface.h:36
ReferenceCountingPointer< Cylinder >
GloballyPositioned< float >::RotationType
TkRotation< float > RotationType
Definition: GloballyPositioned.h:22
SimpleCylinderBounds
Definition: SimpleCylinderBounds.h:19
Plane.h
Surface.h
clone
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
Surface::bounds
const Bounds & bounds() const
Definition: Surface.h:87
Surface::toGlobal
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
DDAxes::z
Point3DBase< float, GlobalTag >
Cylinder::ConstBoundCylinderPointer
ConstReferenceCountingPointer< Cylinder > ConstBoundCylinderPointer
Definition: Cylinder.h:33
Cylinder::Cylinder
Cylinder(const PositionType &pos, const RotationType &rot, SimpleCylinderBounds const &bounds)
Definition: Cylinder.h:24
Bounds::thickness
virtual float thickness() const =0
Cylinder::tangentPlane
ConstReferenceCountingPointer< TangentPlane > tangentPlane(const GlobalPoint &) const override
tangent plane to surface from global point
Definition: Cylinder.cc:19
Cylinder::~Cylinder
~Cylinder() override
Definition: Cylinder.h:59
Cylinder::build
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, Bounds *bounds=nullptr)
Definition: Cylinder.h:45
Vector3DBase::cross
Vector3DBase< typename PreciseFloatType< T, U >::Type, FrameTag > cross(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:110
Cylinder::build
static CylinderPointer build(Scalar radius, const PositionType &pos, const RotationType &rot, Bounds *bounds=nullptr)
Definition: Cylinder.h:52
Cylinder::CylinderPointer
ReferenceCountingPointer< Cylinder > CylinderPointer
Definition: Cylinder.h:30
Cylinder::ConstCylinderPointer
ConstReferenceCountingPointer< Cylinder > ConstCylinderPointer
Definition: Cylinder.h:31
Cylinder::Cylinder
Cylinder(Scalar radius, Args &&... args)
Definition: Cylinder.h:22
GloballyPositioned< float >::position
const PositionType & position() const
Definition: GloballyPositioned.h:36
std
Definition: JetResolutionObject.h:76
Surface::side
virtual Side side(const LocalPoint &p, Scalar tolerance=0) const =0
Plane
Definition: Plane.h:16
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
Cylinder::computeRadius
static float computeRadius(Bounds const &bounds)
Definition: Cylinder.h:28
Cylinder
Definition: Cylinder.h:19
GloballyPositioned< float >::rotation
const RotationType & rotation() const
Definition: GloballyPositioned.h:38
GloballyPositioned< float >::Scalar
float Scalar
Definition: GloballyPositioned.h:20
Cylinder::theRadius
Scalar theRadius
Definition: Cylinder.h:87