CMS 3D CMS Logo

Line Class Reference

A line in 3D space. More...

#include <DataFormats/GeometrySurface/interface/Line.h>

List of all members.

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 (PositionType &pos, DirectionType &dir)
 Line ()
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

typedef GlobalVector Line::DirectionType

Definition at line 14 of file Line.h.

typedef GlobalPoint Line::PositionType

Definition at line 13 of file Line.h.


Constructor & Destructor Documentation

Line::Line (  )  [inline]

Definition at line 16 of file Line.h.

00016 {}

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

Definition at line 19 of file Line.h.

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

Line::~Line (  )  [inline]

Definition at line 22 of file Line.h.

00022 {};


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(), theDir, thePos, and V.

Referenced by AnalyticalTrajectoryExtrapolatorToLine::extrapolateSingleState().

00029                                                          {
00030 
00031 GlobalPoint  V = aLine.position();
00032 GlobalVector J = aLine.direction();
00033 GlobalVector Q = theDir - J.dot(theDir) * J;
00034 double lambda = Q.dot(V-thePos)/Q.dot(theDir);
00035 return   thePos + lambda*theDir;
00036 }

DirectionType Line::direction (  )  const [inline]

Definition at line 27 of file Line.h.

References theDir.

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

00027 { return theDir;}

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

Definition at line 48 of file Line.h.

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

00048                                                         {
00049 
00050 GlobalVector P(aPoint.x(),aPoint.y(),aPoint.z());
00051 GlobalVector T0(thePos.x(),thePos.y(),thePos.z());
00052 return T0-P + theDir.dot(P-T0) * theDir;
00053 }

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

Definition at line 38 of file Line.h.

References Vector3DBase< T, FrameTag >::cross(), funct::D, direction(), Vector3DBase< T, FrameTag >::dot(), P, position(), theDir, thePos, and V.

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

00038                                                  {
00039 
00040 GlobalPoint  V = aLine.position();
00041 GlobalVector J = aLine.direction();
00042 GlobalVector P = (theDir.cross(J)).unit();
00043 GlobalVector D;
00044 D= P.dot(thePos-V) * P;
00045 return D;
00046 }

PositionType Line::position (  )  const [inline]

Definition at line 26 of file Line.h.

References thePos.

Referenced by closerPointToLine(), distance(), SignedImpactParameter3D::distanceWithJetAxis(), IPTools::jetTrackDistance(), and HelixExtrapolatorToLine2Order::pathLength().

00026 { return thePos;}


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


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:27:44 2009 for CMSSW by  doxygen 1.5.4