#include <TrackingTools/AnalyticalJacobians/interface/JacobianCurvilinearToCartesian.h>
Public Member Functions | |
const AlgebraicMatrix65 & | jacobian () const |
Access to Jacobian. | |
const AlgebraicMatrix | jacobian_old () const |
JacobianCurvilinearToCartesian (const GlobalTrajectoryParameters &globalParameters) | |
Constructor from global trajectory parameters. | |
Private Attributes | |
AlgebraicMatrix65 | theJacobian |
The Jacobian is calculated during construction and thereafter cached, enabling reuse of the same Jacobian without calculating it again.
Definition at line 14 of file JacobianCurvilinearToCartesian.h.
JacobianCurvilinearToCartesian::JacobianCurvilinearToCartesian | ( | const GlobalTrajectoryParameters & | globalParameters | ) |
Constructor from global trajectory parameters.
NB!! No default constructor exists!
Definition at line 5 of file JacobianCurvilinearToCartesian.cc.
References GlobalTrajectoryParameters::charge(), funct::cos(), Vector3DBase< T, FrameTag >::cross(), PV3DBase< T, PVType, FrameType >::mag(), GlobalTrajectoryParameters::momentum(), p, p2, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), phi, dttmaxenums::R, funct::sin(), theJacobian, PV3DBase< T, PVType, FrameType >::theta(), Vector3DBase< T, FrameTag >::unit(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().
00005 : theJacobian() { 00006 GlobalVector xt = globalParameters.momentum(); 00007 //GlobalVector yt(xt.y(), -xt.x(), 0.); \\wrong direction of the axis 00008 //GlobalVector zt(xt.x()*xt.z(), xt.y()*xt.z(), -xt.perp2()); \\and then also on this one 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 // for neutrals: qbp is 1/p instead of q/p - 00016 // equivalent to charge 1 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 //ErrorPropagation: 00052 // C(Cart) = R(6*6) * J(6*5) * C(Curvi) * J(5*6)_T * R(6*6)_T 00053 theJacobian = R*theJacobian; 00054 //dbg::dbg_trace(1,"Cu2Ca", globalParameters.vector(),theJacobian); 00055 }
const AlgebraicMatrix65 & JacobianCurvilinearToCartesian::jacobian | ( | ) | const |
Access to Jacobian.
Definition at line 59 of file JacobianCurvilinearToCartesian.cc.
References theJacobian.
Referenced by FreeTrajectoryState::createCartesianError(), TrackKinematicStatePropagator::propagateToTheTransversePCACharged(), and TrackKinematicStatePropagator::propagateToTheTransversePCANeutral().
00059 { 00060 return theJacobian; 00061 }
const AlgebraicMatrix JacobianCurvilinearToCartesian::jacobian_old | ( | ) | const |
Definition at line 56 of file JacobianCurvilinearToCartesian.cc.
References asHepMatrix(), and theJacobian.
00056 { 00057 return asHepMatrix(theJacobian); 00058 }
Definition at line 32 of file JacobianCurvilinearToCartesian.h.
Referenced by jacobian(), jacobian_old(), and JacobianCurvilinearToCartesian().