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

Definition at line 14 of file Line.h.

Definition at line 13 of file Line.h.

Constructor & Destructor Documentation

Line::Line ( )
inline

Definition at line 16 of file Line.h.

16 {}
Line::Line ( PositionType pos,
DirectionType dir 
)
inline

Definition at line 19 of file Line.h.

19  :
20  thePos(pos), theDir(dir.unit()) {}
DirectionType theDir
Definition: Line.h:57
PositionType thePos
Definition: Line.h:56
dbl *** dir
Definition: mlp_gen.cc:35
Line::~Line ( )
inline

Definition at line 22 of file Line.h.

22 {};

Member Function Documentation

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

Definition at line 29 of file Line.h.

References direction(), Vector3DBase< T, FrameTag >::dot(), position(), class-composition::Q, theDir, and thePos.

Referenced by TrajectoryExtrapolatorToLine::extrapolate(), and AnalyticalTrajectoryExtrapolatorToLine::extrapolateSingleState().

29  {
30 
31 GlobalPoint V = aLine.position();
32 GlobalVector J = aLine.direction();
33 GlobalVector Q = theDir - J.dot(theDir) * J;
34 double lambda = Q.dot(V-thePos)/Q.dot(theDir);
35 return thePos + lambda*theDir;
36 }
DirectionType theDir
Definition: Line.h:57
DirectionType direction() const
Definition: Line.h:27
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:107
PositionType thePos
Definition: Line.h:56
PositionType position() const
Definition: Line.h:26
DirectionType Line::direction ( ) const
inline

Definition at line 27 of file Line.h.

References theDir.

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

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

Definition at line 38 of file Line.h.

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

Referenced by SignedImpactParameter3D::distanceWithJetAxis(), TrajectoryExtrapolatorToLine::extrapolate(), and IPTools::jetTrackDistance().

38  {
39 
40 GlobalPoint V = aLine.position();
41 GlobalVector J = aLine.direction();
42 GlobalVector P = (theDir.cross(J)).unit();
44 D= P.dot(thePos-V) * P;
45 return D;
46 }
DirectionType theDir
Definition: Line.h:57
DirectionType direction() const
Definition: Line.h:27
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:107
PositionType thePos
Definition: Line.h:56
PositionType position() const
Definition: Line.h:26
Vector3DBase< typename PreciseFloatType< T, U >::Type, FrameTag > cross(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:119
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150
std::pair< OmniClusterRef, TrackingParticleRef > P
GlobalVector Line::distance ( const GlobalPoint aPoint) const
inline

Definition at line 48 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().

48  {
49 
50 GlobalVector P(aPoint.x(),aPoint.y(),aPoint.z());
51 GlobalVector T0(thePos.x(),thePos.y(),thePos.z());
52 return T0-P + theDir.dot(P-T0) * theDir;
53 }
DirectionType theDir
Definition: Line.h:57
T y() const
Definition: PV3DBase.h:63
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:107
PositionType thePos
Definition: Line.h:56
T z() const
Definition: PV3DBase.h:64
std::pair< OmniClusterRef, TrackingParticleRef > P
T x() const
Definition: PV3DBase.h:62
PositionType Line::position ( ) const
inline

Member Data Documentation

DirectionType Line::theDir
private

Definition at line 57 of file Line.h.

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

PositionType Line::thePos
private

Definition at line 56 of file Line.h.

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