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 | Protected Member Functions | Private Attributes
Cone Class Reference

#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
typedef GloballyPositioned< float > Base
 
typedef SurfaceOrientation::Side 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

 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
ReferenceCountingPointer
< TangentPlane
tangentPlane (const GlobalPoint &) const
 
virtual
ReferenceCountingPointer
< TangentPlane
tangentPlane (const LocalPoint &) const
 
GlobalPoint vertex () const
 Global position of the cone vertex. More...
 
- Public Member Functions inherited from Surface
const MediumPropertiesmediumProperties () const
 
void setMediumProperties (const MediumProperties &mp)
 
void setMediumProperties (MediumProperties *mp)
 
 Surface (const PositionType &pos, const RotationType &rot)
 
 Surface (const PositionType &pos, const RotationType &rot, MediumProperties *mp)
 
 Surface (const PositionType &pos, const RotationType &rot, MediumProperties mp)
 
 Surface (const Surface &iSurface)
 
GlobalPoint toGlobal (const Point2DBase< Scalar, LocalTag > lp) const
 
virtual ~Surface ()=0
 
- Public Member Functions inherited from GloballyPositioned< float >
float eta () const
 
 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 &iRHS)
 
const 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 ()
 

Protected Member Functions

 Cone (const PositionType &pos, const RotationType &rot, const PositionType &vert, Geom::Theta< Scalar > angle, MediumProperties *mp)
 

Private Attributes

Geom::Theta< ScalartheAngle
 
GlobalPoint theVertex
 

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).
Date:
2007/07/31 15:20:07
Revision:
1.2

Definition at line 20 of file Cone.h.

Member Typedef Documentation

Definition at line 22 of file Cone.h.

Definition at line 23 of file Cone.h.

Constructor & Destructor Documentation

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

Referenced by build().

43  :
44  Surface( pos, rot), theVertex(vert), theAngle(angle) {}
GlobalPoint theVertex
Definition: Cone.h:75
Geom::Theta< Scalar > theAngle
Definition: Cone.h:76
Surface(const PositionType &pos, const RotationType &rot)
Definition: Surface.h:40
Cone::Cone ( const PositionType pos,
const RotationType rot,
const PositionType vert,
Geom::Theta< Scalar angle,
MediumProperties mp 
)
inlineprotected

Definition at line 68 of file Cone.h.

70  :
71  Surface(pos, rot, mp), theVertex(vert), theAngle(angle) {}
GlobalPoint theVertex
Definition: Cone.h:75
Geom::Theta< Scalar > theAngle
Definition: Cone.h:76
Surface(const PositionType &pos, const RotationType &rot)
Definition: Surface.h:40

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().

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

Angle of the cone.

Definition at line 53 of file Cone.h.

References theAngle.

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

53 {return theAngle;}
Geom::Theta< Scalar > theAngle
Definition: Cone.h:76
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 58 of file Cone.h.

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

Referenced by side().

58 {return side( toGlobal(p), tolerance);}
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:78
virtual Side side(const LocalPoint &p, Scalar tolerance) const
Definition: Cone.h:58
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:62
GlobalPoint vertex() const
Global position of the cone vertex.
Definition: Cone.h:50
T z() const
Definition: PV3DBase.h:63
double p1[4]
Definition: TauolaWrapper.h:89
double pi()
Definition: Pi.h:31
T x() const
Definition: PV3DBase.h:61
Geom::Theta< float > openingAngle() const
Angle of the cone.
Definition: Cone.h:53
ReferenceCountingPointer< TangentPlane > Cone::tangentPlane ( const GlobalPoint ) const
virtual

Tangent plane to surface from global point. Returns a new 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:121
ReferenceCountingPointer< 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:121
GlobalPoint Cone::vertex ( ) const
inline

Global position of the cone vertex.

Definition at line 50 of file Cone.h.

References theVertex.

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

50 {return theVertex;}
GlobalPoint theVertex
Definition: Cone.h:75

Member Data Documentation

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

Definition at line 76 of file Cone.h.

Referenced by openingAngle().

GlobalPoint Cone::theVertex
private

Definition at line 75 of file Cone.h.

Referenced by vertex().