Go to the documentation of this file.00001 #include "TrackingTools/AnalyticalJacobians/interface/JacobianCartesianToLocal.h"
00002 #include "DataFormats/GeometrySurface/interface/Surface.h"
00003 #include "TrackingTools/TrajectoryParametrization/interface/LocalTrajectoryParameters.h"
00004
00005 JacobianCartesianToLocal::JacobianCartesianToLocal(const Surface& surface,
00006 const LocalTrajectoryParameters& localParameters) : theJacobian() {
00007
00008
00009
00010
00011
00012
00013
00014
00015 LocalVector plocal = localParameters.momentum();
00016 double px = plocal.x(), py = plocal.y(), pz = plocal.z();
00017 double p = plocal.mag();
00018 TrackCharge q = localParameters.charge();
00019
00020
00021 if ( q==0 ) q = 1;
00022
00023 theJacobian(0,3) = -q*px/(p*p*p); theJacobian(0,4) = -q*py/(p*p*p); theJacobian(0,5) = -q*pz/(p*p*p);
00024 if(fabs(pz) > 0){
00025 theJacobian(1,3) = 1./pz; theJacobian(1,5) = -px/(pz*pz);
00026 theJacobian(2,4) = 1./pz; theJacobian(2,5) = -py/(pz*pz);
00027 }
00028 theJacobian(3,0) = 1.;
00029 theJacobian(4,1) = 1.;
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 AlgebraicMatrix33 Rsub;
00042
00043 Surface::RotationType const & rot = surface.rotation();
00044 Rsub(0,0) = rot.xx(); Rsub(0,1) = rot.xy(); Rsub(0,2) = rot.xz();
00045 Rsub(1,0) = rot.yx(); Rsub(1,1) = rot.yy(); Rsub(1,2) = rot.yz();
00046 Rsub(2,0) = rot.zx(); Rsub(2,1) = rot.zy(); Rsub(2,2) = rot.zz();
00047
00048
00049
00050 AlgebraicMatrix66 R;
00051 R.Place_at(Rsub,0,0);
00052 R.Place_at(Rsub,3,3);
00053 theJacobian = theJacobian * R;
00054
00055 }