Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Introduce Exa.TrkX plugin #1151

Merged
merged 103 commits into from
Mar 28, 2022
Merged
Show file tree
Hide file tree
Changes from 93 commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
d3c7189
add data attributes
Sep 9, 2021
259c945
parents of tracks
xju2 Sep 9, 2021
19ceb71
up
xju2 Sep 9, 2021
848b127
add spacepoint writer
xju2 Sep 9, 2021
b00abe5
Merge branch 'xju/add-sp-writer' into xju/add-track-parents
xju2 Sep 9, 2021
c2cfbf6
add license
xju2 Sep 9, 2021
07a0d71
spacepoints as postfix
xju2 Sep 9, 2021
2ab095b
update reader
xju2 Sep 10, 2021
3100a13
break inf loops
Sep 28, 2021
bc5c7a0
starting points
xju2 Nov 10, 2021
4e1b85f
add inputs
xju2 Nov 11, 2021
8cd1709
add old friends
xju2 Nov 11, 2021
8034ae6
for providers too
xju2 Nov 11, 2021
acddeb2
update onnx cmake
xju2 Nov 11, 2021
875a165
all to the main cmake folder
xju2 Nov 11, 2021
46180e3
mind project language
xju2 Nov 11, 2021
7ce8ebc
no error for unused-local-typedefs
xju2 Nov 11, 2021
012bffc
cleanining unused
xju2 Nov 11, 2021
fc713b5
be kind to unused
xju2 Nov 11, 2021
c1425d0
be kind to all
xju2 Nov 11, 2021
fa3ec8f
with kindness it compiles
xju2 Nov 11, 2021
2ff5143
rearrange
xju2 Nov 11, 2021
e5e9164
add an example
xju2 Nov 11, 2021
420dc34
reduce dep.
xju2 Nov 11, 2021
3eec3f0
add an example
xju2 Nov 11, 2021
20d5ba2
cannot link
xju2 Nov 11, 2021
75256e9
move to plugins
xju2 Nov 12, 2021
0d545f3
remove cugraph and libfrnn from examples
xju2 Nov 12, 2021
2160c85
compile dep.
xju2 Nov 12, 2021
9049167
refactorize the code
xju2 Nov 12, 2021
c814983
public vs private
xju2 Nov 12, 2021
bc6403b
add a default constuctor
xju2 Nov 15, 2021
f2949a6
comment most parts for testing
xju2 Nov 15, 2021
bd2ddcc
no regex
xju2 Nov 16, 2021
4441b2c
up
xju2 Nov 16, 2021
2010994
Merge branch 'xju/exatrkx-plugins' into xju/exatrkx-plugins-debug
xju2 Nov 16, 2021
889b94a
ptr protection
xju2 Nov 16, 2021
f155093
a small hack
xju2 Nov 16, 2021
525a985
runs
xju2 Nov 16, 2021
41bbfe5
Merge branch 'master' into xju/exatrkx-plugins-pr
xju2 Dec 23, 2021
3921e99
remove 2spacepoints
xju2 Dec 23, 2021
bb34907
new digi alg
xju2 Dec 23, 2021
a6d95ab
up
xju2 Jan 10, 2022
57a3ae6
Merge branch 'upacts/main' into xju/exatrkx-plugins-pr
xju2 Jan 10, 2022
1571c64
This somehow works I think
benjaminhuth Jan 19, 2022
4a61048
remove some unused cmake files
benjaminhuth Jan 19, 2022
adbe858
Updated to newer cuGraph version
benjaminhuth Jan 24, 2022
e73b65e
TrackFindingMLBasedAlgorithm only use GNN
Corentin-Allaire Jan 24, 2022
1f72d31
ExaTrkXTrackFinding pybinding
Corentin-Allaire Jan 24, 2022
25058fd
py test
Corentin-Allaire Jan 24, 2022
7753739
Merge pull request #1 from Corentin-Allaire/gnn-python
benjaminhuth Jan 24, 2022
65aa744
try to get python binding work (does not compile at the moment)
benjaminhuth Jan 24, 2022
e9593ea
Python binding compiles now (not sure if it runs though)
benjaminhuth Jan 24, 2022
ca0f428
some small changes to the python script
benjaminhuth Jan 24, 2022
86c7888
Now the TrackFinderML can be imported correctly
benjaminhuth Jan 24, 2022
ea1aafb
small fix
Corentin-Allaire Jan 25, 2022
18e3c51
Merge remote-tracking branch 'benjamin/plugin/exatrkx' into gnn-python
Corentin-Allaire Jan 25, 2022
7c8b2d9
Now the python examples works!
benjaminhuth Jan 25, 2022
58b2ba3
add ExaTrkXTrackFinding in the bindings
Corentin-Allaire Jan 25, 2022
e3f4b77
Merge branch 'gnn-python' of https://github.com/Corentin-Allaire/acts…
benjaminhuth Jan 26, 2022
36a9579
Merge branch 'Corentin-Allaire-gnn-python' into plugin/exatrkx
benjaminhuth Jan 26, 2022
5c3fcf6
Some fixes, and add namespace Acts to Plugin Exa.TrkX
benjaminhuth Jan 26, 2022
be3ba14
moved bundled dependencies of Exa.TrkX to thirdparty directory
benjaminhuth Jan 26, 2022
4713831
remove the cugraphtestutil files since they do not seem to be necessary
benjaminhuth Jan 26, 2022
9557dc9
Small changes to cmake and examples binary
Feb 9, 2022
3c08e60
Merge branch 'main' into plugin/exatrkx
Feb 9, 2022
46612de
Revert some changes back to main
Feb 9, 2022
fd59a68
fix
Feb 9, 2022
586da65
clang-format
Feb 9, 2022
c42985f
some cmake cleanup and initial workflow for the CI build of the Exa.T…
Feb 9, 2022
4c41867
Update getting_started.md
benjaminhuth Feb 9, 2022
338bfd0
Create README.md
benjaminhuth Feb 9, 2022
42f19d0
Update README.md
benjaminhuth Feb 9, 2022
31f4573
Update README.md
benjaminhuth Feb 9, 2022
1c227d3
Add some documentation
Feb 9, 2022
d67d9f3
Add licenses
Feb 9, 2022
e27c0cf
clang-format
Feb 9, 2022
2938b9a
fix cmake so that it only builds Exa.TrkX example binary if we enable it
Feb 9, 2022
31d1126
format python
Feb 9, 2022
d7a0ad0
fix python binding in case of disabled ExaTrkX plugin
Feb 10, 2022
aff4ab7
Update Examples/Algorithms/TrackFindingMLBased/src/TrackFindingMLBase…
benjaminhuth Feb 10, 2022
4bf18ed
Update Examples/Algorithms/TrackFindingMLBased/src/TrackFindingMLBase…
benjaminhuth Feb 10, 2022
3646b4b
fix -Werror for unused parameter
Feb 10, 2022
59f471d
clang-format + check if now the CI build for exatrkx works
Feb 10, 2022
39215ea
fix typo in README
benjaminhuth Feb 11, 2022
c9b79aa
rename weakly_connected_components to weaklyConnectedComponents
benjaminhuth Feb 11, 2022
fb334df
Rename example files from '*MLBased*' to '*ExaTrkX*'
benjaminhuth Feb 11, 2022
05eb036
update build workflow for exatrkx plugin, maybe it works
benjaminhuth Feb 11, 2022
c2ae151
clang-format
benjaminhuth Feb 11, 2022
e6f9724
update python script
Feb 16, 2022
e3e1259
rename python script
Feb 16, 2022
e4c5436
py-format
Feb 16, 2022
d790e5b
Update builds.yml
benjaminhuth Feb 16, 2022
fde429d
Fix -Werror-unused
benjaminhuth Feb 16, 2022
22e3a39
Update Examples/Scripts/Python/exatrkx.py
benjaminhuth Feb 16, 2022
bb3a490
update exatrkx.py
benjaminhuth Feb 17, 2022
e28e913
Update exatrkx.py
benjaminhuth Feb 17, 2022
aa3cdf8
Merge branch 'main' into plugin/exatrkx
benjaminhuth Feb 17, 2022
8c4f78d
Merge branch 'main' into plugin/exatrkx
benjaminhuth Mar 23, 2022
8d5d75e
format python
Mar 23, 2022
de7498a
Merge branch 'main' into plugin/exatrkx
benjaminhuth Mar 23, 2022
431d7e7
Merge branch 'main' into plugin/exatrkx
benjaminhuth Mar 24, 2022
52c998e
Merge branch 'main' into plugin/exatrkx
benjaminhuth Mar 25, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,22 @@ jobs:
-DACTS_BUILD_UNITTESTS=ON
- name: Build
run: cmake --build build --
exatrkx:
runs-on: ubuntu-latest
container: ghcr.io/acts-project/ubuntu2004_exatrkx:v17
steps:
- uses: actions/checkout@v2
- name: Configure
run: >
cmake -B build -S .
-GNinja
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_CXX_FLAGS=-Werror
-DACTS_BUILD_PLUGIN_EXATRKX=ON
-DACTS_BUILD_EXAMPLES_EXATRKX=ON
-DACTS_BUILD_EXAMPLES_PYTHON_BINDINGS=ON
- name: Build
run: cmake --build build --
sycl:
runs-on: ubuntu-latest
container: ghcr.io/acts-project/ubuntu2004_oneapi:v9
Expand Down
36 changes: 29 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ option(ACTS_BUILD_PLUGIN_AUTODIFF "Build the autodiff plugin" OFF)
option(ACTS_USE_SYSTEM_AUTODIFF "Use autodiff provided by the system instead of the bundled version" OFF)
option(ACTS_BUILD_PLUGIN_CUDA "Build CUDA plugin" OFF)
option(ACTS_BUILD_PLUGIN_DD4HEP "Build DD4hep plugin" OFF)
option(ACTS_BUILD_PLUGIN_EXATRKX "Build the Exa.TrkX plugin" OFF)
option(ACTS_BUILD_PLUGIN_IDENTIFICATION "Build Identification plugin" OFF)
option(ACTS_BUILD_PLUGIN_JSON "Build json plugin" OFF)
option(ACTS_USE_SYSTEM_NLOHMANN_JSON "Use nlohmann::json provided by the system instead of the bundled version" OFF)
Expand All @@ -47,6 +48,7 @@ option(ACTS_BUILD_ALIGNMENT "Build Alignment package" OFF)
# examples related options
option(ACTS_BUILD_EXAMPLES "Build standalone examples" OFF)
option(ACTS_BUILD_EXAMPLES_DD4HEP "Build DD4hep-based code in the examples" OFF)
option(ACTS_BUILD_EXAMPLES_EXATRKX "Build the Exa.TrkX example code" OFF)
option(ACTS_BUILD_EXAMPLES_GEANT4 "Build Geant4-based code in the examples" OFF)
option(ACTS_BUILD_EXAMPLES_HEPMC3 "Build HepMC3-based code in the examples" OFF)
option(ACTS_BUILD_EXAMPLES_PYTHIA8 "Build Pythia8-based code in the examples" OFF)
Expand Down Expand Up @@ -77,13 +79,15 @@ set_option_if(ACTS_BUILD_EXAMPLES_PYTHIA8 ACTS_BUILD_EVERYTHING)
set_option_if(ACTS_BUILD_FATRAS_GEANT4 ACTS_BUILD_EVERYTHING)
set_option_if(ACTS_BUILD_FATRAS ACTS_BUILD_FATRAS_GEANT4)
set_option_if(ACTS_BUILD_ALIGNMENT ACTS_BUILD_EVERYTHING)

# any examples component activates the general examples option
set_option_if(
ACTS_BUILD_EXAMPLES
ACTS_BUILD_EXAMPLES_DD4HEP
OR ACTS_BUILD_EXAMPLES_GEANT4
OR ACTS_BUILD_EXAMPLES_HEPMC3
OR ACTS_BUILD_EXAMPLES_PYTHIA8
OR ACTS_BUILD_EXAMPLES_EXATRKX
OR ACTS_BUILD_EVERYTHING)
# core plugins might be required by examples or depend on each other
set_option_if(
Expand All @@ -103,6 +107,7 @@ set_option_if(
ACTS_BUILD_EXAMPLES OR ACTS_BUILD_EVERYTHING)
set_option_if(ACTS_BUILD_PLUGIN_LEGACY ACTS_BUILD_EVERYTHING)
set_option_if(ACTS_BUILD_PLUGIN_AUTODIFF ACTS_BUILD_EVERYTHING)
set_option_if(ACTS_BUILD_EXAMPLES_EXATRKX ACTS_BUILD_PLUGIN_EXATRKX)

# feature tests
include(CheckCXXSourceCompiles)
Expand Down Expand Up @@ -179,6 +184,20 @@ macro(project)
set(${PROJECT_NAME}_VERSION "${${PROJECT_NAME}_VERSION}" CACHE INTERNAL "")
endmacro()

# CUDA settings are collected here in a macro, so that they can be reused by different plugins
macro(enable_cuda)
enable_language(CUDA)
set(CMAKE_CUDA_STANDARD 14 CACHE STRING "CUDA C++ standard to use")
set(CMAKE_CUDA_STANDARD_REQUIRED ON CACHE BOOL
"Force the C++ standard requirement")
if(NOT CMAKE_CUDA_ARCHITECTURES)
set(CMAKE_CUDA_ARCHITECTURES "35;52;75" CACHE STRING
"CUDA architectures to generate code for")
endif()
set(CMAKE_CUDA_FLAGS_DEBUG "${CMAKE_CUDA_FLAGS_DEBUG} -g -G")
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --extended-lambda")
endmacro()

# optional packages
#
# find packages explicitly for each component even if this means searching for
Expand Down Expand Up @@ -207,13 +226,7 @@ if(ACTS_BUILD_PLUGIN_AUTODIFF)
endif()
endif()
if(ACTS_BUILD_PLUGIN_CUDA)
enable_language(CUDA)
set(CMAKE_CUDA_STANDARD 14 CACHE STRING "CUDA C++ standard to use")
set(CMAKE_CUDA_STANDARD_REQUIRED ON CACHE BOOL
"Force the C++ standard requirement")
set(CMAKE_CUDA_ARCHITECTURES "35;52;75" CACHE STRING
"CUDA architectures to generate code for")
set(CMAKE_CUDA_FLAGS_DEBUG "-g -G")
enable_cuda()
endif()
if(ACTS_BUILD_PLUGIN_DD4HEP)
find_package(DD4hep ${_acts_dd4hep_version} REQUIRED CONFIG COMPONENTS DDCore DDDetectors)
Expand All @@ -238,6 +251,15 @@ if(ACTS_BUILD_PLUGIN_TGEO)
find_package(ROOT ${_acts_root_version} REQUIRED CONFIG COMPONENTS Geom)
check_root_compatibility()
endif()
if(ACTS_BUILD_PLUGIN_EXATRKX)
enable_cuda()
find_package(CUDAToolkit REQUIRED)
find_package(Torch REQUIRED)
find_package(OnnxRuntime REQUIRED)
find_package(cugraph REQUIRED)
add_subdirectory(thirdparty/libFRNN)
endif()

# examples dependencies
if(ACTS_BUILD_EXAMPLES)
set(THREADS_PREFER_PTHREAD_FLAG ON)
Expand Down
1 change: 1 addition & 0 deletions Examples/Algorithms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ add_subdirectory(MaterialMapping)
add_subdirectory(Printers)
add_subdirectory(Propagation)
add_subdirectory(TrackFinding)
add_subdirectory_if(TrackFindingExaTrkX ACTS_BUILD_EXAMPLES_EXATRKX)
add_subdirectory(TrackFitting)
add_subdirectory(TruthTracking)
add_subdirectory(Vertexing)
Expand Down
23 changes: 23 additions & 0 deletions Examples/Algorithms/TrackFindingExaTrkX/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
add_library(
ActsExamplesTrackFindingExaTrkX SHARED
src/TrackFindingAlgorithmExaTrkX.cpp
)


target_include_directories(
ActsExamplesTrackFindingExaTrkX
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)


target_link_libraries(
ActsExamplesTrackFindingExaTrkX
PUBLIC
ActsPluginExaTrkX
ActsExamplesFramework
)

install(
TARGETS ActsExamplesTrackFindingExaTrkX
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// This file is part of the Acts project.
//
// Copyright (C) 2022 CERN for the benefit of the Acts project
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#pragma once

#include "Acts/Plugins/ExaTrkX/ExaTrkXTrackFinding.hpp"
#include "ActsExamples/Framework/BareAlgorithm.hpp"

#include <string>
#include <vector>

namespace ActsExamples {

class TrackFindingAlgorithmExaTrkX final : public BareAlgorithm {
public:
struct Config {
/// Input spacepoints collection.
std::string inputSpacePoints;

/// Output protoTracks collection.
std::string outputProtoTracks;

/// ML based track finder
std::shared_ptr<Acts::ExaTrkXTrackFinding> trackFinderML;

// NOTE the other config parameters for the Exa.TrkX class for now are just
// initialized as the defaults
};

/// Constructor of the track finding algorithm
///
/// @param cfg is the config struct to configure the algorithm
/// @param level is the logging level
TrackFindingAlgorithmExaTrkX(Config cfg, Acts::Logging::Level lvl);

virtual ~TrackFindingAlgorithmExaTrkX() {}

/// Framework execute method of the track finding algorithm
///
/// @param ctx is the algorithm context that holds event-wise information
/// @return a process code to steer the algorithm flow
ActsExamples::ProcessCode execute(
const ActsExamples::AlgorithmContext& ctx) const final;

const Config& config() const { return m_cfg; }

private:
// configuration
Config m_cfg;
};

} // namespace ActsExamples
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// This file is part of the Acts project.
//
// Copyright (C) 2022 CERN for the benefit of the Acts project
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#include "ActsExamples/TrackFindingExaTrkX/TrackFindingAlgorithmExaTrkX.hpp"

#include "ActsExamples/EventData/Index.hpp"
#include "ActsExamples/EventData/ProtoTrack.hpp"
#include "ActsExamples/EventData/SimSpacePoint.hpp"
#include "ActsExamples/Framework/WhiteBoard.hpp"

ActsExamples::TrackFindingAlgorithmExaTrkX::TrackFindingAlgorithmExaTrkX(
Config config, Acts::Logging::Level level)
: ActsExamples::BareAlgorithm("TrackFindingMLBasedAlgorithm", level),
m_cfg(std::move(config)) {
if (m_cfg.inputSpacePoints.empty()) {
throw std::invalid_argument("Missing spacepoint input collection");
}
if (m_cfg.outputProtoTracks.empty()) {
throw std::invalid_argument("Missing protoTrack output collection");
}
if (!m_cfg.trackFinderML) {
throw std::invalid_argument("Missing track finder");
}
}

ActsExamples::ProcessCode ActsExamples::TrackFindingAlgorithmExaTrkX::execute(
const ActsExamples::AlgorithmContext& ctx) const {
// Read input data
const auto& spacepoints =
ctx.eventStore.get<SimSpacePointContainer>(m_cfg.inputSpacePoints);

// Convert Input data to a list of size [num_measurements x
// measurement_features]
size_t num_spacepoints = spacepoints.size();
ACTS_INFO("Received " << num_spacepoints << " spacepoints");

std::vector<float> inputValues;
std::vector<uint32_t> spacepointIDs;
inputValues.reserve(spacepoints.size() * 3);
spacepointIDs.reserve(spacepoints.size());
for (const auto& sp : spacepoints) {
float x = sp.x();
float y = sp.y();
float z = sp.z();
float r = sp.r();
float phi = std::atan2(y, x);
inputValues.push_back(r);
inputValues.push_back(phi);
inputValues.push_back(z);

spacepointIDs.push_back(sp.measurementIndex());
}

// ProtoTrackContainer protoTracks;
std::vector<std::vector<uint32_t> > trackCandidates;
m_cfg.trackFinderML->getTracks(inputValues, spacepointIDs, trackCandidates);

std::vector<ProtoTrack> protoTracks;
protoTracks.reserve(trackCandidates.size());
for (auto& x : trackCandidates) {
ProtoTrack onetrack;
std::copy(x.begin(), x.end(), std::back_inserter(onetrack));
protoTracks.push_back(std::move(onetrack));
}

ACTS_INFO("Created " << protoTracks.size() << " proto tracks");
ctx.eventStore.add(m_cfg.outputProtoTracks, std::move(protoTracks));

return ActsExamples::ProcessCode::SUCCESS;
}
6 changes: 6 additions & 0 deletions Examples/Python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ else()
target_sources(ActsPythonBindings PRIVATE src/HepMC3Stub.cpp)
endif()

if(ACTS_BUILD_EXAMPLES_EXATRKX)
target_link_libraries(ActsPythonBindings PUBLIC ActsExamplesTrackFindingExaTrkX)
target_sources(ActsPythonBindings PRIVATE src/ExaTrkXTrackFinding.cpp)
else()
target_sources(ActsPythonBindings PRIVATE src/ExaTrkXTrackFindingStub.cpp)
endif()

add_custom_target(ActsPythonGlueCode)
configure_file(setup.sh.in ${_python_dir}/setup.sh)
Expand Down
72 changes: 72 additions & 0 deletions Examples/Python/src/ExaTrkXTrackFinding.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// This file is part of the Acts project.
//
// Copyright (C) 2021 CERN for the benefit of the Acts project
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#include "Acts/Plugins/ExaTrkX/ExaTrkXTrackFinding.hpp"

#include "Acts/Plugins/Python/Utilities.hpp"
#include "Acts/TrackFinding/MeasurementSelector.hpp"
#include "ActsExamples/TrackFinding/SeedingAlgorithm.hpp"
#include "ActsExamples/TrackFinding/SpacePointMaker.hpp"
#include "ActsExamples/TrackFinding/TrackFindingAlgorithm.hpp"
#include "ActsExamples/TrackFindingExaTrkX/TrackFindingAlgorithmExaTrkX.hpp"

#include <memory>

#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

namespace py = pybind11;

using namespace ActsExamples;
using namespace Acts;

namespace Acts::Python {

void addExaTrkXTrackFinding(Context& ctx) {
auto [m, mex] = ctx.get("main", "examples");

{
using Alg = Acts::ExaTrkXTrackFinding;
using Config = Acts::ExaTrkXTrackFinding::Config;

auto alg = py::class_<Alg, std::shared_ptr<Alg>>(mex, "ExaTrkXTrackFinding")
.def(py::init<const Config&>(), py::arg("config"))
.def_property_readonly("config", &Alg::config);

auto c = py::class_<Config>(alg, "Config").def(py::init<>());
ACTS_PYTHON_STRUCT_BEGIN(c, Config);
ACTS_PYTHON_MEMBER(inputMLModuleDir);
ACTS_PYTHON_MEMBER(spacepointFeatures);
ACTS_PYTHON_MEMBER(embeddingDim);
ACTS_PYTHON_MEMBER(rVal);
ACTS_PYTHON_MEMBER(knnVal);
ACTS_PYTHON_MEMBER(filterCut);
ACTS_PYTHON_STRUCT_END();
}

{
using Alg = ActsExamples::TrackFindingAlgorithmExaTrkX;
using Config = Alg::Config;

auto alg =
py::class_<Alg, ActsExamples::BareAlgorithm, std::shared_ptr<Alg>>(
mex, "TrackFindingAlgorithmExaTrkX")
.def(py::init<const Config&, Acts::Logging::Level>(),
py::arg("config"), py::arg("level"))
.def_property_readonly("config", &Alg::config);

auto c = py::class_<Config>(alg, "Config").def(py::init<>());
ACTS_PYTHON_STRUCT_BEGIN(c, Config);
ACTS_PYTHON_MEMBER(inputSpacePoints);
ACTS_PYTHON_MEMBER(outputProtoTracks);
ACTS_PYTHON_MEMBER(trackFinderML);
ACTS_PYTHON_STRUCT_END();
}
}

} // namespace Acts::Python
18 changes: 18 additions & 0 deletions Examples/Python/src/ExaTrkXTrackFindingStub.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// This file is part of the Acts project.
//
// Copyright (C) 2022 CERN for the benefit of the Acts project
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#include "Acts/Plugins/Python/Utilities.hpp"

#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

namespace Acts::Python {
void addExaTrkXTrackFinding(Context&) {
// dummy function
}
} // namespace Acts::Python
Loading