Skip to content

Commit

Permalink
Merge branch 'main' into path-max
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Sep 9, 2024
2 parents e3b639a + 2798d98 commit bb70544
Show file tree
Hide file tree
Showing 53 changed files with 275 additions and 262 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ class MultiComponentCurvilinearTrackParameters
avgDir += w * dir;
}

auto s = Surface::makeShared<PlaneSurface>(avgPos, avgDir);
auto s = CurvilinearSurface(avgPos, avgDir).planeSurface();

std::vector<std::tuple<double, BoundVector, covariance_t>> bound;
bound.reserve(curvi.size());
Expand Down
4 changes: 2 additions & 2 deletions Core/include/Acts/Geometry/CylinderVolumeStack.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class CylinderVolumeStack : public Volume {
/// @param transform is the new transform
/// @pre The volume bounds need to be of type
/// @c CylinderVolumeBounds.
void update(std::shared_ptr<const VolumeBounds> volbounds,
void update(std::shared_ptr<VolumeBounds> volbounds,
std::optional<Transform3> transform = std::nullopt) override;

/// Update the volume bounds and transform. This
Expand All @@ -100,7 +100,7 @@ class CylinderVolumeStack : public Volume {
/// @param logger is the logger
/// @pre The volume bounds need to be of type
/// @c CylinderVolumeBounds.
void update(std::shared_ptr<const CylinderVolumeBounds> newBounds,
void update(std::shared_ptr<CylinderVolumeBounds> newBounds,
std::optional<Transform3> transform, const Logger& logger);

/// Access the gap volume that were created during attachment or resizing.
Expand Down
8 changes: 3 additions & 5 deletions Core/include/Acts/Geometry/TrackingVolume.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class TrackingVolume : public Volume {
/// @param volbounds is the description of the volume boundaries
/// @param volumeName is a string identifier
TrackingVolume(const Transform3& transform,
std::shared_ptr<const VolumeBounds> volbounds,
std::shared_ptr<VolumeBounds> volbounds,
const std::string& volumeName = "undefined");

/// Constructor for a full equipped Tracking Volume
Expand All @@ -140,8 +140,7 @@ class TrackingVolume : public Volume {
/// @param denseVolumeVector The contained dense volumes
/// @param volumeName is a string identifier
TrackingVolume(
const Transform3& transform,
std::shared_ptr<const VolumeBounds> volumeBounds,
const Transform3& transform, std::shared_ptr<VolumeBounds> volumeBounds,
std::shared_ptr<const IVolumeMaterial> volumeMaterial,
std::unique_ptr<const LayerArray> staticLayerArray = nullptr,
std::shared_ptr<const TrackingVolumeArray> containedVolumeArray = nullptr,
Expand All @@ -151,8 +150,7 @@ class TrackingVolume : public Volume {
/// Constructor from a regular volume
/// @param volume is the volume to be converted
/// @param volumeName is a string identifier
TrackingVolume(const Volume& volume,
const std::string& volumeName = "undefined");
TrackingVolume(Volume& volume, const std::string& volumeName = "undefined");

// @TODO: This needs to be refactored to include Gen3 volumes
/// Return the associated sub Volume, returns THIS if no subVolume exists
Expand Down
19 changes: 13 additions & 6 deletions Core/include/Acts/Geometry/Volume.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ class Volume : public GeometryObject {
///
/// @param transform is the transform to position the volume in 3D space
/// @param volbounds is the volume boundary definitions
Volume(const Transform3& transform,
std::shared_ptr<const VolumeBounds> volbounds);
Volume(const Transform3& transform, std::shared_ptr<VolumeBounds> volbounds);

/// Copy Constructor - with optional shift
///
Expand All @@ -65,20 +64,26 @@ class Volume : public GeometryObject {
/// returns the center of the volume
const Vector3& center() const;

/// Returns const reference to the volume bounds
/// Returns a const reference to the volume bounds
const VolumeBounds& volumeBounds() const;

/// Returns a mutable reference to the volume bounds
VolumeBounds& volumeBounds();

/// Returns shared pointer to the volume bounds
std::shared_ptr<const VolumeBounds> volumeBoundsPtr() const;

/// Returns shared pointer to the volume bounds
std::shared_ptr<VolumeBounds> volumeBoundsPtr();

/// Set volume bounds and update volume bounding boxes implicitly
/// @param volbounds The volume bounds to be assigned
void assignVolumeBounds(std::shared_ptr<const VolumeBounds> volbounds);
void assignVolumeBounds(std::shared_ptr<VolumeBounds> volbounds);

/// Set the volume bounds and optionally also update the volume transform
/// @param volbounds The volume bounds to be assigned
/// @param transform The transform to be assigned, can be optional
virtual void update(std::shared_ptr<const VolumeBounds> volbounds,
virtual void update(std::shared_ptr<VolumeBounds> volbounds,
std::optional<Transform3> transform = std::nullopt);

/// Construct bounding box for this shape
Expand Down Expand Up @@ -117,7 +122,9 @@ class Volume : public GeometryObject {
Transform3 m_transform;
Transform3 m_itransform;
Vector3 m_center;
std::shared_ptr<const VolumeBounds> m_volumeBounds;

private:
std::shared_ptr<VolumeBounds> m_volumeBounds;
};

/**Overload of << operator for std::ostream for debug output*/
Expand Down
9 changes: 0 additions & 9 deletions Core/include/Acts/Surfaces/PlaneSurface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,6 @@ class PlaneSurface : public RegularSurface {
PlaneSurface(const GeometryContext& gctx, const PlaneSurface& other,
const Transform3& transform);

/// @deprecated Use `CurvilinearSurface` instead
///
/// Dedicated Constructor with normal vector
/// This is for curvilinear surfaces which are by definition boundless
///
/// @param center is the center position of the surface
/// @param normal is thenormal vector of the plane surface
PlaneSurface(const Vector3& center, const Vector3& normal);

/// Constructor from DetectorElementBase : Element proxy
///
/// @param pbounds are the provided planar bounds
Expand Down
36 changes: 33 additions & 3 deletions Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,9 @@ class CombinatorialKalmanFilter {
/// @param initialParameters The initial track parameters
/// @param tfOptions CombinatorialKalmanFilterOptions steering the track
/// finding
/// @param trackContainer Input track container to use
/// @param trackContainer Track container in which to store the results
/// @param rootBranch The track to be used as the root branch
///
/// @note The input measurements are given in the form of @c SourceLinks.
/// It's @c calibrator_t's job to turn them into calibrated measurements
/// used in the track finding.
Expand All @@ -1247,7 +1249,8 @@ class CombinatorialKalmanFilter {
auto findTracks(const start_parameters_t& initialParameters,
const CombinatorialKalmanFilterOptions<
source_link_iterator_t, track_container_t>& tfOptions,
track_container_t& trackContainer) const
track_container_t& trackContainer,
typename track_container_t::TrackProxy rootBranch) const
-> Result<std::vector<
typename std::decay_t<decltype(trackContainer)>::TrackProxy>> {
using SourceLinkAccessor =
Expand Down Expand Up @@ -1310,7 +1313,6 @@ class CombinatorialKalmanFilter {
r.tracks = &trackContainer;
r.trackStates = &trackContainer.trackStateContainer();

auto rootBranch = trackContainer.makeTrack();
r.activeBranches.push_back(rootBranch);

auto propagationResult = m_propagator.propagate(propState);
Expand Down Expand Up @@ -1349,6 +1351,34 @@ class CombinatorialKalmanFilter {

return std::move(combKalmanResult.collectedTracks);
}

/// Combinatorial Kalman Filter implementation, calls the Kalman filter
///
/// @tparam source_link_iterator_t Type of the source link iterator
/// @tparam start_parameters_t Type of the initial parameters
/// @tparam parameters_t Type of parameters used for local parameters
///
/// @param initialParameters The initial track parameters
/// @param tfOptions CombinatorialKalmanFilterOptions steering the track
/// finding
/// @param trackContainer Track container in which to store the results
/// @note The input measurements are given in the form of @c SourceLinks.
/// It's @c calibrator_t's job to turn them into calibrated measurements
/// used in the track finding.
///
/// @return a container of track finding result for all the initial track
/// parameters
template <typename source_link_iterator_t, typename start_parameters_t,
typename parameters_t = BoundTrackParameters>
auto findTracks(const start_parameters_t& initialParameters,
const CombinatorialKalmanFilterOptions<
source_link_iterator_t, track_container_t>& tfOptions,
track_container_t& trackContainer) const
-> Result<std::vector<
typename std::decay_t<decltype(trackContainer)>::TrackProxy>> {
auto rootBranch = trackContainer.makeTrack();
return findTracks(initialParameters, tfOptions, trackContainer, rootBranch);
}
};

} // namespace Acts
5 changes: 2 additions & 3 deletions Core/include/Acts/TrackFitting/detail/GsfComponentMerging.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "Acts/Definitions/TrackParametrization.hpp"
#include "Acts/Surfaces/CylinderSurface.hpp"
#include "Acts/TrackFitting/GsfOptions.hpp"
#include "Acts/Utilities/Identity.hpp"
#include "Acts/Utilities/detail/periodic.hpp"

#include <cmath>
Expand Down Expand Up @@ -123,7 +122,7 @@ auto gaussianMixtureCov(const components_t components,
/// std::tuple< weight, mean, std::optional< cov > >
/// @tparam angle_desc_t A angle description object which defines the cyclic
/// angles in the bound parameters
template <typename components_t, typename projector_t = Identity,
template <typename components_t, typename projector_t = std::identity,
typename angle_desc_t = AngleDescription<Surface::Plane>::Desc>
auto gaussianMixtureMeanCov(const components_t components,
projector_t &&projector = projector_t{},
Expand Down Expand Up @@ -212,7 +211,7 @@ auto gaussianMixtureMeanCov(const components_t components,
/// like a std::tuple< double, BoundVector, BoundMatrix >
///
/// @return parameters and covariance as std::tuple< BoundVector, BoundMatrix >
template <typename mixture_t, typename projector_t = Acts::Identity>
template <typename mixture_t, typename projector_t = std::identity>
auto mergeGaussianMixture(const mixture_t &mixture, const Surface &surface,
ComponentMergeMethod method,
projector_t &&projector = projector_t{}) {
Expand Down
36 changes: 0 additions & 36 deletions Core/include/Acts/Utilities/Identity.hpp

This file was deleted.

14 changes: 0 additions & 14 deletions Core/include/Acts/Utilities/Intersection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,6 @@ class Intersection {
Status status)
: m_position(position), m_pathLength(pathLength), m_status(status) {}

/// Returns whether the intersection was successful or not
/// @deprecated
[[deprecated("Use isValid() instead")]] constexpr explicit operator bool()
const {
return isValid();
}

/// Returns whether the intersection was successful or not
constexpr bool isValid() const { return m_status != Status::missed; }

Expand Down Expand Up @@ -149,13 +142,6 @@ class ObjectIntersection {
const object_t* object, std::uint8_t index = 0)
: m_intersection(intersection), m_object(object), m_index(index) {}

/// Returns whether the intersection was successful or not
/// @deprecated
[[deprecated("Use isValid() instead")]] constexpr explicit operator bool()
const {
return isValid();
}

/// Returns whether the intersection was successful or not
constexpr bool isValid() const { return m_intersection.isValid(); }

Expand Down
9 changes: 0 additions & 9 deletions Core/include/Acts/Vertexing/Vertex.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,6 @@ class Vertex {
/// @param position Vertex position
void setPosition(const Vector3& position);

/// @brief Set position and time
///
/// @deprecated Use setFullPosition instead
///
/// @param position Vertex position
/// @param time The time
[[deprecated("Use setFullPosition instead")]] void setPosition(
const Vector3& position, ActsScalar time);

/// @brief Set position and time
///
/// @param fullPosition Vertex position and time
Expand Down
19 changes: 9 additions & 10 deletions Core/src/Geometry/CylinderVolumeStack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ void CylinderVolumeStack::initializeOuterVolume(BinningValue direction,
const auto* cylBounds = dynamic_cast<const CylinderVolumeBounds*>(
&m_volumes.front()->volumeBounds());
assert(cylBounds != nullptr && "Volume bounds are not cylinder bounds");
m_volumeBounds = std::make_shared<CylinderVolumeBounds>(*cylBounds);
Volume::update(std::make_shared<CylinderVolumeBounds>(*cylBounds));
return;
}

Expand Down Expand Up @@ -211,8 +211,8 @@ void CylinderVolumeStack::initializeOuterVolume(BinningValue direction,

m_transform = m_groupTransform * Translation3{0, 0, midZ};

m_volumeBounds = std::make_shared<CylinderVolumeBounds>(minR, maxR, hlZ);
ACTS_DEBUG("Outer bounds are:\n" << *m_volumeBounds);
Volume::update(std::make_shared<CylinderVolumeBounds>(minR, maxR, hlZ));
ACTS_DEBUG("Outer bounds are:\n" << volumeBounds());
ACTS_DEBUG("Outer transform / new group transform is:\n"
<< m_transform.matrix());

Expand Down Expand Up @@ -269,9 +269,9 @@ void CylinderVolumeStack::initializeOuterVolume(BinningValue direction,

m_transform = m_groupTransform * Translation3{0, 0, midZ};

m_volumeBounds = std::make_shared<CylinderVolumeBounds>(minR, maxR, hlZ);
Volume::update(std::make_shared<CylinderVolumeBounds>(minR, maxR, hlZ));

ACTS_DEBUG("Outer bounds are:\n" << *m_volumeBounds);
ACTS_DEBUG("Outer bounds are:\n" << volumeBounds());
ACTS_DEBUG("Outer transform is:\n" << m_transform.matrix());

// Update group transform to the new center
Expand Down Expand Up @@ -625,13 +625,12 @@ std::pair<ActsScalar, ActsScalar> CylinderVolumeStack::synchronizeZBounds(
return {minZ, maxZ};
}

void CylinderVolumeStack::update(std::shared_ptr<const VolumeBounds> volbounds,
void CylinderVolumeStack::update(std::shared_ptr<VolumeBounds> volbounds,
std::optional<Transform3> transform) {
if (volbounds == nullptr) {
throw std::invalid_argument("New bounds are nullptr");
}
auto cylBounds =
std::dynamic_pointer_cast<const CylinderVolumeBounds>(volbounds);
auto cylBounds = std::dynamic_pointer_cast<CylinderVolumeBounds>(volbounds);
if (cylBounds == nullptr) {
throw std::invalid_argument(
"CylinderVolumeStack requires CylinderVolumeBounds");
Expand All @@ -641,7 +640,7 @@ void CylinderVolumeStack::update(std::shared_ptr<const VolumeBounds> volbounds,
}

void CylinderVolumeStack::update(
std::shared_ptr<const CylinderVolumeBounds> newBounds,
std::shared_ptr<CylinderVolumeBounds> newBounds,
std::optional<Transform3> transform, const Logger& logger) {
ACTS_DEBUG(
"Resizing CylinderVolumeStack with strategy: " << m_resizeStrategy);
Expand Down Expand Up @@ -934,7 +933,7 @@ void CylinderVolumeStack::update(
}

m_transform = newVolume.globalTransform;
m_volumeBounds = std::move(newBounds);
Volume::update(std::move(newBounds));
}

void CylinderVolumeStack::checkNoPhiOrBevel(const CylinderVolumeBounds& bounds,
Expand Down
8 changes: 3 additions & 5 deletions Core/src/Geometry/TrackingVolume.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ namespace Acts {

// constructor for arguments
TrackingVolume::TrackingVolume(
const Transform3& transform,
std::shared_ptr<const VolumeBounds> volumeBounds,
const Transform3& transform, std::shared_ptr<VolumeBounds> volumeBounds,
std::shared_ptr<const IVolumeMaterial> volumeMaterial,
std::unique_ptr<const LayerArray> staticLayerArray,
std::shared_ptr<const TrackingVolumeArray> containedVolumeArray,
Expand All @@ -49,14 +48,13 @@ TrackingVolume::TrackingVolume(
connectDenseBoundarySurfaces(denseVolumeVector);
}

TrackingVolume::TrackingVolume(const Volume& volume,
const std::string& volumeName)
TrackingVolume::TrackingVolume(Volume& volume, const std::string& volumeName)
: TrackingVolume(volume.transform(), volume.volumeBoundsPtr(), nullptr,
nullptr, nullptr, MutableTrackingVolumeVector{},
volumeName) {}

TrackingVolume::TrackingVolume(const Transform3& transform,
std::shared_ptr<const VolumeBounds> volbounds,
std::shared_ptr<VolumeBounds> volbounds,
const std::string& volumeName)
: TrackingVolume(transform, std::move(volbounds), nullptr, nullptr, nullptr,
{}, volumeName) {}
Expand Down
Loading

0 comments on commit bb70544

Please sign in to comment.