CMS 3D CMS Logo

Line.h
Go to the documentation of this file.
1 #ifndef Geom_Line_H
2 #define Geom_Line_H
3 
6 
10 class Line {
11 public:
14 
15  Line() {}
16 
17  //Line( const PositionType& pos, const DirectionType& dir) :
19 
20  ~Line(){};
21 
22  //const PositionType& position() const { return thePos;}
23  //const DirectionType& direction() const { return theDir;}
24  PositionType position() const { return thePos; }
25  DirectionType direction() const { return theDir; }
26 
27  GlobalPoint closerPointToLine(const Line& aLine) const {
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  }
34 
35  GlobalVector distance(const Line& aLine) const {
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  }
43 
44  GlobalVector distance(const GlobalPoint& aPoint) const {
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  }
49 
50 private:
53 };
54 
55 #endif // Geom_Line_H
Vector3DBase
Definition: Vector3DBase.h:8
cms::cuda::V
cudaStream_t T uint32_t const T *__restrict__ const uint32_t *__restrict__ uint32_t int cudaStream_t V
Definition: HistoContainer.h:99
Line::closerPointToLine
GlobalPoint closerPointToLine(const Line &aLine) const
Definition: Line.h:27
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
Line::DirectionType
GlobalVector DirectionType
Definition: Line.h:13
pos
Definition: PixelAliasList.h:18
Line::Line
Line(PositionType &pos, DirectionType &dir)
Definition: Line.h:18
Line::~Line
~Line()
Definition: Line.h:20
class-composition.Q
Q
Definition: class-composition.py:82
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
Line::PositionType
GlobalPoint PositionType
Definition: Line.h:12
Line::theDir
DirectionType theDir
Definition: Line.h:52
Point3DBase
Definition: Point3DBase.h:10
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
Line::direction
DirectionType direction() const
Definition: Line.h:25
Line
Definition: Line.h:10
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
Line::distance
GlobalVector distance(const Line &aLine) const
Definition: Line.h:35
funct::D
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
Line::thePos
PositionType thePos
Definition: Line.h:51
GlobalVector.h
Line::position
PositionType position() const
Definition: Line.h:24
P
std::pair< OmniClusterRef, TrackingParticleRef > P
Definition: BDHadronTrackMonitoringAnalyzer.cc:202
Line::distance
GlobalVector distance(const GlobalPoint &aPoint) const
Definition: Line.h:44
GlobalPoint.h
Line::Line
Line()
Definition: Line.h:15
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23