Skip to content

Commit

Permalink
Merge branch 'main' into ranges-of
Browse files Browse the repository at this point in the history
  • Loading branch information
AJPfleger authored Sep 10, 2024
2 parents 17e4f2a + d80f91f commit 0fb54a7
Show file tree
Hide file tree
Showing 97 changed files with 684 additions and 1,210 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
6 changes: 3 additions & 3 deletions Core/include/Acts/Material/ISurfaceMaterial.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of the Acts project.
//
// Copyright (C) 2016-2020 CERN for the benefit of the Acts project
// Copyright (C) 2016-2024 CERN for the benefit of the Acts project
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
Expand Down Expand Up @@ -139,7 +139,7 @@ inline MaterialSlab ISurfaceMaterial::materialSlab(
// The plain material properties associated to this bin
MaterialSlab plainMatProp = materialSlab(lp);
// Scale if you have material to scale
if (plainMatProp) {
if (plainMatProp.isValid()) {
double scaleFactor = factor(pDir, mStage);
if (scaleFactor == 0.) {
return MaterialSlab();
Expand All @@ -154,7 +154,7 @@ inline MaterialSlab ISurfaceMaterial::materialSlab(
// The plain material properties associated to this bin
MaterialSlab plainMatProp = materialSlab(gp);
// Scale if you have material to scale
if (plainMatProp) {
if (plainMatProp.isValid()) {
double scaleFactor = factor(pDir, mStage);
if (scaleFactor == 0.) {
return MaterialSlab();
Expand Down
8 changes: 4 additions & 4 deletions Core/include/Acts/Material/Material.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of the Acts project.
//
// Copyright (C) 2016-2020 CERN for the benefit of the Acts project
// Copyright (C) 2016-2024 CERN for the benefit of the Acts project
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
Expand Down Expand Up @@ -74,7 +74,7 @@ class Material {
/// Construct a vacuum representation.
Material() = default;
/// Construct from an encoded parameters vector.
Material(const ParametersVector& parameters);
explicit Material(const ParametersVector& parameters);

Material(Material&& mat) = default;
Material(const Material& mat) = default;
Expand All @@ -83,9 +83,9 @@ class Material {
Material& operator=(const Material& mat) = default;

/// Check if the material is valid, i.e. it is not vacuum.
constexpr operator bool() const { return 0.0f < m_ar; }
bool isValid() const { return 0.0f < m_ar; }

/// Return the radition length. Infinity in case of vacuum.
/// Return the radiation length. Infinity in case of vacuum.
constexpr float X0() const { return m_x0; }
/// Return the nuclear interaction length. Infinity in case of vacuum.
constexpr float L0() const { return m_l0; }
Expand Down
6 changes: 3 additions & 3 deletions Core/include/Acts/Material/MaterialSlab.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of the Acts project.
//
// Copyright (C) 2016-2020 CERN for the benefit of the Acts project
// Copyright (C) 2016-2024 CERN for the benefit of the Acts project
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
Expand Down Expand Up @@ -45,7 +45,7 @@ class MaterialSlab {
/// Construct vacuum without thickness.
MaterialSlab() = default;
/// Construct vacuum with thickness.
MaterialSlab(float thickness);
explicit MaterialSlab(float thickness);
/// Construct from material description.
///
/// @param material is the material description
Expand All @@ -62,7 +62,7 @@ class MaterialSlab {
void scaleThickness(float scale);

/// Check if the material is valid, i.e. it is finite and not vacuum.
constexpr operator bool() const { return m_material && (0.0f < m_thickness); }
bool isValid() const { return m_material.isValid() && (0.0f < m_thickness); }

/// Access the (average) material parameters.
constexpr const Material& material() const { return m_material; }
Expand Down
22 changes: 8 additions & 14 deletions Core/include/Acts/Propagator/EigenStepper.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of the Acts project.
//
// Copyright (C) 2016-2022 CERN for the benefit of the Acts project
// Copyright (C) 2016-2024 CERN for the benefit of the Acts project
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
Expand All @@ -15,20 +15,18 @@
#include "Acts/Definitions/Tolerance.hpp"
#include "Acts/Definitions/Units.hpp"
#include "Acts/EventData/TrackParameters.hpp"
#include "Acts/EventData/detail/CorrectedTransformationFreeToBound.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/MagneticField/MagneticFieldContext.hpp"
#include "Acts/MagneticField/MagneticFieldProvider.hpp"
#include "Acts/Propagator/ConstrainedStep.hpp"
#include "Acts/Propagator/DefaultExtension.hpp"
#include "Acts/Propagator/DenseEnvironmentExtension.hpp"
#include "Acts/Propagator/EigenStepperError.hpp"
#include "Acts/Propagator/EigenStepperDefaultExtension.hpp"
#include "Acts/Propagator/PropagatorTraits.hpp"
#include "Acts/Propagator/StepperExtensionList.hpp"
#include "Acts/Propagator/StepperOptions.hpp"
#include "Acts/Propagator/detail/Auctioneer.hpp"
#include "Acts/Propagator/detail/SteppingHelper.hpp"
#include "Acts/Utilities/Intersection.hpp"
#include "Acts/Utilities/Result.hpp"

#include <cmath>
#include <functional>
#include <limits>
#include <type_traits>
Expand All @@ -47,8 +45,7 @@ namespace Acts {
/// with s being the arc length of the track, q the charge of the particle,
/// p the momentum magnitude and B the magnetic field
///
template <typename extensionlist_t = StepperExtensionList<DefaultExtension>,
typename auctioneer_t = detail::VoidAuctioneer>
template <typename extension_t = EigenStepperDefaultExtension>
class EigenStepper {
public:
/// Jacobian, Covariance and State definitions
Expand Down Expand Up @@ -155,11 +152,8 @@ class EigenStepper {
/// The geometry context
std::reference_wrapper<const GeometryContext> geoContext;

/// List of algorithmic extensions
extensionlist_t extension;

/// Auctioneer for choosing the extension
auctioneer_t auctioneer;
/// Algorithmic extension
extension_t extension;

/// @brief Storage of magnetic field and the sub steps during a RKN4 step
struct {
Expand Down
Loading

0 comments on commit 0fb54a7

Please sign in to comment.