Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions Core/include/Acts/Utilities/Grid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,7 @@ class Grid final : public IGrid {

/// @copydoc Acts::IGrid::atLocalBinsAny
std::any atLocalBinsAny(AnyIndexType indices) const override {
const_reference cref = atLocalBins(toIndexType(indices));
return &cref;
return &atLocalBins(toIndexType(indices));
}

/// @brief access value stored in bin with given local bin numbers
Expand All @@ -285,8 +284,7 @@ class Grid final : public IGrid {

/// @copydoc Acts::IGrid::atLocalBinsAny
std::any atLocalBinsAny(AnyIndexType indices) override {
reference ref = atLocalBins(toIndexType(indices));
return &ref;
return &atLocalBins(toIndexType(indices));
Comment thread
asalzburger marked this conversation as resolved.
}

/// @brief get global bin indices for closest points on grid
Expand Down
50 changes: 22 additions & 28 deletions Core/include/Acts/Utilities/detail/grid_helper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,8 +533,8 @@ struct grid_helper {
const std::array<std::size_t, sizeof...(Axes)>& localIndices,
const std::tuple<Axes...>& axes) {
std::array<double, sizeof...(Axes)> center{};
constexpr std::size_t MAX = sizeof...(Axes) - 1;
grid_helper_impl<MAX>::getBinCenter(center, localIndices, axes);
grid_helper_impl<sizeof...(Axes) - 1>::getBinCenter(center, localIndices,
axes);
Comment thread
asalzburger marked this conversation as resolved.

return center;
}
Expand All @@ -553,11 +553,11 @@ struct grid_helper {
static std::size_t getGlobalBin(
const std::array<std::size_t, sizeof...(Axes)>& localBins,
const std::tuple<Axes...>& axes) {
constexpr std::size_t MAX = sizeof...(Axes) - 1;
std::size_t area = 1;
std::size_t bin = 0;

grid_helper_impl<MAX>::getGlobalBin(localBins, axes, bin, area);
grid_helper_impl<sizeof...(Axes) - 1>::getGlobalBin(localBins, axes, bin,
area);

return bin;
}
Expand All @@ -579,10 +579,10 @@ struct grid_helper {
template <class Point, class... Axes>
static std::array<std::size_t, sizeof...(Axes)> getLocalBinIndices(
const Point& point, const std::tuple<Axes...>& axes) {
constexpr std::size_t MAX = sizeof...(Axes) - 1;
std::array<std::size_t, sizeof...(Axes)> indices{};

grid_helper_impl<MAX>::getLocalBinIndices(point, axes, indices);
grid_helper_impl<sizeof...(Axes) - 1>::getLocalBinIndices(point, axes,
indices);

return indices;
}
Expand All @@ -600,11 +600,11 @@ struct grid_helper {
template <class... Axes>
static std::array<std::size_t, sizeof...(Axes)> getLocalBinIndices(
std::size_t bin, const std::tuple<Axes...>& axes) {
constexpr std::size_t MAX = sizeof...(Axes) - 1;
std::size_t area = 1;
std::array<std::size_t, sizeof...(Axes)> indices{};

grid_helper_impl<MAX>::getLocalBinIndices(bin, axes, area, indices);
grid_helper_impl<sizeof...(Axes) - 1>::getLocalBinIndices(bin, axes, area,
indices);

return indices;
}
Expand All @@ -623,8 +623,8 @@ struct grid_helper {
const std::array<std::size_t, sizeof...(Axes)>& localIndices,
const std::tuple<Axes...>& axes) {
std::array<double, sizeof...(Axes)> llEdge{};
constexpr std::size_t MAX = sizeof...(Axes) - 1;
grid_helper_impl<MAX>::getLowerLeftBinEdge(llEdge, localIndices, axes);
grid_helper_impl<sizeof...(Axes) - 1>::getLowerLeftBinEdge(
llEdge, localIndices, axes);

return llEdge;
}
Expand All @@ -646,9 +646,9 @@ struct grid_helper {
static std::array<std::size_t, sizeof...(Axes)> getLowerLeftBinIndices(
const std::array<std::size_t, sizeof...(Axes)>& localIndices,
const std::tuple<Axes...>& axes) {
constexpr std::size_t MAX = sizeof...(Axes) - 1;
auto llIndices = localIndices;
grid_helper_impl<MAX>::getLowerLeftBinIndices(llIndices, axes);
grid_helper_impl<sizeof...(Axes) - 1>::getLowerLeftBinIndices(llIndices,
axes);

return llIndices;
}
Expand Down Expand Up @@ -697,8 +697,8 @@ struct grid_helper {
const std::array<std::size_t, sizeof...(Axes)>& localIndices,
const std::tuple<Axes...>& axes) {
std::array<double, sizeof...(Axes)> urEdge{};
constexpr std::size_t MAX = sizeof...(Axes) - 1;
grid_helper_impl<MAX>::getUpperRightBinEdge(urEdge, localIndices, axes);
grid_helper_impl<sizeof...(Axes) - 1>::getUpperRightBinEdge(
urEdge, localIndices, axes);

return urEdge;
}
Expand All @@ -720,9 +720,9 @@ struct grid_helper {
static std::array<std::size_t, sizeof...(Axes)> getUpperRightBinIndices(
const std::array<std::size_t, sizeof...(Axes)>& localIndices,
const std::tuple<Axes...>& axes) {
constexpr std::size_t MAX = sizeof...(Axes) - 1;
auto urIndices = localIndices;
grid_helper_impl<MAX>::getUpperRightBinIndices(urIndices, axes);
grid_helper_impl<sizeof...(Axes) - 1>::getUpperRightBinIndices(urIndices,
axes);

return urIndices;
}
Expand Down Expand Up @@ -791,13 +791,11 @@ struct grid_helper {
const std::array<std::size_t, sizeof...(Axes)>& localIndices,
std::pair<std::size_t, std::size_t> sizes,
const std::tuple<Axes...>& axes) {
constexpr std::size_t MAX = sizeof...(Axes) - 1;

// length N array which contains local neighbors based on size par
std::array<NeighborHoodIndices, sizeof...(Axes)> neighborIndices{};
// get local bin indices for neighboring bins
grid_helper_impl<MAX>::neighborHoodIndices(localIndices, sizes, axes,
neighborIndices);
grid_helper_impl<sizeof...(Axes) - 1>::neighborHoodIndices(
localIndices, sizes, axes, neighborIndices);

// Query the number of bins
std::array<std::size_t, sizeof...(Axes)> nBinsArray = getNBins(axes);
Expand Down Expand Up @@ -840,13 +838,11 @@ struct grid_helper {
const std::array<std::size_t, sizeof...(Axes)>& localIndices,
std::array<std::pair<int, int>, sizeof...(Axes)>& sizes,
const std::tuple<Axes...>& axes) {
constexpr std::size_t MAX = sizeof...(Axes) - 1;

// length N array which contains local neighbors based on size par
std::array<NeighborHoodIndices, sizeof...(Axes)> neighborIndices{};
// get local bin indices for neighboring bins
grid_helper_impl<MAX>::neighborHoodIndices(localIndices, sizes, axes,
neighborIndices);
grid_helper_impl<sizeof...(Axes) - 1>::neighborHoodIndices(
localIndices, sizes, axes, neighborIndices);

// Query the number of bins
std::array<std::size_t, sizeof...(Axes)> nBinsArray = getNBins(axes);
Expand All @@ -863,13 +859,11 @@ struct grid_helper {
template <class... Axes>
static std::set<std::size_t> exteriorBinIndices(
const std::tuple<Axes...>& axes) {
constexpr std::size_t MAX = sizeof...(Axes) - 1;

std::array<std::size_t, sizeof...(Axes)> idx{};
std::array<bool, sizeof...(Axes)> isExterior{};
std::set<std::size_t> combinations;
grid_helper_impl<MAX>::exteriorBinIndices(idx, isExterior, combinations,
axes);
grid_helper_impl<sizeof...(Axes) - 1>::exteriorBinIndices(
idx, isExterior, combinations, axes);

return combinations;
}
Expand Down
2 changes: 1 addition & 1 deletion Core/src/Definitions/ParticleIdHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ int charge3(const DecodedPID& p) {
int signmult = 1;
int result = 0;
bool classified = false;
if (!classified && isMeson(p)) {
if (isMeson(p)) {
classified = true;
nq = 2;
if ((*(p.second.rbegin() + 2)) == 2 || (*(p.second.rbegin() + 2)) == 4) {
Expand Down
1 change: 0 additions & 1 deletion Core/src/Surfaces/AnnulusBounds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,6 @@ Vector2 AnnulusBounds::closestPoint(const Vector2& lposition,
double currentDist =
squaredNorm(lpositionModulePC - currentClosest, metricModulePC);
if (currentDist < minDist) {
minDist = currentDist;
Comment thread
asalzburger marked this conversation as resolved.
closest = m_rotationStripPC.inverse() * modulePCToStripPC(currentClosest);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ class IAlgorithm : public SequenceElement {
/// @level The logging level for this algorithm
/// @deprecated Use the constructor with a logger instead
[[deprecated("Use the constructor with a logger instead")]]
explicit IAlgorithm(std::string name, Acts::Logging::Level level);
explicit IAlgorithm(const std::string& name, Acts::Logging::Level level);

/// Constructor
///
/// @name The algorithm name
/// @logger The logger for this algorithm
explicit IAlgorithm(std::string name,
explicit IAlgorithm(const std::string& name,
std::unique_ptr<const Acts::Logger> logger = nullptr);

/// The algorithm name.
Expand Down
8 changes: 4 additions & 4 deletions Examples/Framework/src/Framework/IAlgorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@

namespace ActsExamples {

IAlgorithm::IAlgorithm(std::string name, Acts::Logging::Level level)
: IAlgorithm(std::move(name), Acts::getDefaultLogger(name, level)) {}
Comment thread
asalzburger marked this conversation as resolved.
IAlgorithm::IAlgorithm(const std::string& name, Acts::Logging::Level level)
: IAlgorithm(name, Acts::getDefaultLogger(name, level)) {}

IAlgorithm::IAlgorithm(std::string name,
IAlgorithm::IAlgorithm(const std::string& name,
std::unique_ptr<const Acts::Logger> logger)
: m_name(std::move(name)),
: m_name(name),
m_logger(logger != nullptr
? std::move(logger)
: Acts::getDefaultLogger(name, Acts::Logging::INFO)) {}
Expand Down
12 changes: 5 additions & 7 deletions Examples/Framework/src/Framework/WhiteBoard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,11 @@ void WhiteBoard::addHolder(const std::string &name,
: "unknown")
<< "'");

if (success) {
// deal with aliases
auto range = m_objectAliases.equal_range(name);
for (auto it = range.first; it != range.second; ++it) {
m_store[it->second] = storeVal;
ACTS_VERBOSE("Added alias object '" << it->second << "'");
}
Comment thread
asalzburger marked this conversation as resolved.
// deal with aliases
auto range = m_objectAliases.equal_range(name);
for (auto it = range.first; it != range.second; ++it) {
m_store[it->second] = storeVal;
ACTS_VERBOSE("Added alias object '" << it->second << "'");
}
}

Expand Down
3 changes: 3 additions & 0 deletions Examples/Scripts/TrackingPerformance/CommonUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
/// @param color the color
template <typename hist_t>
void setHistStyle(hist_t* hist, short color = 1) {
if (hist == nullptr) {
return;
}
Comment thread
asalzburger marked this conversation as resolved.
hist->GetXaxis()->SetTitleSize(0.04);
hist->GetYaxis()->SetTitleSize(0.04);
hist->GetXaxis()->SetLabelSize(0.04);
Expand Down
2 changes: 1 addition & 1 deletion Plugins/ActSVG/include/ActsPlugins/ActSVG/SvgUtils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ struct Style {
fnt._size = fontSize;
fnt._fc._rgb = fontColor;

return std::tie(fll, str, fnt);
return {fll, str, fnt};
}
};

Expand Down
Loading