Skip to content

Commit

Permalink
fixes after rebase, matching the changes in TrackFindingAlgorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Adye authored and Tim Adye committed Mar 26, 2024
1 parent 17fd5da commit 3c3ce1a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
#include <functional>
#include <limits>
#include <memory>
#include <optional>
#include <string>
#include <variant>
#include <vector>

namespace Acts {
Expand Down Expand Up @@ -65,7 +67,9 @@ class MyTrackFindingAlgorithm final : public IAlgorithm {
/// CKF measurement selector config
Acts::MeasurementSelector::Config measurementSelectorCfg;
/// Track selector config
std::optional<Acts::TrackSelector::Config> trackSelectorCfg;
std::optional<std::variant<Acts::TrackSelector::Config,
Acts::TrackSelector::EtaBinnedConfig>>
trackSelectorCfg = std::nullopt;
/// Maximum number of propagation steps
unsigned int maxSteps = 100000;
};
Expand Down
23 changes: 14 additions & 9 deletions Examples/Algorithms/TrackFinding/src/MyTrackFindingAlgorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@
#include "Acts/Definitions/Algebra.hpp"
#include "Acts/Definitions/Direction.hpp"
#include "Acts/EventData/MultiTrajectory.hpp"
#include "Acts/EventData/ProxyAccessor.hpp"
#include "Acts/EventData/TrackContainer.hpp"
#include "Acts/EventData/TrackParameters.hpp"
#include "Acts/EventData/TrackStateType.hpp"
#include "Acts/EventData/VectorMultiTrajectory.hpp"
#include "Acts/EventData/VectorTrackContainer.hpp"
#include "Acts/Propagator/EigenStepper.hpp"
#include "Acts/Propagator/Propagator.hpp"
#include "Acts/Propagator/Navigator.hpp"
#include "Acts/Surfaces/PerigeeSurface.hpp"
#include "Acts/Surfaces/Surface.hpp"
#include "Acts/TrackFinding/CombinatorialKalmanFilter.hpp"
Expand All @@ -44,13 +46,14 @@ ActsExamples::MyTrackFindingAlgorithm::MyTrackFindingAlgorithm(
Config config, Acts::Logging::Level level)
: ActsExamples::IAlgorithm("MyTrackFindingAlgorithm", level),
m_cfg(std::move(config)),
m_trackSelector([this]() -> std::optional<Acts::TrackSelector> {
if (m_cfg.trackSelectorCfg.has_value()) {
return {m_cfg.trackSelectorCfg.value()};
} else {
return std::nullopt;
}
}()) {
m_trackSelector(
m_cfg.trackSelectorCfg.has_value()
? std::visit(
[](const auto& cfg) -> std::optional<Acts::TrackSelector> {
return {cfg};
},
m_cfg.trackSelectorCfg.value())
: std::nullopt) {
if (m_cfg.inputMeasurements.empty()) {
throw std::invalid_argument("Missing measurements input collection");
}
Expand Down Expand Up @@ -164,7 +167,7 @@ ActsExamples::ProcessCode ActsExamples::MyTrackFindingAlgorithm::execute(

tracks.addColumn<unsigned int>("trackGroup");
tracksTemp.addColumn<unsigned int>("trackGroup");
Acts::TrackAccessor<unsigned int> seedNumber("trackGroup");
Acts::ProxyAccessor<unsigned int> seedNumber("trackGroup");

unsigned int nSeed = 0;

Expand Down Expand Up @@ -218,7 +221,9 @@ ActsExamples::ProcessCode ActsExamples::MyTrackFindingAlgorithm::execute(
}

bwdTrack.reverseTrackStates(true);
seedNumber(bwdTrack) = nSeed;
// Set the seed number, this number decrease by 1 since the seed number
// has already been updated
seedNumber(bwdTrack) = nSeed - 1;

auto innermostFwdState = fwdTrack.trackStatesReversed().begin();
for (auto i = innermostFwdState;
Expand Down

0 comments on commit 3c3ce1a

Please sign in to comment.