File indexing completed on 2026-01-09 09:26:47
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "Acts/Geometry/TrackingGeometry.hpp"
0010 #include "Acts/Utilities/Logger.hpp"
0011 #include "ActsExamples/EventData/GeometryContainers.hpp"
0012 #include "ActsExamples/EventData/SimHit.hpp"
0013 #include "ActsExamples/EventData/SimSpacePoint.hpp"
0014 #include "ActsExamples/Io/Svg/SvgPointWriter.hpp"
0015 #include "ActsExamples/Io/Svg/SvgTrackingGeometryWriter.hpp"
0016 #include "ActsPython/Utilities/Helpers.hpp"
0017 #include "ActsPython/Utilities/Macros.hpp"
0018
0019 #include <algorithm>
0020 #include <memory>
0021 #include <ranges>
0022 #include <sstream>
0023 #include <string>
0024 #include <tuple>
0025 #include <vector>
0026
0027 #include <pybind11/pybind11.h>
0028 #include <pybind11/stl.h>
0029
0030 namespace py = pybind11;
0031 using namespace pybind11::literals;
0032
0033 using namespace Acts;
0034 using namespace ActsExamples;
0035 using namespace ActsPlugins;
0036 using namespace ActsPython;
0037
0038 PYBIND11_MODULE(ActsExamplesPythonBindingsSvg, svg) {
0039
0040 {
0041 using Writer = SvgTrackingGeometryWriter;
0042 auto w =
0043 py::class_<Writer, std::shared_ptr<Writer>>(svg,
0044 "SvgTrackingGeometryWriter")
0045 .def(py::init<const Writer::Config&, Logging::Level>(),
0046 py::arg("config"), py::arg("level"))
0047 .def("write",
0048 py::overload_cast<const AlgorithmContext&,
0049 const TrackingGeometry&>(&Writer::write));
0050
0051 auto c = py::class_<Writer::Config>(w, "Config").def(py::init<>());
0052 ACTS_PYTHON_STRUCT(c, outputDir, converterOptions);
0053 }
0054 {
0055 using Writer = SvgPointWriter<SimSpacePoint>;
0056 auto w =
0057 py::class_<Writer, IWriter, std::shared_ptr<Writer>>(
0058 svg, "SvgSimSpacePointWriter")
0059 .def(py::init<const Writer::Config&, Logging::Level>(),
0060 py::arg("config"), py::arg("level"))
0061 .def("write",
0062 py::overload_cast<const AlgorithmContext&>(&Writer::write));
0063
0064 auto c = py::class_<Writer::Config>(w, "Config").def(py::init<>());
0065 ACTS_PYTHON_STRUCT(c, writerName, trackingGeometry, inputCollection,
0066 infoBoxTitle, outputDir);
0067 }
0068
0069 {
0070 using Writer = SvgPointWriter<SimHit, AccessorPositionXYZ>;
0071 auto w =
0072 py::class_<Writer, IWriter, std::shared_ptr<Writer>>(svg,
0073 "SvgSimHitWriter")
0074 .def(py::init<const Writer::Config&, Logging::Level>(),
0075 py::arg("config"), py::arg("level"))
0076 .def("write",
0077 py::overload_cast<const AlgorithmContext&>(&Writer::write));
0078
0079 auto c = py::class_<Writer::Config>(w, "Config").def(py::init<>());
0080 ACTS_PYTHON_STRUCT(c, writerName, trackingGeometry, inputCollection,
0081 infoBoxTitle, outputDir);
0082 }
0083 }