CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_2_9_HLT1_bphpatch4/src/RecoTracker/NuclearSeedGenerator/src/TangentHelix.cc

Go to the documentation of this file.
00001 #include "RecoTracker/NuclearSeedGenerator/interface/TangentHelix.h"
00002 
00003 TangentHelix::TangentHelix(const TangentHelix& primCircle, const GlobalPoint& outerPoint, const GlobalPoint& innerPoint) :
00004      theInnerPoint(innerPoint), theOuterPoint(outerPoint), theCircle(primCircle.circle(), outerPoint, innerPoint) {
00005 
00006    // Calculation of vertex.z :
00007    GlobalPoint inner_T( innerPoint.x() , innerPoint.y() , 0.0 );
00008    GlobalPoint outer_T( outerPoint.x() , outerPoint.y() , 0.0 );
00009    GlobalPoint vtx_T( theCircle.vertexPoint().x() , theCircle.vertexPoint().y() , 0.0 );
00010 
00011    double d1 = (inner_T - vtx_T).mag();
00012    double d = (inner_T - outer_T).mag();
00013 
00014    theVertexPoint = GlobalPoint(vtx_T.x() , vtx_T.y(), innerPoint.z() - (outerPoint.z() - innerPoint.z()) * d1 / d );
00015    theDirectionAtVertex = GlobalVector(1000, 1000, 1000);
00016 }
00017 
00018 GlobalVector TangentHelix::directionAtVertex() {
00019 
00020    if(theDirectionAtVertex.z() > 999) {
00021       GlobalPoint inner_T( theInnerPoint.x() , theInnerPoint.y() , 0.0 );
00022       GlobalPoint outer_T( theOuterPoint.x() , theOuterPoint.y() , 0.0 );
00023       double p_z = (theOuterPoint.z() - theInnerPoint.z()) / (outer_T - inner_T).mag();
00024 
00025       GlobalVector dir_T = theCircle.directionAtVertex();
00026       GlobalVector dir( dir_T.x(), dir_T.y(), p_z);
00027 
00028       dir/=dir.mag();
00029       theDirectionAtVertex = dir;
00030     }
00031 
00032    return theDirectionAtVertex;
00033 }