Skip to content

Commit

Permalink
Merge branch 'main' into gx2f-trackcontainer
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Dec 7, 2023
2 parents 14ea9ef + c65d419 commit dc71e2c
Show file tree
Hide file tree
Showing 75 changed files with 843 additions and 645 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/iwyu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
-DACTS_BUILD_EXAMPLES_EDM4HEP=ON
- name: Run IWYU
run: python3 iwyu-install/bin/iwyu_tool.py -p acts-build/ -j2 -- --mapping_file=acts/CI/iwyu/mapping.imp | tee iwyu-output.txt
run: python3 iwyu-install/bin/iwyu_tool.py -p acts-build/ -j2 -- -Xiwyu --mapping_file=$(pwd)/acts/CI/iwyu/mapping.imp | tee iwyu-output.txt
- name: Filter IWYU output
run: python3 acts/CI/iwyu/filter.py acts/CI/iwyu/filter.yaml iwyu-output.txt iwyu-filtered.txt
- name: Apply IWYU
Expand Down
12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
repos:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: 'v14.0.0'
hooks:
- id: clang-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
16 changes: 16 additions & 0 deletions CI/iwyu/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# IWYU = Include what you use

This tool finds unused includes and suggestes additional includes and declarations.

It is not very stable at the moment and takes a few hours to complete within ACTS therefor it only runs once a week and can be triggered manually.

There is also not sufficient filtering offered by IWYU at the moment. For that reason there is a specific filtering script for now which tries to get rid of unwanted changes.

offline resources
- [GitHub Actions Workflow](../../.github/workflows/iwyu.yml)
- [Custom filter script](./filter.py)

online resources

- https://include-what-you-use.org/
- https://github.com/include-what-you-use/include-what-you-use
6 changes: 3 additions & 3 deletions CI/iwyu/filter.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
remove_lines:
# ignore unexiting std
# ignore if not existing in std
- "^#include <new>"
- "^#include <bits/"
- "^#include <ext/"
Expand All @@ -8,7 +8,7 @@ remove_lines:
- "namespace Eigen {"
# ignore boost
- "^(- )?#include <boost/"
# don remove ipp
# don't remove ipp
- "^- #include [<\"].*\\.ipp"
# ignore pybind11
- "^(- )?#include <pybind11/"
Expand All @@ -21,7 +21,7 @@ replace_lines:
- "^#include <unistd\\.h>": "#include <cunistd>"
- "^#include <stdint\\.h>": "#include <cstdint>"
- "^#include <stdlib.h>": "#include <cstdlib>"
# don use ipp
# don't use ipp
- "^#include ([<\"].*)\\.ipp": "#include \\1.hpp"

ignore_files:
Expand Down
Binary file modified CI/physmon/reference/performance_amvf_gridseeder_seeded_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_amvf_gridseeder_ttbar_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_amvf_orthogonal_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_amvf_seeded_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_amvf_truth_estimated_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_amvf_truth_smeared_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_amvf_ttbar_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_ivf_orthogonal_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_ivf_seeded_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_ivf_truth_estimated_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_ivf_truth_smeared_hist.root
Binary file not shown.
2 changes: 1 addition & 1 deletion CI/physmon/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import os
import csv

HERALD_URL = "https://herald.dokku.paulgessinger.com/view/{repo}/runs/{run_id}/artifacts/{artifact_name}/{path}"
HERALD_URL = "https://acts-herald.app.cern.ch/view/{repo}/runs/{run_id}/artifacts/{artifact_name}/{path}"
IS_CI = "GITHUB_ACTIONS" in os.environ


Expand Down
5 changes: 5 additions & 0 deletions CI/physmon/vertexing_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ histograms:
nbins: 100
min: 0.999
max: 1

"trk_weight":
nbins: 100
min: -0.01
max: 1.01

extra_histograms:
- expression: df["nRecoVtx"] / df["nTrueVtx"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
#include <random>
#include <utility>

namespace Acts {
namespace Test {
namespace Acts::detail::Test {

/// Generate a random parameters vector and covariance matrix.
///
Expand Down Expand Up @@ -77,5 +76,4 @@ inline auto generateFreeParametersCovariance(generator_t& rng) {
return generateParametersCovariance<ActsScalar, eFreeSize>(rng);
}

} // namespace Test
} // namespace Acts
} // namespace Acts::detail::Test
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@

#include "Acts/Definitions/TrackParametrization.hpp"
#include "Acts/EventData/TrackStatePropMask.hpp"
#include "Acts/EventData/detail/TestSourceLink.hpp"
#include "Acts/EventData/detail/TestTrackState.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/Tests/CommonHelpers/TestSourceLink.hpp"
#include "Acts/Tests/CommonHelpers/TestTrackState.hpp"
#include "Acts/Utilities/CalibrationContext.hpp"
#include "Acts/Utilities/HashedString.hpp"

#include <random>

namespace Acts::Test {
namespace Acts::detail::Test {

template <typename factory_t>
class MultiTrajectoryTestsCommon {
Expand Down Expand Up @@ -376,7 +376,7 @@ class MultiTrajectoryTestsCommon {
BOOST_CHECK_EQUAL(
ts.getUncalibratedSourceLink().template get<TestSourceLink>().sourceId,
ttsb.sourceLink.sourceId);
auto m2 = std::get<Measurement<BoundIndices, 2u>>(meas);
auto m2 = std::get<Acts::Measurement<BoundIndices, 2u>>(meas);

BOOST_CHECK_EQUAL(ts.calibratedSize(), 2);
BOOST_CHECK_EQUAL(ts.effectiveCalibrated(), m2.parameters());
Expand Down Expand Up @@ -1065,4 +1065,4 @@ class MultiTrajectoryTestsCommon {
// runTest([](std::string_view c) { return c; });
}
};
} // namespace Acts::Test
} // namespace Acts::detail::Test
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
#include <iosfwd>
#include <stdexcept>

namespace Acts {
namespace Test {
namespace Acts::detail::Test {

/// A minimal source link implementation for testing.
///
Expand Down Expand Up @@ -69,7 +68,24 @@ struct TestSourceLink final {
TestSourceLink(TestSourceLink&&) = default;
TestSourceLink& operator=(const TestSourceLink&) = default;
TestSourceLink& operator=(TestSourceLink&&) = default;

bool operator==(const TestSourceLink& rhs) const {
return (m_geometryId == rhs.m_geometryId) && (sourceId == rhs.sourceId) &&
(indices == rhs.indices) && (parameters == rhs.parameters) &&
(covariance == rhs.covariance);
}
bool operator!=(const TestSourceLink& rhs) const { return !(*this == rhs); }
std::ostream& print(std::ostream& os) const {
os << "TestsSourceLink(geometryId=" << m_geometryId
<< ",sourceId=" << sourceId;
if (indices[0] != eBoundSize) {
os << ",index0=" << indices[0];
}
if (indices[1] != eBoundSize) {
os << ",index1=" << indices[1];
}
os << ")";
return os;
}
constexpr std::size_t index() const { return sourceId; }

struct SurfaceAccessor {
Expand All @@ -82,9 +98,10 @@ struct TestSourceLink final {
};
};

bool operator==(const TestSourceLink& lhs, const TestSourceLink& rhs);
bool operator!=(const TestSourceLink& lhs, const TestSourceLink& rhs);
std::ostream& operator<<(std::ostream& os, const TestSourceLink& sourceLink);
inline std::ostream& operator<<(std::ostream& os,
const TestSourceLink& sourceLink) {
return sourceLink.print(os);
}

/// Extract the measurement from a TestSourceLink.
///
Expand Down Expand Up @@ -133,5 +150,4 @@ void testSourceLinkCalibrator(
trackState);
}

} // namespace Test
} // namespace Acts
} // namespace Acts::detail::Test
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@

#include "Acts/EventData/TrackParameters.hpp"
#include "Acts/EventData/VectorMultiTrajectory.hpp"
#include "Acts/Tests/CommonHelpers/GenerateParameters.hpp"
#include "Acts/Tests/CommonHelpers/TestSourceLink.hpp"
#include "Acts/EventData/detail/GenerateParameters.hpp"
#include "Acts/EventData/detail/TestSourceLink.hpp"
#include "Acts/Utilities/CalibrationContext.hpp"

#include <random>

namespace Acts::Test {
namespace Acts::detail::Test {

struct TestTrackState {
std::shared_ptr<Surface> surface;
Expand Down Expand Up @@ -132,4 +132,4 @@ void fillTrackState(const TestTrackState& pc, TrackStatePropMask mask,
}
}

} // namespace Acts::Test
} // namespace Acts::detail::Test
10 changes: 6 additions & 4 deletions Core/include/Acts/Geometry/TrackingVolume.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,19 @@ using LayerArray = BinnedArray<LayerPtr>;
using LayerVector = std::vector<LayerPtr>;

/// Intersection with @c Layer
using LayerIntersection = ObjectIntersection<Layer, Surface>;
using LayerIntersection = std::pair<SurfaceIntersection, const Layer*>;
/// Multi-intersection with @c Layer
using LayerMultiIntersection = ObjectMultiIntersection<Layer, Surface>;
using LayerMultiIntersection =
std::pair<SurfaceMultiIntersection, const Layer*>;

/// BoundarySurface of a volume
using BoundarySurface = BoundarySurfaceT<TrackingVolume>;
/// Intersection with a @c BoundarySurface
using BoundaryIntersection = ObjectIntersection<BoundarySurface, Surface>;
using BoundaryIntersection =
std::pair<SurfaceIntersection, const BoundarySurface*>;
/// Multi-intersection with a @c BoundarySurface
using BoundaryMultiIntersection =
ObjectMultiIntersection<BoundarySurface, Surface>;
std::pair<SurfaceMultiIntersection, const BoundarySurface*>;

/// @class TrackingVolume
///
Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/Propagator/MultiEigenStepperLoop.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ class MultiEigenStepperLoop
template <typename object_intersection_t>
void updateStepSize(State& state, const object_intersection_t& oIntersection,
Direction direction, bool release = true) const {
const Surface& surface = *oIntersection.representation();
const Surface& surface = *oIntersection.object();

for (auto& component : state.components) {
auto intersection = surface.intersect(
Expand Down
43 changes: 29 additions & 14 deletions Core/include/Acts/Propagator/Navigator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ class Navigator {
state.navigation.lastHierarchySurfaceReached = false;
// Update volume information
// get the attached volume information
auto boundary = state.navigation.navBoundary().object();
auto boundary = state.navigation.navBoundary().second;
state.navigation.currentVolume = boundary->attachedVolume(
state.geoContext, stepper.position(state.stepping),
stepper.direction(state.stepping), state.options.direction);
Expand Down Expand Up @@ -568,6 +568,19 @@ class Navigator {
}

private:
const SurfaceIntersection& candidateIntersection(
const NavigationSurfaces& surfaces, std::size_t index) const {
return surfaces.at(index);
}
const SurfaceIntersection& candidateIntersection(
const NavigationLayers& surfaces, std::size_t index) const {
return surfaces.at(index).first;
}
const SurfaceIntersection& candidateIntersection(
const NavigationBoundaries& surfaces, std::size_t index) const {
return surfaces.at(index).first;
}

/// @brief Status call for test surfaces (surfaces, layers, boundaries)
///
/// If there are surfaces to be handled, check if the current
Expand All @@ -592,9 +605,9 @@ class Navigator {
if (navSurfaces.empty() || navIndex == navSurfaces.size()) {
return false;
}
const auto& intersection = navSurfaces.at(navIndex);
const auto& intersection = candidateIntersection(navSurfaces, navIndex);
// Take the current surface
auto surface = intersection.representation();
const auto* surface = intersection.object();
// Check if we are at a surface
// If we are on the surface pointed at by the index, we can make
// it the current one to pass it to the other actors
Expand Down Expand Up @@ -844,9 +857,9 @@ class Navigator {
// loop over the available navigation layer candidates
while (state.navigation.navLayerIndex !=
state.navigation.navLayers.size()) {
const auto& intersection = state.navigation.navLayer();
const auto& intersection = state.navigation.navLayer().first;
// The layer surface
const auto* layerSurface = intersection.representation();
const auto* layerSurface = intersection.object();
// We are on the layer
if (state.navigation.currentSurface == layerSurface) {
ACTS_VERBOSE(volInfo(state) << "We are on a layer, resolve Surfaces.");
Expand Down Expand Up @@ -976,15 +989,16 @@ class Navigator {
os << state.navigation.navBoundaries.size();
os << " boundary candidates found at path(s): ";
for (auto& bc : state.navigation.navBoundaries) {
os << bc.pathLength() << " ";
os << bc.first.pathLength() << " ";
}
logger().log(Logging::VERBOSE, os.str());
}
// Set the begin index
state.navigation.navBoundaryIndex = 0;
if (!state.navigation.navBoundaries.empty()) {
// Set to the first and return to the stepper
stepper.updateStepSize(state.stepping, state.navigation.navBoundary(),
stepper.updateStepSize(state.stepping,
state.navigation.navBoundary().first,
state.options.direction, true);
ACTS_VERBOSE(volInfo(state) << "Navigation stepSize updated to "
<< stepper.outputStepSize(state.stepping));
Expand All @@ -1001,9 +1015,9 @@ class Navigator {
// Loop over the boundary surface
while (state.navigation.navBoundaryIndex !=
state.navigation.navBoundaries.size()) {
const auto& intersection = state.navigation.navBoundary();
const auto& intersection = state.navigation.navBoundary().first;
// That is the current boundary surface
const auto* boundarySurface = intersection.representation();
const auto* boundarySurface = intersection.object();
// Step towards the boundary surfrace
auto boundaryStatus = stepper.updateSurfaceStatus(
state.stepping, *boundarySurface, intersection.index(),
Expand Down Expand Up @@ -1133,8 +1147,8 @@ class Navigator {
const Layer* cLayer = nullptr) const {
// get the layer and layer surface
auto layerSurface = cLayer ? state.navigation.startSurface
: state.navigation.navLayer().representation();
auto navLayer = cLayer ? cLayer : state.navigation.navLayer().object();
: state.navigation.navLayer().first.object();
auto navLayer = cLayer ? cLayer : state.navigation.navLayer().second;
// are we on the start layer
bool onStart = (navLayer == state.navigation.startLayer);
auto startSurface = onStart ? state.navigation.startSurface : layerSurface;
Expand Down Expand Up @@ -1248,18 +1262,19 @@ class Navigator {
os << state.navigation.navLayers.size();
os << " layer candidates found at path(s): ";
for (auto& lc : state.navigation.navLayers) {
os << lc.pathLength() << " ";
os << lc.first.pathLength() << " ";
}
logger().log(Logging::VERBOSE, os.str());
}
// Set the index to the first
state.navigation.navLayerIndex = 0;
// Setting the step size towards first
if (state.navigation.startLayer &&
state.navigation.navLayer().object() != state.navigation.startLayer) {
state.navigation.navLayer().second != state.navigation.startLayer) {
ACTS_VERBOSE(volInfo(state) << "Target at layer.");
// The stepper updates the step size ( single / multi component)
stepper.updateStepSize(state.stepping, state.navigation.navLayer(),
stepper.updateStepSize(state.stepping,
state.navigation.navLayer().first,
state.options.direction, true);
ACTS_VERBOSE(volInfo(state) << "Navigation stepSize updated to "
<< stepper.outputStepSize(state.stepping));
Expand Down
8 changes: 0 additions & 8 deletions Core/include/Acts/Seeding/GNN_DataStorage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,6 @@ class TrigFTF_GNN_DataStorage {
float max_tau = 100.0;
// can't do this bit yet as dont have cluster width
if (useClusterWidth) {
// const Trk::SpacePoint* osp = sp.offlineSpacePoint();
// const InDet::PixelCluster* pCL = dynamic_cast<const
// InDet::PixelCluster*>(osp->clusterList().first);
// float cluster_width = pCL->width().widthPhiRZ().y();
float cluster_width = 1; // temporary while cluster width not available
min_tau = 6.7 * (cluster_width - 0.2);
max_tau =
Expand All @@ -194,10 +190,6 @@ class TrigFTF_GNN_DataStorage {
sp, min_tau, max_tau)); // adding ftf member to nodes
} else {
if (useClusterWidth) {
// const Trk::SpacePoint* osp = sp.offlineSpacePoint();
// const InDet::PixelCluster* pCL = dynamic_cast<const
// InDet::PixelCluster*>(osp->clusterList().first);
// float cluster_width = pCL->width().widthPhiRZ().y();
float cluster_width = 1; // temporary while cluster width not available
if (cluster_width > 0.2) {
return -3;
Expand Down
Loading

0 comments on commit dc71e2c

Please sign in to comment.