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

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(), MagneticField::inInverseGeV(), LocalTrajectoryParameters::position(), makeMuonMisalignmentScenario::rot, GloballyPositioned< T >::rotation(), LocalTrajectoryParameters::signedInverseMomentum(), Surface::toGlobal(), and x.

11  : theJacobian(ROOT::Math::SMatrixNoInit()) {
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  Surface::RotationType const & rot = surface.rotation();
23 
24  compute(rot, tnl, tn, hq);
25 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:106
LocalVector direction() const
Momentum vector unit in the local frame.
LocalPoint position() const
Local x and y position coordinates.
float signedInverseMomentum() const
Signed inverse momentum q/p (zero for neutrals).
GlobalVector inInverseGeV(const GlobalPoint &gp) const
Field value ad specified global point, in 1/Gev.
Definition: MagneticField.h:39
void compute(Surface::RotationType const &rot, LocalVector const &tnl, GlobalVector const &tn, GlobalVector const &hq)
const RotationType & rotation() const
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 28 of file JacobianLocalToCurvilinear.cc.

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

31  : theJacobian(ROOT::Math::SMatrixNoInit()) {
32 
33  GlobalVector h = globalParameters.magneticFieldInInverseGeV();
34  GlobalVector hq = h*localParameters.signedInverseMomentum(); // changed sign
35 
36 
37  LocalVector tnl = localParameters.direction();
38  GlobalVector tn = surface.toGlobal(tnl); // globalParameters.momentum().unit();
39 
40  Surface::RotationType const & rot = surface.rotation();
41 
42  compute(rot, tnl, tn, hq);
43 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:106
LocalVector direction() const
Momentum vector unit in the local frame.
GlobalVector magneticFieldInInverseGeV(const GlobalPoint &x) const
float signedInverseMomentum() const
Signed inverse momentum q/p (zero for neutrals).
void compute(Surface::RotationType const &rot, LocalVector const &tnl, GlobalVector const &tn, GlobalVector const &hq)
const RotationType & rotation() const

Member Function Documentation

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

Definition at line 46 of file JacobianLocalToCurvilinear.cc.

References Vector3DBase< T, FrameTag >::dot(), MillePedeFileConverter_cfg::e, mps_fire::i, 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 jacobian(), and JacobianLocalToCurvilinear().

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

Access to Jacobian.

Definition at line 45 of file JacobianLocalToCurvilinear.h.

References compute(), dso_internal, makeMuonMisalignmentScenario::rot, and 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().