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 Member Functions | Private Attributes
JacobianLocalToCurvilinear Class Reference

#include <JacobianLocalToCurvilinear.h>

Public Member Functions

const AlgebraicMatrix55jacobian () const
 
 JacobianLocalToCurvilinear (const Surface &surface, const LocalTrajectoryParameters &localParameters, const MagneticField &magField)
 
 JacobianLocalToCurvilinear (const Surface &surface, const LocalTrajectoryParameters &localParameters, const GlobalTrajectoryParameters &globalParameters, const MagneticField &magField)
 

Private Member Functions

void compute (Surface::RotationType const &rot, LocalVector const &tnl, GlobalVector const &tn, GlobalVector const &hq) dso_internal
 

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 22 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 9 of file JacobianLocalToCurvilinear.cc.

References compute(), LocalTrajectoryParameters::direction(), h, MagneticField::inInverseGeV(), LocalTrajectoryParameters::position(), makeMuonMisalignmentScenario::rot, GloballyPositioned< T >::rotation(), LocalTrajectoryParameters::signedInverseMomentum(), Surface::toGlobal(), and x.

11  : theJacobian() {
12 
13 
14  GlobalPoint x = surface.toGlobal(localParameters.position());
15  GlobalVector h = magField.inInverseGeV(x);
16  GlobalVector hq = h*localParameters.signedInverseMomentum(); // changed sign
17 
18 
19  LocalVector tnl = localParameters.direction();
20  GlobalVector tn = surface.toGlobal(tnl);
21 
22  // GlobalVector dj = surface.toGlobal(LocalVector(1., 0., 0.));
23  // GlobalVector dk = surface.toGlobal(LocalVector(0., 1., 0.));
24  Surface::RotationType const & rot = surface.rotation();
25 
26  compute(rot, tnl, tn, hq);
27 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:78
LocalVector direction() const
Momentum vector unit in the local frame.
LocalPoint position() const
Local x and y position coordinates.
GlobalVector inInverseGeV(const GlobalPoint &gp) const
Field value ad specified global point, in 1/Gev.
Definition: MagneticField.h:40
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
void compute(Surface::RotationType const &rot, LocalVector const &tnl, GlobalVector const &tn, GlobalVector const &hq) dso_internal
const RotationType & rotation() const
Definition: DDAxes.h:10
double signedInverseMomentum() const
Signed inverse momentum q/p (zero for neutrals).
JacobianLocalToCurvilinear::JacobianLocalToCurvilinear ( const Surface surface,
const LocalTrajectoryParameters localParameters,
const GlobalTrajectoryParameters globalParameters,
const MagneticField magField 
)

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

Definition at line 30 of file JacobianLocalToCurvilinear.cc.

References compute(), LocalTrajectoryParameters::direction(), h, MagneticField::inInverseGeV(), GlobalTrajectoryParameters::position(), makeMuonMisalignmentScenario::rot, GloballyPositioned< T >::rotation(), LocalTrajectoryParameters::signedInverseMomentum(), Surface::toGlobal(), and x.

33  : theJacobian() {
34 
35  GlobalPoint x = globalParameters.position();
36  GlobalVector h = magField.inInverseGeV(x);
37  GlobalVector hq = h*localParameters.signedInverseMomentum(); // changed sign
38 
39 
40  LocalVector tnl = localParameters.direction();
41  GlobalVector tn = surface.toGlobal(tnl); // globalParameters.momentum().unit();
42 
43  // GlobalVector dj = surface.toGlobal(LocalVector(1., 0., 0.));
44  // GlobalVector dk = surface.toGlobal(LocalVector(0., 1., 0.));
45  Surface::RotationType const & rot = surface.rotation();
46 
47  compute(rot, tnl, tn, hq);
48 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:78
LocalVector direction() const
Momentum vector unit in the local frame.
GlobalVector inInverseGeV(const GlobalPoint &gp) const
Field value ad specified global point, in 1/Gev.
Definition: MagneticField.h:40
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
void compute(Surface::RotationType const &rot, LocalVector const &tnl, GlobalVector const &tn, GlobalVector const &hq) dso_internal
const RotationType & rotation() const
Definition: DDAxes.h:10
double signedInverseMomentum() const
Signed inverse momentum q/p (zero for neutrals).

Member Function Documentation

void JacobianLocalToCurvilinear::compute ( Surface::RotationType const &  rot,
LocalVector const &  tnl,
GlobalVector const &  tn,
GlobalVector const &  hq 
)
private

Definition at line 51 of file JacobianLocalToCurvilinear.cc.

References Vector3DBase< T, FrameTag >::dot(), alignCSCRings::e, PV3DBase< T, PVType, FrameType >::perp(), theJacobian, PV3DBase< T, PVType, FrameType >::x(), TkRotation< T >::x(), PV3DBase< T, PVType, FrameType >::y(), TkRotation< T >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by JacobianLocalToCurvilinear().

51  {
52  // Origin: TRSDSC
53 
54  GlobalVector dj(rot.x());
55  GlobalVector dk(rot.y());
56 
57  // GlobalVector p = surface.toGlobal(localParameters.momentum());
58  // GlobalVector pt(p.x(), p.y(), 0.);
59  // pt = pt.unit();
60  // GlobalVector tn = p.unit();
61 
62  // GlobalVector di = tsos.surface().toGlobal(LocalVector(0., 0., 1.));
63 
64  // rotate coordinates because of wrong coordinate system in orca
65  LocalVector tvw(tnl.z(), tnl.x(), tnl.y());
66  double cosl = tn.perp(); if (cosl < 1.e-30) cosl = 1.e-30;
67  double cosl1 = 1./cosl;
68 
69 
70  GlobalVector un(-tn.y()*cosl1, tn.x()*cosl1, 0.);
71  double uj = un.dot(dj);
72  double uk = un.dot(dk);
73  double sinz =-un.dot(hq);
74 
75  GlobalVector vn(-tn.z()*un.y(), tn.z()*un.x(), cosl);
76  double vj = vn.dot(dj);
77  double vk = vn.dot(dk);
78  double cosz = vn.dot(hq);
79 
80 
81  theJacobian(0,0) = 1.;
82  theJacobian(1,1) = tvw.x()*vj;
83  theJacobian(1,2) = tvw.x()*vk;
84  theJacobian(2,1) = tvw.x()*uj*cosl1;
85  theJacobian(2,2) = tvw.x()*uk*cosl1;
86  theJacobian(3,3) = uj;
87  theJacobian(3,4) = uk;
88  theJacobian(4,3) = vj;
89  theJacobian(4,4) = vk;
90 
91  theJacobian(1,3) = tvw.y()*sinz;
92  theJacobian(1,4) = tvw.z()*sinz;
93  theJacobian(2,3) = tvw.y()*(cosz*cosl1);
94  theJacobian(2,4) = tvw.z()*(cosz*cosl1);
95  // end of TRSDSC
96 
97  //dbg::dbg_trace(1,"Loc2Cu", localParameters.vector(),x,dj,dk,theJacobian);
98 }
T perp() const
Definition: PV3DBase.h:71
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:107
const AlgebraicMatrix55& JacobianLocalToCurvilinear::jacobian ( ) const
inline

Access to Jacobian.

Definition at line 45 of file JacobianLocalToCurvilinear.h.

References theJacobian.

Referenced by BasicTrajectoryState::checkCurvilinError().

45 {return theJacobian;}

Member Data Documentation

AlgebraicMatrix55 JacobianLocalToCurvilinear::theJacobian
private

Definition at line 51 of file JacobianLocalToCurvilinear.h.

Referenced by compute(), and jacobian().