Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OnnxNeuralCalibrator.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file OnnxNeuralCalibrator.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2023 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
11 
12 #include <pybind11/pybind11.h>
13 #include <pybind11/stl.h>
14 
15 namespace py = pybind11;
16 
17 using namespace ActsExamples;
18 using namespace Acts;
19 
20 namespace Acts::Python {
21 
23  auto [m, mex, onnx] = ctx.get("main", "examples", "onnx");
24 
25  onnx.def(
26  "makeNeuralCalibrator",
27  [](const char *modelPath, size_t nComp, std::vector<size_t> volumeIds)
28  -> std::shared_ptr<MeasurementCalibrator> {
29  return std::make_shared<NeuralCalibrator>(modelPath, nComp, volumeIds);
30  },
31  py::arg("modelPath"), py::arg("nComp") = 1,
32  py::arg("volumeIds") = std::vector<size_t>({7, 8, 9}));
33 }
34 } // namespace Acts::Python