TrackingTools
AnalyticalJacobians
src
JacobianCartesianToLocal.cc
Go to the documentation of this file.
1
#include "
TrackingTools/AnalyticalJacobians/interface/JacobianCartesianToLocal.h
"
2
#include "
DataFormats/GeometrySurface/interface/Surface.h
"
3
#include "
TrackingTools/TrajectoryParametrization/interface/LocalTrajectoryParameters.h
"
4
5
JacobianCartesianToLocal::JacobianCartesianToLocal
(
const
Surface
& surface,
6
const
LocalTrajectoryParameters
& localParameters)
7
: theJacobian() {
8
//LocalCoordinates 1 = (q/|p|, dx/dz, dy/dz, x, y)
9
//LocalCoordinates 2 = (x, y, z, px, py, pz)
10
//Transformation: q/|p| = q/sqrt(px*px + py*py + pz*pz)
11
// dx/dz = px/pz
12
// dy/dz = py/pz
13
// x = x
14
// y = y
15
LocalVector
plocal = localParameters.
momentum
();
16
double
px
= plocal.
x
(),
py
= plocal.
y
(), pz = plocal.
z
();
17
double
p
= plocal.
mag
();
18
TrackCharge
q
= localParameters.
charge
();
19
// for neutrals: qbp is 1/p instead of q/p -
20
// equivalent to charge 1
21
if
(
q
== 0)
22
q
= 1;
23
//Jacobian theJacobian( (q/|p|, dx/dz, dy/dz, x, y) = f(x, y, z, px, py, pz) )
24
theJacobian
(0, 3) = -
q
*
px
/ (
p
*
p
*
p
);
25
theJacobian
(0, 4) = -
q
*
py
/ (
p
*
p
*
p
);
26
theJacobian
(0, 5) = -
q
* pz / (
p
*
p
*
p
);
27
if
(fabs(pz) > 0) {
28
theJacobian
(1, 3) = 1. / pz;
29
theJacobian
(1, 5) = -
px
/ (pz * pz);
30
theJacobian
(2, 4) = 1. / pz;
31
theJacobian
(2, 5) = -
py
/ (pz * pz);
32
}
33
theJacobian
(3, 0) = 1.;
34
theJacobian
(4, 1) = 1.;
35
36
/*
37
LocalVector l1 = surface.toLocal(GlobalVector(1., 0., 0.));
38
LocalVector l2 = surface.toLocal(GlobalVector(0., 1., 0.));
39
LocalVector l3 = surface.toLocal(GlobalVector(0., 0., 1.));
40
AlgebraicMatrix33 Rsub;
41
Rsub(0,0) = l1.x(); Rsub(0,1) = l2.x(); Rsub(0,2) = l3.x();
42
Rsub(1,0) = l1.y(); Rsub(1,1) = l2.y(); Rsub(1,2) = l3.y();
43
Rsub(2,0) = l1.z(); Rsub(2,1) = l2.z(); Rsub(2,2) = l3.z();
44
*/
45
46
AlgebraicMatrix33
Rsub;
47
// need to be copied anhhow to go from float to double...
48
Surface::RotationType
const
&
rot
= surface.
rotation
();
49
Rsub(0, 0) =
rot
.xx();
50
Rsub(0, 1) =
rot
.xy();
51
Rsub(0, 2) =
rot
.xz();
52
Rsub(1, 0) =
rot
.yx();
53
Rsub(1, 1) =
rot
.yy();
54
Rsub(1, 2) =
rot
.yz();
55
Rsub(2, 0) =
rot
.zx();
56
Rsub(2, 1) =
rot
.zy();
57
Rsub(2, 2) =
rot
.zz();
58
59
AlgebraicMatrix66
R
;
60
R
.Place_at(Rsub, 0, 0);
61
R
.Place_at(Rsub, 3, 3);
62
theJacobian
=
theJacobian
*
R
;
63
//dbg::dbg_trace(1,"Ca2L", localParameters.vector(),l1,l2,l3,theJacobian);
64
}
Vector3DBase< float, LocalTag >
JacobianCartesianToLocal.h
TkRotation< float >
LocalTrajectoryParameters.h
JacobianCartesianToLocal::theJacobian
AlgebraicMatrix56 theJacobian
Definition:
JacobianCartesianToLocal.h:29
TrackCharge
int TrackCharge
Definition:
TrackCharge.h:4
PV3DBase::x
T x() const
Definition:
PV3DBase.h:59
multPhiCorr_741_25nsDY_cfi.py
py
Definition:
multPhiCorr_741_25nsDY_cfi.py:12
Surface
Definition:
Surface.h:36
AlgebraicMatrix33
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepStd< double, 3, 3 > > AlgebraicMatrix33
Definition:
AlgebraicROOTObjects.h:41
JacobianCartesianToLocal::JacobianCartesianToLocal
JacobianCartesianToLocal(const Surface &surface, const LocalTrajectoryParameters &localParameters)
Definition:
JacobianCartesianToLocal.cc:5
PV3DBase::z
T z() const
Definition:
PV3DBase.h:61
LocalTrajectoryParameters
Definition:
LocalTrajectoryParameters.h:25
Surface.h
LocalTrajectoryParameters::charge
TrackCharge charge() const
Charge (-1, 0 or 1)
Definition:
LocalTrajectoryParameters.h:110
AlCaHLTBitMon_ParallelJobs.p
def p
Definition:
AlCaHLTBitMon_ParallelJobs.py:153
PV3DBase::y
T y() const
Definition:
PV3DBase.h:60
submitPVResolutionJobs.q
q
Definition:
submitPVResolutionJobs.py:84
PV3DBase::mag
T mag() const
Definition:
PV3DBase.h:64
multPhiCorr_741_25nsDY_cfi.px
px
Definition:
multPhiCorr_741_25nsDY_cfi.py:10
AlgebraicMatrix66
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepStd< double, 6, 6 > > AlgebraicMatrix66
Definition:
AlgebraicROOTObjects.h:62
LocalTrajectoryParameters::momentum
LocalVector momentum() const
Momentum vector in the local frame.
Definition:
LocalTrajectoryParameters.h:88
makeMuonMisalignmentScenario.rot
rot
Definition:
makeMuonMisalignmentScenario.py:322
GloballyPositioned::rotation
const RotationType & rotation() const
Definition:
GloballyPositioned.h:38
dttmaxenums::R
Definition:
DTTMax.h:29
Generated for CMSSW Reference Manual by
1.8.16