15 #include "edm4hep/TrackState.h"
18 namespace EDM4hepUtil {
48 double cotTheta = std::tan(M_PI_2 + theta);
49 J(3, 3) = -cotTheta * cotTheta - 1;
50 J(4, 4) = Bz / std::sin(theta);
51 double sinTheta = std::sin(theta);
52 J(4, 3) = -Bz * qOverP * std::cos(theta) /
53 (sinTheta * sinTheta);
84 J(3, 3) = -1 / (tanLambda * tanLambda + 1);
85 J(4, 3) = -1 * omega * tanLambda /
86 (Bz * std::pow(tanLambda * tanLambda + 1, 3. / 2.));
87 J(4, 4) = 1 / (Bz * std::hypot(tanLambda, 1));
93 for (
int i = 0;
i < from.rows();
i++) {
94 for (
int j = 0;
j <=
i;
j++) {
95 size_t k = (
i + 1) *
i / 2 +
j;
102 auto k = [](
size_t i,
size_t j) {
return (i + 1) * i / 2 +
j; };
103 for (
int i = 0; i < to.rows(); i++) {
104 for (
int j = 0;
j < to.cols();
j++) {
105 to(i,
j) = from[
j <= i ?
k(i, j) :
k(j, i)];
116 std::shared_ptr<const Acts::Surface> refSurface =
120 std::optional<Acts::FreeVector> freePars;
122 auto makeFreePars = [&]() {
130 if (dynamic_cast<const Acts::PerigeeSurface*>(refSurface.get()) ==
nullptr) {
131 refSurface = Acts::Surface::makeShared<Acts::PerigeeSurface>(global);
136 freePars = makeFreePars();
148 refSurface->boundToFreeJacobian(gctx, params.
parameters());
150 boundToFree * params.
covariance().value() * boundToFree.transpose();
153 if (!freePars.has_value()) {
154 freePars = makeFreePars();
159 gctx, *refSurface, freePars.value(), covCache);
160 auto targetCov = std::get<Acts::BoundSquareMatrix>(varNewCov);
173 std::sin(targetPars[Acts::eBoundTheta]) *
Bz;
188 std::optional<BoundMatrix>
cov;
190 cov = J * params.
covariance.value() * J.transpose();