ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkEvent
TrkEventPrimitives
src
JacobianCurvilinearToLocal.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// JacobianCurvilinearToLocal.cxx, (c) ATLAS Detector software
8
9
10
//Trk
11
#include "
TrkEventPrimitives/JacobianCurvilinearToLocal.h
"
12
#include "
TrkEventPrimitives/CurvilinearUVT.h
"
13
//Gaudi
14
#include "GaudiKernel/PhysicalConstants.h"
15
#include "GaudiKernel/MsgStream.h"
16
//STD
17
#include <iostream>
18
#include <iomanip>
19
#include <sstream>
20
21
25
Trk::JacobianCurvilinearToLocal::JacobianCurvilinearToLocal
(
const
CurvilinearUVT
& curvUVT,
26
const
Amg::Vector3D
&
locX
,
27
const
Amg::Vector3D
&
locY
,
28
const
Amg::Vector3D
&
locZ
29
) :
30
AmgMatrix
(5,5)()
31
{
32
//initialize to zero
33
this->setIdentity();
34
35
double
locZdotCurvT =
locZ
.dot(curvUVT.
curvT
());
36
(*this)(0,0) = curvUVT.
curvV
().dot(
locY
)/locZdotCurvT;
// d(locX)/d(u)
37
(*this)(0,1) = - curvUVT.
curvU
().dot(
locY
)/locZdotCurvT;
// d(locX)/d(v)
38
(*this)(1,0) = - curvUVT.
curvV
().dot(
locX
)/locZdotCurvT;
// d(locY)/d(u)
39
(*this)(1,1) = curvUVT.
curvU
().dot(
locX
)/locZdotCurvT;
// d(locY)/d(v)
40
41
}
42
46
Trk::JacobianCurvilinearToLocal::JacobianCurvilinearToLocal
(
47
const
Amg::Vector3D
& bfield,
48
double
qOp,
49
double
sinTheta,
50
const
CurvilinearUVT
& curvUVT,
51
const
Amg::Vector3D
&
locX
,
52
const
Amg::Vector3D
&
locY
,
53
const
Amg::Vector3D
&
locZ
)
54
:
AmgMatrix
(5, 5)()
55
{
56
this->setIdentity();
57
58
// prepare the dot products
59
double
oneOverZt = 1./
locZ
.dot(curvUVT.
curvT
());
// 1./locZ * t
60
double
ux = curvUVT.
curvU
().dot(
locX
);
// u * locX
61
double
uy = curvUVT.
curvU
().dot(
locY
);
// u * locY
62
double
uz = curvUVT.
curvU
().dot(
locZ
);
// u * locZ
63
double
vx = curvUVT.
curvV
().dot(
locX
);
// v * locX
64
double
vy = curvUVT.
curvV
().dot(
locY
);
// v * locY
65
double
vz = curvUVT.
curvV
().dot(
locZ
);
// v * locZ
66
// specific for the helix
67
const
Amg::Vector3D
&
h
= bfield.normalized();
68
Amg::Vector3D
n(
h
.cross(curvUVT.
curvT
()));
// direction normal to track and magnetic field direction
69
double
alpha = n.mag();
// | h x t | projection of track normal to magnetic field direction
70
n /= alpha;
// normalization
71
double
B = bfield.mag();
72
73
// -> Psi and pathlength related variables
74
double
Q = - B * Gaudi::Units::c_light * qOp;
75
double
alphaQ = alpha*Q;
76
77
double
un = curvUVT.
curvU
().dot(n);
78
double
vn = curvUVT.
curvV
().dot(n);
79
// fill the components
80
(*this)(0,0) = vy*oneOverZt;
// d(locX)/d(u)
81
(*this)(0,1) = - uy*oneOverZt;
// d(locX)/d(v)
82
(*this)(1,0) = - vx*oneOverZt;
// d(locY)/d(u)
83
(*this)(1,1) = ux*oneOverZt;
// d(locY)/d(v)
84
(*this)(2,0) = - alphaQ/sinTheta*un*uz*oneOverZt;
// d(phi)/d(u)
85
(*this)(2,1) = - alphaQ/sinTheta*un*vz*oneOverZt;
// d(phi)/d(v)
86
(*this)(3,0) = alphaQ*vn*uz*oneOverZt;
// d(theta)/d(v)
87
(*this)(3,1) = alphaQ*vn*vz*oneOverZt;
// d(theta)/d(v)
88
89
}
90
91
92
94
MsgStream&
Trk::operator <<
( MsgStream& sl,
const
Trk::JacobianCurvilinearToLocal
& jac)
95
{
96
std::ostringstream os;
97
os << jac;
98
sl << MSG::DEBUG << os.str();
99
return
sl;
100
}
101
102
std::ostream&
Trk::operator <<
( std::ostream& sl,
const
Trk::JacobianCurvilinearToLocal
& jac)
103
{
104
auto
p = sl.precision();
105
sl << std::setiosflags(std::ios::fixed);
106
sl << std::setprecision(6);
107
sl <<
"Trk::JacobianCurvilinearToLocal \n"
;
108
sl <<
"______________________________________________________________________\n"
;
109
for
(
int
irow = 0; irow<5; irow++){
110
for
(
int
icol =0; icol<5; icol++){
111
sl << (jac)(irow,icol);
112
if
(irow < 4 || icol < 4 ) { sl <<
" "
;}
113
}
114
sl << std::endl;
115
}
116
sl <<
"______________________________________________________________________"
;
117
sl << std::setprecision(p);
118
return
sl;
119
}
CurvilinearUVT.h
JacobianCurvilinearToLocal.h
h
Header file for AthHistogramAlgorithm.
Trk::CurvilinearUVT
simple class that constructs the curvilinear vectors curvU and curvV from a given momentum direction ...
Definition
CurvilinearUVT.h:45
Trk::CurvilinearUVT::curvU
const Amg::Vector3D & curvU() const
Access methods.
Trk::CurvilinearUVT::curvT
const Amg::Vector3D & curvT() const
Trk::CurvilinearUVT::curvV
const Amg::Vector3D & curvV() const
Trk::JacobianCurvilinearToLocal
This class represents the jacobian for transforming from a curvilinear to a local frame.
Definition
JacobianCurvilinearToLocal.h:75
Trk::JacobianCurvilinearToLocal::JacobianCurvilinearToLocal
JacobianCurvilinearToLocal(const Trk::CurvilinearUVT &curvUVT, const Amg::Vector3D &locX, const Amg::Vector3D &locY, const Amg::Vector3D &locZ)
Constructor for straight line track model.
Definition
JacobianCurvilinearToLocal.cxx:25
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition
GeoPrimitives.h:47
Trk::AmgMatrix
AmgMatrix(3, 3) NeutralParticleParameterCalculator
Definition
NeutralParticleParameterCalculator.cxx:231
Trk::operator<<
MsgStream & operator<<(MsgStream &sl, const AlignModule &alignModule)
overload of << operator for MsgStream for debug output
Definition
AlignModule.cxx:204
Trk::locY
@ locY
local cartesian
Definition
ParamDefs.h:38
Trk::locX
@ locX
Definition
ParamDefs.h:37
Trk::locZ
@ locZ
local cylindrical
Definition
ParamDefs.h:42
Generated on
for ATLAS Offline Software by
1.17.0