|
8 | 8 |
|
9 | 9 | #include "Acts/Definitions/Algebra.hpp" |
10 | 10 | #include "Acts/Definitions/PdgParticle.hpp" |
| 11 | +#include "Acts/Definitions/TrackParametrization.hpp" |
11 | 12 | #include "Acts/Definitions/Units.hpp" |
12 | 13 | #include "Acts/EventData/ParticleHypothesis.hpp" |
13 | 14 |
|
@@ -99,6 +100,40 @@ void addDefinitions(py::module_& m) { |
99 | 100 | self[3]); |
100 | 101 | }); |
101 | 102 |
|
| 103 | + py::class_<BoundVector>(m, "BoundVector") |
| 104 | + .def(py::init<double, double, double, double, double, double>()) |
| 105 | + .def(py::init([](std::array<double, 6> a) { |
| 106 | + BoundVector v; |
| 107 | + v << a[0], a[1], a[2], a[3], a[4], a[5]; |
| 108 | + return v; |
| 109 | + })) |
| 110 | + .def_static("Zero", []() -> BoundVector { return BoundVector::Zero(); }) |
| 111 | + .def("__getitem__", |
| 112 | + [](const BoundVector& self, Eigen::Index i) { return self[i]; }) |
| 113 | + .def("__str__", [](const BoundVector& self) { |
| 114 | + return std::format("({}, {}, {}, {}, {}, {})", self[0], self[1], |
| 115 | + self[2], self[3], self[4], self[5]); |
| 116 | + }); |
| 117 | + |
| 118 | + py::class_<BoundMatrix>(m, "BoundMatrix") |
| 119 | + .def(py::init([]() { return BoundMatrix::Zero(); })) |
| 120 | + .def_static("Zero", []() -> BoundMatrix { return BoundMatrix::Zero(); }) |
| 121 | + .def_static("Identity", |
| 122 | + []() -> BoundMatrix { return BoundMatrix::Identity(); }) |
| 123 | + .def("__getitem__", |
| 124 | + [](const BoundMatrix& self, py::object idx) { |
| 125 | + py::tuple t = idx.cast<py::tuple>(); |
| 126 | + if (py::len(t) != 2) { |
| 127 | + throw py::index_error("BoundMatrix index must be (i, j)"); |
| 128 | + } |
| 129 | + return self(t[0].cast<Eigen::Index>(), t[1].cast<Eigen::Index>()); |
| 130 | + }) |
| 131 | + .def("__str__", [](const BoundMatrix& self) { |
| 132 | + std::stringstream ss; |
| 133 | + ss << self; |
| 134 | + return ss.str(); |
| 135 | + }); |
| 136 | + |
102 | 137 | py::class_<Translation3>(m, "Translation3") |
103 | 138 | .def(py::init([](const Vector3& a) { return Translation3(a); })) |
104 | 139 | .def(py::init([](std::array<double, 3> a) { |
|
0 commit comments