ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkEvent
TrkEventPrimitives
src
JacobianPhiThetaLocalAngles.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// JacobianPhiThetaLocalAngles.cxx, (c) ATLAS Detector software
8
9
#include "
TrkEventPrimitives/JacobianPhiThetaLocalAngles.h
"
10
#include <cmath>
11
12
13
Trk::JacobianPhiThetaLocalAngles::JacobianPhiThetaLocalAngles
(
const
double
phi
,
const
double
theta
,
const
Amg::RotationMatrix3D
& rot) :
14
AmgMatrix
(2,2)()
15
{
16
// initialize
17
this->setIdentity();
18
19
// Rot is a 3x3 rotation matrix from global 3-vector to local 3-vector
20
double
cp = std::cos(
phi
);
21
double
sp
= std::sin(
phi
);
22
double
ct = std::cos(
theta
);
23
double
st = std::sin(
theta
);
24
25
AmgMatrix
(3,2) J2 =
AmgMatrix
(3,2)::Zero();
26
//
27
// derivatives dx/dphi dx/dtheta
28
// dy/dphi dy/dtheta
29
// dz/dphi dz/dtheta
30
//
31
// x = sin(theta)*cos(phi)
32
// y = sin(theta)*sin(phi)
33
// z = cos(theta)
34
//
35
J2(0,0) = -st*
sp
;
36
J2(1,0) = st*cp;
37
J2(0,1) = ct*cp;
38
J2(1,1) = ct*
sp
;
39
J2(2,1) = -st;
40
41
// Determine Local theta and phi
42
43
Amg::Vector3D
gdir(st*cp,st*
sp
,ct);
44
Amg::Vector3D
ldir = rot*gdir;
45
double
angleXZ = std::atan2(ldir.z(),ldir.x());
46
double
angleYZ = std::atan2(ldir.z(),ldir.y());
47
48
double
cx = std::cos(angleXZ);
49
double
sx = std::sin(angleXZ);
50
double
cy = std::cos(angleYZ);
51
double
sy = std::sin(angleYZ);
52
double
norm = std::sqrt(cx*sy*cx*sy + cy*sx*cy*sx + sx*sy*sx*sy);
53
double
zinv = norm/(sx*sy) ;
54
55
// std::cout << " Local angles XZ " << angleXZ << " YZ " << angleYZ << std::endl;
56
//
57
// local direction x = cx * sy / norm
58
// y = cy * sx / norm
59
// z = sx * sy / norm
60
//
61
AmgMatrix
(2,3) J1 =
AmgMatrix
(2,3)::Zero();
62
//
63
// derivatives d alphaXZ/dx d alphaXZ/dy d alphaXZ/dz
64
// d alphaYZ/dx d alphaYZ/dy d alphaYZ/dz
65
//
66
// tan(alphaXZ) = z / x
67
// tan(alhpaYZ) = z / y
68
//
69
J1(0,0) = -sx*sx*zinv;
70
J1(1,1) = -sy*sy*zinv;
71
J1(0,2) = cx*sx*zinv;
72
J1(1,2) = cy*sy*zinv;
73
74
const
AmgMatrix
(3,3)& Rot = rot;
75
AmgMatrix
(2,2) J =
AmgMatrix
(2,2)::Zero();
76
//
77
// Jacobian: lefthand local righthand global
78
//
79
J = J1*(Rot*J2);
80
//
81
// Store Jacobian J
82
//
83
(*this)(0,0) = J(0,0);
84
(*this)(0,1) = J(0,1);
85
(*this)(1,0) = J(1,0);
86
(*this)(1,1) = J(1,1);
87
}
88
AmgMatrix
#define AmgMatrix(rows, cols)
Definition
EventPrimitives.h:49
JacobianPhiThetaLocalAngles.h
sp
static Double_t sp
Definition
LArPhysWaveHECTool.cxx:37
Trk::JacobianPhiThetaLocalAngles::JacobianPhiThetaLocalAngles
JacobianPhiThetaLocalAngles(const Amg::RotationMatrix3D &rot)
Amg::RotationMatrix3D
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Definition
GeoPrimitives.h:50
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition
GeoPrimitives.h:48
Trk::AmgMatrix
AmgMatrix(3, 3) NeutralParticleParameterCalculator
Definition
NeutralParticleParameterCalculator.cxx:231
Trk::theta
@ theta
Definition
ParamDefs.h:66
Trk::phi
@ phi
Definition
ParamDefs.h:75
Generated on
for ATLAS Offline Software by
1.17.0