Commit 6f456acf authored by Wouter Deconinck's avatar Wouter Deconinck
Browse files

Support for acts@19.0.0

parent fa539623
Pipeline #32113 failed with stages
in 59 seconds
......@@ -44,7 +44,7 @@ find_package(ROOT COMPONENTS Core RIO Tree MathCore GenVector Geom REQUIRED)
find_package(DD4hep COMPONENTS DDG4 DDG4IO DDRec REQUIRED)
find_package(Acts REQUIRED COMPONENTS Core PluginIdentification PluginTGeo PluginDD4hep PluginJson)
set(Acts_VERSION_MIN "15.1.0")
set(Acts_VERSION_MIN "19.0.0")
set(Acts_VERSION "${Acts_VERSION_MAJOR}.${Acts_VERSION_MINOR}.${Acts_VERSION_PATCH}")
if(${Acts_VERSION} VERSION_LESS ${Acts_VERSION_MIN}
AND NOT "${Acts_VERSION}" STREQUAL "9.9.9")
......
......@@ -11,6 +11,7 @@
#include "JugTrack/Utilities/GroupBy.hpp"
#include "JugTrack/Utilities/Range.hpp"
#include "Acts/Geometry/GeometryIdentifier.hpp"
#include "Acts/Surfaces/Surface.hpp"
#include <algorithm>
#include <cstddef>
......@@ -177,21 +178,11 @@ struct GeometryIdMultisetAccessor {
// pointer to the container
const Container* container = nullptr;
// count the number of elements with requested geoId
size_t count(const Acts::GeometryIdentifier& geoId) const {
assert(container != nullptr);
return container->count(geoId);
}
// get the range of elements with requested geoId
std::pair<Iterator, Iterator> range(
const Acts::GeometryIdentifier& geoId) const {
std::pair<Iterator, Iterator> range(const Acts::Surface& surface) const {
assert(container != nullptr);
return container->equal_range(geoId);
return container->equal_range(surface.geometryId());
}
// get the element using the iterator
const Value& at(const Iterator& it) const { return *it; }
};
} // namespace FW
......@@ -12,6 +12,7 @@
#include "JugTrack/Index.hpp"
#include "Acts/EventData/SourceLink.hpp"
#include "Acts/Surfaces/Surface.hpp"
#include <cassert>
......
......@@ -141,14 +141,18 @@ namespace Jug::Reco {
extensions.measurementSelector.connect<&Acts::MeasurementSelector::select>(
&measSel);
IndexSourceLinkAccessor slAccessor;
slAccessor.container = src_links;
Acts::SourceLinkAccessorDelegate<IndexSourceLinkAccessor::Iterator>
slAccessorDelegate;
slAccessorDelegate.connect<&IndexSourceLinkAccessor::range>(&slAccessor);
// Set the CombinatorialKalmanFilter options
CKFTracking::TrackFinderOptions options(
m_geoctx, m_fieldctx, m_calibctx,
IndexSourceLinkAccessor(), extensions,
Acts::LoggerWrapper{logger()},
pOptions, &(*pSurface));
m_geoctx, m_fieldctx, m_calibctx, slAccessorDelegate,
extensions, Acts::LoggerWrapper{logger()}, pOptions, &(*pSurface));
auto results = (*m_trackFinderFunc)(*src_links, *init_trk_params, options);
auto results = (*m_trackFinderFunc)(*init_trk_params, options);
for (std::size_t iseed = 0; iseed < init_trk_params->size(); ++iseed) {
......
......@@ -40,7 +40,7 @@ class CKFTracking : public GaudiAlgorithm {
public:
/// Track finder function that takes input measurements, initial trackstate
/// and track finder options and returns some track-finder-specific result.
using TrackFinderOptions = Acts::CombinatorialKalmanFilterOptions<IndexSourceLinkAccessor>;
using TrackFinderOptions = Acts::CombinatorialKalmanFilterOptions<IndexSourceLinkAccessor::Iterator>;
using TrackFinderResult = std::vector<Acts::Result<Acts::CombinatorialKalmanFilterResult>>;
/// Find function that takes the above parameters
......@@ -49,8 +49,7 @@ public:
class CKFTrackingFunction {
public:
virtual ~CKFTrackingFunction() = default;
virtual TrackFinderResult operator()(const IndexSourceLinkContainer&,
const TrackParametersContainer&,
virtual TrackFinderResult operator()(const TrackParametersContainer&,
const TrackFinderOptions&) const = 0;
};
......
......@@ -44,12 +44,11 @@ namespace {
CKFTrackingFunctionImpl(CKF&& f) : trackFinder(std::move(f)) {}
Jug::Reco::CKFTracking::TrackFinderResult
operator()(const Jug::IndexSourceLinkContainer& sourcelinks,
const Jug::TrackParametersContainer& initialParameters,
operator()(const Jug::TrackParametersContainer& initialParameters,
const Jug::Reco::CKFTracking::TrackFinderOptions& options)
const override
{
return trackFinder.findTracks(sourcelinks, initialParameters, options);
return trackFinder.findTracks(initialParameters, options);
};
};
......
......@@ -142,14 +142,18 @@ namespace Jug::Reco {
extensions.measurementSelector.connect<&Acts::MeasurementSelector::select>(
&measSel);
IndexSourceLinkAccessor slAccessor;
slAccessor.container = src_links;
Acts::SourceLinkAccessorDelegate<IndexSourceLinkAccessor::Iterator>
slAccessorDelegate;
slAccessorDelegate.connect<&IndexSourceLinkAccessor::range>(&slAccessor);
// Set the CombinatorialKalmanFilter options
TrackFindingAlgorithm::TrackFinderOptions options(
m_geoctx, m_fieldctx, m_calibctx,
IndexSourceLinkAccessor(), extensions,
Acts::LoggerWrapper{logger()},
pOptions, &(*pSurface));
m_geoctx, m_fieldctx, m_calibctx, slAccessorDelegate,
extensions, Acts::LoggerWrapper{logger()}, pOptions, &(*pSurface));
auto results = (*m_trackFinderFunc)(*src_links, *init_trk_params, options);
auto results = (*m_trackFinderFunc)(*init_trk_params, options);
for (std::size_t iseed = 0; iseed < init_trk_params->size(); ++iseed) {
......
......@@ -40,7 +40,7 @@ class TrackFindingAlgorithm : public GaudiAlgorithm {
public:
/// Track finder function that takes input measurements, initial trackstate
/// and track finder options and returns some track-finder-specific result.
using TrackFinderOptions = Acts::CombinatorialKalmanFilterOptions<IndexSourceLinkAccessor>;
using TrackFinderOptions = Acts::CombinatorialKalmanFilterOptions<IndexSourceLinkAccessor::Iterator>;
using TrackFinderResult = std::vector<Acts::Result<Acts::CombinatorialKalmanFilterResult>>;
/// Find function that takes the above parameters
......@@ -49,8 +49,7 @@ public:
class TrackFinderFunction {
public:
virtual ~TrackFinderFunction() = default;
virtual TrackFinderResult operator()(const IndexSourceLinkContainer&,
const TrackParametersContainer&,
virtual TrackFinderResult operator()(const TrackParametersContainer&,
const TrackFinderOptions&) const = 0;
};
......
......@@ -44,12 +44,11 @@ namespace {
TrackFinderFunctionImpl(CKF&& f) : trackFinder(std::move(f)) {}
Jug::Reco::TrackFindingAlgorithm::TrackFinderResult
operator()(const Jug::IndexSourceLinkContainer& sourcelinks,
const Jug::TrackParametersContainer& initialParameters,
operator()(const Jug::TrackParametersContainer& initialParameters,
const Jug::Reco::TrackFindingAlgorithm::TrackFinderOptions& options)
const override
{
return trackFinder.findTracks(sourcelinks, initialParameters, options);
return trackFinder.findTracks(initialParameters, options);
};
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment