CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
Cone Class Referencefinal

#include <Cone.h>

Inheritance diagram for Cone:
Surface BasicReferenceCounted GloballyPositioned< float >

Public Types

typedef ReferenceCountingPointer< ConeConePointer
 
typedef ReferenceCountingPointer< ConeConstConePointer
 
- Public Types inherited from Surface
using Base = GloballyPositioned< float >
 
using Side = SurfaceOrientation::Side
 
- Public Types inherited from GloballyPositioned< float >
typedef Point3DBase< float, GlobalTagGlobalPoint
 
typedef Vector3DBase< float, GlobalTagGlobalVector
 
typedef Point3DBase< float, LocalTagLocalPoint
 
typedef Vector3DBase< float, LocalTagLocalVector
 
typedef Point3DBase< float, GlobalTagPositionType
 
typedef TkRotation< float > RotationType
 
typedef float Scalar
 

Public Member Functions

template<typename... Args>
 Cone (const PositionType &vert, Geom::Theta< Scalar > angle, Args &&...args)
 
 Cone (const PositionType &pos, const RotationType &rot, const PositionType &vert, Geom::Theta< Scalar > angle)
 
Geom::Theta< float > openingAngle () const
 Angle of the cone. More...
 
Side side (const LocalPoint &p, Scalar tolerance) const override
 
Side side (const GlobalPoint &p, Scalar tolerance) const override
 
ConstReferenceCountingPointer< TangentPlanetangentPlane (const GlobalPoint &) const override
 
ConstReferenceCountingPointer< TangentPlanetangentPlane (const LocalPoint &) const override
 
GlobalPoint vertex () const
 Global position of the cone vertex. More...
 
- Public Member Functions inherited from Surface
const Boundsbounds () const
 
const MediumPropertiesmediumProperties () const
 
std::pair< float, float > const & phiSpan () const
 
std::pair< float, float > const & rSpan () const
 
void setMediumProperties (const MediumProperties &mp)
 
GlobalPoint toGlobal (const Point2DBase< Scalar, LocalTag > lp) const
 
std::pair< float, float > const & zSpan () const
 
 ~Surface () override
 
- Public Member Functions inherited from BasicReferenceCounted
void addReference () const
 
 BasicReferenceCounted ()
 
 BasicReferenceCounted (const BasicReferenceCounted &)
 
 BasicReferenceCounted (BasicReferenceCounted &&)
 
BasicReferenceCountedoperator= (BasicReferenceCounted &&)
 
BasicReferenceCountedoperator= (const BasicReferenceCounted &)
 
unsigned int references () const
 
void removeReference () const
 
virtual ~BasicReferenceCounted ()
 
- Public Member Functions inherited from GloballyPositioned< float >
float eta () const
 
 GloballyPositioned ()
 
 GloballyPositioned (const PositionType &pos, const RotationType &rot)
 
void move (const GlobalVector &displacement)
 
float phi () const
 
const PositionTypeposition () const
 
void rotate (const RotationType &rotation)
 
const RotationTyperotation () const
 
GlobalPoint toGlobal (const LocalPoint &lp) const
 
Point3DBase< U, GlobalTagtoGlobal (const Point3DBase< U, LocalTag > &lp) const
 
GlobalVector toGlobal (const LocalVector &lv) const
 
Vector3DBase< U, GlobalTagtoGlobal (const Vector3DBase< U, LocalTag > &lv) const
 
LocalPoint toLocal (const GlobalPoint &gp) const
 
Point3DBase< U, LocalTagtoLocal (const Point3DBase< U, GlobalTag > &gp) const
 
LocalVector toLocal (const GlobalVector &gv) const
 
Vector3DBase< U, LocalTagtoLocal (const Vector3DBase< U, GlobalTag > &gv) const
 
virtual ~GloballyPositioned ()
 

Static Public Member Functions

static ConePointer build (const PositionType &pos, const RotationType &rot, const PositionType &vert, Geom::Theta< Scalar > angle)
 
- Static Public Member Functions inherited from GloballyPositioned< float >
static float iniEta ()
 
static float iniPhi ()
 

Private Attributes

Geom::Theta< ScalartheAngle
 
GlobalPoint theVertex
 

Additional Inherited Members

- Protected Member Functions inherited from Surface
 Surface ()
 
 Surface (const PositionType &pos, const RotationType &rot)
 
 Surface (const PositionType &pos, const RotationType &rot, Bounds *bounds)
 
 Surface (const PositionType &pos, const RotationType &rot, MediumProperties mp)
 
 Surface (const PositionType &pos, const RotationType &rot, MediumProperties mp, Bounds *bounds)
 
 Surface (const Surface &iSurface)
 
 Surface (Surface &&iSurface)
 
- Protected Attributes inherited from Surface
extstd::clone_ptr< BoundstheBounds
 
MediumProperties theMediumProperties
 

Detailed Description

A Cone.

Warning
Surfaces are reference counted, so only ReferenceCountingPointer should be used to point to them. For this reason, they should be using the static build() method. (The normal constructors will become private in the future).

Definition at line 17 of file Cone.h.

Member Typedef Documentation

Definition at line 23 of file Cone.h.

Definition at line 24 of file Cone.h.

Constructor & Destructor Documentation

template<typename... Args>
Cone::Cone ( const PositionType vert,
Geom::Theta< Scalar angle,
Args &&...  args 
)
inline

Definition at line 20 of file Cone.h.

Referenced by build().

21  : Surface(std::forward<Args>(args)...), theVertex(vert), theAngle(angle) {}
GlobalPoint theVertex
Definition: Cone.h:63
Geom::Theta< Scalar > theAngle
Definition: Cone.h:64
Surface()
Definition: Surface.h:47
Cone::Cone ( const PositionType pos,
const RotationType rot,
const PositionType vert,
Geom::Theta< Scalar angle 
)
inline

Do not use this constructor directly; use the static build method, which returns a ReferenceCountingPointer. This constructor will soon become private

Definition at line 41 of file Cone.h.

42  : Surface(pos, rot), theVertex(vert), theAngle(angle) {}
GlobalPoint theVertex
Definition: Cone.h:63
Geom::Theta< Scalar > theAngle
Definition: Cone.h:64
Surface()
Definition: Surface.h:47

Member Function Documentation

static ConePointer Cone::build ( const PositionType pos,
const RotationType rot,
const PositionType vert,
Geom::Theta< Scalar angle 
)
inlinestatic

Construct a cone with the specified vertex and opening angle. The reference frame is defined by pos and rot; the cone axis is parallel to the local Z axis.

Definition at line 29 of file Cone.h.

References Cone().

Referenced by psClasses.BuildThread::run().

32  {
33  return ConePointer(new Cone(vert, angle, pos, rot));
34  }
ReferenceCountingPointer< Cone > ConePointer
Definition: Cone.h:23
Cone(const PositionType &vert, Geom::Theta< Scalar > angle, Args &&...args)
Definition: Cone.h:20
Geom::Theta<float> Cone::openingAngle ( ) const
inline

Angle of the cone.

Definition at line 50 of file Cone.h.

References theAngle.

Referenced by SteppingHelixPropagator::refToMagVolume(), magneticfield::BaseVolumeHandle::sameSurface(), and side().

50 { return theAngle; }
Geom::Theta< Scalar > theAngle
Definition: Cone.h:64
Side Cone::side ( const LocalPoint p,
Scalar  tolerance 
) const
inlineoverridevirtual

Returns the side of the surface on which the point is. Not defined for 1-sided surfaces (Moebius leaf etc.) For normal 2-sided surfaces the meaning of side is surface type dependent.

Implements Surface.

Definition at line 54 of file Cone.h.

References AlCaHLTBitMon_ParallelJobs::p, side(), tangentPlane(), Surface::toGlobal(), and tolerance.

Referenced by side().

54 { return side(toGlobal(p), tolerance); }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:81
Side side(const LocalPoint &p, Scalar tolerance) const override
Definition: Cone.h:54
const double tolerance
Surface::Side Cone::side ( const GlobalPoint p,
Scalar  tolerance 
) const
overridevirtual

Reimplemented from Surface.

Definition at line 22 of file Cone.cc.

References dumpMFGeometry_cfg::delta, SurfaceOrientation::negativeSide, SurfaceOrientation::onSurface, openingAngle(), p1, Geom::pi(), SurfaceOrientation::positiveSide, tolerance, vertex(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

22  {
23  // FIXME: should be done in local coordinates as this is not correct in the case the verstex is not on the (global) Z axis!!!!
24 
25  // tolerance is interpreted as max distance from cone surface.
26  // FIXME: check case when vertex().z()==inf.
27  GlobalPoint p1(p.x(), p.y(), p.z() - vertex().z());
28 
29  // handle the singularity of p=vertex (i.e. p1.mag() undefined)
30  if (p1.mag() < tolerance)
32  double delta = double(p1.theta()) - double(openingAngle());
33  if (fabs(delta) < tolerance / p1.mag())
35 
36  if (p1.theta() < Geom::pi() / 2.) {
38  } else {
40  }
41 }
const double tolerance
T y() const
Definition: PV3DBase.h:60
GlobalPoint vertex() const
Global position of the cone vertex.
Definition: Cone.h:47
T z() const
Definition: PV3DBase.h:61
double p1[4]
Definition: TauolaWrapper.h:89
constexpr double pi()
Definition: Pi.h:31
T x() const
Definition: PV3DBase.h:59
Geom::Theta< float > openingAngle() const
Angle of the cone.
Definition: Cone.h:50
ConstReferenceCountingPointer< TangentPlane > Cone::tangentPlane ( const GlobalPoint ) const
overridevirtual

Tangent plane to surface from global point. Returns a plane, tangent to the Surface at a point. The point must be on the surface. The return type is a ReferenceCountingPointer, so the plane will be deleted automatically when no longer needed.

Implements Surface.

Definition at line 8 of file Cone.cc.

References gather_cfg::cout.

Referenced by side().

8  {
9  // FIXME: to be implemented...
10  std::cout << "*** WARNING: Cone::tangentPlane not implemented." << std::endl;
11  abort();
13 }
ConstReferenceCountingPointer< TangentPlane > Cone::tangentPlane ( const LocalPoint ) const
overridevirtual

Tangent plane to surface from local point.

Implements Surface.

Definition at line 15 of file Cone.cc.

References gather_cfg::cout.

15  {
16  // FIXME: to be implemented...
17  std::cout << "*** WARNING: Cone::tangentPlane not implemented." << std::endl;
18  abort();
20 }
GlobalPoint Cone::vertex ( ) const
inline

Global position of the cone vertex.

Definition at line 47 of file Cone.h.

References theVertex.

Referenced by Tau.Tau::dxy(), SteppingHelixPropagator::refToMagVolume(), magneticfield::BaseVolumeHandle::sameSurface(), and side().

47 { return theVertex; }
GlobalPoint theVertex
Definition: Cone.h:63

Member Data Documentation

Geom::Theta<Scalar> Cone::theAngle
private

Definition at line 64 of file Cone.h.

Referenced by openingAngle().

GlobalPoint Cone::theVertex
private

Definition at line 63 of file Cone.h.

Referenced by vertex().