Skip to content

Commit

Permalink
chore: rename unused params (#1952)
Browse files Browse the repository at this point in the history
- rename `/*unused*/` params into something more understandable
- improve doc
  • Loading branch information
andiwand committed Mar 22, 2023
1 parent bf5a3fc commit 34a0534
Show file tree
Hide file tree
Showing 54 changed files with 144 additions and 143 deletions.
7 changes: 3 additions & 4 deletions Core/include/Acts/EventData/Charge.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ struct Neutral {
///
/// This is always `true` as `Neutral` has no internal state.
/// Must be available to provide a consistent interface.
friend constexpr bool operator==(Neutral /*unused*/,
Neutral /*unused*/) noexcept {
friend constexpr bool operator==(Neutral /*lhs*/, Neutral /*rhs*/) noexcept {
return true;
}
};
Expand Down Expand Up @@ -110,8 +109,8 @@ struct SinglyCharged {
///
/// This is always `true` as `SinglyCharged` has no internal state.
/// Must be available to provide a consistent interface.
friend constexpr bool operator==(SinglyCharged /*unused*/,
SinglyCharged /*unused*/) noexcept {
friend constexpr bool operator==(SinglyCharged /*lhs*/,
SinglyCharged /*rhs*/) noexcept {
return true;
}
};
Expand Down
4 changes: 2 additions & 2 deletions Core/include/Acts/Geometry/CuboidVolumeBuilder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ class CuboidVolumeBuilder : public ITrackingVolumeBuilder {
/// @return Pointer to the created TrackingGeometry
std::shared_ptr<TrackingVolume> trackingVolume(
const GeometryContext& gctx,
std::shared_ptr<const TrackingVolume> /*unused*/,
std::shared_ptr<const VolumeBounds> /*unused*/) const override;
std::shared_ptr<const TrackingVolume> /*oppositeVolume*/,
std::shared_ptr<const VolumeBounds> /*outsideBounds*/) const override;

private:
/// Configuration of the world volume
Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/Navigation/NavigationStateUpdators.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class IndexedUpdatorImpl : public INavigationDelegate {
/// @param a is the array to be filled
template <typename Array, std::size_t... idx>
void fillCasts(const Vector3& position, Array& a,
std::index_sequence<idx...> /*unused*/) const {
std::index_sequence<idx...> /*indices*/) const {
((a[idx] = VectorHelpers::cast(position, casts[idx])), ...);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ struct GenericDefaultExtension {
/// @tparam stepper_t Type of the stepper
/// @return Boolean flag if the step would be valid
template <typename propagator_state_t, typename stepper_t>
int bid(const propagator_state_t& /*unused*/,
const stepper_t& /*unused*/) const {
int bid(const propagator_state_t& /*state*/,
const stepper_t& /*stepper*/) const {
return 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ struct VoidNavigator {
/// Empty call, compiler should optimise that
template <typename propagator_state_t, typename stepper_t>
void status(propagator_state_t& /*state*/,
const stepper_t& /*unused*/) const {}
const stepper_t& /*stepper*/) const {}

/// Navigation call - void
///
Expand All @@ -56,7 +56,7 @@ struct VoidNavigator {
/// Empty call, compiler should optimise that
template <typename propagator_state_t, typename stepper_t>
void target(propagator_state_t& /*state*/,
const stepper_t& /*unused*/) const {}
const stepper_t& /*stepper*/) const {}
};

} // namespace detail
Expand Down
2 changes: 1 addition & 1 deletion Core/src/Detector/DetectorVolume.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Acts::Experimental::DetectorVolume::DetectorVolume(
}

Acts::Experimental::DetectorVolume::DetectorVolume(
const GeometryContext& /*unused*/, const std::string& name,
const GeometryContext& /*gctx*/, const std::string& name,
const Transform3& transform, std::unique_ptr<VolumeBounds> bounds,
SurfaceCandidatesUpdator&& surfaceCandidateUpdator)
: m_name(name),
Expand Down
4 changes: 2 additions & 2 deletions Core/src/Geometry/CuboidVolumeBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ std::shared_ptr<Acts::TrackingVolume> Acts::CuboidVolumeBuilder::buildVolume(
}

Acts::MutableTrackingVolumePtr Acts::CuboidVolumeBuilder::trackingVolume(
const GeometryContext& gctx, Acts::TrackingVolumePtr /*unused*/,
Acts::VolumeBoundsPtr /*unused*/) const {
const GeometryContext& gctx, Acts::TrackingVolumePtr /*gctx*/,
Acts::VolumeBoundsPtr /*bounds*/) const {
// Build volumes
std::vector<std::shared_ptr<TrackingVolume>> volumes;
volumes.reserve(m_cfg.volumeCfg.size());
Expand Down
2 changes: 1 addition & 1 deletion Core/src/Geometry/CylinderVolumeHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ bool Acts::CylinderVolumeHelper::estimateAndCheckDimension(
const CylinderVolumeBounds*& cylinderVolumeBounds,
const Transform3& transform, double& rMinClean, double& rMaxClean,
double& zMinClean, double& zMaxClean, BinningValue& bValue,
BinningType /*unused*/) const {
BinningType /*bType*/) const {
// some verbose output

ACTS_VERBOSE("Parsing the " << layers.size()
Expand Down
2 changes: 1 addition & 1 deletion Core/src/Geometry/GeometryIdentifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ std::ostream& Acts::operator<<(std::ostream& os, Acts::GeometryIdentifier id) {

Acts::GeometryIdentifier Acts::GeometryIdentifierHook::decorateIdentifier(
Acts::GeometryIdentifier identifier,
const Acts::Surface& /*unused*/) const {
const Acts::Surface& /*surface*/) const {
return identifier;
}
6 changes: 3 additions & 3 deletions Core/src/Surfaces/ConeSurface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Acts::Vector3 Acts::ConeSurface::rotSymmetryAxis(

Acts::RotationMatrix3 Acts::ConeSurface::referenceFrame(
const GeometryContext& gctx, const Vector3& position,
const Vector3& /*unused*/) const {
const Vector3& /*momentum*/) const {
RotationMatrix3 mFrame;
// construct the measurement frame
// measured Y is the local z axis
Expand All @@ -102,7 +102,7 @@ Acts::RotationMatrix3 Acts::ConeSurface::referenceFrame(

Acts::Vector3 Acts::ConeSurface::localToGlobal(
const GeometryContext& gctx, const Vector2& lposition,
const Vector3& /*unused*/) const {
const Vector3& /*momentum*/) const {
// create the position in the local 3d frame
double r = lposition[Acts::eBoundLoc1] * bounds().tanAlpha();
double phi = lposition[Acts::eBoundLoc0] / r;
Expand All @@ -112,7 +112,7 @@ Acts::Vector3 Acts::ConeSurface::localToGlobal(

Acts::Result<Acts::Vector2> Acts::ConeSurface::globalToLocal(
const GeometryContext& gctx, const Vector3& position,
const Vector3& /*unused*/, double tolerance) const {
const Vector3& /*momentum*/, double tolerance) const {
Vector3 loc3Dframe = transform(gctx).inverse() * position;
double r = loc3Dframe.z() * bounds().tanAlpha();
if (std::abs(perp(loc3Dframe) - r) > tolerance) {
Expand Down
6 changes: 3 additions & 3 deletions Core/src/Surfaces/CylinderSurface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Acts::Vector3 Acts::CylinderSurface::binningPosition(
// return the measurement frame: it's the tangential plane
Acts::RotationMatrix3 Acts::CylinderSurface::referenceFrame(
const GeometryContext& gctx, const Vector3& position,
const Vector3& /*unused*/) const {
const Vector3& /*momentum*/) const {
RotationMatrix3 mFrame;
// construct the measurement frame
// measured Y is the z axis
Expand All @@ -100,7 +100,7 @@ Acts::Surface::SurfaceType Acts::CylinderSurface::type() const {

Acts::Vector3 Acts::CylinderSurface::localToGlobal(
const GeometryContext& gctx, const Vector2& lposition,
const Vector3& /*unused*/) const {
const Vector3& /*momentum*/) const {
// create the position in the local 3d frame
double r = bounds().get(CylinderBounds::eR);
double phi = lposition[Acts::eBoundLoc0] / r;
Expand All @@ -110,7 +110,7 @@ Acts::Vector3 Acts::CylinderSurface::localToGlobal(

Acts::Result<Acts::Vector2> Acts::CylinderSurface::globalToLocal(
const GeometryContext& gctx, const Vector3& position,
const Vector3& /*unused*/, double tolerance) const {
const Vector3& /*momentum*/, double tolerance) const {
double inttol = tolerance;
if (tolerance == s_onSurfaceTolerance) {
// transform default value!
Expand Down
4 changes: 2 additions & 2 deletions Core/src/Surfaces/DiscSurface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Acts::Vector3 Acts::DiscSurface::localCartesianToGlobal(

Acts::Vector2 Acts::DiscSurface::globalToLocalCartesian(
const GeometryContext& gctx, const Vector3& position,
double /*unused*/) const {
double /*momentum*/) const {
Vector3 loc3Dframe = (transform(gctx).inverse()) * position;
return Vector2(loc3Dframe.x(), loc3Dframe.y());
}
Expand Down Expand Up @@ -333,7 +333,7 @@ Acts::ActsMatrix<2, 3> Acts::DiscSurface::localCartesianToBoundLocalDerivative(
}

Acts::Vector3 Acts::DiscSurface::normal(const GeometryContext& gctx,
const Vector2& /*unused*/) const {
const Vector2& /*lposition*/) const {
// fast access via tranform matrix (and not rotation())
const auto& tMatrix = transform(gctx).matrix();
return Vector3(tMatrix(0, 2), tMatrix(1, 2), tMatrix(2, 2));
Expand Down
4 changes: 2 additions & 2 deletions Core/src/Surfaces/LineSurface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ std::string Acts::LineSurface::name() const {
}

Acts::RotationMatrix3 Acts::LineSurface::referenceFrame(
const GeometryContext& gctx, const Vector3& /*unused*/,
const GeometryContext& gctx, const Vector3& /*position*/,
const Vector3& momentum) const {
RotationMatrix3 mFrame;
const auto& tMatrix = transform(gctx).matrix();
Expand All @@ -100,7 +100,7 @@ Acts::RotationMatrix3 Acts::LineSurface::referenceFrame(
return mFrame;
}

double Acts::LineSurface::pathCorrection(const GeometryContext& /*unused*/,
double Acts::LineSurface::pathCorrection(const GeometryContext& /*gctx*/,
const Vector3& /*pos*/,
const Vector3& /*mom*/) const {
return 1.;
Expand Down
6 changes: 3 additions & 3 deletions Core/src/Surfaces/PlaneSurface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ Acts::Surface::SurfaceType Acts::PlaneSurface::type() const {

Acts::Vector3 Acts::PlaneSurface::localToGlobal(
const GeometryContext& gctx, const Vector2& lposition,
const Vector3& /*unused*/) const {
const Vector3& /*momentum*/) const {
return transform(gctx) *
Vector3(lposition[Acts::eBoundLoc0], lposition[Acts::eBoundLoc1], 0.);
}

Acts::Result<Acts::Vector2> Acts::PlaneSurface::globalToLocal(
const GeometryContext& gctx, const Vector3& position,
const Vector3& /*unused*/, double tolerance) const {
const Vector3& /*momentum*/, double tolerance) const {
Vector3 loc3Dframe = transform(gctx).inverse() * position;
if (std::abs(loc3Dframe.z()) > std::abs(tolerance)) {
return Result<Vector2>::failure(SurfaceError::GlobalPositionNotOnSurface);
Expand Down Expand Up @@ -193,7 +193,7 @@ Acts::SurfaceIntersection Acts::PlaneSurface::intersect(
}

Acts::ActsMatrix<2, 3> Acts::PlaneSurface::localCartesianToBoundLocalDerivative(
const GeometryContext& /*unused*/, const Vector3& /*unused*/) const {
const GeometryContext& /*gctx*/, const Vector3& /*position*/) const {
const ActsMatrix<2, 3> loc3DToLocBound = ActsMatrix<2, 3>::Identity();
return loc3DToLocBound;
}
6 changes: 3 additions & 3 deletions Core/src/Surfaces/Surface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ Acts::Vector3 Acts::Surface::center(const GeometryContext& gctx) const {
}

Acts::Vector3 Acts::Surface::normal(const GeometryContext& gctx,
const Vector3& /*unused*/) const {
const Vector3& /*position*/) const {
return normal(gctx, Vector2(Vector2::Zero()));
}

Expand All @@ -245,8 +245,8 @@ bool Acts::Surface::insideBounds(const Vector2& lposition,
}

Acts::RotationMatrix3 Acts::Surface::referenceFrame(
const GeometryContext& gctx, const Vector3& /*unused*/,
const Vector3& /*unused*/) const {
const GeometryContext& gctx, const Vector3& /*position*/,
const Vector3& /*momentum*/) const {
return transform(gctx).matrix().block<3, 3>(0, 0);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ struct GeometricConfig {
bool digital = false;

/// Charge generation (configurable via the chargeSmearer)
Acts::ActsScalar charge(Acts::ActsScalar path, Acts::ActsScalar /*unused*/,
RandomEngine &rng) const {
Acts::ActsScalar charge(Acts::ActsScalar path, RandomEngine &rng) const {
if (not chargeSmearer) {
return path;
}
Expand All @@ -71,16 +70,16 @@ struct GeometricConfig {
/// Position and Covariance generation (currently not implemented)
/// Takes as an argument the clsuter size and an random engine
/// @return a vector of uncorrelated covariance values
std::vector<Acts::ActsScalar> variances(size_t /*unused*/, size_t /*unused*/,
RandomEngine & /*unused*/) const {
std::vector<Acts::ActsScalar> variances(size_t /*size0*/, size_t /*size1*/,
RandomEngine & /*rng*/) const {
return {};
};

/// Drift generation (currently not implemented)
/// Takes as an argument the position, and a random engine
/// @return drift direction in local 3D coordinates
Acts::Vector3 drift(const Acts::Vector3 & /*unused*/,
RandomEngine & /*unused*/) const {
Acts::Vector3 drift(const Acts::Vector3 & /*position*/,
RandomEngine & /*rng*/) const {
return Acts::Vector3(0., 0., 0.);
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ struct Exact {
/// @return a Result that is always ok(), and just returns
/// the value and a stddev of 0.0
Acts::Result<std::pair<double, double>> operator()(
double value, RandomEngine& /*unused*/) const {
double value, RandomEngine& /*rnd*/) const {
return std::pair{value, 0.0};
}
};
Expand Down Expand Up @@ -191,7 +191,7 @@ struct Digital {
///
/// @return a Result is uniformly distributed between bin borders
Acts::Result<std::pair<double, double>> operator()(
double value, RandomEngine& /*unused*/) const {
double value, RandomEngine& /*rnd*/) const {
if (binningData.min < value and binningData.max > value) {
auto bin = binningData.search(value);
auto lower = binningData.boundaries()[bin];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ ActsExamples::DigitizationAlgorithm::localParameters(
for (const auto& ch : channels) {
auto bin = ch.bin;
Acts::ActsScalar charge =
geoCfg.digital ? 1. : geoCfg.charge(ch.activation, ch.activation, rng);
geoCfg.digital ? 1. : geoCfg.charge(ch.activation, rng);
if (geoCfg.digital or charge > geoCfg.threshold) {
totalWeight += charge;
size_t b0 = bin[0];
Expand Down
4 changes: 2 additions & 2 deletions Examples/Algorithms/Geant4HepMC/src/EventAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,13 @@ EventAction::~EventAction() {
s_instance = nullptr;
}

void EventAction::BeginOfEventAction(const G4Event* /*unused*/) {
void EventAction::BeginOfEventAction(const G4Event* /*event*/) {
SteppingAction::instance()->clear();
m_event = ::HepMC3::GenEvent(::HepMC3::Units::GEV, ::HepMC3::Units::MM);
m_event.add_beam_particle(std::make_shared<::HepMC3::GenParticle>());
}

void EventAction::EndOfEventAction(const G4Event* /*unused*/) {
void EventAction::EndOfEventAction(const G4Event* /*event*/) {
// Fast exit if the event is empty
if (m_event.vertices().empty()) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction {
static PrimaryGeneratorAction* instance();

/// Interface method to generate the primary
void GeneratePrimaries(G4Event* /*unused*/) override;
void GeneratePrimaries(G4Event* event) override;

/// Prepare the particle gun with initial parameters
void prepareParticleGun(const ActsExamples::SimParticle& part);
Expand Down
4 changes: 2 additions & 2 deletions Examples/Algorithms/Geant4HepMC/src/RunAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ RunAction::~RunAction() {
s_instance = nullptr;
}

void RunAction::BeginOfRunAction(const G4Run* /*unused*/) {
void RunAction::BeginOfRunAction(const G4Run* /*run*/) {
// initialize event cumulative quantities
EventAction::instance()->clear();
}

void RunAction::EndOfRunAction(const G4Run* /*unused*/) {}
void RunAction::EndOfRunAction(const G4Run* /*run*/) {}

} // namespace ActsExamples::Geant4::HepMC3
4 changes: 2 additions & 2 deletions Examples/Algorithms/Geant4HepMC/src/RunAction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ class RunAction final : public G4UserRunAction {

/// Interface method at the begin of the run
/// @note resets the event action
void BeginOfRunAction(const G4Run* /*unused*/) override;
void BeginOfRunAction(const G4Run* run) override;

/// Interface method at the end of the run
void EndOfRunAction(const G4Run* /*unused*/) override;
void EndOfRunAction(const G4Run* run) override;

private:
/// Instance of the EventAction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ struct TelescopeDetector {

std::pair<TrackingGeometryPtr, ContextDecorators> finalize(
const Config& cfg,
const std::shared_ptr<const Acts::IMaterialDecorator>& /*unused*/);
const std::shared_ptr<const Acts::IMaterialDecorator>& mdecorator);
};

} // namespace Telescope
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

auto ActsExamples::Telescope::TelescopeDetector::finalize(
const Config& cfg, const std::shared_ptr<const Acts::IMaterialDecorator> &
/*unused*/) -> std::pair<TrackingGeometryPtr, ContextDecorators> {
/*mdecorator*/) -> std::pair<TrackingGeometryPtr, ContextDecorators> {
DetectorElement::ContextType nominalContext;

if (cfg.surfaceType > 1) {
Expand Down
4 changes: 2 additions & 2 deletions Examples/Python/src/DigitizationStub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
#include "Acts/Plugins/Python/Utilities.hpp"

namespace Acts::Python {
void addDigitization(Context& /*unused*/) {}
} // namespace Acts::Python
void addDigitization(Context& /*ctx*/) {}
} // namespace Acts::Python
2 changes: 1 addition & 1 deletion Examples/Python/src/EDM4hepStub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
#include "Acts/Plugins/Python/Utilities.hpp"

namespace Acts::Python {
void addEDM4hep(Context& /*unused*/) {}
void addEDM4hep(Context& /*ctx*/) {}
} // namespace Acts::Python
2 changes: 1 addition & 1 deletion Examples/Python/src/ExaTrkXTrackFindingStub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <pybind11/stl.h>

namespace Acts::Python {
void addExaTrkXTrackFinding(Context& /*unused*/) {
void addExaTrkXTrackFinding(Context& /*ctx*/) {
// dummy function
}
} // namespace Acts::Python

0 comments on commit 34a0534

Please sign in to comment.