CMS 3D CMS Logo

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

Definition at line 13 of file Line.h.

Definition at line 12 of file Line.h.

Constructor & Destructor Documentation

Line::Line ( )
inline

Definition at line 15 of file Line.h.

15 {}
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 ( )
inline

Definition at line 20 of file Line.h.

20 {};

Member Function Documentation

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

Definition at line 25 of file Line.h.

References theDir.

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

25 { return theDir; }
DirectionType theDir
Definition: Line.h:52
GlobalVector Line::distance ( const Line aLine) const
inline

Definition at line 35 of file Line.h.

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

Referenced by btagbtvdeep::TrackPairInfoBuilder::buildTrackPairInfo(), SignedImpactParameter3D::distanceWithJetAxis(), TrajectoryExtrapolatorToLine::extrapolate(), 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
DirectionType direction() const
Definition: Line.h:25
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:99
PositionType thePos
Definition: Line.h:51
PositionType position() const
Definition: Line.h:24
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t V
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
std::pair< OmniClusterRef, TrackingParticleRef > P
Basic3DVector unit() const
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 y() const
Definition: PV3DBase.h:60
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:99
PositionType thePos
Definition: Line.h:51
T z() const
Definition: PV3DBase.h:61
std::pair< OmniClusterRef, TrackingParticleRef > P
T x() const
Definition: PV3DBase.h:59
PositionType Line::position ( ) const
inline

Member Data Documentation

DirectionType Line::theDir
private

Definition at line 52 of file Line.h.

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

PositionType Line::thePos
private

Definition at line 51 of file Line.h.

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