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(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  // 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:114
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:39
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, GlobalTrajectoryParameters::magneticFieldInInverseGeV(), makeMuonMisalignmentScenario::rot, GloballyPositioned< T >::rotation(), LocalTrajectoryParameters::signedInverseMomentum(), and Surface::toGlobal().

33  : theJacobian(ROOT::Math::SMatrixNoInit()) {
34 
35  // GlobalPoint x = globalParameters.position();
36  // GlobalVector h = magField.inInverseGeV(x);
37  GlobalVector h = globalParameters.magneticFieldInInverseGeV();
38  GlobalVector hq = h*localParameters.signedInverseMomentum(); // changed sign
39 
40 
41  LocalVector tnl = localParameters.direction();
42  GlobalVector tn = surface.toGlobal(tnl); // globalParameters.momentum().unit();
43 
44  // GlobalVector dj = surface.toGlobal(LocalVector(1., 0., 0.));
45  // GlobalVector dk = surface.toGlobal(LocalVector(0., 1., 0.));
46  Surface::RotationType const & rot = surface.rotation();
47 
48  compute(rot, tnl, tn, hq);
49 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:114
LocalVector direction() const
Momentum vector unit in the local frame.
GlobalVector magneticFieldInInverseGeV(const GlobalPoint &x) const
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
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 52 of file JacobianLocalToCurvilinear.cc.

References Vector3DBase< T, FrameTag >::dot(), alignCSCRings::e, 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 JacobianLocalToCurvilinear().

52  {
53  // Origin: TRSDSC
54 
55  GlobalVector dj(rot.x());
56  GlobalVector dk(rot.y());
57 
58  // GlobalVector p = surface.toGlobal(localParameters.momentum());
59  // GlobalVector pt(p.x(), p.y(), 0.);
60  // pt = pt.unit();
61  // GlobalVector tn = p.unit();
62 
63  // GlobalVector di = tsos.surface().toGlobal(LocalVector(0., 0., 1.));
64 
65  // rotate coordinates because of wrong coordinate system in orca
66  LocalVector tvw(tnl.z(), tnl.x(), tnl.y());
67  double cosl = tn.perp(); if (cosl < 1.e-30) cosl = 1.e-30;
68  double cosl1 = 1./cosl;
69 
70 
71  GlobalVector un(-tn.y()*cosl1, tn.x()*cosl1, 0.);
72  double uj = un.dot(dj);
73  double uk = un.dot(dk);
74  double sinz =-un.dot(hq);
75 
76  GlobalVector vn(-tn.z()*un.y(), tn.z()*un.x(), cosl);
77  double vj = vn.dot(dj);
78  double vk = vn.dot(dk);
79  double cosz = vn.dot(hq);
80 
81 
82  theJacobian(0,0) = 1.; for (auto i=1;i<5; ++i) theJacobian(0,i)=0.;
83 
84  theJacobian(1,0) = 0.;
85  theJacobian(2,0) = 0.;
86 
87  theJacobian(1,1) = tvw.x()*vj;
88  theJacobian(1,2) = tvw.x()*vk;
89  theJacobian(2,1) = tvw.x()*uj*cosl1;
90  theJacobian(2,2) = tvw.x()*uk*cosl1;
91 
92  for (auto i=0;i<3; ++i) { theJacobian(3,i)=0.; theJacobian(4,i)=0.; }
93 
94  theJacobian(3,3) = uj;
95  theJacobian(3,4) = uk;
96  theJacobian(4,3) = vj;
97  theJacobian(4,4) = vk;
98 
99  theJacobian(1,3) = tvw.y()*sinz;
100  theJacobian(1,4) = tvw.z()*sinz;
101  theJacobian(2,3) = tvw.y()*(cosz*cosl1);
102  theJacobian(2,4) = tvw.z()*(cosz*cosl1);
103  // end of TRSDSC
104 
105  //dbg::dbg_trace(1,"Loc2Cu", localParameters.vector(),x,dj,dk,theJacobian);
106 }
int i
Definition: DBlmapReader.cc:9
T perp() const
Definition: PV3DBase.h:72
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().