CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 GloballyPositioned< float > BasicReferenceCounted

Public Types

typedef
ReferenceCountingPointer< Cone
ConePointer
 
typedef
ReferenceCountingPointer< Cone
ConstConePointer
 
- Public Types inherited from Surface
using Base = GloballyPositioned< float >
 
using Side = SurfaceOrientation::Side
 
- Public Types inherited from GloballyPositioned< float >
typedef Point3DBase< float,
GlobalTag
GlobalPoint
 
typedef Vector3DBase< float,
GlobalTag
GlobalVector
 
typedef Point3DBase< float,
LocalTag
LocalPoint
 
typedef Vector3DBase< float,
LocalTag
LocalVector
 
typedef Point3DBase< float,
GlobalTag
PositionType
 
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...
 
virtual Side side (const LocalPoint &p, Scalar tolerance) const
 
virtual Side side (const GlobalPoint &p, Scalar tolerance) const
 
virtual
ConstReferenceCountingPointer
< TangentPlane
tangentPlane (const GlobalPoint &) const
 
virtual
ConstReferenceCountingPointer
< TangentPlane
tangentPlane (const LocalPoint &) const
 
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
 
virtual ~Surface ()
 
- 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 ()
 
- Public Member Functions inherited from BasicReferenceCounted
void addReference () const
 
 BasicReferenceCounted ()
 
 BasicReferenceCounted (const BasicReferenceCounted &)
 
 BasicReferenceCounted (BasicReferenceCounted &&)=default
 
BasicReferenceCountedoperator= (BasicReferenceCounted &&)=default
 
BasicReferenceCountedoperator= (const BasicReferenceCounted &)
 
unsigned int references () const
 
void removeReference () const
 
virtual ~BasicReferenceCounted ()
 

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 27 of file Cone.h.

Definition at line 28 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 21 of file Cone.h.

Referenced by build().

23  :
24  Surface(std::forward<Args>(args)...),
25  theVertex(vert), theAngle(angle) {}
GlobalPoint theVertex
Definition: Cone.h:74
Geom::Theta< Scalar > theAngle
Definition: Cone.h:75
Surface()
Definition: Surface.h:53
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 47 of file Cone.h.

48  :
49  Surface( pos, rot), theVertex(vert), theAngle(angle) {}
GlobalPoint theVertex
Definition: Cone.h:74
Geom::Theta< Scalar > theAngle
Definition: Cone.h:75
Surface()
Definition: Surface.h:53

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 34 of file Cone.h.

References Cone().

Referenced by psClasses.BuildThread::run().

37  {
38  return ConePointer(new Cone(vert, angle, pos, rot));
39  }
ReferenceCountingPointer< Cone > ConePointer
Definition: Cone.h:27
Cone(const PositionType &vert, Geom::Theta< Scalar > angle, Args &&...args)
Definition: Cone.h:21
Geom::Theta<float> Cone::openingAngle ( ) const
inline

Angle of the cone.

Definition at line 58 of file Cone.h.

References theAngle.

Referenced by SteppingHelixPropagator::refToMagVolume(), MagGeoBuilderFromDDD::volumeHandle::sameSurface(), and side().

58 {return theAngle;}
Geom::Theta< Scalar > theAngle
Definition: Cone.h:75
virtual Side Cone::side ( const LocalPoint p,
Scalar  tolerance 
) const
inlinevirtual

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 63 of file Cone.h.

References side(), and Surface::toGlobal().

Referenced by side().

63 {return side( toGlobal(p), tolerance);}
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:106
virtual Side side(const LocalPoint &p, Scalar tolerance) const
Definition: Cone.h:63
Surface::Side Cone::side ( const GlobalPoint p,
Scalar  tolerance 
) const
virtual

Reimplemented from Surface.

Definition at line 22 of file Cone.cc.

References delta, SurfaceOrientation::negativeSide, SurfaceOrientation::onSurface, openingAngle(), p1, Geom::pi(), SurfaceOrientation::positiveSide, 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) return SurfaceOrientation::onSurface;
31  double delta = double(p1.theta())- double(openingAngle());
32  if (fabs(delta) < tolerance/p1.mag()) return SurfaceOrientation::onSurface;
33 
34  if (p1.theta() < Geom::pi()/2.) {
36  } else {
38  }
39 }
dbl * delta
Definition: mlp_gen.cc:36
T y() const
Definition: PV3DBase.h:63
GlobalPoint vertex() const
Global position of the cone vertex.
Definition: Cone.h:55
T z() const
Definition: PV3DBase.h:64
double p1[4]
Definition: TauolaWrapper.h:89
double pi()
Definition: Pi.h:31
T x() const
Definition: PV3DBase.h:62
Geom::Theta< float > openingAngle() const
Angle of the cone.
Definition: Cone.h:58
ConstReferenceCountingPointer< TangentPlane > Cone::tangentPlane ( const GlobalPoint ) const
virtual

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.

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

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 }
tuple cout
Definition: gather_cfg.py:145
GlobalPoint Cone::vertex ( ) const
inline

Global position of the cone vertex.

Definition at line 55 of file Cone.h.

References theVertex.

Referenced by Tau.Tau::dxy(), SteppingHelixPropagator::refToMagVolume(), MagGeoBuilderFromDDD::volumeHandle::sameSurface(), and side().

55 {return theVertex;}
GlobalPoint theVertex
Definition: Cone.h:74

Member Data Documentation

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

Definition at line 75 of file Cone.h.

Referenced by openingAngle().

GlobalPoint Cone::theVertex
private

Definition at line 74 of file Cone.h.

Referenced by vertex().