Skip to content

Commit

Permalink
Merge branch 'main' into trapezoidShellGen3
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitra97 authored Mar 5, 2025
2 parents 180f897 + 7cdb5b4 commit 9a14fe4
Show file tree
Hide file tree
Showing 311 changed files with 2,537 additions and 1,309 deletions.
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Checks: >
cppcoreguidelines-init-variables,
cppcoreguidelines-pro-type-member-init,
google-readability-casting,
google-explicit-constructor,
modernize-concat-nested-namespaces,
modernize-use-equals-default,
modernize-use-default-member-init,
Expand Down
7 changes: 4 additions & 3 deletions Alignment/include/ActsAlignment/Kernel/Alignment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,10 @@ struct Alignment {
Alignment() = delete;

/// Constructor from arguments
Alignment(fitter_t fitter,
std::unique_ptr<const Acts::Logger> _logger =
Acts::getDefaultLogger("Alignment", Acts::Logging::INFO))
explicit Alignment(fitter_t fitter,
std::unique_ptr<const Acts::Logger> _logger =
Acts::getDefaultLogger("Alignment",
Acts::Logging::INFO))
: m_fitter(std::move(fitter)), m_logger{std::move(_logger)} {}

/// @brief evaluate alignment state for a single track
Expand Down
1 change: 1 addition & 0 deletions CI/clang_tidy/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ limits:
"cppcoreguidelines-init-variables": 0
"cppcoreguidelines-pro-type-member-init": 0
"google-readability-casting": 0
"google-explicit-constructor": 0
"modernize-concat-nested-namespaces": 0
"modernize-use-equals-default": 0
"modernize-use-default-member-init": 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ class AmbiguityResolutionML {
///
/// @param cfg is the algorithm configuration
/// @param logger is the logging instance
AmbiguityResolutionML(const Config& cfg,
std::unique_ptr<const Logger> logger = getDefaultLogger(
"AmbiguityResolutionML", Logging::INFO))
explicit AmbiguityResolutionML(const Config& cfg,
std::unique_ptr<const Logger> logger =
getDefaultLogger("AmbiguityResolutionML",
Logging::INFO))
: m_cfg{cfg},
m_duplicateClassifier(m_cfg.inputDuplicateNN.c_str()),
m_logger{std::move(logger)} {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ class GreedyAmbiguityResolution {
boost::container::flat_set<std::size_t> selectedTracks;
};

GreedyAmbiguityResolution(const Config& cfg,
std::unique_ptr<const Logger> logger =
getDefaultLogger("GreedyAmbiguityResolution",
Logging::INFO))
explicit GreedyAmbiguityResolution(
const Config& cfg,
std::unique_ptr<const Logger> logger =
getDefaultLogger("GreedyAmbiguityResolution", Logging::INFO))
: m_cfg{cfg}, m_logger{std::move(logger)} {}

/// Computes the initial state for the input data. This function accumulates
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class ScoreBasedAmbiguityResolution {
std::vector<OptionalHitSelection> hitSelections = {};
};

ScoreBasedAmbiguityResolution(
explicit ScoreBasedAmbiguityResolution(
const Config& cfg,
std::unique_ptr<const Logger> logger =
getDefaultLogger("ScoreBasedAmbiguityResolution", Logging::INFO))
Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/Clusterization/TimedClusterization.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct TimedConnect : public Acts::Ccl::DefaultConnect<Cell, N> {
double timeTolerance{std::numeric_limits<double>::max()};

TimedConnect() = default;
TimedConnect(double time);
explicit TimedConnect(double time);
TimedConnect(double time, bool commonCorner)
requires(N == 2);
~TimedConnect() override = default;
Expand Down
10 changes: 5 additions & 5 deletions Core/include/Acts/Detector/CuboidalContainerBuilder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ class CuboidalContainerBuilder : public IDetectorComponentBuilder {
///
/// @param cfg is the configuration struct
/// @param logger logging instance for screen output
CuboidalContainerBuilder(const Config& cfg,
std::unique_ptr<const Logger> logger =
getDefaultLogger("CuboidalContainerBuilder",
Logging::INFO));
explicit CuboidalContainerBuilder(
const Config& cfg,
std::unique_ptr<const Logger> logger =
getDefaultLogger("CuboidalContainerBuilder", Logging::INFO));

/// Constructor from blueprint and logging level
///
Expand All @@ -84,7 +84,7 @@ class CuboidalContainerBuilder : public IDetectorComponentBuilder {
/// @note that the naming of the builders is taken from the bluprint nodes
///
/// @return a cylindrical container builder representing this blueprint
CuboidalContainerBuilder(
explicit CuboidalContainerBuilder(
const Acts::Experimental::Gen2Blueprint::Node& bpNode,
Acts::Logging::Level logLevel = Acts::Logging::INFO);

Expand Down
4 changes: 2 additions & 2 deletions Core/include/Acts/Detector/CylindricalContainerBuilder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class CylindricalContainerBuilder : public IDetectorComponentBuilder {
///
/// @param cfg is the configuration struct
/// @param logger logging instance for screen output
CylindricalContainerBuilder(
explicit CylindricalContainerBuilder(
const Config& cfg,
std::unique_ptr<const Logger> logger =
getDefaultLogger("CylindricalContainerBuilder", Logging::INFO));
Expand All @@ -86,7 +86,7 @@ class CylindricalContainerBuilder : public IDetectorComponentBuilder {
/// @note that the naming of the builders is taken from the bluprint nodes
///
/// @return a cylindrical container builder representing this blueprint
CylindricalContainerBuilder(
explicit CylindricalContainerBuilder(
const Acts::Experimental::Gen2Blueprint::Node& bpNode,
Acts::Logging::Level logLevel = Acts::Logging::INFO);

Expand Down
7 changes: 4 additions & 3 deletions Core/include/Acts/Detector/DetectorBuilder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ class DetectorBuilder final : public IDetectorBuilder {
///
/// @param cfg is the configuration struct
/// @param mlogger logging instance for screen output
DetectorBuilder(const Config& cfg,
std::unique_ptr<const Logger> mlogger =
getDefaultLogger("DetectorBuilder", Logging::INFO));
explicit DetectorBuilder(const Config& cfg,
std::unique_ptr<const Logger> mlogger =
getDefaultLogger("DetectorBuilder",
Logging::INFO));

/// Final implementation of a volume builder that is purely defined
/// by an internal and external structure builder
Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/Detector/DetectorVolume.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class DetectorVolume : public std::enable_shared_from_this<DetectorVolume> {
/// Store constructor
///
/// @param objects are the ones copied into the internal store
ObjectStore(std::vector<internal_type> objects)
explicit ObjectStore(std::vector<internal_type> objects)
: internal(std::move(objects)) {
external = unpack_shared_const_vector(internal);
}
Expand Down
8 changes: 4 additions & 4 deletions Core/include/Acts/Detector/DetectorVolumeBuilder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ class DetectorVolumeBuilder : public IDetectorComponentBuilder {
///
/// @param cfg is the configuration struct
/// @param mlogger logging instance for screen output
DetectorVolumeBuilder(const Config& cfg,
std::unique_ptr<const Logger> mlogger =
getDefaultLogger("DetectorVolumeBuilder",
Logging::INFO));
explicit DetectorVolumeBuilder(const Config& cfg,
std::unique_ptr<const Logger> mlogger =
getDefaultLogger("DetectorVolumeBuilder",
Logging::INFO));

/// Final implementation of a volume builder that is purely defined
/// by an internal and external structure builder
Expand Down
15 changes: 8 additions & 7 deletions Core/include/Acts/Detector/GeometryIdGenerator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ class GeometryIdGenerator final : public IGeometryIdGenerator {
///
/// @param cfg is the geometry configuration object
/// @param mlogger is the logging instance
GeometryIdGenerator(const Config& cfg,
std::unique_ptr<const Logger> mlogger = getDefaultLogger(
"GeometryIdGenerator", Logging::INFO))
explicit GeometryIdGenerator(const Config& cfg,
std::unique_ptr<const Logger> mlogger =
getDefaultLogger("GeometryIdGenerator",
Logging::INFO))
: m_cfg(cfg), m_logger(std::move(mlogger)) {}

~GeometryIdGenerator() override = default;
Expand Down Expand Up @@ -142,10 +143,10 @@ class ChainedGeometryIdGenerator : public IGeometryIdGenerator {
///
/// @param gens the updators to be called in chain
/// @param mlogger is the logging instance
ChainedGeometryIdGenerator(const std::tuple<generators_t...>&& gens,
std::unique_ptr<const Logger> mlogger =
getDefaultLogger("ChainedGeometryIdGenerator",
Logging::INFO))
explicit ChainedGeometryIdGenerator(
const std::tuple<generators_t...>&& gens,
std::unique_ptr<const Logger> mlogger =
getDefaultLogger("ChainedGeometryIdGenerator", Logging::INFO))
: generators(std::move(gens)), m_logger(std::move(mlogger)) {}

/// @brief Interface method to generate a geometry id cache
Expand Down
7 changes: 4 additions & 3 deletions Core/include/Acts/Detector/GeometryIdMapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ class GeometryIdMapper final : public IGeometryIdGenerator {
///
/// @param cfg is the geometry configuration object
/// @param mlogger is the logging instance
GeometryIdMapper(const Config& cfg,
std::unique_ptr<const Logger> mlogger =
getDefaultLogger("GeometryIdMapper", Logging::INFO))
explicit GeometryIdMapper(const Config& cfg,
std::unique_ptr<const Logger> mlogger =
getDefaultLogger("GeometryIdMapper",
Logging::INFO))
: m_cfg(cfg), m_logger(std::move(mlogger)) {}

~GeometryIdMapper() override = default;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ class IndexedRootVolumeFinderBuilder final : public IRootVolumeFinderBuilder {
public:
/// @brief Constructor with binning casts
/// @param binning the cast values for the grid binning
IndexedRootVolumeFinderBuilder(std::vector<Acts::AxisDirection> binning);
explicit IndexedRootVolumeFinderBuilder(
std::vector<Acts::AxisDirection> binning);

/// The virtual interface definition for root volume finder builders
///
Expand Down
9 changes: 5 additions & 4 deletions Core/include/Acts/Detector/LayerStructureBuilder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class LayerStructureBuilder : public IInternalStructureBuilder {
public:
/// Constructor with predefined surfaces
/// @param isurfaces is the vector of surfaces
SurfacesHolder(std::vector<std::shared_ptr<Surface>> isurfaces)
explicit SurfacesHolder(std::vector<std::shared_ptr<Surface>> isurfaces)
: m_surfaces(std::move(isurfaces)) {}

/// Return the surfaces from the holder
Expand Down Expand Up @@ -101,9 +101,10 @@ class LayerStructureBuilder : public IInternalStructureBuilder {
///
/// @param cfg is the configuration struct
/// @param logger logging instance for screen output
LayerStructureBuilder(const Config& cfg,
std::unique_ptr<const Logger> logger = getDefaultLogger(
"LayerStructureBuilder", Logging::INFO));
explicit LayerStructureBuilder(const Config& cfg,
std::unique_ptr<const Logger> logger =
getDefaultLogger("LayerStructureBuilder",
Logging::INFO));

/// The interface definition for internal structure creation
///
Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/Detector/MultiWireStructureBuilder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class MultiWireStructureBuilder {
/// @param config The configure of the MultiWireStructureBuilder
/// @param logger logging instance for screen output

MultiWireStructureBuilder(
explicit MultiWireStructureBuilder(
const Config& config,
std::unique_ptr<const Acts::Logger> logger = Acts::getDefaultLogger(
"MultiWireStructureBuilder", Acts::Logging::VERBOSE));
Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/Detector/Portal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Portal {
/// Constructor from surface w/o portal links
///
/// @param surface is the representing surface
Portal(std::shared_ptr<RegularSurface> surface);
explicit Portal(std::shared_ptr<RegularSurface> surface);

/// The vector of attached volumes forward/backward, this is useful in the
/// geometry building
Expand Down
8 changes: 4 additions & 4 deletions Core/include/Acts/Detector/VolumeStructureBuilder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ class VolumeStructureBuilder : public IExternalStructureBuilder {
///
/// @param cfg is the configuration struct
/// @param mlogger logging instance for screen output
VolumeStructureBuilder(const Config& cfg,
std::unique_ptr<const Logger> mlogger =
getDefaultLogger("VolumeStructureBuilder",
Logging::INFO));
explicit VolumeStructureBuilder(const Config& cfg,
std::unique_ptr<const Logger> mlogger =
getDefaultLogger("VolumeStructureBuilder",
Logging::INFO));

/// The interface definition for internal structure creation
///
Expand Down
14 changes: 7 additions & 7 deletions Core/include/Acts/EventData/Charge.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ struct Neutral {
/// Construct and verify the input charge magnitude (in debug builds).
///
/// This constructor is only provided to allow consistent construction.
constexpr Neutral(float absQ) noexcept {
constexpr explicit Neutral(float absQ) noexcept {
assert((absQ == 0) && "Input charge must be zero");
(void)absQ;
}
Expand Down Expand Up @@ -102,7 +102,7 @@ struct SinglyCharged {
/// Construct and verify the input charge magnitude (in debug builds).
///
/// This constructor is only provided to allow consistent construction.
constexpr SinglyCharged(float absQ) noexcept {
constexpr explicit SinglyCharged(float absQ) noexcept {
assert((absQ == UnitConstants::e) && "Input charge magnitude must be e");
(void)absQ;
}
Expand Down Expand Up @@ -141,10 +141,10 @@ static_assert(ChargeConcept<SinglyCharged>,
class NonNeutralCharge {
public:
/// Construct with the magnitude of the input charge.
constexpr NonNeutralCharge(float absQ) noexcept : m_absQ{absQ} {
constexpr explicit NonNeutralCharge(float absQ) noexcept : m_absQ{absQ} {
assert((0 < absQ) && "Input charge magnitude must be positive");
}
constexpr NonNeutralCharge(SinglyCharged /*unused*/) noexcept
constexpr explicit NonNeutralCharge(SinglyCharged /*unused*/) noexcept
: m_absQ{UnitConstants::e} {}

constexpr float absQ() const noexcept { return m_absQ; }
Expand Down Expand Up @@ -182,12 +182,12 @@ static_assert(ChargeConcept<NonNeutralCharge>,
class AnyCharge {
public:
/// Construct with the magnitude of the input charge.
constexpr AnyCharge(float absQ) noexcept : m_absQ{absQ} {
constexpr explicit AnyCharge(float absQ) noexcept : m_absQ{absQ} {
assert((0 <= absQ) && "Input charge magnitude must be zero or positive");
}
constexpr AnyCharge(SinglyCharged /*unused*/) noexcept
constexpr explicit AnyCharge(SinglyCharged /*unused*/) noexcept
: m_absQ{UnitConstants::e} {}
constexpr AnyCharge(Neutral /*unused*/) noexcept {}
constexpr explicit AnyCharge(Neutral /*unused*/) noexcept {}

constexpr float absQ() const noexcept { return m_absQ; }

Expand Down
15 changes: 11 additions & 4 deletions Core/include/Acts/EventData/GenericBoundTrackParameters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#pragma once

#include "Acts/Definitions/Tolerance.hpp"
#include "Acts/EventData/ParticleHypothesis.hpp"
#include "Acts/EventData/TrackParameterHelpers.hpp"
#include "Acts/EventData/TransformationHelpers.hpp"
#include "Acts/EventData/detail/PrintParameters.hpp"
Expand Down Expand Up @@ -69,11 +70,17 @@ class GenericBoundTrackParameters {

/// Converts a bound track parameter with a different hypothesis.
template <typename other_particle_hypothesis_t>
GenericBoundTrackParameters(
explicit GenericBoundTrackParameters(
const GenericBoundTrackParameters<other_particle_hypothesis_t>& other)
: GenericBoundTrackParameters(other.referenceSurface().getSharedPtr(),
other.parameters(), other.covariance(),
other.particleHypothesis()) {}
: GenericBoundTrackParameters(
other.referenceSurface().getSharedPtr(), other.parameters(),
other.covariance(),
ParticleHypothesis{other.particleHypothesis()}) {}

/// Convert this track parameter object to the general type-erased one
GenericBoundTrackParameters<Acts::ParticleHypothesis> toBound() const {
return GenericBoundTrackParameters<Acts::ParticleHypothesis>{*this};
}

/// Factory to construct from four-position, direction, absolute momentum, and
/// charge.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class GenericCurvilinearTrackParameters

/// Converts a bound track parameter with a different hypothesis.
template <typename other_particle_hypothesis_t>
GenericCurvilinearTrackParameters(
explicit GenericCurvilinearTrackParameters(
const GenericCurvilinearTrackParameters<other_particle_hypothesis_t>&
other)
: GenericCurvilinearTrackParameters(other.fourPosition(),
Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/EventData/GenericFreeTrackParameters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class GenericFreeTrackParameters {

/// Converts a free track parameter with a different hypothesis.
template <typename other_particle_hypothesis_t>
GenericFreeTrackParameters(
explicit GenericFreeTrackParameters(
const GenericFreeTrackParameters<other_particle_hypothesis_t>& other)
: GenericFreeTrackParameters(other.parameters(),
other.particleHypothesis(),
Expand Down
4 changes: 2 additions & 2 deletions Core/include/Acts/EventData/GenericParticleHypothesis.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class GenericParticleHypothesis {
/// If the lookup fails an exception is thrown.
///
/// @param absPdg the absolute PDG
GenericParticleHypothesis(PdgParticle absPdg)
explicit GenericParticleHypothesis(PdgParticle absPdg)
: m_absPdg{absPdg},
m_mass{findMass(absPdg).value()},
m_chargeType{std::abs(findCharge(absPdg).value())} {
Expand All @@ -57,7 +57,7 @@ class GenericParticleHypothesis {
///
/// @note This enables implicit conversion.
template <typename other_charge_t>
constexpr GenericParticleHypothesis(
explicit constexpr GenericParticleHypothesis(
const GenericParticleHypothesis<other_charge_t>& other)
: m_absPdg{other.absolutePdg()},
m_mass{other.mass()},
Expand Down
3 changes: 3 additions & 0 deletions Core/include/Acts/EventData/MultiComponentTrackParameters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ class MultiComponentBoundTrackParameters {
MultiComponentBoundTrackParameters& operator=(
MultiComponentBoundTrackParameters&&) = default;

/// Comply with bound convertible, in this case return a copy
MultiComponentBoundTrackParameters toBound() const { return *this; }

/// Access the parameters
const auto& components() const { return m_components; }

Expand Down
Loading

0 comments on commit 9a14fe4

Please sign in to comment.