Go to the documentation of this file.00001 #include "TrackingTools/AnalyticalJacobians/interface/JacobianCurvilinearToCartesian.h"
00002 #include "TrackingTools/TrajectoryParametrization/interface/GlobalTrajectoryParameters.h"
00003
00004 JacobianCurvilinearToCartesian::
00005 JacobianCurvilinearToCartesian(const GlobalTrajectoryParameters& globalParameters) : theJacobian() {
00006 GlobalVector xt = globalParameters.momentum();
00007
00008
00009 GlobalVector yt(-xt.y(), xt.x(), 0.);
00010 GlobalVector zt = xt.cross(yt);
00011
00012 GlobalVector pvec = globalParameters.momentum();
00013 double pt = pvec.perp();
00014 TrackCharge q = globalParameters.charge();
00015
00016
00017 if ( q==0 ) q = 1;
00018
00019 xt = xt.unit();
00020 if(fabs(pt) > 0){
00021 yt = yt.unit();
00022 zt = zt.unit();
00023 }
00024
00025 AlgebraicMatrix66 R;
00026 R(0,0) = xt.x(); R(0,1) = yt.x(); R(0,2) = zt.x();
00027 R(1,0) = xt.y(); R(1,1) = yt.y(); R(1,2) = zt.y();
00028 R(2,0) = xt.z(); R(2,1) = yt.z(); R(2,2) = zt.z();
00029 R(3,3) = 1.;
00030 R(4,4) = 1.;
00031 R(5,5) = 1.;
00032
00033 double p = pvec.mag(), p2 = p*p;
00034 double lambda = 0.5 * M_PI - pvec.theta();
00035 double phi = pvec.phi();
00036 double sinlambda = sin(lambda), coslambda = cos(lambda);
00037 double sinphi = sin(phi), cosphi = cos(phi);
00038
00039 theJacobian(1,3) = 1.;
00040 theJacobian(2,4) = 1.;
00041 theJacobian(3,0) = -q * p2 * coslambda * cosphi;
00042 theJacobian(3,1) = -p * sinlambda * cosphi;
00043 theJacobian(3,2) = -p * coslambda * sinphi;
00044 theJacobian(4,0) = -q * p2 * coslambda * sinphi;
00045 theJacobian(4,1) = -p * sinlambda * sinphi;
00046 theJacobian(4,2) = p * coslambda * cosphi;
00047 theJacobian(5,0) = -q * p2 * sinlambda;
00048 theJacobian(5,1) = p * coslambda;
00049 theJacobian(5,2) = 0.;
00050
00051
00052
00053 theJacobian = R*theJacobian;
00054
00055 }
00056 const AlgebraicMatrix JacobianCurvilinearToCartesian::jacobian_old() const {
00057 return asHepMatrix(theJacobian);
00058 }
00059 const AlgebraicMatrix65& JacobianCurvilinearToCartesian::jacobian() const {
00060 return theJacobian;
00061 }