16 template<
class T>
inline constexpr
T square(
const T&
x) {
return x*
x;}
19 template<
class T>
T radius(
const T&
x,
const T&
y)
26 std::cout << std::endl << message << std::endl;
27 for(
int i = 0 ;
i < matrix.rows(); ++
i)
29 for(
int j = 0;
j < matrix.cols(); ++
j)
30 { std::cout << matrix(
i,
j) <<
", "; }
32 std::cout << std::endl;
48 for(
int i = 0;
i < 6; ++
i)
50 for(
int j = 0;
j < 6; ++
j)
64 printMatrix(
"svtx covariance, acts units: ", svtxCovariance);
66 const double px = state->
get_px();
67 const double py = state->
get_py();
68 const double pz = state->
get_pz();
70 const double p = std::sqrt(p2);
71 const double invp = 1./
p;
73 const double uPx = px/
p;
74 const double uPy = py/
p;
75 const double uPz = pz/
p;
78 const double cosTheta = uPz;
79 const double sinTheta = std::sqrt(
square(uPx) +
square(uPy));
80 const double invSinTheta = 1. / sinTheta;
81 const double cosPhi = uPx * invSinTheta;
82 const double sinPhi = uPy * invSinTheta;
94 sphenixRot(4,3) = invp;
95 sphenixRot(5,4) = invp;
96 sphenixRot(6,5) = invp;
97 sphenixRot(7,3) = uPx/p2;
98 sphenixRot(7,4) = uPy/p2;
99 sphenixRot(7,5) = uPz/p2;
101 const auto rotatedMatrix = sphenixRot*svtxCovariance*sphenixRot.transpose();
119 Acts::BoundSquareMatrix actsLocalCov = jacobianGlobalToLocal * rotatedMatrix * jacobianGlobalToLocal.transpose();
127 printMatrix(
"Rotated to Acts local cov : ",actsLocalCov);
135 const auto covarianceMatrix = *params.
covariance();
136 printMatrix(
"Initial Acts covariance: ", covarianceMatrix);
138 const double px = params.
momentum().x();
139 const double py = params.
momentum().y();
140 const double pz = params.
momentum().z();
141 const double p = params.
momentum().norm();
142 const double p2 =
square(p);
144 const double uPx = px/
p;
145 const double uPy = py/
p;
146 const double uPz = pz/
p;
148 const double cosTheta = uPz;
149 const double sinTheta = std::sqrt(
square(uPx) +
square(uPy));
150 const double invSinTheta = 1./sinTheta;
151 const double cosPhi = uPx*invSinTheta;
152 const double sinPhi = uPy*invSinTheta;
171 const auto rotatedMatrix = jacobianLocalToGlobal * covarianceMatrix * jacobianLocalToGlobal.transpose();
181 sphenixRot(3,7) = uPx*p2;
182 sphenixRot(4,7) = uPy*p2;
183 sphenixRot(5,7) = uPz*p2;
189 for(
int i = 0;
i < 6; ++
i)
191 for(
int j = 0;
j < 6; ++
j)
203 printMatrix(
"Global sphenix cov after unit conv: " , globalCov);
209 {
if(
m_verbosity > 10) print_matrix( message, matrix ); }
218 float &dca3DzCov)
const
227 for(
int i = 0;
i < 3; ++
i)
229 for(
int j = 0;
j < 3; ++
j)
236 float phi = atan2(
r(1),
r(0));
241 rot(0,1) = -sin(phi);
250 rot_T = rot.transpose();
257 dca3DxyCov = rotCov(0,0);
258 dca3DzCov = rotCov(2,2);
264 const size_t& trackTip,
272 const auto typeFlags =
state.typeFlags();
277 if( !
state.hasSmoothed())
return true;
285 state.referenceSurface().getSharedPtr(),
287 state.smoothedCovariance(),
291 const auto global = params.
position(geoContext);
297 const auto momentum = params.momentum();
301 auto sourceLink =
state.getUncalibratedSourceLink().template get<ActsSourceLink>();
306 for (
int i = 0;
i < 6; ++
i)
307 for (
int j = 0;
j < 6; ++
j)
313 std::cout <<
" inserting state with x,y,z ="
317 <<
" pathlength " << pathlength
320 <<
"covariance " << globalCov << std::endl;