CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
JacobianLocalToCurvilinear Class Reference

#include <JacobianLocalToCurvilinear.h>

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(), x, PV3DBase< T, PVType, FrameType >::x(), TkRotation< T >::x(), PV3DBase< T, PVType, FrameType >::y(), TkRotation< T >::y(), and PV3DBase< T, PVType, FrameType >::z().

9  : theJacobian() {
10 
11  // Origin: TRSDSC
12 
13  GlobalPoint x = surface.toGlobal(localParameters.position());
14  GlobalVector h = magField.inInverseGeV(x);
15 
16 
17  LocalVector tnl = localParameters.momentum().unit();
18  GlobalVector tn = surface.toGlobal(tnl);
19 
20  // GlobalVector dj = surface.toGlobal(LocalVector(1., 0., 0.));
21  // GlobalVector dk = surface.toGlobal(LocalVector(0., 1., 0.));
22  Surface::RotationType const & rot = surface.rotation();
23  GlobalVector dj(rot.x());
24  GlobalVector dk(rot.y());
25 
26  // GlobalVector p = surface.toGlobal(localParameters.momentum());
27  // GlobalVector pt(p.x(), p.y(), 0.);
28  // pt = pt.unit();
29  // GlobalVector tn = p.unit();
30 
31  // GlobalVector di = tsos.surface().toGlobal(LocalVector(0., 0., 1.));
32 
33  // rotate coordinates because of wrong coordinate system in orca
34  LocalVector tvw(tnl.z(), tnl.x(), tnl.y());
35  double cosl = tn.perp(); if (cosl < 1.e-30) cosl = 1.e-30;
36  double cosl1 = 1./cosl;
37 
38  double q = -h.mag() * localParameters.signedInverseMomentum();
39 
40  GlobalVector un(-tn.y()*cosl1, tn.x()*cosl1, 0.);
41  double uj = un.dot(dj);
42  double uk = un.dot(dk);
43  double sinz =-un.dot(h.unit());
44 
45  GlobalVector vn(-tn.z()*un.y(), tn.z()*un.x(), cosl);
46  double vj = vn.dot(dj);
47  double vk = vn.dot(dk);
48  double cosz = vn.dot(h.unit());
49 
50 
51  theJacobian(0,0) = 1.;
52  theJacobian(1,1) = tvw.x()*vj;
53  theJacobian(1,2) = tvw.x()*vk;
54  theJacobian(2,1) = tvw.x()*uj*cosl1;
55  theJacobian(2,2) = tvw.x()*uk*cosl1;
56  theJacobian(3,3) = uj;
57  theJacobian(3,4) = uk;
58  theJacobian(4,3) = vj;
59  theJacobian(4,4) = vk;
60 
61  theJacobian(1,3) = -q*tvw.y()*sinz;
62  theJacobian(1,4) = -q*tvw.z()*sinz;
63  theJacobian(2,3) = -q*tvw.y()*(cosz*cosl1);
64  theJacobian(2,4) = -q*tvw.z()*(cosz*cosl1);
65  // end of TRSDSC
66 
67  //dbg::dbg_trace(1,"Loc2Cu", localParameters.vector(),x,dj,dk,theJacobian);
68 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:78
T perp() const
Definition: PV3DBase.h:66
Basic3DVector< T > y() const
LocalPoint position() const
Local x and y position coordinates.
T y() const
Definition: PV3DBase.h:57
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:107
Basic3DVector< T > x() const
virtual GlobalVector inInverseGeV(const GlobalPoint &gp) const
Field value ad specified global point, in 1/Gev.
T mag() const
Definition: PV3DBase.h:61
T z() const
Definition: PV3DBase.h:58
LocalVector momentum() const
Momentum vector in the local frame.
Vector3DBase unit() const
Definition: Vector3DBase.h:57
const RotationType & rotation() const
Definition: DDAxes.h:10
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
T x() const
Definition: PV3DBase.h:56
double signedInverseMomentum() const
Signed inverse momentum q/p (zero for neutrals).

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().

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

Definition at line 69 of file JacobianLocalToCurvilinear.cc.

References asHepMatrix(), and theJacobian.

69  {
70  return asHepMatrix(theJacobian);
71 }
CLHEP::HepMatrix asHepMatrix(const ROOT::Math::SMatrix< double, N1, N2, typename ROOT::Math::MatRepStd< double, N1, N2 > > &rm)
Definition: Migration.h:49

Member Data Documentation

AlgebraicMatrix55 JacobianLocalToCurvilinear::theJacobian
private

Definition at line 37 of file JacobianLocalToCurvilinear.h.

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