File indexing completed on 2023-03-17 11:22:43
0001 #include "RecoTracker/NuclearSeedGenerator/interface/TangentHelix.h"
0002
0003 TangentHelix::TangentHelix(const TangentHelix& primCircle, const GlobalPoint& outerPoint, const GlobalPoint& innerPoint)
0004 : theInnerPoint(innerPoint), theOuterPoint(outerPoint), theCircle(primCircle.circle(), outerPoint, innerPoint) {
0005
0006 GlobalPoint inner_T(innerPoint.x(), innerPoint.y(), 0.0);
0007 GlobalPoint outer_T(outerPoint.x(), outerPoint.y(), 0.0);
0008 GlobalPoint vtx_T(theCircle.vertexPoint().x(), theCircle.vertexPoint().y(), 0.0);
0009
0010 double d1 = (inner_T - vtx_T).mag();
0011 double d = (inner_T - outer_T).mag();
0012
0013 theVertexPoint = GlobalPoint(vtx_T.x(), vtx_T.y(), innerPoint.z() - (outerPoint.z() - innerPoint.z()) * d1 / d);
0014 theDirectionAtVertex = GlobalVector(1000, 1000, 1000);
0015 }
0016
0017 GlobalVector TangentHelix::directionAtVertex() {
0018 if (theDirectionAtVertex.z() > 999) {
0019 GlobalPoint inner_T(theInnerPoint.x(), theInnerPoint.y(), 0.0);
0020 GlobalPoint outer_T(theOuterPoint.x(), theOuterPoint.y(), 0.0);
0021 double p_z = (theOuterPoint.z() - theInnerPoint.z()) / (outer_T - inner_T).mag();
0022
0023 GlobalVector dir_T = theCircle.directionAtVertex();
0024 GlobalVector dir(dir_T.x(), dir_T.y(), p_z);
0025
0026 dir /= dir.mag();
0027 theDirectionAtVertex = dir;
0028 }
0029
0030 return theDirectionAtVertex;
0031 }