File indexing completed on 2025-01-18 09:12:03
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "Acts/Plugins/Hashing/HashingAlgorithmConfig.hpp"
0010 #include "Acts/Plugins/Hashing/HashingTrainingConfig.hpp"
0011 #include "Acts/Plugins/Python/Utilities.hpp"
0012 #include "ActsExamples/TrackFinding/SeedingAlgorithmHashing.hpp"
0013
0014 #include <memory>
0015
0016 #include <pybind11/pybind11.h>
0017 #include <pybind11/stl.h>
0018
0019 namespace py = pybind11;
0020
0021 using namespace ActsExamples;
0022 using namespace Acts;
0023
0024 namespace Acts::Python {
0025
0026 void addHashing(Context& ctx) {
0027 auto [m, mex] = ctx.get("main", "examples");
0028
0029 auto hashingModule = m.def_submodule("hashing");
0030 auto hashingExampleModule = mex.def_submodule("_hashing");
0031
0032 {
0033 using Config = Acts::HashingAlgorithmConfig;
0034 auto c = py::class_<Config>(hashingModule, "HashingAlgorithmConfig")
0035 .def(py::init<>());
0036 ACTS_PYTHON_STRUCT_BEGIN(c, Config);
0037 ACTS_PYTHON_MEMBER(bucketSize);
0038 ACTS_PYTHON_MEMBER(zBins);
0039 ACTS_PYTHON_MEMBER(phiBins);
0040 ACTS_PYTHON_STRUCT_END();
0041 patchKwargsConstructor(c);
0042 }
0043
0044 {
0045 using Config = Acts::HashingTrainingConfig;
0046 auto c = py::class_<Config>(hashingModule, "HashingTrainingConfig")
0047 .def(py::init<>());
0048 ACTS_PYTHON_STRUCT_BEGIN(c, Config);
0049 ACTS_PYTHON_MEMBER(annoySeed);
0050 ACTS_PYTHON_MEMBER(f);
0051 ACTS_PYTHON_STRUCT_END();
0052 patchKwargsConstructor(c);
0053 }
0054
0055 ACTS_PYTHON_DECLARE_ALGORITHM(
0056 ActsExamples::SeedingAlgorithmHashing, hashingExampleModule,
0057 "SeedingAlgorithmHashing", inputSpacePoints, outputSeeds, outputBuckets,
0058 seedFilterConfig, seedFinderConfig, seedFinderOptions, gridConfig,
0059 gridOptions, allowSeparateRMax, zBinNeighborsTop, zBinNeighborsBottom,
0060 numPhiNeighbors, hashingConfig, hashingTrainingConfig, useExtraCuts);
0061 }
0062
0063 }