diff --git a/.clang-tidy b/.clang-tidy index f761f7f3c47..8411466091e 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -21,6 +21,7 @@ Checks: > readability-inconsistent-declaration-parameter-name, readability-named-parameter, readability-operators-representation, + readability-redundant-smartptr-get HeaderFilterRegex: '.*(? inline const RegularSurface& BoundarySurfaceT::surfaceRepresentation() const { - return (*(m_surface.get())); + return *m_surface; } template diff --git a/Core/src/Detector/DetectorVolume.cpp b/Core/src/Detector/DetectorVolume.cpp index eb74a2b8b57..199a4d88d76 100644 --- a/Core/src/Detector/DetectorVolume.cpp +++ b/Core/src/Detector/DetectorVolume.cpp @@ -100,7 +100,7 @@ Acts::Vector3 Acts::Experimental::DetectorVolume::center( const Acts::VolumeBounds& Acts::Experimental::DetectorVolume::volumeBounds() const { - return (*m_bounds.get()); + return *m_bounds; } std::vector>& @@ -195,7 +195,7 @@ void Acts::Experimental::DetectorVolume::construct( const GeometryContext& gctx, const PortalGenerator& portalGenerator) { // Create portals with the given generator auto portalSurfaces = - portalGenerator(transform(gctx), *(m_bounds.get()), getSharedPtr()); + portalGenerator(transform(gctx), *m_bounds, getSharedPtr()); m_portals = ObjectStore>(portalSurfaces); createBoundingBox(gctx); } diff --git a/Core/src/Detector/Portal.cpp b/Core/src/Detector/Portal.cpp index e3caa8c7c06..f5340093c40 100644 --- a/Core/src/Detector/Portal.cpp +++ b/Core/src/Detector/Portal.cpp @@ -26,11 +26,11 @@ Portal::Portal(std::shared_ptr surface) } const Acts::RegularSurface& Portal::surface() const { - return *m_surface.get(); + return *m_surface; } Acts::RegularSurface& Portal::surface() { - return *m_surface.get(); + return *m_surface; } const std::array& diff --git a/Core/src/Material/MaterialMapper.cpp b/Core/src/Material/MaterialMapper.cpp index bd635bfd608..2797d7e5f93 100644 --- a/Core/src/Material/MaterialMapper.cpp +++ b/Core/src/Material/MaterialMapper.cpp @@ -63,7 +63,7 @@ Acts::MaterialMapper::mapMaterial(State& state, const GeometryContext& gctx, // The material interactions m_cfg.surfaceMaterialAccumulater->accumulate( - *state.surfaceMaterialAccumulaterState.get(), assigned, emptyBinSurfaces); + *state.surfaceMaterialAccumulaterState, assigned, emptyBinSurfaces); // The function to calculate the total material before returning auto calculateTotalMaterial = [](RecordedMaterialTrack& rTrack) -> void { @@ -86,7 +86,7 @@ Acts::MaterialMapper::DetectorMaterialMaps Acts::MaterialMapper::finalizeMaps( // The surface maps detectorMaterialMaps.first = m_cfg.surfaceMaterialAccumulater->finalizeMaterial( - *state.surfaceMaterialAccumulaterState.get()); + *state.surfaceMaterialAccumulaterState); return detectorMaterialMaps; } diff --git a/Core/src/Surfaces/ConeSurface.cpp b/Core/src/Surfaces/ConeSurface.cpp index 1b9c1906856..39a0d8ac9e8 100644 --- a/Core/src/Surfaces/ConeSurface.cpp +++ b/Core/src/Surfaces/ConeSurface.cpp @@ -177,7 +177,7 @@ Vector3 ConeSurface::normal(const GeometryContext& gctx, const ConeBounds& ConeSurface::bounds() const { // is safe because no constructor w/o bounds exists - return (*m_bounds.get()); + return *m_bounds; } Polyhedron ConeSurface::polyhedronRepresentation( diff --git a/Core/src/Surfaces/CylinderSurface.cpp b/Core/src/Surfaces/CylinderSurface.cpp index 45ec85ae1a8..7c78a2e50ae 100644 --- a/Core/src/Surfaces/CylinderSurface.cpp +++ b/Core/src/Surfaces/CylinderSurface.cpp @@ -177,7 +177,7 @@ double CylinderSurface::pathCorrection(const GeometryContext& gctx, } const CylinderBounds& CylinderSurface::bounds() const { - return (*m_bounds.get()); + return *m_bounds; } Polyhedron CylinderSurface::polyhedronRepresentation( diff --git a/Core/src/Surfaces/DiscSurface.cpp b/Core/src/Surfaces/DiscSurface.cpp index 64369c5dcc9..42d566336c2 100644 --- a/Core/src/Surfaces/DiscSurface.cpp +++ b/Core/src/Surfaces/DiscSurface.cpp @@ -145,7 +145,7 @@ std::string DiscSurface::name() const { const SurfaceBounds& DiscSurface::bounds() const { if (m_bounds) { - return (*(m_bounds.get())); + return *m_bounds; } return s_noBounds; } diff --git a/Core/src/Surfaces/LineSurface.cpp b/Core/src/Surfaces/LineSurface.cpp index 6f6350625d6..9fb437bfe91 100644 --- a/Core/src/Surfaces/LineSurface.cpp +++ b/Core/src/Surfaces/LineSurface.cpp @@ -132,7 +132,7 @@ Vector3 LineSurface::normal(const GeometryContext& gctx, const Vector3& pos, const SurfaceBounds& LineSurface::bounds() const { if (m_bounds) { - return (*m_bounds.get()); + return *m_bounds; } return s_noBounds; } diff --git a/Core/src/Surfaces/PlaneSurface.cpp b/Core/src/Surfaces/PlaneSurface.cpp index 9437937afc4..aaaac177213 100644 --- a/Core/src/Surfaces/PlaneSurface.cpp +++ b/Core/src/Surfaces/PlaneSurface.cpp @@ -87,7 +87,7 @@ std::string PlaneSurface::name() const { const SurfaceBounds& PlaneSurface::bounds() const { if (m_bounds) { - return (*m_bounds.get()); + return *m_bounds; } return s_noBounds; } diff --git a/Examples/Algorithms/Geant4/src/Geant4Simulation.cpp b/Examples/Algorithms/Geant4/src/Geant4Simulation.cpp index 9ae93e97087..5b99ece34ff 100644 --- a/Examples/Algorithms/Geant4/src/Geant4Simulation.cpp +++ b/Examples/Algorithms/Geant4/src/Geant4Simulation.cpp @@ -93,7 +93,7 @@ void Geant4SimulationBase::commonInitialization() { } G4RunManager& Geant4SimulationBase::runManager() const { - return *m_geant4Instance->runManager.get(); + return *m_geant4Instance->runManager; } Geant4::EventStore& Geant4SimulationBase::eventStore() const { diff --git a/Examples/Detectors/ContextualDetector/src/ExternalAlignmentDecorator.cpp b/Examples/Detectors/ContextualDetector/src/ExternalAlignmentDecorator.cpp index 5120a29c334..dacdcaa99f0 100644 --- a/Examples/Detectors/ContextualDetector/src/ExternalAlignmentDecorator.cpp +++ b/Examples/Detectors/ContextualDetector/src/ExternalAlignmentDecorator.cpp @@ -26,7 +26,7 @@ ExternalAlignmentDecorator::ExternalAlignmentDecorator( : m_cfg(cfg), m_logger(std::move(logger)) { if (m_cfg.trackingGeometry != nullptr) { // parse and populate - parseGeometry(*m_cfg.trackingGeometry.get()); + parseGeometry(*m_cfg.trackingGeometry); } } diff --git a/Examples/Detectors/GenericDetector/include/ActsExamples/GenericDetector/ProtoLayerCreatorT.hpp b/Examples/Detectors/GenericDetector/include/ActsExamples/GenericDetector/ProtoLayerCreatorT.hpp index 9eca8f20de5..8ddad182380 100644 --- a/Examples/Detectors/GenericDetector/include/ActsExamples/GenericDetector/ProtoLayerCreatorT.hpp +++ b/Examples/Detectors/GenericDetector/include/ActsExamples/GenericDetector/ProtoLayerCreatorT.hpp @@ -269,7 +269,7 @@ ProtoLayerCreatorT::centralProtoLayers( m_cfg.centralModuleFrontsideStereo.at(icl) != 0.) { // twist by the stereo angle double stereo = m_cfg.centralModuleFrontsideStereo.at(icl); - (*mutableModuleTransform.get()) *= + (*mutableModuleTransform) *= Acts::AngleAxis3(-stereo, Acts::Vector3::UnitZ()); } // count the modules @@ -304,7 +304,7 @@ ProtoLayerCreatorT::centralProtoLayers( if (!m_cfg.centralModuleBacksideStereo.empty()) { // twist by the stereo angle double stereoBackSide = m_cfg.centralModuleBacksideStereo.at(icl); - (*mutableModuleTransform.get()) *= + (*mutableModuleTransform) *= Acts::AngleAxis3(-stereoBackSide, Acts::Vector3::UnitZ()); } // Finalize the transform @@ -478,7 +478,7 @@ ProtoLayerCreatorT::createProtoLayers( // twist by the stereo angle double stereoBackSide = m_cfg.posnegModuleBacksideStereo.at(ipnl).at(ipnR); - (*mutableModuleTransform.get()) *= + (*mutableModuleTransform) *= Acts::AngleAxis3(-stereoBackSide, Acts::Vector3::UnitZ()); } // Finalize the transform diff --git a/Examples/Io/Csv/src/CsvTrackingGeometryWriter.cpp b/Examples/Io/Csv/src/CsvTrackingGeometryWriter.cpp index e40c679a055..c101b3efcf5 100644 --- a/Examples/Io/Csv/src/CsvTrackingGeometryWriter.cpp +++ b/Examples/Io/Csv/src/CsvTrackingGeometryWriter.cpp @@ -351,9 +351,8 @@ void writeVolume(SurfaceWriter& sfWriter, SurfaceGridWriter& sfGridWriter, // step down into hierarchy to process all child volumnes if (volume.confinedVolumes()) { for (const auto& confined : volume.confinedVolumes()->arrayObjects()) { - writeVolume(sfWriter, sfGridWriter, lvWriter, *confined.get(), - writeSensitive, writeBoundary, writeSurfaceGrid, - writeLayerVolume, geoCtx); + writeVolume(sfWriter, sfGridWriter, lvWriter, *confined, writeSensitive, + writeBoundary, writeSurfaceGrid, writeLayerVolume, geoCtx); } } } diff --git a/Examples/Io/Json/src/JsonSurfacesWriter.cpp b/Examples/Io/Json/src/JsonSurfacesWriter.cpp index 9e6a5cc0135..d8f9c00b5e5 100644 --- a/Examples/Io/Json/src/JsonSurfacesWriter.cpp +++ b/Examples/Io/Json/src/JsonSurfacesWriter.cpp @@ -109,7 +109,7 @@ void collectSurfaces(std::vector& cSurfaces, // Step down into hierarchy to process all child volumnes if (volume.confinedVolumes()) { for (const auto& confined : volume.confinedVolumes()->arrayObjects()) { - collectSurfaces(cSurfaces, *confined.get(), writeLayer, writeApproach, + collectSurfaces(cSurfaces, *confined, writeLayer, writeApproach, writeSensitive, writeBoundary); } } diff --git a/Plugins/DD4hep/src/DD4hepDetectorSurfaceFactory.cpp b/Plugins/DD4hep/src/DD4hepDetectorSurfaceFactory.cpp index 7f0275ed1a8..ad142070626 100644 --- a/Plugins/DD4hep/src/DD4hepDetectorSurfaceFactory.cpp +++ b/Plugins/DD4hep/src/DD4hepDetectorSurfaceFactory.cpp @@ -113,7 +113,7 @@ Acts::DD4hepDetectorSurfaceFactory::constructSensitiveComponents( } // Attach surface material if present - attachSurfaceMaterial(gctx, "acts_surface_", dd4hepElement, *sSurface.get(), + attachSurfaceMaterial(gctx, "acts_surface_", dd4hepElement, *sSurface, dd4hepDetElement->thickness(), options); // return the surface return {dd4hepDetElement, sSurface}; diff --git a/Plugins/Geant4/src/Geant4Converters.cpp b/Plugins/Geant4/src/Geant4Converters.cpp index a2450fdf41f..645d8defc76 100644 --- a/Plugins/Geant4/src/Geant4Converters.cpp +++ b/Plugins/Geant4/src/Geant4Converters.cpp @@ -369,7 +369,7 @@ std::shared_ptr Acts::Geant4PhysicalVolumeConverter::surface( auto orientedToGlobal = axesOriented(toGlobal, axes); surface = Acts::Surface::makeShared(orientedToGlobal, std::move(bounds)); - assignMaterial(*surface.get(), original, compressed); + assignMaterial(*surface, original, compressed); return surface; } else { throw std::runtime_error("Can not convert 'G4Box' into forced shape."); @@ -386,7 +386,7 @@ std::shared_ptr Acts::Geant4PhysicalVolumeConverter::surface( auto orientedToGlobal = axesOriented(toGlobal, axes); surface = Acts::Surface::makeShared(orientedToGlobal, std::move(bounds)); - assignMaterial(*surface.get(), original, compressed); + assignMaterial(*surface, original, compressed); return surface; } else { throw std::runtime_error("Can not convert 'G4Trd' into forced shape."); @@ -403,7 +403,7 @@ std::shared_ptr Acts::Geant4PhysicalVolumeConverter::surface( auto orientedToGlobal = axesOriented(toGlobal, axes); surface = Acts::Surface::makeShared(orientedToGlobal, std::move(bounds)); - assignMaterial(*surface.get(), original, compressed); + assignMaterial(*surface, original, compressed); return surface; } else { throw std::runtime_error("Can not convert 'G4Trap' into forced shape."); @@ -437,7 +437,7 @@ std::shared_ptr Acts::Geant4PhysicalVolumeConverter::surface( } else { throw std::runtime_error("Can not convert 'G4Tubs' into forced shape."); } - assignMaterial(*surface.get(), original, compressed); + assignMaterial(*surface, original, compressed); return surface; } diff --git a/Plugins/GeoModel/include/Acts/Plugins/GeoModel/GeoModelBlueprintCreater.hpp b/Plugins/GeoModel/include/Acts/Plugins/GeoModel/GeoModelBlueprintCreater.hpp index 78dfca36996..ada9e3d8071 100644 --- a/Plugins/GeoModel/include/Acts/Plugins/GeoModel/GeoModelBlueprintCreater.hpp +++ b/Plugins/GeoModel/include/Acts/Plugins/GeoModel/GeoModelBlueprintCreater.hpp @@ -73,7 +73,7 @@ class GeoModelBlueprintCreater { throw std::runtime_error( "GeoModelBlueprintCreater::Blueprint: No top node created"); } - return *(topNode.get()); + return *topNode; } }; diff --git a/Plugins/GeoModel/include/Acts/Plugins/GeoModel/GeoModelDetectorElement.hpp b/Plugins/GeoModel/include/Acts/Plugins/GeoModel/GeoModelDetectorElement.hpp index 12df4605a92..8fd670c9a65 100644 --- a/Plugins/GeoModel/include/Acts/Plugins/GeoModel/GeoModelDetectorElement.hpp +++ b/Plugins/GeoModel/include/Acts/Plugins/GeoModel/GeoModelDetectorElement.hpp @@ -55,7 +55,7 @@ class GeoModelDetectorElement : public DetectorElementBase { // First create the detector element with a nullptr auto detElement = std::make_shared( geoPhysVol, nullptr, sfTransform, thickness); - auto surface = Surface::makeShared(bounds, *detElement.get()); + auto surface = Surface::makeShared(bounds, *detElement); detElement->attachSurface(surface); return detElement; } diff --git a/Plugins/GeoModel/src/GeoModelDetectorElementITk.cpp b/Plugins/GeoModel/src/GeoModelDetectorElementITk.cpp index 1f45a10d391..bdf168188de 100644 --- a/Plugins/GeoModel/src/GeoModelDetectorElementITk.cpp +++ b/Plugins/GeoModel/src/GeoModelDetectorElementITk.cpp @@ -100,7 +100,7 @@ Acts::GeoModelDetectorElementITk::convertFromGeomodel( detEl->physicalVolume(), nullptr, detEl->transform(gctx), detEl->thickness(), hardware, barrelEndcap, layerWheel, etaModule, phiModule, side); - auto surface = Surface::makeShared(bounds, *itkEl.get()); + auto surface = Surface::makeShared(bounds, *itkEl); itkEl->attachSurface(surface); itkEl->setDatabaseEntryName(detEl->databaseEntryName()); diff --git a/Plugins/Json/src/SurfaceJsonConverter.cpp b/Plugins/Json/src/SurfaceJsonConverter.cpp index fb6b0e7b08d..c924fd205db 100644 --- a/Plugins/Json/src/SurfaceJsonConverter.cpp +++ b/Plugins/Json/src/SurfaceJsonConverter.cpp @@ -44,13 +44,13 @@ void Acts::to_json(nlohmann::json& j, const Acts::Surface& surface) { void Acts::to_json(nlohmann::json& j, const std::shared_ptr& surface) { Acts::GeometryContext gctx; - j = SurfaceJsonConverter::toJson(gctx, *(surface.get())); + j = SurfaceJsonConverter::toJson(gctx, *surface); } void Acts::toJson(nlohmann::json& j, const std::shared_ptr& surface, const Acts::GeometryContext& gctx) { - j = SurfaceJsonConverter::toJson(gctx, *(surface.get())); + j = SurfaceJsonConverter::toJson(gctx, *surface); } std::shared_ptr Acts::SurfaceJsonConverter::fromJson( diff --git a/Tests/UnitTests/Core/Geometry/ProtoLayerTests.cpp b/Tests/UnitTests/Core/Geometry/ProtoLayerTests.cpp index 88fd5fbaeb5..d40de262466 100644 --- a/Tests/UnitTests/Core/Geometry/ProtoLayerTests.cpp +++ b/Tests/UnitTests/Core/Geometry/ProtoLayerTests.cpp @@ -108,7 +108,7 @@ void testProtoLayer() { auto addSurface = Surface::makeShared(Transform3::Identity(), rB); - pLayerSf.add(tgContext, *addSurface.get()); + pLayerSf.add(tgContext, *addSurface); // CHECK That if you now have 5 surfaces BOOST_CHECK_EQUAL(pLayerSf.surfaces().size(), 5); diff --git a/Tests/UnitTests/Core/TrackFitting/FitterTestsCommon.hpp b/Tests/UnitTests/Core/TrackFitting/FitterTestsCommon.hpp index 757e6f5da81..b2eed053510 100644 --- a/Tests/UnitTests/Core/TrackFitting/FitterTestsCommon.hpp +++ b/Tests/UnitTests/Core/TrackFitting/FitterTestsCommon.hpp @@ -22,6 +22,7 @@ #include "Acts/MagneticField/ConstantBField.hpp" #include "Acts/MagneticField/MagneticFieldContext.hpp" #include "Acts/Propagator/Navigator.hpp" +#include "Acts/Propagator/Propagator.hpp" #include "Acts/Propagator/StraightLineStepper.hpp" #include "Acts/Surfaces/CurvilinearSurface.hpp" #include "Acts/Tests/CommonHelpers/CubicTrackingGeometry.hpp" diff --git a/Tests/UnitTests/Plugins/Geant4/Geant4DetectorElementTests.cpp b/Tests/UnitTests/Plugins/Geant4/Geant4DetectorElementTests.cpp index d0ee306a18c..5abf5d62c94 100644 --- a/Tests/UnitTests/Plugins/Geant4/Geant4DetectorElementTests.cpp +++ b/Tests/UnitTests/Plugins/Geant4/Geant4DetectorElementTests.cpp @@ -36,8 +36,8 @@ BOOST_AUTO_TEST_CASE(Geant4DetectorElement_construction) { auto rSurface = Acts::Surface::makeShared( rTransform, std::move(rBounds)); // A detector element - Acts::Geant4DetectorElement g4DetElement(rSurface, *g4physVol.get(), - rTransform, 0.1); + Acts::Geant4DetectorElement g4DetElement(rSurface, *g4physVol, rTransform, + 0.1); BOOST_CHECK_EQUAL(g4DetElement.thickness(), 0.1); BOOST_CHECK_EQUAL(&g4DetElement.surface(), rSurface.get()); diff --git a/Tests/UnitTests/Plugins/TGeo/TGeoParserTests.cpp b/Tests/UnitTests/Plugins/TGeo/TGeoParserTests.cpp index 78fd673d0bf..1e8ff4e5515 100644 --- a/Tests/UnitTests/Plugins/TGeo/TGeoParserTests.cpp +++ b/Tests/UnitTests/Plugins/TGeo/TGeoParserTests.cpp @@ -61,7 +61,7 @@ BOOST_AUTO_TEST_CASE(TGeoParser_Pixel) { ObjVisualization3D objVis; for (auto& snode : tgpState.selectedNodes) { const auto& shape = *(snode.node->GetVolume()->GetShape()); - const auto& transform = *(snode.transform.get()); + const auto& transform = *snode.transform; auto [surface, thickness] = TGeoSurfaceConverter::toSurface(shape, transform, axes, scale); GeometryView3D::drawSurface(objVis, *surface, tgContext); @@ -97,7 +97,7 @@ BOOST_AUTO_TEST_CASE(TGeoParser_Pixel_SelectInnermost) { ObjVisualization3D objVis; for (auto& snode : tgpState.selectedNodes) { const auto& shape = *(snode.node->GetVolume()->GetShape()); - const auto& transform = *(snode.transform.get()); + const auto& transform = *snode.transform; auto [surface, thickness] = TGeoSurfaceConverter::toSurface( shape, transform, axes, tgpOptions.unit); GeometryView3D::drawSurface(objVis, *surface, tgContext);