test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
6  // Calculation of vertex.z :
7  GlobalPoint inner_T( innerPoint.x() , innerPoint.y() , 0.0 );
8  GlobalPoint outer_T( outerPoint.x() , outerPoint.y() , 0.0 );
9  GlobalPoint vtx_T( theCircle.vertexPoint().x() , theCircle.vertexPoint().y() , 0.0 );
10 
11  double d1 = (inner_T - vtx_T).mag();
12  double d = (inner_T - outer_T).mag();
13 
14  theVertexPoint = GlobalPoint(vtx_T.x() , vtx_T.y(), innerPoint.z() - (outerPoint.z() - innerPoint.z()) * d1 / d );
15  theDirectionAtVertex = GlobalVector(1000, 1000, 1000);
16 }
17 
19 
20  if(theDirectionAtVertex.z() > 999) {
21  GlobalPoint inner_T( theInnerPoint.x() , theInnerPoint.y() , 0.0 );
22  GlobalPoint outer_T( theOuterPoint.x() , theOuterPoint.y() , 0.0 );
23  double p_z = (theOuterPoint.z() - theInnerPoint.z()) / (outer_T - inner_T).mag();
24 
26  GlobalVector dir( dir_T.x(), dir_T.y(), p_z);
27 
28  dir/=dir.mag();
30  }
31 
32  return theDirectionAtVertex;
33 }
GlobalPoint theOuterPoint
Definition: TangentHelix.h:46
GlobalPoint theInnerPoint
Definition: TangentHelix.h:45
GlobalVector directionAtVertex()
Definition: TangentHelix.cc:18
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T y() const
Definition: PV3DBase.h:63
tuple d
Definition: ztail.py:151
T mag() const
Definition: PV3DBase.h:67
T z() const
Definition: PV3DBase.h:64
GlobalVector theDirectionAtVertex
Definition: TangentHelix.h:51
GlobalVector directionAtVertex()
Return the direction at the vertex.
dbl *** dir
Definition: mlp_gen.cc:35
GlobalPoint theVertexPoint
Definition: TangentHelix.h:47
T x() const
Definition: PV3DBase.h:62
GlobalPoint vertexPoint() const
Definition: TangentCircle.h:42
TangentCircle theCircle
Definition: TangentHelix.h:49
Global3DVector GlobalVector
Definition: GlobalVector.h:10