CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/TrackingTools/TrajectoryParametrization/src/CurvilinearTrajectoryParameters.cc

Go to the documentation of this file.
00001 #include "TrackingTools/TrajectoryParametrization/interface/CurvilinearTrajectoryParameters.h"
00002 #include<cmath>
00003 
00004 
00005 CurvilinearTrajectoryParameters::CurvilinearTrajectoryParameters(const GlobalPoint& aX,const GlobalVector& aP,TrackCharge aCharge)
00006 {
00007  
00008   theQbp=aCharge/aP.mag();
00009 
00010   double pT2= aP.x()*aP.x()+aP.y()*aP.y();
00011   double pT =sqrt(pT2);
00012   thelambda= atan(aP.z()/pT);
00013   thephi=atan2(aP.y(),aP.x());
00014   thexT= (-aP.y()*aX.x()+ aP.x()*aX.y()) / pT;
00015   theyT= (-aX.x()*aP.x()*aP.z() - aX.y()*aP.z()*aP.y() + aX.z()*(pT2))  / (aP.mag()*pT);
00016 }
00017 
00018 
00019 bool CurvilinearTrajectoryParameters::updateP(double dP) {
00020   //FIXME. something is very likely to be missing here
00021   double p = 1./std::abs(Qbp());
00022   if ((p += dP) <= 0.) return false;
00023   double newQbp = Qbp() > 0 ? 1./p : -1./p;
00024   theQbp = newQbp;
00025   return true;
00026 }