CMS 3D CMS Logo

TangentHelix.cc
Go to the documentation of this file.
2 
3 TangentHelix::TangentHelix(const TangentHelix& primCircle, const GlobalPoint& outerPoint, const GlobalPoint& innerPoint)
4  : theInnerPoint(innerPoint), theOuterPoint(outerPoint), theCircle(primCircle.circle(), outerPoint, innerPoint) {
5  // Calculation of vertex.z :
6  GlobalPoint inner_T(innerPoint.x(), innerPoint.y(), 0.0);
7  GlobalPoint outer_T(outerPoint.x(), outerPoint.y(), 0.0);
9 
10  double d1 = (inner_T - vtx_T).mag();
11  double d = (inner_T - outer_T).mag();
12 
13  theVertexPoint = GlobalPoint(vtx_T.x(), vtx_T.y(), innerPoint.z() - (outerPoint.z() - innerPoint.z()) * d1 / d);
14  theDirectionAtVertex = GlobalVector(1000, 1000, 1000);
15 }
16 
18  if (theDirectionAtVertex.z() > 999) {
19  GlobalPoint inner_T(theInnerPoint.x(), theInnerPoint.y(), 0.0);
20  GlobalPoint outer_T(theOuterPoint.x(), theOuterPoint.y(), 0.0);
21  double p_z = (theOuterPoint.z() - theInnerPoint.z()) / (outer_T - inner_T).mag();
22 
24  GlobalVector dir(dir_T.x(), dir_T.y(), p_z);
25 
26  dir /= dir.mag();
28  }
29 
30  return theDirectionAtVertex;
31 }
GlobalPoint theOuterPoint
Definition: TangentHelix.h:51
GlobalPoint theInnerPoint
Definition: TangentHelix.h:50
GlobalVector directionAtVertex()
Definition: TangentHelix.cc:17
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T y() const
Definition: PV3DBase.h:60
T z() const
Definition: PV3DBase.h:61
d
Definition: ztail.py:151
GlobalVector theDirectionAtVertex
Definition: TangentHelix.h:56
GlobalVector directionAtVertex()
Return the direction at the vertex.
GlobalPoint theVertexPoint
Definition: TangentHelix.h:52
T x() const
Definition: PV3DBase.h:59
GlobalPoint vertexPoint() const
Definition: TangentCircle.h:48
TangentCircle theCircle
Definition: TangentHelix.h:54
Global3DVector GlobalVector
Definition: GlobalVector.h:10