CMS 3D CMS Logo

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 GlobalTrajectoryParameters &globalParameters, const MagneticField &magField)
 
 JacobianLocalToCurvilinear (const Surface &surface, const LocalTrajectoryParameters &localParameters, const MagneticField &magField)
 

Private Member Functions

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

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 21 of file JacobianLocalToCurvilinear.h.

Constructor & Destructor Documentation

◆ JacobianLocalToCurvilinear() [1/2]

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

11  : theJacobian(ROOT::Math::SMatrixNoInit()) {
12  GlobalPoint x = surface.toGlobal(localParameters.position());
13  GlobalVector h = magField.inInverseGeV(x);
14  GlobalVector hq = h * localParameters.signedInverseMomentum(); // changed sign
15 
16  LocalVector tnl = localParameters.direction();
17  GlobalVector tn = surface.toGlobal(tnl);
18 
19  Surface::RotationType const& rot = surface.rotation();
20 
21  compute(rot, tnl, tn, hq);
22 }

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

◆ JacobianLocalToCurvilinear() [2/2]

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

28  : theJacobian(ROOT::Math::SMatrixNoInit()) {
29  GlobalVector h = globalParameters.magneticFieldInInverseGeV();
30  GlobalVector hq = h * localParameters.signedInverseMomentum(); // changed sign
31 
32  LocalVector tnl = localParameters.direction();
33  GlobalVector tn = surface.toGlobal(tnl); // globalParameters.momentum().unit();
34 
35  Surface::RotationType const& rot = surface.rotation();
36 
37  compute(rot, tnl, tn, hq);
38 }

References compute(), LocalTrajectoryParameters::direction(), GlobalTrajectoryParameters::magneticFieldInInverseGeV(), makeMuonMisalignmentScenario::rot, GloballyPositioned< T >::rotation(), LocalTrajectoryParameters::signedInverseMomentum(), and Surface::toGlobal().

Member Function Documentation

◆ compute()

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

Definition at line 40 of file JacobianLocalToCurvilinear.cc.

43  {
44  // Origin: TRSDSC
45 
46  GlobalVector dj(rot.x());
47  GlobalVector dk(rot.y());
48 
49  // rotate coordinates because of wrong coordinate system in orca
50  double tvwX = tnl.z(), tvwY = tnl.x(), tvwZ = tnl.y();
51  double cosl = tn.perp();
52  if (cosl < 1.e-30)
53  cosl = 1.e-30;
54  double cosl1 = 1. / cosl;
55 
56  GlobalVector un(-tn.y() * cosl1, tn.x() * cosl1, 0.);
57  double uj = un.dot(dj);
58  double uk = un.dot(dk);
59  double sinz = -un.dot(hq);
60 
61  GlobalVector vn(-tn.z() * un.y(), tn.z() * un.x(), cosl);
62  double vj = vn.dot(dj);
63  double vk = vn.dot(dk);
64  double cosz = vn.dot(hq);
65 
66  theJacobian(0, 0) = 1.;
67  for (auto i = 1; i < 5; ++i)
68  theJacobian(0, i) = 0.;
69 
70  theJacobian(1, 0) = 0.;
71  theJacobian(2, 0) = 0.;
72 
73  theJacobian(1, 1) = tvwX * vj;
74  theJacobian(1, 2) = tvwX * vk;
75  theJacobian(2, 1) = tvwX * uj * cosl1;
76  theJacobian(2, 2) = tvwX * uk * cosl1;
77 
78  for (auto i = 0; i < 3; ++i) {
79  theJacobian(3, i) = 0.;
80  theJacobian(4, i) = 0.;
81  }
82 
83  theJacobian(3, 3) = uj;
84  theJacobian(3, 4) = uk;
85  theJacobian(4, 3) = vj;
86  theJacobian(4, 4) = vk;
87 
88  theJacobian(1, 3) = tvwY * sinz;
89  theJacobian(1, 4) = tvwZ * sinz;
90  theJacobian(2, 3) = tvwY * (cosz * cosl1);
91  theJacobian(2, 4) = tvwZ * (cosz * cosl1);
92  // end of TRSDSC
93 
94  //dbg::dbg_trace(1,"Loc2Cu", localParameters.vector(),x,dj,dk,theJacobian);
95 }

References Vector3DBase< T, FrameTag >::dot(), MillePedeFileConverter_cfg::e, mps_fire::i, PV3DBase< T, PVType, FrameType >::perp(), makeMuonMisalignmentScenario::rot, theJacobian, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by JacobianLocalToCurvilinear().

◆ jacobian()

const AlgebraicMatrix55& JacobianLocalToCurvilinear::jacobian ( ) const
inline

Access to Jacobian.

Definition at line 42 of file JacobianLocalToCurvilinear.h.

42 { return theJacobian; }

References theJacobian.

Referenced by BasicTrajectoryState::checkCurvilinError().

Member Data Documentation

◆ theJacobian

AlgebraicMatrix55 JacobianLocalToCurvilinear::theJacobian
private

Definition at line 48 of file JacobianLocalToCurvilinear.h.

Referenced by compute(), and jacobian().

Vector3DBase
Definition: Vector3DBase.h:8
TkRotation< float >
mps_fire.i
i
Definition: mps_fire.py:428
LocalTrajectoryParameters::signedInverseMomentum
float signedInverseMomentum() const
Signed inverse momentum q/p (zero for neutrals).
Definition: LocalTrajectoryParameters.h:113
LocalTrajectoryParameters::direction
LocalVector direction() const
Momentum vector unit in the local frame.
Definition: LocalTrajectoryParameters.h:99
JacobianLocalToCurvilinear::theJacobian
AlgebraicMatrix55 theJacobian
Definition: JacobianLocalToCurvilinear.h:48
DDAxes::x
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
JacobianLocalToCurvilinear::compute
void compute(Surface::RotationType const &rot, LocalVector const &tnl, GlobalVector const &tn, GlobalVector const &hq)
Definition: JacobianLocalToCurvilinear.cc:40
LocalTrajectoryParameters::position
LocalPoint position() const
Local x and y position coordinates.
Definition: LocalTrajectoryParameters.h:85
Surface::toGlobal
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
h
Point3DBase< float, GlobalTag >
MagneticField::inInverseGeV
GlobalVector inInverseGeV(const GlobalPoint &gp) const
Field value ad specified global point, in 1/Gev.
Definition: MagneticField.h:36
Vector3DBase::dot
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:99
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
GlobalTrajectoryParameters::magneticFieldInInverseGeV
GlobalVector magneticFieldInInverseGeV(const GlobalPoint &x) const
Definition: GlobalTrajectoryParameters.cc:35
GloballyPositioned::rotation
const RotationType & rotation() const
Definition: GloballyPositioned.h:38
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37