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(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 }
28 
31  const LocalTrajectoryParameters& localParameters,
32  const GlobalTrajectoryParameters& globalParameters,
33  const MagneticField& magField) : 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 }
50 
51 
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 }
107 
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:114
LocalVector direction() const
Momentum vector unit in the local frame.
int i
Definition: DBlmapReader.cc:9
T perp() const
Definition: PV3DBase.h:72
Basic3DVector< T > y() const
LocalPoint position() const
Local x and y position coordinates.
T y() const
Definition: PV3DBase.h:63
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:107
GlobalVector magneticFieldInInverseGeV(const GlobalPoint &x) const
Basic3DVector< T > x() const
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
T z() const
Definition: PV3DBase.h:64
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
JacobianLocalToCurvilinear(const Surface &surface, const LocalTrajectoryParameters &localParameters, const MagneticField &magField)
T x() const
Definition: PV3DBase.h:62