File indexing completed on 2025-01-18 09:12:03
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "Acts/Plugins/Python/Utilities.hpp"
0010 #include <ActsExamples/EventData/NeuralCalibrator.hpp>
0011
0012 #include <pybind11/pybind11.h>
0013 #include <pybind11/stl.h>
0014
0015 namespace py = pybind11;
0016
0017 using namespace ActsExamples;
0018 using namespace Acts;
0019
0020 namespace Acts::Python {
0021
0022 void addOnnxNeuralCalibrator(Context &ctx) {
0023 auto [m, mex, onnx] = ctx.get("main", "examples", "onnx");
0024
0025 onnx.def(
0026 "makeNeuralCalibrator",
0027 [](const char *modelPath, std::size_t nComp,
0028 std::vector<std::size_t> volumeIds)
0029 -> std::shared_ptr<MeasurementCalibrator> {
0030 return std::make_shared<NeuralCalibrator>(modelPath, nComp, volumeIds);
0031 },
0032 py::arg("modelPath"), py::arg("nComp") = 1,
0033 py::arg("volumeIds") = std::vector<std::size_t>({7, 8, 9}));
0034 }
0035 }