CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
JacobianLocalToCurvilinear.cc
Go to the documentation of this file.
5 
7 
10  const LocalTrajectoryParameters& localParameters,
11  const MagneticField& magField) : 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 }
28 
31  const LocalTrajectoryParameters& localParameters,
32  const GlobalTrajectoryParameters& globalParameters,
33  const MagneticField& magField) : 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 }
49 
50 
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 }
99 
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:78
LocalVector direction() const
Momentum vector unit in the local frame.
T perp() const
Definition: PV3DBase.h:71
Basic3DVector< T > y() const
LocalPoint position() const
Local x and y position coordinates.
T y() const
Definition: PV3DBase.h:62
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:107
Basic3DVector< T > x() const
GlobalVector inInverseGeV(const GlobalPoint &gp) const
Field value ad specified global point, in 1/Gev.
Definition: MagneticField.h:40
T z() const
Definition: PV3DBase.h:63
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)
const RotationType & rotation() const
x
Definition: VDTMath.h:216
JacobianLocalToCurvilinear(const Surface &surface, const LocalTrajectoryParameters &localParameters, const MagneticField &magField)
T x() const
Definition: PV3DBase.h:61
double signedInverseMomentum() const
Signed inverse momentum q/p (zero for neutrals).