From 8ae4a6fdb22e81ecfd10744f84d794face85de9a Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Thu, 16 Jan 2025 15:09:24 -0600 Subject: [PATCH 1/9] refactor!: Use track container in Core CKF and pass track proxies to delegates (#3161) @36.0.0: --- src/algorithms/tracking/CKFTracking.h | 6 ++++++ src/algorithms/tracking/CKFTrackingFunction.cc | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/src/algorithms/tracking/CKFTracking.h b/src/algorithms/tracking/CKFTracking.h index 896944c54..1050dedc3 100644 --- a/src/algorithms/tracking/CKFTracking.h +++ b/src/algorithms/tracking/CKFTracking.h @@ -40,9 +40,15 @@ namespace eicrecon { public: /// Track finder function that takes input measurements, initial trackstate /// and track finder options and returns some track-finder-specific result. +#if Acts_VERSION_MAJOR >= 36 + using TrackFinderOptions = + Acts::CombinatorialKalmanFilterOptions; +#else using TrackFinderOptions = Acts::CombinatorialKalmanFilterOptions; +#endif using TrackFinderResult = Acts::Result>; diff --git a/src/algorithms/tracking/CKFTrackingFunction.cc b/src/algorithms/tracking/CKFTrackingFunction.cc index 5e748ff5b..4075415f6 100644 --- a/src/algorithms/tracking/CKFTrackingFunction.cc +++ b/src/algorithms/tracking/CKFTrackingFunction.cc @@ -38,8 +38,13 @@ namespace eicrecon{ using Navigator = Acts::Navigator; using Propagator = Acts::Propagator; +#if Acts_VERSION_MAJOR >= 36 + using CKF = + Acts::CombinatorialKalmanFilter; +#else using CKF = Acts::CombinatorialKalmanFilter; +#endif using TrackContainer = Acts::TrackContainer Date: Thu, 16 Jan 2025 15:14:54 -0600 Subject: [PATCH 2/9] refactor!: Fuse Actor and Aborter (#3573) @37.0.0: --- src/algorithms/tracking/CKFTracking.cc | 45 +++++++++++++++++++-- src/algorithms/tracking/TrackPropagation.cc | 4 ++ 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/src/algorithms/tracking/CKFTracking.cc b/src/algorithms/tracking/CKFTracking.cc index ba07f9356..09e776edc 100644 --- a/src/algorithms/tracking/CKFTracking.cc +++ b/src/algorithms/tracking/CKFTracking.cc @@ -26,12 +26,19 @@ #include #include #if Acts_VERSION_MAJOR >= 34 +#if Acts_VERSION_MAJOR >= 37 +#include "Acts/Propagator/ActorList.hpp" +#else #include "Acts/Propagator/AbortList.hpp" +#endif #include "Acts/Propagator/EigenStepper.hpp" #include "Acts/Propagator/MaterialInteractor.hpp" #include "Acts/Propagator/Navigator.hpp" #endif #include +#if Acts_VERSION_MAJOR >= 36 +#include "Acts/Propagator/PropagatorOptions.hpp" +#endif #if Acts_VERSION_MAJOR >= 34 #include "Acts/Propagator/StandardAborters.hpp" #endif @@ -152,7 +159,7 @@ namespace eicrecon { cov(1, 0) = meas2D.getCovariance().xy; #if Acts_VERSION_MAJOR >= 36 - auto measurement = ActsExamples::makeFixedSizeMeasurement( + auto measurement = ActsExamples::makeVariableSizeMeasurement( Acts::SourceLink{sourceLink}, loc, cov, Acts::eBoundLoc0, Acts::eBoundLoc1); #else auto measurement = Acts::makeMeasurement( @@ -197,7 +204,11 @@ namespace eicrecon { ACTS_LOCAL_LOGGER(eicrecon::getSpdlogLogger("CKF", m_log, {"^No tracks found$"})); +#if Acts_VERSION_MAJOR >= 36 + Acts::PropagatorPlainOptions pOptions(m_geoctx, m_fieldctx); +#else Acts::PropagatorPlainOptions pOptions; +#endif pOptions.maxSteps = 10000; ActsExamples::PassThroughCalibrator pcalibrator; @@ -208,13 +219,25 @@ namespace eicrecon { #endif Acts::MeasurementSelector measSel{m_sourcelinkSelectorCfg}; +#if Acts_VERSION_MAJOR >= 36 + Acts::CombinatorialKalmanFilterExtensions + extensions; +#else Acts::CombinatorialKalmanFilterExtensions extensions; +#endif extensions.calibrator.connect<&ActsExamples::MeasurementCalibratorAdapter::calibrate>( &calibrator); +#if Acts_VERSION_MAJOR >= 36 + extensions.updater.connect< + &Acts::GainMatrixUpdater::operator()< + typename ActsExamples::TrackContainer::TrackStateContainerBackend>>( + &kfUpdater); +#else extensions.updater.connect< &Acts::GainMatrixUpdater::operator()>( &kfUpdater); +#endif #if Acts_VERSION_MAJOR < 34 extensions.smoother.connect< &Acts::GainMatrixSmoother::operator()>( @@ -241,13 +264,29 @@ namespace eicrecon { extensions, pOptions); #endif -#if Acts_VERSION_MAJOR >= 34 +#if Acts_VERSION_MAJOR >= 36 + using Extrapolator = Acts::Propagator, Acts::Navigator>; +# if Acts_VERSION_MAJOR >= 37 + using ExtrapolatorOptions = + Extrapolator::template Options>; +# else + using ExtrapolatorOptions = + Extrapolator::template Options, + Acts::AbortList>; +# endif + Extrapolator extrapolator( + Acts::EigenStepper<>(m_BField), + Acts::Navigator({m_geoSvc->trackingGeometry()}, + logger().cloneWithSuffix("Navigator")), + logger().cloneWithSuffix("Propagator")); + ExtrapolatorOptions extrapolationOptions(m_geoctx, m_fieldctx); +#elif Acts_VERSION_MAJOR >= 34 Acts::Propagator, Acts::Navigator> extrapolator( Acts::EigenStepper<>(m_BField), Acts::Navigator({m_geoSvc->trackingGeometry()}, logger().cloneWithSuffix("Navigator")), logger().cloneWithSuffix("Propagator")); - Acts::PropagatorOptions, Acts::AbortList> extrapolationOptions(m_geoctx, m_fieldctx); diff --git a/src/algorithms/tracking/TrackPropagation.cc b/src/algorithms/tracking/TrackPropagation.cc index 6ad4e9813..b226a4bcc 100644 --- a/src/algorithms/tracking/TrackPropagation.cc +++ b/src/algorithms/tracking/TrackPropagation.cc @@ -245,7 +245,11 @@ void TrackPropagation::propagateToSurfaceList( ACTS_LOCAL_LOGGER(eicrecon::getSpdlogLogger("PROP", m_log)); +#if Acts_VERSION_MAJOR >= 36 + Propagator::template Options<> options(m_geoContext, m_fieldContext); +#else Acts::PropagatorOptions<> options(m_geoContext, m_fieldContext); +#endif auto result = propagator.propagate(initial_bound_parameters, *targetSurf, options); From 543c9c3cac2bceae65e81df4c2522c164e34da42 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Thu, 16 Jan 2025 15:21:31 -0600 Subject: [PATCH 3/9] refactor: Make ViewConfig usable with designated initializers (#3613) @37.0.0: --- src/algorithms/tracking/ActsGeometryProvider.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/algorithms/tracking/ActsGeometryProvider.h b/src/algorithms/tracking/ActsGeometryProvider.h index bfe3f6403..e1b090996 100644 --- a/src/algorithms/tracking/ActsGeometryProvider.h +++ b/src/algorithms/tracking/ActsGeometryProvider.h @@ -108,11 +108,19 @@ class ActsGeometryProvider { std::shared_ptr m_init_log; /// Configuration for obj export +#if Acts_VERSION_MAJOR >= 37 + Acts::ViewConfig m_containerView{.color = {220, 220, 220}}; + Acts::ViewConfig m_volumeView{.color = {220, 220, 0}}; + Acts::ViewConfig m_sensitiveView{.color = {0, 180, 240}}; + Acts::ViewConfig m_passiveView{.color = {240, 280, 0}}; + Acts::ViewConfig m_gridView{.color = {220, 0, 0}}; +#else Acts::ViewConfig m_containerView{{220, 220, 220}}; Acts::ViewConfig m_volumeView{{220, 220, 0}}; Acts::ViewConfig m_sensitiveView{{0, 180, 240}}; Acts::ViewConfig m_passiveView{{240, 280, 0}}; Acts::ViewConfig m_gridView{{220, 0, 0}}; +#endif bool m_objWriteIt{false}; bool m_plyWriteIt{false}; std::string m_outputTag{""}; From 81693e883c43073a1660464f6ed048f9f4e6cddd Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Thu, 16 Jan 2025 15:23:44 -0600 Subject: [PATCH 4/9] refactor: Visualization3D location and API (#3622) @37.0.0: --- src/algorithms/tracking/ActsGeometryProvider.h | 15 ++++++++++----- src/services/geometry/acts/ACTSGeo_service.cc | 8 ++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/algorithms/tracking/ActsGeometryProvider.h b/src/algorithms/tracking/ActsGeometryProvider.h index e1b090996..9241948a2 100644 --- a/src/algorithms/tracking/ActsGeometryProvider.h +++ b/src/algorithms/tracking/ActsGeometryProvider.h @@ -137,15 +137,20 @@ class ActsGeometryProvider { void setOutputDir(std::string dir) { m_outputDir = dir; } std::string getOutputDir() const { return m_outputDir; } - void setContainerView(std::array view) { m_containerView = Acts::ViewConfig{view}; } +#if Acts_VERSION_MAJOR >= 37 + using Color = Acts::Color; +#else + using Color = Acts::ColorRGB; +#endif + void setContainerView(std::array c) { m_containerView.color = Color(c); } const Acts::ViewConfig& getContainerView() const { return m_containerView; } - void setVolumeView(std::array view) { m_volumeView = Acts::ViewConfig{view}; } + void setVolumeView(std::array c) { m_volumeView.color = Color(c); } const Acts::ViewConfig& getVolumeView() const { return m_volumeView; } - void setSensitiveView(std::array view) { m_sensitiveView = Acts::ViewConfig{view}; } + void setSensitiveView(std::array c) { m_sensitiveView.color = Color(c); } const Acts::ViewConfig& getSensitiveView() const { return m_sensitiveView; } - void setPassiveView(std::array view) { m_passiveView = Acts::ViewConfig{view}; } + void setPassiveView(std::array c) { m_passiveView.color = Color(c); } const Acts::ViewConfig& getPassiveView() const { return m_passiveView; } - void setGridView(std::array view) { m_gridView = Acts::ViewConfig{view}; } + void setGridView(std::array c) { m_gridView.color = Color(c); } const Acts::ViewConfig& getGridView() const { return m_gridView; } }; diff --git a/src/services/geometry/acts/ACTSGeo_service.cc b/src/services/geometry/acts/ACTSGeo_service.cc index 00010b7c0..89f698d97 100644 --- a/src/services/geometry/acts/ACTSGeo_service.cc +++ b/src/services/geometry/acts/ACTSGeo_service.cc @@ -70,11 +70,19 @@ std::shared_ptr ACTSGeo_service::actsGeoProvider() { m_acts_provider->setOutputTag(outputTag); m_acts_provider->setOutputDir(outputDir); +#if Acts_VERSION_MAJOR >= 37 + std::array containerView = m_acts_provider->getContainerView().color.rgb; + std::array volumeView = m_acts_provider->getVolumeView().color.rgb; + std::array sensitiveView = m_acts_provider->getSensitiveView().color.rgb; + std::array passiveView = m_acts_provider->getPassiveView().color.rgb; + std::array gridView = m_acts_provider->getGridView().color.rgb; +#else std::array containerView = m_acts_provider->getContainerView().color; std::array volumeView = m_acts_provider->getVolumeView().color; std::array sensitiveView = m_acts_provider->getSensitiveView().color; std::array passiveView = m_acts_provider->getPassiveView().color; std::array gridView = m_acts_provider->getGridView().color; +#endif m_app->SetDefaultParameter("acts:ContainerView", containerView, "RGB for container views"); m_app->SetDefaultParameter("acts:VolumeView", volumeView, "RGB for volume views"); m_app->SetDefaultParameter("acts:SensitiveView", sensitiveView, "RGB for sensitive views"); From 25519ecb60d989a1935938799c1da9e39a4c5d81 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Thu, 16 Jan 2025 16:11:51 -0600 Subject: [PATCH 5/9] feat!: Track-EDM like implementation for the space points, to be used in the seeding (#3432) @37.0.0: --- src/algorithms/tracking/SpacePoint.h | 6 ++- src/algorithms/tracking/TrackSeeding.cc | 52 +++++++++++++++++++++++-- src/algorithms/tracking/TrackSeeding.h | 17 ++++++++ 3 files changed, 71 insertions(+), 4 deletions(-) diff --git a/src/algorithms/tracking/SpacePoint.h b/src/algorithms/tracking/SpacePoint.h index b45927931..3de37e13d 100644 --- a/src/algorithms/tracking/SpacePoint.h +++ b/src/algorithms/tracking/SpacePoint.h @@ -1,7 +1,11 @@ #pragma once -#include +#if Acts_VERSION_MAJOR >= 37 +#include +#else #include +#endif +#include #include #include "ActsGeometryProvider.h" namespace eicrecon { diff --git a/src/algorithms/tracking/TrackSeeding.cc b/src/algorithms/tracking/TrackSeeding.cc index 3c285d631..871a35cdb 100644 --- a/src/algorithms/tracking/TrackSeeding.cc +++ b/src/algorithms/tracking/TrackSeeding.cc @@ -6,7 +6,11 @@ #include #include +#if Acts_VERSION_MAJOR >= 37 +#include +#else #include +#endif #include #include #include @@ -85,7 +89,11 @@ void eicrecon::TrackSeeding::configure() { m_seedFilterConfig = m_seedFilterConfig.toInternalUnits(); // Finder parameters +#if Acts_VERSION_MAJOR >= 37 + m_seedFinderConfig.seedFilter = std::make_unique>(m_seedFilterConfig); +#else m_seedFinderConfig.seedFilter = std::make_unique>(Acts::SeedFilter(m_seedFilterConfig)); +#endif m_seedFinderConfig.rMax = m_cfg.rMax; m_seedFinderConfig.rMin = m_cfg.rMin; m_seedFinderConfig.deltaRMinTopSP = m_cfg.deltaRMinTopSP; @@ -120,9 +128,45 @@ std::unique_ptr eicrecon::TrackSeeding::prod std::vector spacePoints = getSpacePoints(trk_hits); +#if Acts_VERSION_MAJOR >=37 + Acts::SeedFinderOrthogonal finder(m_seedFinderConfig); // FIXME move into class scope +#else Acts::SeedFinderOrthogonal finder(m_seedFinderConfig); // FIXME move into class scope +#endif + + +#if Acts_VERSION_MAJOR >= 37 + // Config + Acts::SpacePointContainerConfig spConfig; + + // Options + Acts::SpacePointContainerOptions spOptions; + spOptions.beamPos = {0., 0.}; + + ActsExamples::SpacePointContainer container(spacePoints); + Acts::SpacePointContainer + spContainer(spConfig, spOptions, container); -#if Acts_VERSION_MAJOR >= 32 + std::vector> seeds = + finder.createSeeds(m_seedFinderOptions, spContainer); + + // need to convert here from seed of proxies to seed of sps + eicrecon::SeedContainer seedsToAdd; + seedsToAdd.reserve(seeds.size()); + for (const auto &seed : seeds) { + const auto &sps = seed.sp(); + seedsToAdd.emplace_back(*sps[0]->externalSpacePoint(), + *sps[1]->externalSpacePoint(), + *sps[2]->externalSpacePoint()); + seedsToAdd.back().setVertexZ(seed.z()); + seedsToAdd.back().setQuality(seed.seedQuality()); + } + + std::unique_ptr trackparams = makeTrackParams(seedsToAdd); + +#else + +# if Acts_VERSION_MAJOR >= 32 std::function>( const eicrecon::SpacePoint *sp)> create_coordinates = [](const eicrecon::SpacePoint *sp) { @@ -130,7 +174,7 @@ std::unique_ptr eicrecon::TrackSeeding::prod Acts::Vector2 variance(sp->varianceR(), sp->varianceZ()); return std::make_tuple(position, variance, sp->t()); }; -#else +# else std::function( const eicrecon::SpacePoint *sp)> create_coordinates = [](const eicrecon::SpacePoint *sp) { @@ -138,12 +182,14 @@ std::unique_ptr eicrecon::TrackSeeding::prod Acts::Vector2 variance(sp->varianceR(), sp->varianceZ()); return std::make_pair(position, variance); }; -#endif +# endif eicrecon::SeedContainer seeds = finder.createSeeds(m_seedFinderOptions, spacePoints, create_coordinates); std::unique_ptr trackparams = makeTrackParams(seeds); +#endif + for (auto& sp: spacePoints) { delete sp; } diff --git a/src/algorithms/tracking/TrackSeeding.h b/src/algorithms/tracking/TrackSeeding.h index 2f0b8d885..a365a9632 100644 --- a/src/algorithms/tracking/TrackSeeding.h +++ b/src/algorithms/tracking/TrackSeeding.h @@ -4,10 +4,16 @@ #pragma once +#if Acts_VERSION_MAJOR >= 37 +#include +#endif #include #include #include #include +#if Acts_VERSION_MAJOR >= 37 +#include +#endif #include #include #include @@ -28,6 +34,13 @@ namespace eicrecon { class TrackSeeding: public eicrecon::WithPodConfig { public: + +#if Acts_VERSION_MAJOR >= 37 + using proxy_type = typename Acts::SpacePointContainer< + ActsExamples::SpacePointContainer>, + Acts::detail::RefHolder>::SpacePointProxyType; +#endif + void init(std::shared_ptr geo_svc, std::shared_ptr log); std::unique_ptr produce(const edm4eic::TrackerHitCollection& trk_hits); @@ -42,7 +55,11 @@ namespace eicrecon { Acts::SeedFilterConfig m_seedFilterConfig; Acts::SeedFinderOptions m_seedFinderOptions; +#if Acts_VERSION_MAJOR >= 37 + Acts::SeedFinderOrthogonalConfig m_seedFinderConfig; +#else Acts::SeedFinderOrthogonalConfig m_seedFinderConfig; +#endif int determineCharge(std::vector>& positions, const std::pair& PCA, std::tuple& RX0Y0) const; std::pair findPCA(std::tuple& circleParams) const; From 9d6282801b1615b7d2357f13c59a030f1347c162 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Thu, 16 Jan 2025 16:54:53 -0600 Subject: [PATCH 6/9] feat: Variable size measurement for Examples (#3107) @36.1.0: --- src/algorithms/tracking/CKFTracking.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/algorithms/tracking/CKFTracking.cc b/src/algorithms/tracking/CKFTracking.cc index 09e776edc..820b59556 100644 --- a/src/algorithms/tracking/CKFTracking.cc +++ b/src/algorithms/tracking/CKFTracking.cc @@ -158,14 +158,19 @@ namespace eicrecon { cov(0, 1) = meas2D.getCovariance().xy; cov(1, 0) = meas2D.getCovariance().xy; -#if Acts_VERSION_MAJOR >= 36 +#if Acts_VERSION_MAJOR > 36 || (Acts_VERSION_MAJOR == 36 && Acts_VERSION_MINOR >= 1) auto measurement = ActsExamples::makeVariableSizeMeasurement( Acts::SourceLink{sourceLink}, loc, cov, Acts::eBoundLoc0, Acts::eBoundLoc1); + measurements->emplace_back(std::move(measurement)); +#elif Acts_VERSION_MAJOR == 36 && Acts_VERSION_MINOR == 0 + auto measurement = ActsExamples::makeFixedSizeMeasurement( + Acts::SourceLink{sourceLink}, loc, cov, Acts::eBoundLoc0, Acts::eBoundLoc1); + measurements->emplace_back(std::move(measurement)); #else auto measurement = Acts::makeMeasurement( Acts::SourceLink{sourceLink}, loc, cov, Acts::eBoundLoc0, Acts::eBoundLoc1); -#endif measurements->emplace_back(std::move(measurement)); +#endif hit_index++; } From 627825249e990a8601a1bcf27b1537d80836a64b Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Thu, 16 Jan 2025 16:59:31 -0600 Subject: [PATCH 7/9] feat: Memory dense MeasurementContainer for Examples (#3528) @37.0.0: --- src/algorithms/tracking/CKFTracking.cc | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/algorithms/tracking/CKFTracking.cc b/src/algorithms/tracking/CKFTracking.cc index 820b59556..e172c0c91 100644 --- a/src/algorithms/tracking/CKFTracking.cc +++ b/src/algorithms/tracking/CKFTracking.cc @@ -137,8 +137,10 @@ namespace eicrecon { for (const auto& meas2D : meas2Ds) { + Acts::GeometryIdentifier geoId = meas2D.getSurface(); + // --follow example from ACTS to create source links - sourceLinkStorage.emplace_back(meas2D.getSurface(), hit_index); + sourceLinkStorage.emplace_back(geoId, hit_index); ActsExamples::IndexSourceLink& sourceLink = sourceLinkStorage.back(); // Add to output containers: // index map and source link container are geometry-ordered. @@ -158,7 +160,20 @@ namespace eicrecon { cov(0, 1) = meas2D.getCovariance().xy; cov(1, 0) = meas2D.getCovariance().xy; -#if Acts_VERSION_MAJOR > 36 || (Acts_VERSION_MAJOR == 36 && Acts_VERSION_MINOR >= 1) +#if Acts_VERSION_MAJOR >= 37 + std::array indices = {Acts::eBoundLoc0, Acts::eBoundLoc1}; + Acts::visit_measurement( + indices.size(), [&](auto dim) -> ActsExamples::VariableBoundMeasurementProxy { + ActsExamples::FixedBoundMeasurementProxy measurement = + measurements->makeMeasurement(); + measurement.setSourceLink(sourceLink); + measurement.setSubspaceIndices(indices); + measurement.parameters() = loc; + measurement.covariance() = cov; + return measurement; + } + ); +#elif Acts_VERSION_MAJOR == 36 && Acts_VERSION_MINOR >= 1 auto measurement = ActsExamples::makeVariableSizeMeasurement( Acts::SourceLink{sourceLink}, loc, cov, Acts::eBoundLoc0, Acts::eBoundLoc1); measurements->emplace_back(std::move(measurement)); From 94f082985290bcd653c82b5a815fc71257b0a522 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Thu, 16 Jan 2025 17:01:44 -0600 Subject: [PATCH 8/9] feat: Add measurement emplace functions (#3627) @36.0.0: --- src/algorithms/tracking/CKFTracking.cc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/algorithms/tracking/CKFTracking.cc b/src/algorithms/tracking/CKFTracking.cc index e172c0c91..24a084f4d 100644 --- a/src/algorithms/tracking/CKFTracking.cc +++ b/src/algorithms/tracking/CKFTracking.cc @@ -163,14 +163,8 @@ namespace eicrecon { #if Acts_VERSION_MAJOR >= 37 std::array indices = {Acts::eBoundLoc0, Acts::eBoundLoc1}; Acts::visit_measurement( - indices.size(), [&](auto dim) -> ActsExamples::VariableBoundMeasurementProxy { - ActsExamples::FixedBoundMeasurementProxy measurement = - measurements->makeMeasurement(); - measurement.setSourceLink(sourceLink); - measurement.setSubspaceIndices(indices); - measurement.parameters() = loc; - measurement.covariance() = cov; - return measurement; + indices.size(), [&](auto dim) -> ActsExamples::FixedBoundMeasurementProxy<6> { + return measurements->emplaceMeasurement(sourceLink, indices, loc, cov); } ); #elif Acts_VERSION_MAJOR == 36 && Acts_VERSION_MINOR >= 1 From fbb48be3d5d89288ad67fa62e37c93d1c52d6905 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Thu, 16 Jan 2025 17:11:00 -0600 Subject: [PATCH 9/9] refactor: Integrate source link container into measurements container in Examples (#3732) @37.1.0: --- src/algorithms/tracking/CKFTracking.cc | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/algorithms/tracking/CKFTracking.cc b/src/algorithms/tracking/CKFTracking.cc index 24a084f4d..8cb0f7cce 100644 --- a/src/algorithms/tracking/CKFTracking.cc +++ b/src/algorithms/tracking/CKFTracking.cc @@ -130,8 +130,10 @@ namespace eicrecon { // need list here for stable addresses std::list sourceLinkStorage; +#if Acts_VERSION_MAJOR < 37 || (Acts_VERSION_MAJOR == 37 && Acts_VERSION_MINOR < 1) ActsExamples::IndexSourceLinkContainer src_links; src_links.reserve(meas2Ds.size()); +#endif std::size_t hit_index = 0; @@ -146,21 +148,29 @@ namespace eicrecon { // index map and source link container are geometry-ordered. // since the input is also geometry-ordered, new items can // be added at the end. +#if Acts_VERSION_MAJOR < 37 || (Acts_VERSION_MAJOR == 37 && Acts_VERSION_MINOR < 1) src_links.insert(src_links.end(), sourceLink); +#endif // --- // Create ACTS measurements Acts::Vector2 loc = Acts::Vector2::Zero(); loc[Acts::eBoundLoc0] = meas2D.getLoc().a; loc[Acts::eBoundLoc1] = meas2D.getLoc().b; - Acts::SquareMatrix2 cov = Acts::SquareMatrix2::Zero(); cov(0, 0) = meas2D.getCovariance().xx; cov(1, 1) = meas2D.getCovariance().yy; cov(0, 1) = meas2D.getCovariance().xy; cov(1, 0) = meas2D.getCovariance().xy; -#if Acts_VERSION_MAJOR >= 37 +#if Acts_VERSION_MAJOR > 37 || (Acts_VERSION_MAJOR == 37 && Acts_VERSION_MINOR >= 1) + std::array indices = {Acts::eBoundLoc0, Acts::eBoundLoc1}; + Acts::visit_measurement( + indices.size(), [&](auto dim) -> ActsExamples::FixedBoundMeasurementProxy<6> { + return measurements->emplaceMeasurement(sourceLink, indices, loc, cov); + } + ); +#elif Acts_VERSION_MAJOR == 37 && Acts_VERSION_MINOR == 0 std::array indices = {Acts::eBoundLoc0, Acts::eBoundLoc1}; Acts::visit_measurement( indices.size(), [&](auto dim) -> ActsExamples::FixedBoundMeasurementProxy<6> { @@ -262,7 +272,11 @@ namespace eicrecon { &measSel); ActsExamples::IndexSourceLinkAccessor slAccessor; +#if Acts_VERSION_MAJOR >= 37 || (Acts_VERSION_MAJOR == 37 && Acts_VERSION_MINOR >= 1) + slAccessor.container = &measurements->orderedIndices(); +#else slAccessor.container = &src_links; +#endif Acts::SourceLinkAccessorDelegate slAccessorDelegate; slAccessorDelegate.connect<&ActsExamples::IndexSourceLinkAccessor::range>(&slAccessor);