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/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 }  // namespace Acts::Python