Go to the documentation of this file.00001 #include "TrackingTools/AnalyticalJacobians/interface/JacobianCurvilinearToLocal.h"
00002 #include "DataFormats/GeometrySurface/interface/Surface.h"
00003 #include "TrackingTools/TrajectoryParametrization/interface/LocalTrajectoryParameters.h"
00004 #include "MagneticField/Engine/interface/MagneticField.h"
00005
00006 JacobianCurvilinearToLocal::
00007 JacobianCurvilinearToLocal(const Surface& surface,
00008 const LocalTrajectoryParameters& localParameters,
00009 const MagneticField& magField) : theJacobian() {
00010
00011
00012 GlobalPoint x = surface.toGlobal(localParameters.position());
00013 GlobalVector h = magField.inInverseGeV(x);
00014 GlobalVector hdir = h.unit();
00015
00016 LocalVector tnl = localParameters.momentum().unit();
00017 GlobalVector tn = surface.toGlobal(tnl);
00018
00019
00020
00021
00022 Surface::RotationType const & rot = surface.rotation();
00023 GlobalVector dj(rot.x());
00024 GlobalVector dk(rot.y());
00025 GlobalVector di(rot.z());
00026
00027
00028
00029 double cosl = tn.perp(); if (cosl < 1.e-30) cosl = 1.e-30;
00030 double cosl1 = 1./cosl;
00031 GlobalVector un(-tn.y()*cosl1, tn.x()*cosl1, 0.);
00032 GlobalVector vn(-tn.z()*un.y(), tn.z()*un.x(), cosl);
00033
00034 double uj = un.dot(dj);
00035 double uk = un.dot(dk);
00036 double vj = vn.dot(dj);
00037 double vk = vn.dot(dk);
00038
00039
00040 double t1r = 1./tnl.z();
00041 double t2r = t1r*t1r;
00042 double t3r = t1r*t2r;
00043
00044 theJacobian(0,0) = 1.;
00045 theJacobian(1,1) = -uk*t2r;
00046 theJacobian(1,2) = vk*(cosl*t2r);
00047 theJacobian(2,1) = uj*t2r;
00048 theJacobian(2,2) = -vj*(cosl*t2r);
00049 theJacobian(3,3) = vk*t1r;
00050 theJacobian(3,4) = -uk*t1r;
00051 theJacobian(4,3) = -vj*t1r;
00052 theJacobian(4,4) = uj*t1r;
00053
00054 double q = -h.mag() * localParameters.signedInverseMomentum();
00055
00056 double sinz =-un.dot(hdir);
00057 double cosz = vn.dot(hdir);
00058 double ui = un.dot(di)*(q*t3r);
00059 double vi = vn.dot(di)*(q*t3r);
00060 theJacobian(1,3) =-ui*(vk*cosz-uk*sinz);
00061 theJacobian(1,4) =-vi*(vk*cosz-uk*sinz);
00062 theJacobian(2,3) = ui*(vj*cosz-uj*sinz);
00063 theJacobian(2,4) = vi*(vj*cosz-uj*sinz);
00064
00065
00066 }