Skip to content

Commit

Permalink
Merge branch 'main' into feature-g4sim-barcodes
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Feb 9, 2023
2 parents fadeb65 + d18a2e5 commit 2f172d3
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 73 deletions.
4 changes: 2 additions & 2 deletions Core/include/Acts/EventData/Track.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ struct TrackAccessorBase {
/// @return mutable reference to the column behind the key
template <typename track_proxy_t, bool RO = ReadOnly,
typename = std::enable_if_t<!RO>>
T& operator()(track_proxy_t track) {
T& operator()(track_proxy_t track) const {
static_assert(!track_proxy_t::ReadOnly,
"Cannot get mutable ref for const track proxy");
return track.template component<T>(key);
Expand All @@ -691,7 +691,7 @@ struct TrackAccessorBase {
/// @return const reference to the column behind the key
template <typename track_proxy_t, bool RO = ReadOnly,
typename = std::enable_if_t<RO>>
const T& operator()(track_proxy_t track) {
const T& operator()(track_proxy_t track) const {
if constexpr (track_proxy_t::ReadOnly) {
return track.template component<T>(key);
} else {
Expand Down
1 change: 0 additions & 1 deletion Examples/Python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ pybind11_add_module(ActsPythonBindings
src/Generators.cpp
src/TruthTracking.cpp
src/TrackFitting.cpp
src/TrackFittingChi2.cpp
src/TrackFinding.cpp
src/Vertexing.cpp
)
Expand Down
2 changes: 0 additions & 2 deletions Examples/Python/src/ModuleEntry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ void addInput(Context& ctx);
void addGenerators(Context& ctx);
void addTruthTracking(Context& ctx);
void addTrackFitting(Context& ctx);
void addTrackFittingChi2(Context& ctx);
void addTrackFinding(Context& ctx);
void addVertexing(Context& ctx);

Expand Down Expand Up @@ -265,7 +264,6 @@ PYBIND11_MODULE(ActsPythonBindings, m) {
addGenerators(ctx);
addTruthTracking(ctx);
addTrackFitting(ctx);
addTrackFittingChi2(ctx);
addTrackFinding(ctx);
addVertexing(ctx);

Expand Down
39 changes: 39 additions & 0 deletions Examples/Python/src/TrackFitting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "ActsExamples/TrackFitting/KalmanFitterFunction.hpp"
#include "ActsExamples/TrackFitting/SurfaceSortingAlgorithm.hpp"
#include "ActsExamples/TrackFitting/TrackFittingAlgorithm.hpp"
#include "ActsExamples/TrackFittingChi2/TrackFittingChi2Algorithm.hpp"

#include <memory>

Expand Down Expand Up @@ -106,6 +107,44 @@ void addTrackFitting(Context& ctx) {
py::arg("level"));
}

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

auto alg =
py::class_<Alg, BareAlgorithm, std::shared_ptr<Alg>>(
mex, "TrackFittingChi2Algorithm")
.def(py::init<const Alg::Config&, Acts::Logging::Level>(),
py::arg("config"), py::arg("level"))
.def_property_readonly("config", &Alg::config)
.def_static("makeTrackFitterChi2Function",
py::overload_cast<
std::shared_ptr<const Acts::TrackingGeometry>,
std::shared_ptr<const Acts::MagneticFieldProvider>>(
&Alg::makeTrackFitterChi2Function));

py::class_<
TrackFittingChi2Algorithm::TrackFitterChi2Function,
std::shared_ptr<TrackFittingChi2Algorithm::TrackFitterChi2Function>>(
alg, "TrackFitterChi2Function");

auto c = py::class_<Config>(alg, "Config").def(py::init<>());

ACTS_PYTHON_STRUCT_BEGIN(c, Config);
ACTS_PYTHON_MEMBER(inputMeasurements);
ACTS_PYTHON_MEMBER(inputSourceLinks);
ACTS_PYTHON_MEMBER(inputProtoTracks);
ACTS_PYTHON_MEMBER(inputInitialTrackParameters);
ACTS_PYTHON_MEMBER(outputTrajectories);
ACTS_PYTHON_MEMBER(nUpdates);
ACTS_PYTHON_MEMBER(fit);
ACTS_PYTHON_MEMBER(trackingGeometry);
ACTS_PYTHON_MEMBER(multipleScattering);
ACTS_PYTHON_MEMBER(energyLoss);
ACTS_PYTHON_MEMBER(pickTrack);
ACTS_PYTHON_STRUCT_END();
}

{
py::class_<FreeToBoundCorrection>(mex, "FreeToBoundCorrection")
.def(py::init<>())
Expand Down
68 changes: 0 additions & 68 deletions Examples/Python/src/TrackFittingChi2.cpp

This file was deleted.

0 comments on commit 2f172d3

Please sign in to comment.