CMS 3D CMS Logo

JacobianCartesianToLocal Class Reference

Class which calculates the Jacobian matrix of the transformation from the Cartesian to the local frame. More...

#include <TrackingTools/AnalyticalJacobians/interface/JacobianCartesianToLocal.h>

List of all members.

Public Member Functions

const AlgebraicMatrix56jacobian () const
 Access to Jacobian.
const AlgebraicMatrix jacobian_old () const
 JacobianCartesianToLocal (const Surface &surface, const LocalTrajectoryParameters &localParameters)
 Constructor from local trajectory parameters and surface defining the local frame.

Private Attributes

AlgebraicMatrix56 theJacobian


Detailed Description

Class which calculates the Jacobian matrix of the transformation from the Cartesian to the local frame.

The Jacobian is calculated during construction and thereafter cached, enabling reuse of the same Jacobian without calculating it again.

Definition at line 15 of file JacobianCartesianToLocal.h.


Constructor & Destructor Documentation

JacobianCartesianToLocal::JacobianCartesianToLocal ( const Surface surface,
const LocalTrajectoryParameters localParameters 
)

Constructor from local trajectory parameters and surface defining the local frame.

NB!! No default constructor exists!

Definition at line 5 of file JacobianCartesianToLocal.cc.

References LocalTrajectoryParameters::charge(), l1, l2, l3, PV3DBase< T, PVType, FrameType >::mag(), LocalTrajectoryParameters::momentum(), p, dttmaxenums::R, theJacobian, GloballyPositioned< T >::toLocal(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

00006                                                                                : theJacobian() {
00007  
00008   //LocalCoordinates 1 = (q/|p|, dx/dz, dy/dz, x, y)
00009   //LocalCoordinates 2 = (x, y, z, px, py, pz)
00010   //Transformation: q/|p| = q/sqrt(px*px + py*py + pz*pz)
00011   //                dx/dz = px/pz
00012   //                dy/dz = py/pz
00013   //                x     = x
00014   //                y     = y
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   // for neutrals: qbp is 1/p instead of q/p - 
00020   //   equivalent to charge 1
00021   if ( q==0 )  q = 1;
00022   //Jacobian theJacobian( (q/|p|, dx/dz, dy/dz, x, y) = f(x, y, z, px, py, pz) )
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   LocalVector l1 = surface.toLocal(GlobalVector(1., 0., 0.));
00031   LocalVector l2 = surface.toLocal(GlobalVector(0., 1., 0.));
00032   LocalVector l3 = surface.toLocal(GlobalVector(0., 0., 1.));
00033   AlgebraicMatrix33 Rsub;
00034   Rsub(0,0) = l1.x(); Rsub(0,1) = l2.x(); Rsub(0,2) = l3.x();
00035   Rsub(1,0) = l1.y(); Rsub(1,1) = l2.y(); Rsub(1,2) = l3.y();
00036   Rsub(2,0) = l1.z(); Rsub(2,1) = l2.z(); Rsub(2,2) = l3.z();
00037 
00038   AlgebraicMatrix66 R;
00039   R.Place_at(Rsub,0,0);
00040   R.Place_at(Rsub,3,3);
00041   theJacobian = theJacobian * R;
00042   //dbg::dbg_trace(1,"Ca2L", localParameters.vector(),l1,l2,l3,theJacobian);
00043 }


Member Function Documentation

const AlgebraicMatrix56 & JacobianCartesianToLocal::jacobian (  )  const

Access to Jacobian.

Definition at line 47 of file JacobianCartesianToLocal.cc.

References theJacobian.

Referenced by BasicSingleTrajectoryState::createLocalErrorFromCartesianError().

00047                                                                   {
00048   return theJacobian;
00049 }

const AlgebraicMatrix JacobianCartesianToLocal::jacobian_old (  )  const

Definition at line 44 of file JacobianCartesianToLocal.cc.

References asHepMatrix(), and theJacobian.

00044                                                                    {
00045   return asHepMatrix(theJacobian);
00046 }


Member Data Documentation

AlgebraicMatrix56 JacobianCartesianToLocal::theJacobian [private]

Definition at line 34 of file JacobianCartesianToLocal.h.

Referenced by jacobian(), jacobian_old(), and JacobianCartesianToLocal().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:26:00 2009 for CMSSW by  doxygen 1.5.4