Skip to content

Commit

Permalink
Merge branch 'main' into yolo
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Nov 24, 2023
2 parents c1ba586 + ecb139f commit 3a9aa33
Show file tree
Hide file tree
Showing 85 changed files with 110 additions and 409 deletions.
5 changes: 5 additions & 0 deletions Core/include/Acts/Seeding/SeedConfirmationRangeConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@

namespace Acts {

// defaults experimental cuts to no operation in both seeding algorithms
inline bool noopExperimentCuts(float /*bottomRadius*/, float /*cotTheta*/) {
return true;
}

/// @brief contains parameters for seed confirmation
struct SeedConfirmationRangeConfig {
// z minimum and maximum of middle component of the seed used to define the
Expand Down
28 changes: 24 additions & 4 deletions Core/include/Acts/Seeding/SeedFinder.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,11 @@ SeedFinder<external_spacepoint_t, platform_t>::getCompatibleDoublets(
const float deltaRMinSP, const float deltaRMaxSP, const float uIP,
const float uIP2, const float cosPhiM, const float sinPhiM) const {
float impactMax = m_config.impactMax;
if constexpr (candidateType == Acts::SpacePointCandidateType::eBottom) {

constexpr bool isBottomCandidate =
candidateType == Acts::SpacePointCandidateType::eBottom;

if constexpr (isBottomCandidate) {
impactMax = -impactMax;
}

Expand Down Expand Up @@ -252,7 +256,7 @@ SeedFinder<external_spacepoint_t, platform_t>::getCompatibleDoublets(
// the iterator so we don't need to look at the other SPs again
for (; min_itr != otherSPs.end(); ++min_itr) {
const auto& otherSP = *min_itr;
if constexpr (candidateType == Acts::SpacePointCandidateType::eBottom) {
if constexpr (isBottomCandidate) {
// if r-distance is too big, try next SP in bin
if ((rM - otherSP->radius()) <= deltaRMaxSP) {
break;
Expand All @@ -272,7 +276,7 @@ SeedFinder<external_spacepoint_t, platform_t>::getCompatibleDoublets(
for (; min_itr != otherSPs.end(); ++min_itr) {
const auto& otherSP = *min_itr;

if constexpr (candidateType == Acts::SpacePointCandidateType::eBottom) {
if constexpr (isBottomCandidate) {
deltaR = (rM - otherSP->radius());

// if r-distance is too small, try next SP in bin
Expand All @@ -288,7 +292,7 @@ SeedFinder<external_spacepoint_t, platform_t>::getCompatibleDoublets(
}
}

if constexpr (candidateType == Acts::SpacePointCandidateType::eBottom) {
if constexpr (isBottomCandidate) {
deltaZ = (zM - otherSP->z());
} else {
deltaZ = (otherSP->z() - zM);
Expand Down Expand Up @@ -379,6 +383,14 @@ SeedFinder<external_spacepoint_t, platform_t>::getCompatibleDoublets(
const float iDeltaR = std::sqrt(iDeltaR2);
const float cotTheta = deltaZ * iDeltaR;

// discard bottom-middle dublets in a certain (r, eta) region according
// to detector specific cuts
if constexpr (isBottomCandidate) {
if (!m_config.experimentCuts(otherSP->radius(), cotTheta)) {
continue;
}
}

const float Er =
((varianceZM + otherSP->varianceZ()) +
(cotTheta * cotTheta) * (varianceRM + otherSP->varianceR())) *
Expand Down Expand Up @@ -420,6 +432,14 @@ SeedFinder<external_spacepoint_t, platform_t>::getCompatibleDoublets(
const float iDeltaR = std::sqrt(iDeltaR2);
const float cotTheta = deltaZ * iDeltaR;

// discard bottom-middle dublets in a certain (r, eta) region according
// to detector specific cuts
if constexpr (isBottomCandidate) {
if (!m_config.experimentCuts(otherSP->radius(), cotTheta)) {
continue;
}
}

const float Er =
((varianceZM + otherSP->varianceZ()) +
(cotTheta * cotTheta) * (varianceRM + otherSP->varianceR())) *
Expand Down
4 changes: 4 additions & 0 deletions Core/include/Acts/Seeding/SeedFinderConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ struct SeedFinderConfig {
// Returns position of the center of the top strip.
Delegate<Acts::Vector3(const SpacePoint&)> getTopStripCenterPosition;

// Delegate to apply experiment specific cuts
Delegate<bool(float /*bottomRadius*/, float /*cotTheta*/)> experimentCuts{
DelegateFuncTag<&noopExperimentCuts>{}};

bool isInInternalUnits = false;

SeedFinderConfig toInternalUnits() const {
Expand Down
11 changes: 10 additions & 1 deletion Core/include/Acts/Seeding/SeedFinderOrthogonal.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,15 @@ bool SeedFinderOrthogonal<external_spacepoint_t>::validTuple(
return false;
}

/*
* Cut: Ensure that inner-middle dublet is in a certain (r, eta) region of the
* detector according to detector specific cuts.
*/
const float rInner = (isMiddleInverted) ? rH : rL;
if (!m_config.experimentCuts(rInner, cotTheta)) {
return false;
}

return true;
}

Expand Down Expand Up @@ -453,7 +462,7 @@ void SeedFinderOrthogonal<external_spacepoint_t>::filterCandidates(
}

// continue if number of top SPs is smaller than minimum required for filter
if (top.size() < minCompatibleTopSPs) {
if (top_valid.size() < minCompatibleTopSPs) {
continue;
}

Expand Down
5 changes: 5 additions & 0 deletions Core/include/Acts/Seeding/SeedFinderOrthogonalConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "Acts/Definitions/Algebra.hpp"
#include "Acts/Definitions/Units.hpp"
#include "Acts/Seeding/SeedConfirmationRangeConfig.hpp"
#include "Acts/Utilities/Delegate.hpp"

#include <memory>

Expand Down Expand Up @@ -109,6 +110,10 @@ struct SeedFinderOrthogonalConfig {
float highland = 0;
float maxScatteringAngle2 = 0;

// Delegate to apply experiment specific cuts
Delegate<bool(float /*bottomRadius*/, float /*cotTheta*/)> experimentCuts{
DelegateFuncTag<&noopExperimentCuts>{}};

bool isInInternalUnits = false;

SeedFinderOrthogonalConfig calculateDerivedQuantities() const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ class CombinatorialKalmanFilter {
// Return error if filtering finds no tracks
if (result.lastTrackIndices.empty()) {
// @TODO: Tracks like this should not be in the final output!
ACTS_WARNING("No tracks found");
ACTS_DEBUG("No tracks found");
result.finished = true;
} else {
if (!smoothing) {
Expand Down
1 change: 0 additions & 1 deletion Tests/Benchmarks/SurfaceIntersectionBenchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include <random>

namespace bdata = boost::unit_test::data;
namespace tt = boost::test_tools;
using namespace Acts::UnitLiterals;

namespace Acts {
Expand Down
4 changes: 0 additions & 4 deletions Tests/IntegrationTests/InterpolatedSolenoidBFieldTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "Acts/MagneticField/SolenoidBField.hpp"
#include "Acts/Tests/CommonHelpers/FloatComparisons.hpp"
#include "Acts/Utilities/Grid.hpp"
#include "Acts/Utilities/VectorHelpers.hpp"
#include "Acts/Utilities/detail/Axis.hpp"

#include <cmath>
Expand All @@ -24,11 +23,8 @@
#include <random>

using namespace Acts::UnitLiterals;
using Acts::VectorHelpers::perp;
using Acts::VectorHelpers::phi;

namespace bdata = boost::unit_test::data;
namespace tt = boost::test_tools;

namespace Acts {
namespace IntegrationTest {
Expand Down
4 changes: 0 additions & 4 deletions Tests/IntegrationTests/PropagationTestsAtlasField.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@

#include "PropagationTestHelper.hpp"

namespace bdata = boost::unit_test::data;
namespace tt = boost::test_tools;

namespace Acts {

/// Get the ATLAS field from :
Expand Down Expand Up @@ -125,5 +122,4 @@ AtlasPropagatorType apropagator(std::move(astepper));
#include "PropagationTestBase.hpp"

} // namespace IntegrationTest

} // namespace Acts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
#include <cstdlib>
#include <memory>

namespace bdata = boost::unit_test::data;
namespace tt = boost::test_tools;
using namespace Acts::UnitLiterals;

namespace Acts {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <vector>

namespace bdata = boost::unit_test::data;
namespace tt = boost::test_tools;
using namespace Acts::UnitLiterals;

namespace Acts {
Expand Down
2 changes: 0 additions & 2 deletions Tests/UnitTests/Core/EventData/FreeTrackParametersTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "Acts/EventData/Charge.hpp"
#include "Acts/EventData/GenericFreeTrackParameters.hpp"
#include "Acts/EventData/TrackParameters.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/Tests/CommonHelpers/FloatComparisons.hpp"
#include "Acts/Utilities/UnitVectors.hpp"

Expand All @@ -33,7 +32,6 @@ using namespace Acts;
using namespace Acts::UnitLiterals;

constexpr auto eps = 8 * std::numeric_limits<ActsScalar>::epsilon();
const GeometryContext geoCtx;
const FreeSquareMatrix cov = FreeSquareMatrix::Identity();

void checkParameters(const FreeTrackParameters& params, const Vector4& pos4,
Expand Down
1 change: 0 additions & 1 deletion Tests/UnitTests/Core/Geometry/BVHDataTestCase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "Acts/Surfaces/Surface.hpp"

namespace bdata = boost::unit_test::data;
using Box = Acts::Volume::BoundingBox;
using Ray = Acts::Ray<double, 3>;

GeometryContext tgContext = GeometryContext();
Expand Down
5 changes: 0 additions & 5 deletions Tests/UnitTests/Core/Geometry/ConeLayerTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@
#include <utility>
#include <vector>

using boost::test_tools::output_test_stream;
namespace utf = boost::unit_test;

namespace Acts {

namespace Test {
namespace Layers {
BOOST_AUTO_TEST_SUITE(Layers)
Expand Down Expand Up @@ -79,5 +75,4 @@ BOOST_AUTO_TEST_CASE(ConeLayerConstruction) {
BOOST_AUTO_TEST_SUITE_END()
} // namespace Layers
} // namespace Test

} // namespace Acts
7 changes: 0 additions & 7 deletions Tests/UnitTests/Core/Geometry/ConeVolumeBoundsTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,10 @@
#include <utility>
#include <vector>

namespace tt = boost::test_tools;

namespace Acts {

using namespace UnitLiterals;

// Create a test context
GeometryContext tgContext = GeometryContext();

namespace Test {

BOOST_AUTO_TEST_SUITE(VolumeBounds)
Expand Down Expand Up @@ -86,8 +81,6 @@ BOOST_AUTO_TEST_CASE(ConeVolumeBoundsTests) {
}

BOOST_AUTO_TEST_CASE(ConeVolumeBoundsSurfaceOrientation) {
GeometryContext tgContext = GeometryContext();

ConeVolumeBounds hcone(10_mm, 0.45, 80_mm, 50_mm, 0., M_PI);

auto cvbOrientedSurfaces = hcone.orientedSurfaces(Transform3::Identity());
Expand Down
22 changes: 0 additions & 22 deletions Tests/UnitTests/Core/Geometry/CuboidVolumeBuilderTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,28 +38,6 @@ using namespace Acts::UnitLiterals;
namespace Acts {
namespace Test {

struct StepVolumeCollector {
///
/// @brief Data container for result analysis
///
struct this_result {
// Position of the propagator after each step
std::vector<Vector3> position;
// Volume of the propagator after each step
std::vector<TrackingVolume const*> volume;
};

using result_type = this_result;

template <typename propagator_state_t, typename stepper_t,
typename navigator_t>
void operator()(propagator_state_t& state, const stepper_t& stepper,
const navigator_t& navigator, result_type& result) const {
result.position.push_back(stepper.position(state.stepping));
result.volume.push_back(navigator.currentVolume(state.navigation));
}
};

BOOST_AUTO_TEST_CASE(CuboidVolumeBuilderTest) {
// Construct builder
CuboidVolumeBuilder cvb;
Expand Down
11 changes: 0 additions & 11 deletions Tests/UnitTests/Core/Geometry/CylinderLayerTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#include <boost/test/data/test_case.hpp>
#include <boost/test/tools/output_test_stream.hpp>
#include <boost/test/unit_test.hpp>

#include "Acts/Definitions/Algebra.hpp"
#include "Acts/Geometry/ApproachDescriptor.hpp"
#include "Acts/Geometry/CylinderLayer.hpp"
#include "Acts/Geometry/GenericApproachDescriptor.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/Geometry/Layer.hpp"
#include "Acts/Surfaces/CylinderBounds.hpp"
#include "Acts/Surfaces/CylinderSurface.hpp"
Expand All @@ -29,16 +27,8 @@
#include <utility>
#include <vector>

using boost::test_tools::output_test_stream;
namespace utf = boost::unit_test;

namespace Acts {

namespace Test {

// Create a test context
GeometryContext tgContext = GeometryContext();

namespace Layers {
BOOST_AUTO_TEST_SUITE(Layers)

Expand Down Expand Up @@ -102,5 +92,4 @@ BOOST_AUTO_TEST_CASE(CylinderLayerProperties) {
BOOST_AUTO_TEST_SUITE_END()
} // namespace Layers
} // namespace Test

} // namespace Acts
5 changes: 0 additions & 5 deletions Tests/UnitTests/Core/Geometry/CylinderVolumeBoundsTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,9 @@
#include <vector>

namespace bdata = boost::unit_test::data;
namespace tt = boost::test_tools;

namespace Acts {

namespace Test {

BOOST_AUTO_TEST_SUITE(Geometry)

BOOST_AUTO_TEST_CASE(CylinderVolumeBoundsConstruction) {
Expand Down Expand Up @@ -329,7 +326,5 @@ BOOST_AUTO_TEST_CASE(CylinderVolumeOrientedBoundaries) {
}

BOOST_AUTO_TEST_SUITE_END()

} // namespace Test

} // namespace Acts
3 changes: 0 additions & 3 deletions Tests/UnitTests/Core/Geometry/CylinderVolumeBuilderTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
#include <utility>

namespace bdata = boost::unit_test::data;
namespace tt = boost::test_tools;

namespace Acts {

namespace Test {

/// Unit test for testing the wraps() function of the CylinderVolumeBuilder
Expand Down Expand Up @@ -370,5 +368,4 @@ BOOST_DATA_TEST_CASE(
}

} // namespace Test

} // namespace Acts
Loading

0 comments on commit 3a9aa33

Please sign in to comment.