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

 Cone (const PositionType &pos, const RotationType &rot, const PositionType &vert, Geom::Theta< Scalar > angle)
 
template<typename... Args>
 Cone (const PositionType &vert, Geom::Theta< Scalar > angle, Args &&... args)
 
Geom::Theta< float > openingAngle () const
 Angle of the cone. More...
 
Side side (const GlobalPoint &p, Scalar tolerance) const override
 
Side side (const LocalPoint &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)
 
virtual Side side (const GlobalPoint &p, Scalar tolerance=0) const
 
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 (BasicReferenceCounted &&)
 
 BasicReferenceCounted (const 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
 
GlobalVector toGlobal (const LocalVector &lv) const
 
Point3DBase< U, GlobalTagtoGlobal (const Point3DBase< U, LocalTag > &lp) const
 
Vector3DBase< U, GlobalTagtoGlobal (const Vector3DBase< U, LocalTag > &lv) const
 
LocalPoint toLocal (const GlobalPoint &gp) const
 
LocalVector toLocal (const GlobalVector &gv) const
 
Point3DBase< U, LocalTagtoLocal (const Point3DBase< U, GlobalTag > &gp) 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

◆ ConePointer

Definition at line 23 of file Cone.h.

◆ ConstConePointer

Definition at line 24 of file Cone.h.

Constructor & Destructor Documentation

◆ Cone() [1/2]

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

Definition at line 20 of file Cone.h.

21  : Surface(std::forward<Args>(args)...), theVertex(vert), theAngle(angle) {}

Referenced by build().

◆ Cone() [2/2]

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) {}

Member Function Documentation

◆ build()

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.

32  {
33  return ConePointer(new Cone(vert, angle, pos, rot));
34  }

References angle(), Cone(), and makeMuonMisalignmentScenario::rot.

Referenced by psClasses.BuildThread::run().

◆ openingAngle()

Geom::Theta<float> Cone::openingAngle ( ) const
inline

Angle of the cone.

Definition at line 50 of file Cone.h.

50 { return theAngle; }

References theAngle.

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

◆ side() [1/2]

Surface::Side Cone::side ( const GlobalPoint p,
Scalar  tolerance 
) const
override

Definition at line 22 of file Cone.cc.

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 }

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

◆ side() [2/2]

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.

54 { return side(toGlobal(p), tolerance); }

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

Referenced by side().

◆ tangentPlane() [1/2]

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.

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

References gather_cfg::cout.

◆ tangentPlane() [2/2]

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.

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

References gather_cfg::cout.

◆ vertex()

GlobalPoint Cone::vertex ( ) const
inline

Global position of the cone vertex.

Definition at line 47 of file Cone.h.

47 { return theVertex; }

References theVertex.

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

Member Data Documentation

◆ theAngle

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

Definition at line 64 of file Cone.h.

Referenced by openingAngle().

◆ theVertex

GlobalPoint Cone::theVertex
private

Definition at line 63 of file Cone.h.

Referenced by vertex().

Cone::openingAngle
Geom::Theta< float > openingAngle() const
Angle of the cone.
Definition: Cone.h:50
writedatasetfile.args
args
Definition: writedatasetfile.py:18
SurfaceOrientation::onSurface
Definition: Surface.h:18
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
gather_cfg.cout
cout
Definition: gather_cfg.py:144
pos
Definition: PixelAliasList.h:18
ConstReferenceCountingPointer
Definition: ReferenceCounted.h:67
Cone::vertex
GlobalPoint vertex() const
Global position of the cone vertex.
Definition: Cone.h:47
Cone::ConePointer
ReferenceCountingPointer< Cone > ConePointer
Definition: Cone.h:23
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
Surface::toGlobal
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
Geom::pi
constexpr double pi()
Definition: Pi.h:31
Point3DBase< float, GlobalTag >
dumpMFGeometry_cfg.delta
delta
Definition: dumpMFGeometry_cfg.py:25
tolerance
const double tolerance
Definition: HGCalGeomParameters.cc:26
Cone::side
Side side(const LocalPoint &p, Scalar tolerance) const override
Definition: Cone.h:54
p1
double p1[4]
Definition: TauolaWrapper.h:89
SurfaceOrientation::negativeSide
Definition: Surface.h:18
Cone::theVertex
GlobalPoint theVertex
Definition: Cone.h:63
Cone::theAngle
Geom::Theta< Scalar > theAngle
Definition: Cone.h:64
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
Surface::Surface
Surface()
Definition: Surface.h:45
angle
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11
SurfaceOrientation::positiveSide
Definition: Surface.h:18
Cone::Cone
Cone(const PositionType &vert, Geom::Theta< Scalar > angle, Args &&... args)
Definition: Cone.h:20