Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into MLSeedFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
Corentin-Allaire committed Dec 7, 2023
2 parents 791498d + 5cc42d2 commit 10dd25c
Show file tree
Hide file tree
Showing 29 changed files with 221 additions and 199 deletions.
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
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
27 changes: 15 additions & 12 deletions Core/include/Acts/Seeding/SeedFinderOrthogonal.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ auto SeedFinderOrthogonal<external_spacepoint_t>::validTupleOrthoRangeLH(
res[DimPhi].shrinkMin(pL - m_config.deltaPhiMax);
res[DimPhi].shrinkMax(pL + m_config.deltaPhiMax);

// Cut: Ensure that z-distance between SPs is within max and min values.
res[DimZ].shrinkMin(zL - m_config.deltaZMax);
res[DimZ].shrinkMax(zL + m_config.deltaZMax);

return res;
}

Expand All @@ -93,6 +97,7 @@ auto SeedFinderOrthogonal<external_spacepoint_t>::validTupleOrthoRangeHL(
const internal_sp_t &high) const -> typename tree_t::range_t {
float pM = high.phi();
float rM = high.radius();
float zM = high.z();

typename tree_t::range_t res;

Expand Down Expand Up @@ -129,20 +134,24 @@ auto SeedFinderOrthogonal<external_spacepoint_t>::validTupleOrthoRangeHL(
*/
float fracR = res[DimR].min() / rM;

float zMin = (high.z() - m_config.collisionRegionMin) * fracR +
m_config.collisionRegionMin;
float zMax = (high.z() - m_config.collisionRegionMax) * fracR +
m_config.collisionRegionMax;
float zMin =
(zM - m_config.collisionRegionMin) * fracR + m_config.collisionRegionMin;
float zMax =
(zM - m_config.collisionRegionMax) * fracR + m_config.collisionRegionMax;

res[DimZ].shrinkMin(std::min(zMin, high.z()));
res[DimZ].shrinkMax(std::max(zMax, high.z()));
res[DimZ].shrinkMin(std::min(zMin, zM));
res[DimZ].shrinkMax(std::max(zMax, zM));

/*
* Cut: Shrink the φ range, such that Δφ_min ≤ φ - φ_H ≤ Δφ_max
*/
res[DimPhi].shrinkMin(pM - m_config.deltaPhiMax);
res[DimPhi].shrinkMax(pM + m_config.deltaPhiMax);

// Cut: Ensure that z-distance between SPs is within max and min values.
res[DimZ].shrinkMin(zM - m_config.deltaZMax);
res[DimZ].shrinkMax(zM + m_config.deltaZMax);

return res;
}

Expand Down Expand Up @@ -219,12 +228,6 @@ bool SeedFinderOrthogonal<external_spacepoint_t>::validTuple(
if (std::fabs(cotTheta) > m_config.cotThetaMax) {
return false;
}
/*
* Cut: Ensure that z-distance between SPs is within max and min values.
*/
if (std::abs(deltaZ) > m_config.deltaZMax) {
return false;
}

/*
* Cut: Ensure that inner-middle dublet is in a certain (r, eta) region of the
Expand Down
Loading

0 comments on commit 10dd25c

Please sign in to comment.