CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
Line Class Reference

#include <Line.h>

Public Types

typedef GlobalVector DirectionType
 
typedef GlobalPoint PositionType
 

Public Member Functions

GlobalPoint closerPointToLine (const Line &aLine) const
 
DirectionType direction () const
 
GlobalVector distance (const GlobalPoint &aPoint) const
 
GlobalVector distance (const Line &aLine) const
 
 Line ()
 
 Line (PositionType &pos, DirectionType &dir)
 
PositionType position () const
 
 ~Line ()
 

Private Attributes

DirectionType theDir
 
PositionType thePos
 

Detailed Description

A line in 3D space.

Definition at line 10 of file Line.h.

Member Typedef Documentation

◆ DirectionType

Definition at line 13 of file Line.h.

◆ PositionType

Definition at line 12 of file Line.h.

Constructor & Destructor Documentation

◆ Line() [1/2]

Line::Line ( )
inline

Definition at line 15 of file Line.h.

15 {}

◆ Line() [2/2]

Line::Line ( PositionType pos,
DirectionType dir 
)
inline

Definition at line 18 of file Line.h.

18 : thePos(pos), theDir(dir.unit()) {}

◆ ~Line()

Line::~Line ( )
inline

Definition at line 20 of file Line.h.

20 {};

Member Function Documentation

◆ closerPointToLine()

GlobalPoint Line::closerPointToLine ( const Line aLine) const
inline

Definition at line 27 of file Line.h.

27  {
28  GlobalPoint V = aLine.position();
29  GlobalVector J = aLine.direction();
30  GlobalVector Q = theDir - J.dot(theDir) * J;
31  double lambda = Q.dot(V - thePos) / Q.dot(theDir);
32  return thePos + lambda * theDir;
33  }

References direction(), Vector3DBase< T, FrameTag >::dot(), position(), theDir, thePos, and cms::cuda::V.

Referenced by AnalyticalTrajectoryExtrapolatorToLine::extrapolateSingleState().

◆ direction()

DirectionType Line::direction ( ) const
inline

Definition at line 25 of file Line.h.

25 { return theDir; }

References theDir.

Referenced by closerPointToLine(), distance(), and TSCBLBuilderWithPropagator::operator()().

◆ distance() [1/2]

GlobalVector Line::distance ( const GlobalPoint aPoint) const
inline

Definition at line 44 of file Line.h.

44  {
45  GlobalVector P(aPoint.x(), aPoint.y(), aPoint.z());
46  GlobalVector T0(thePos.x(), thePos.y(), thePos.z());
47  return T0 - P + theDir.dot(P - T0) * theDir;
48  }

References Vector3DBase< T, FrameTag >::dot(), theDir, thePos, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

◆ distance() [2/2]

GlobalVector Line::distance ( const Line aLine) const
inline

Definition at line 35 of file Line.h.

35  {
36  GlobalPoint V = aLine.position();
37  GlobalVector J = aLine.direction();
38  GlobalVector P = (theDir.cross(J)).unit();
40  D = P.dot(thePos - V) * P;
41  return D;
42  }

References Vector3DBase< T, FrameTag >::cross(), direction(), position(), theDir, thePos, unit(), and cms::cuda::V.

Referenced by btagbtvdeep::TrackPairInfoBuilder::buildTrackPairInfo(), and IPTools::jetTrackDistance().

◆ position()

PositionType Line::position ( ) const
inline

Definition at line 24 of file Line.h.

24 { return thePos; }

References thePos.

Referenced by closerPointToLine(), distance(), and IPTools::jetTrackDistance().

Member Data Documentation

◆ theDir

DirectionType Line::theDir
private

Definition at line 52 of file Line.h.

Referenced by closerPointToLine(), direction(), and distance().

◆ thePos

PositionType Line::thePos
private

Definition at line 51 of file Line.h.

Referenced by closerPointToLine(), distance(), and position().

Vector3DBase
Definition: Vector3DBase.h:8
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
pos
Definition: PixelAliasList.h:18
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
Line::theDir
DirectionType theDir
Definition: Line.h:52
Point3DBase< float, GlobalTag >
cms::cuda::V
uint32_t const T *__restrict__ const uint32_t *__restrict__ int32_t int Histo::index_type cudaStream_t V
Definition: HistoContainer.h:51
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
Line::direction
DirectionType direction() const
Definition: Line.h:25
Vector3DBase::cross
Vector3DBase< typename PreciseFloatType< T, U >::Type, FrameTag > cross(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:110
Vector3DBase::dot
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:99
unit
Basic3DVector unit() const
Definition: Basic3DVectorLD.h:162
funct::D
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
Line::thePos
PositionType thePos
Definition: Line.h:51
Line::position
PositionType position() const
Definition: Line.h:24
P
std::pair< OmniClusterRef, TrackingParticleRef > P
Definition: BDHadronTrackMonitoringAnalyzer.cc:203
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23