Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-10-30 07:54:43

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 "ActsExamples/TrackFinding/SeedingAlgorithmHashing.hpp"
0010 #include "ActsPlugins/Hashing/HashingAlgorithmConfig.hpp"
0011 #include "ActsPlugins/Hashing/HashingTrainingConfig.hpp"
0012 #include "ActsPython/Utilities/Helpers.hpp"
0013 #include "ActsPython/Utilities/Macros.hpp"
0014 
0015 #include <memory>
0016 
0017 #include <pybind11/pybind11.h>
0018 #include <pybind11/stl.h>
0019 
0020 namespace py = pybind11;
0021 
0022 using namespace Acts;
0023 using namespace ActsPlugins;
0024 using namespace ActsExamples;
0025 
0026 namespace ActsPython {
0027 
0028 void addHashing(Context& ctx) {
0029   auto [m, mex] = ctx.get("main", "examples");
0030 
0031   auto hashingModule = m.def_submodule("hashing");
0032   auto hashingExampleModule = mex.def_submodule("_hashing");
0033 
0034   {
0035     using Config = HashingAlgorithmConfig;
0036     auto c = py::class_<Config>(hashingModule, "HashingAlgorithmConfig")
0037                  .def(py::init<>());
0038     ACTS_PYTHON_STRUCT(c, bucketSize, zBins, phiBins);
0039     patchKwargsConstructor(c);
0040   }
0041 
0042   {
0043     using Config = HashingTrainingConfig;
0044     auto c = py::class_<Config>(hashingModule, "HashingTrainingConfig")
0045                  .def(py::init<>());
0046     ACTS_PYTHON_STRUCT(c, annoySeed, f);
0047     patchKwargsConstructor(c);
0048   }
0049 
0050   ACTS_PYTHON_DECLARE_ALGORITHM(
0051       SeedingAlgorithmHashing, hashingExampleModule, "SeedingAlgorithmHashing",
0052       inputSpacePoints, outputSeeds, outputBuckets, seedFilterConfig,
0053       seedFinderConfig, seedFinderOptions, gridConfig, gridOptions,
0054       allowSeparateRMax, zBinNeighborsTop, zBinNeighborsBottom, numPhiNeighbors,
0055       hashingConfig, hashingTrainingConfig);
0056 }
0057 
0058 }  // namespace ActsPython