CMS 3D CMS Logo

Public Member Functions | Private Attributes

JacobianLocalToCurvilinear Class Reference

#include <JacobianLocalToCurvilinear.h>

List of all members.

Public Member Functions

const AlgebraicMatrix55jacobian () const
const AlgebraicMatrix jacobian_old () const
 JacobianLocalToCurvilinear (const Surface &surface, const LocalTrajectoryParameters &localParameters, const MagneticField &magField)

Private Attributes

AlgebraicMatrix55 theJacobian

Detailed Description

Class which calculates the Jacobian matrix of the transformation from the local to the curvilinear frame. The Jacobian is calculated during construction and thereafter cached, enabling reuse of the same Jacobian without calculating it again.

Definition at line 16 of file JacobianLocalToCurvilinear.h.


Constructor & Destructor Documentation

JacobianLocalToCurvilinear::JacobianLocalToCurvilinear ( const Surface surface,
const LocalTrajectoryParameters localParameters,
const MagneticField magField 
)

Constructor from local trajectory parameters and surface defining the local frame. NB!! No default constructor exists!

Definition at line 7 of file JacobianLocalToCurvilinear.cc.

References Vector3DBase< T, FrameTag >::dot(), h, MagneticField::inInverseGeV(), PV3DBase< T, PVType, FrameType >::mag(), LocalTrajectoryParameters::momentum(), PV3DBase< T, PVType, FrameType >::perp(), LocalTrajectoryParameters::position(), lumiQueryAPI::q, GloballyPositioned< T >::rotation(), LocalTrajectoryParameters::signedInverseMomentum(), theJacobian, Surface::toGlobal(), Vector3DBase< T, FrameTag >::unit(), PV3DBase< T, PVType, FrameType >::x(), TkRotation< T >::x(), x, PV3DBase< T, PVType, FrameType >::y(), TkRotation< T >::y(), and PV3DBase< T, PVType, FrameType >::z().

                                                          : theJacobian() {
  
  // Origin: TRSDSC

  GlobalPoint  x = surface.toGlobal(localParameters.position());
  GlobalVector h  = magField.inInverseGeV(x);

 
  LocalVector tnl = localParameters.momentum().unit();
  GlobalVector tn = surface.toGlobal(tnl);
 
  // GlobalVector dj = surface.toGlobal(LocalVector(1., 0., 0.));
  // GlobalVector dk = surface.toGlobal(LocalVector(0., 1., 0.));
  Surface::RotationType const & rot = surface.rotation();
  GlobalVector dj(rot.x());
  GlobalVector dk(rot.y());
 
  // GlobalVector p = surface.toGlobal(localParameters.momentum());
  // GlobalVector pt(p.x(), p.y(), 0.);
  // pt = pt.unit();
  // GlobalVector tn = p.unit();

  //  GlobalVector di = tsos.surface().toGlobal(LocalVector(0., 0., 1.));

  // rotate coordinates because of wrong coordinate system in orca
  LocalVector tvw(tnl.z(), tnl.x(), tnl.y());
  double cosl = tn.perp(); if (cosl < 1.e-30) cosl = 1.e-30;
  double cosl1 = 1./cosl;

  double q = -h.mag() * localParameters.signedInverseMomentum();

  GlobalVector un(-tn.y()*cosl1, tn.x()*cosl1, 0.);
  double uj = un.dot(dj);
  double uk = un.dot(dk);
  double sinz =-un.dot(h.unit());

  GlobalVector vn(-tn.z()*un.y(), tn.z()*un.x(), cosl);
  double vj = vn.dot(dj);
  double vk = vn.dot(dk);
  double cosz = vn.dot(h.unit());
 

  theJacobian(0,0) = 1.;
  theJacobian(1,1) = tvw.x()*vj;
  theJacobian(1,2) = tvw.x()*vk;
  theJacobian(2,1) = tvw.x()*uj*cosl1;
  theJacobian(2,2) = tvw.x()*uk*cosl1;
  theJacobian(3,3) = uj;
  theJacobian(3,4) = uk;
  theJacobian(4,3) = vj;
  theJacobian(4,4) = vk;
 
  theJacobian(1,3) = -q*tvw.y()*sinz;
  theJacobian(1,4) = -q*tvw.z()*sinz;
  theJacobian(2,3) = -q*tvw.y()*(cosz*cosl1);
  theJacobian(2,4) = -q*tvw.z()*(cosz*cosl1);
  // end of TRSDSC

  //dbg::dbg_trace(1,"Loc2Cu", localParameters.vector(),x,dj,dk,theJacobian);
}

Member Function Documentation

const AlgebraicMatrix55 & JacobianLocalToCurvilinear::jacobian ( ) const

Access to Jacobian.

Definition at line 72 of file JacobianLocalToCurvilinear.cc.

References theJacobian.

Referenced by BasicSingleTrajectoryState::checkCurvilinError().

                                                                   {
  return theJacobian;
}
const AlgebraicMatrix JacobianLocalToCurvilinear::jacobian_old ( ) const

Definition at line 69 of file JacobianLocalToCurvilinear.cc.

References asHepMatrix(), and theJacobian.

                                                                    {
  return asHepMatrix(theJacobian);
}

Member Data Documentation

Definition at line 37 of file JacobianLocalToCurvilinear.h.

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