Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:12:03

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
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 }  // namespace Acts::Python