Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierfrancesco committed Jan 29, 2025
1 parent 29675fe commit 73067da
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 28 deletions.
16 changes: 8 additions & 8 deletions Core/src/Geometry/CylinderVolumeBounds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,19 @@ std::vector<OrientedSurface> CylinderVolumeBounds::orientedSurfaces(
double bevelMaxZ = get(eBevelMaxZ);
Transform3 transMinZ, transMaxZ;
if (bevelMinZ != 0.) {
//double sy = 1 - 1 / std::cos(bevelMinZ);
//transMinZ = transform * vMinZ *
// Eigen::AngleAxisd(-bevelMinZ, Eigen::Vector3d(1., 0., 0.)) *
// Eigen::Scaling(1., 1. + sy, 1.);
// double sy = 1 - 1 / std::cos(bevelMinZ);
// transMinZ = transform * vMinZ *
// Eigen::AngleAxisd(-bevelMinZ, Eigen::Vector3d(1., 0., 0.)) *
// Eigen::Scaling(1., 1. + sy, 1.);
throw std::invalid_argument("Bevel Min Z != 0 is not supported");
} else {
transMinZ = transform * vMinZ;
}
if (bevelMaxZ != 0.) {
//double sy = 1 - 1 / std::cos(bevelMaxZ);
//transMaxZ = transform * vMaxZ *
// Eigen::AngleAxisd(bevelMaxZ, Eigen::Vector3d(1., 0., 0.)) *
// Eigen::Scaling(1., 1. + sy, 1.);
// double sy = 1 - 1 / std::cos(bevelMaxZ);
// transMaxZ = transform * vMaxZ *
// Eigen::AngleAxisd(bevelMaxZ, Eigen::Vector3d(1., 0., 0.)) *
// Eigen::Scaling(1., 1. + sy, 1.);
throw std::invalid_argument("Bevel Max Z != 0 is not supported");
} else {
transMaxZ = transform * vMaxZ;
Expand Down
16 changes: 10 additions & 6 deletions Core/src/Geometry/PlaneLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,16 @@ void Acts::PlaneLayer::buildApproachDescriptor() {
const Vector3& lVector = normal(GeometryContext(), lCenter);
// create new surfaces

const auto lTrans = Translation3(lCenter - 0.5 * Layer::m_layerThickness * lVector);
const auto rTrans = Translation3(lCenter + 0.5 * Layer::m_layerThickness * lVector);

const Transform3 apnTransform = Transform3(lTrans*Eigen::Isometry3d(lRotation));
const Transform3 appTransform = Transform3(rTrans*Eigen::Isometry3d(lRotation));

const auto lTrans =
Translation3(lCenter - 0.5 * Layer::m_layerThickness * lVector);
const auto rTrans =
Translation3(lCenter + 0.5 * Layer::m_layerThickness * lVector);

const Transform3 apnTransform =
Transform3(lTrans * Eigen::Isometry3d(lRotation));
const Transform3 appTransform =
Transform3(rTrans * Eigen::Isometry3d(lRotation));

// create the new surfaces
aSurfaces.push_back(Surface::makeShared<Acts::PlaneSurface>(
apnTransform, PlaneSurface::m_bounds));
Expand Down
2 changes: 1 addition & 1 deletion Core/src/Seeding/EstimateTrackParamsFromSeed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Acts::FreeVector Acts::estimateTrackParamsFromSeed(const Vector3& sp0,

// The transform which constructs the new frame
Transform3 transform(trans * Eigen::Isometry3d(rotation));

// The coordinate of the middle and top space point in the new frame
Vector3 local1 = transform.inverse() * sp1;
Vector3 local2 = transform.inverse() * sp2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,9 @@ ProtoLayerCreatorT<detector_element_t>::centralProtoLayers(
moduleRotation.col(2) = moduleLocalZ;
// get the moduleTransform
std::shared_ptr<Acts::Transform3> mutableModuleTransform =
std::make_shared<Acts::Transform3>(
Acts::Translation3(moduleCenter) * Eigen::Isometry3d(moduleRotation));
std::make_shared<Acts::Transform3>(
Acts::Translation3(moduleCenter) *
Eigen::Isometry3d(moduleRotation));
// stereo angle if necessary
if (!m_cfg.centralModuleFrontsideStereo.empty() &&
m_cfg.centralModuleFrontsideStereo.at(icl) != 0.) {
Expand Down Expand Up @@ -299,7 +300,8 @@ ProtoLayerCreatorT<detector_element_t>::centralProtoLayers(
moduleCenter +
m_cfg.centralModuleBacksideGap.at(icl) * moduleLocalZ;
mutableModuleTransform = std::make_shared<Acts::Transform3>(
Acts::Translation3(bsModuleCenter) * Eigen::Isometry3d(moduleRotation));
Acts::Translation3(bsModuleCenter) *
Eigen::Isometry3d(moduleRotation));
// apply the stereo
if (!m_cfg.centralModuleBacksideStereo.empty()) {
// twist by the stereo angle
Expand Down Expand Up @@ -449,7 +451,8 @@ ProtoLayerCreatorT<detector_element_t>::createProtoLayers(
// the transforms for the two modules
std::shared_ptr<const Acts::Transform3> moduleTransform =
std::make_shared<const Acts::Transform3>(
Acts::Translation3(moduleCenter) * Eigen::Isometry3d(moduleRotation));
Acts::Translation3(moduleCenter) *
Eigen::Isometry3d(moduleRotation));

// create the modules identifier
GenericDetectorElement::Identifier moduleIdentifier =
Expand All @@ -472,7 +475,8 @@ ProtoLayerCreatorT<detector_element_t>::createProtoLayers(
m_cfg.posnegModuleBacksideGap.at(ipnl).at(ipnR) * moduleLocalZ;
// the new transforms
auto mutableModuleTransform = std::make_shared<Acts::Transform3>(
Acts::Translation3(moduleCenter) * Eigen::Isometry3d(moduleRotation));
Acts::Translation3(moduleCenter) *
Eigen::Isometry3d(moduleRotation));
// apply the stereo
if (!m_cfg.posnegModuleBacksideStereo.empty()) {
// twist by the stereo angle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ ActsExamples::buildTelescopeDetector(
// The entire transformation (the coordinate system, whose center is defined
// by trans, will be rotated as well)
Acts::Transform3 trafo(Eigen::Isometry3d(rotation) * trans);


// rotate around local z axis by stereo angle
auto stereo = stereoAngles[i];
Expand Down
4 changes: 2 additions & 2 deletions Plugins/Geant4/src/Geant4Converters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@ Acts::Geant4ShapeConverter::planarBounds(const G4VSolid& g4Solid) {
namespace {
Acts::Transform3 axesOriented(const Acts::Transform3& toGlobalOriginal,
const std::array<int, 2u>& axes) {
//auto originalRotation = toGlobalOriginal.rotation();
// auto originalRotation = toGlobalOriginal.rotation();
auto originalRotation = toGlobalOriginal.linear();
//make a copy
// make a copy
Acts::Vector3 colX = originalRotation.col(std::abs(axes[0u])).eval();
Acts::Vector3 colY = originalRotation.col(std::abs(axes[1u])).eval();
colX *= std::copysign(1, axes[0u]);
Expand Down
5 changes: 3 additions & 2 deletions Plugins/Json/src/AlgebraJsonConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,14 @@ nlohmann::json Acts::Transform3JsonConverter::toJson(const Transform3& t,
jTransform["translation"] = nlohmann::json();
}
// Write out the rotation, could be transposed
//auto rotation = options.transpose ? t.rotation().transpose() : t.rotation();
// auto rotation = options.transpose ? t.rotation().transpose() :
// t.rotation();

Acts::RotationMatrix3 rotation = t.rotation();
if (options.transpose) {
rotation.transposeInPlace();
}

if (rotation != Acts::RotationMatrix3::Identity() || options.writeIdentity) {
std::array<double, 9> rdata = {
rotation(0, 0), rotation(0, 1), rotation(0, 2),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ struct CylindricalTrackingGeometry {
longitudinalOverlap, binningSchema);

for (auto& mCenter : moduleCenters) {

// The association transform
double modulePhi = VectorHelpers::phi(mCenter);
// Local z axis is the normal vector
Expand All @@ -166,7 +165,7 @@ struct CylindricalTrackingGeometry {
moduleRotation.col(2) = moduleLocalZ;
// Get the moduleTransform
auto mModuleTransform =
Transform3(Translation3(mCenter) * Eigen::Isometry3d(moduleRotation));
Transform3(Translation3(mCenter) * Eigen::Isometry3d(moduleRotation));

// Create the detector element
auto detElement = std::make_unique<const DetectorElementStub>(
Expand Down
2 changes: 1 addition & 1 deletion Tests/UnitTests/Core/Surfaces/PlaneSurfaceTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ BOOST_AUTO_TEST_CASE(PlaneSurfaceAlignment) {
RotationMatrix3 rotationMat = rotation.toRotationMatrix();

auto pTransform = Transform3{translation * Eigen::Isometry3d(rotationMat)};

auto planeSurfaceObject =
Surface::makeShared<PlaneSurface>(pTransform, rBounds);

Expand Down

0 comments on commit 73067da

Please sign in to comment.