Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix!: Make BinUtility constructor explicit #3953

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions Core/include/Acts/Utilities/BinUtility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ class BinUtility {
///
/// @param bData is the provided binning data
/// @param tForm is the (optional) transform
BinUtility(const BinningData& bData,
const Transform3& tForm = Transform3::Identity())
explicit BinUtility(const BinningData& bData,
const Transform3& tForm = Transform3::Identity())
andiwand marked this conversation as resolved.
Show resolved Hide resolved
: m_binningData(), m_transform(tForm), m_itransform(tForm.inverse()) {
m_binningData.reserve(3);
m_binningData.push_back(bData);
Expand Down
2 changes: 1 addition & 1 deletion Plugins/Detray/src/DetrayMaterialConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ Acts::DetrayMaterialConverter::convertGridSurfaceMaterial(
bUtility.binningData()[0u].binvalue == BinningValue::binZ &&
bUtility.binningData()[1u].binvalue == BinningValue::binPhi) {
BinUtility nbUtility(bUtility.binningData()[1u]);
nbUtility += bUtility.binningData()[0u];
nbUtility += BinUtility{bUtility.binningData()[0u]};
bUtility = std::move(nbUtility);
swapped = true;
}
Expand Down
2 changes: 1 addition & 1 deletion Plugins/Json/src/MaterialJsonConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ nlohmann::json Acts::MaterialJsonConverter::toJsonDetray(
bUtility.binningData()[0u].binvalue == BinningValue::binZ &&
bUtility.binningData()[1u].binvalue == BinningValue::binPhi) {
BinUtility nbUtility(bUtility.binningData()[1u]);
nbUtility += bUtility.binningData()[0u];
nbUtility += BinUtility{bUtility.binningData()[0u]};
bUtility = std::move(nbUtility);
swapped = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include <boost/test/unit_test.hpp>

#include "Acts/Utilities/BinUtility.hpp"
#include "Acts/Utilities/BinningData.hpp"
#include "ActsExamples/Digitization/ModuleClusters.hpp"
#include "ActsFatras/Digitization/Segmentizer.hpp"
Expand Down Expand Up @@ -46,10 +47,10 @@ DigitizedParameters makeDigitizationParameters(const Vector2 &position,
auto testDigitizedParametersWithTwoClusters(bool merge, const Vector2 &firstHit,
const Vector2 &secondHit) {
BinUtility binUtility;
binUtility +=
BinningData(BinningOption::open, BinningValue::binX, 20, -10.0f, 10.0f);
binUtility +=
BinningData(BinningOption::open, BinningValue::binY, 20, -10.0f, 10.0f);
binUtility += BinUtility{
andiwand marked this conversation as resolved.
Show resolved Hide resolved
BinningData(BinningOption::open, BinningValue::binX, 20, -10.0f, 10.0f)};
binUtility += BinUtility{
BinningData(BinningOption::open, BinningValue::binY, 20, -10.0f, 10.0f)};
std::vector<Acts::BoundIndices> boundIndices = {eBoundLoc0, eBoundLoc1};
double nsigma = 1;
bool commonCorner = true;
Expand Down
Loading