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 Line &aLine) const
 
GlobalVector distance (const GlobalPoint &aPoint) 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()) {}
DirectionType theDir
Definition: Line.h:52
PositionType thePos
Definition: Line.h:51

◆ ~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.

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

Referenced by AnalyticalTrajectoryExtrapolatorToLine::extrapolateSingleState().

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  }
DirectionType theDir
Definition: Line.h:52
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:99
PositionType thePos
Definition: Line.h:51
DirectionType direction() const
Definition: Line.h:25
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t V
PositionType position() const
Definition: Line.h:24

◆ direction()

DirectionType Line::direction ( ) const
inline

Definition at line 25 of file Line.h.

References theDir.

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

25 { return theDir; }
DirectionType theDir
Definition: Line.h:52

◆ distance() [1/2]

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

Definition at line 35 of file Line.h.

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

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

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  }
DirectionType theDir
Definition: Line.h:52
Vector3DBase< typename PreciseFloatType< T, U >::Type, FrameTag > cross(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:110
PositionType thePos
Definition: Line.h:51
DirectionType direction() const
Definition: Line.h:25
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t V
Basic3DVector unit() const
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
std::pair< OmniClusterRef, TrackingParticleRef > P
PositionType position() const
Definition: Line.h:24

◆ distance() [2/2]

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

Definition at line 44 of file Line.h.

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

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  }
DirectionType theDir
Definition: Line.h:52
T z() const
Definition: PV3DBase.h:61
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:99
PositionType thePos
Definition: Line.h:51
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
std::pair< OmniClusterRef, TrackingParticleRef > P

◆ position()

PositionType Line::position ( ) const
inline

Definition at line 24 of file Line.h.

References thePos.

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

24 { return thePos; }
PositionType thePos
Definition: Line.h:51

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