diff --git a/Core/include/Acts/EventData/MultiComponentTrackParameters.hpp b/Core/include/Acts/EventData/MultiComponentTrackParameters.hpp index cf932fc0470..5e079af0df7 100644 --- a/Core/include/Acts/EventData/MultiComponentTrackParameters.hpp +++ b/Core/include/Acts/EventData/MultiComponentTrackParameters.hpp @@ -129,11 +129,11 @@ class MultiComponentBoundTrackParameters { /// Get the weight and a GenericBoundTrackParameters object for one component std::pair operator[](std::size_t i) const { - return std::make_pair( + return { std::get(m_components[i]), Parameters(m_surface, std::get(m_components[i]), std::get>(m_components[i]), - m_particleHypothesis)); + m_particleHypothesis)}; } /// Parameters vector. diff --git a/Core/include/Acts/Seeding/BinnedGroupIterator.ipp b/Core/include/Acts/Seeding/BinnedGroupIterator.ipp index 70cd691f5db..8bcd0ac04b8 100644 --- a/Core/include/Acts/Seeding/BinnedGroupIterator.ipp +++ b/Core/include/Acts/Seeding/BinnedGroupIterator.ipp @@ -64,7 +64,7 @@ Acts::BinnedGroupIterator::operator*() const { #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstringop-overread" #endif - return std::make_tuple(std::move(bottoms), global_index, std::move(tops)); + return {std::move(bottoms), global_index, std::move(tops)}; #if defined(__GNUC__) && __GNUC__ >= 12 && !defined(__clang__) #pragma GCC diagnostic pop #endif diff --git a/Core/include/Acts/Seeding/SeedFinder.ipp b/Core/include/Acts/Seeding/SeedFinder.ipp index e6ccb9f589f..b61947bb634 100644 --- a/Core/include/Acts/Seeding/SeedFinder.ipp +++ b/Core/include/Acts/Seeding/SeedFinder.ipp @@ -839,7 +839,7 @@ std::pair SeedFinder:: const external_spacepoint_t& spM, const Acts::Range1D& rMiddleSPRange) const { if (m_config.useVariableMiddleSPRange) { - return std::make_pair(rMiddleSPRange.min(), rMiddleSPRange.max()); + return {rMiddleSPRange.min(), rMiddleSPRange.max()}; } if (!m_config.rRangeMiddleSP.empty()) { /// get zBin position of the middle SP @@ -848,10 +848,9 @@ std::pair SeedFinder:: int zBin = std::distance(m_config.zBinEdges.begin(), pVal); /// protects against zM at the limit of zBinEdges zBin == 0 ? zBin : --zBin; - return std::make_pair(m_config.rRangeMiddleSP[zBin][0], - m_config.rRangeMiddleSP[zBin][1]); + return {m_config.rRangeMiddleSP[zBin][0], m_config.rRangeMiddleSP[zBin][1]}; } - return std::make_pair(m_config.rMinMiddle, m_config.rMaxMiddle); + return {m_config.rMinMiddle, m_config.rMaxMiddle}; } } // namespace Acts diff --git a/Core/include/Acts/TrackFitting/detail/KalmanGlobalCovariance.hpp b/Core/include/Acts/TrackFitting/detail/KalmanGlobalCovariance.hpp index cf9a3f36b01..66dfe439fd8 100644 --- a/Core/include/Acts/TrackFitting/detail/KalmanGlobalCovariance.hpp +++ b/Core/include/Acts/TrackFitting/detail/KalmanGlobalCovariance.hpp @@ -95,7 +95,7 @@ globalTrackParametersCovariance(const traj_t& multiTraj, prev_ts = ts; }); - return std::make_pair(fullGlobalTrackParamsCov, stateRowIndices); + return {fullGlobalTrackParamsCov, stateRowIndices}; } } // namespace Acts::detail diff --git a/Core/include/Acts/Utilities/GridBinFinder.ipp b/Core/include/Acts/Utilities/GridBinFinder.ipp index 8b06748ffec..37db6082bb0 100644 --- a/Core/include/Acts/Utilities/GridBinFinder.ipp +++ b/Core/include/Acts/Utilities/GridBinFinder.ipp @@ -45,9 +45,9 @@ std::array, DIM> Acts::GridBinFinder::getSizePerAxis( using value_t = typename std::decay_t; if constexpr (std::is_same_v) { assert(val >= 0); - return std::make_pair(-val, val); + return {-val, val}; } else if constexpr (std::is_same_v, value_t>) { - return std::make_pair(-val.first, val.second); + return {-val.first, val.second}; } else { assert(locPosition.size() > i); assert(locPosition[i] > 0ul); diff --git a/Core/include/Acts/Utilities/TrackHelpers.hpp b/Core/include/Acts/Utilities/TrackHelpers.hpp index 36d37fab714..dc3765be7f6 100644 --- a/Core/include/Acts/Utilities/TrackHelpers.hpp +++ b/Core/include/Acts/Utilities/TrackHelpers.hpp @@ -209,7 +209,7 @@ findTrackStateForExtrapolation( } ACTS_VERBOSE("found intersection at " << intersection.pathLength()); - return std::make_pair(*first, intersection.pathLength()); + return std::pair(*first, intersection.pathLength()); } case TrackExtrapolationStrategy::last: { @@ -229,7 +229,7 @@ findTrackStateForExtrapolation( } ACTS_VERBOSE("found intersection at " << intersection.pathLength()); - return std::make_pair(*last, intersection.pathLength()); + return std::pair(*last, intersection.pathLength()); } case TrackExtrapolationStrategy::firstOrLast: { @@ -256,13 +256,13 @@ findTrackStateForExtrapolation( if (intersectionFirst.isValid() && absDistanceFirst <= absDistanceLast) { ACTS_VERBOSE("using first track state with intersection at " << intersectionFirst.pathLength()); - return std::make_pair(*first, intersectionFirst.pathLength()); + return std::pair(*first, intersectionFirst.pathLength()); } if (intersectionLast.isValid() && absDistanceLast <= absDistanceFirst) { ACTS_VERBOSE("using last track state with intersection at " << intersectionLast.pathLength()); - return std::make_pair(*last, intersectionLast.pathLength()); + return std::pair(*last, intersectionLast.pathLength()); } ACTS_ERROR("no intersection found"); @@ -531,7 +531,7 @@ calculatePredictedResidual(track_state_proxy_t trackState) { MeasurementMatrix residualCovariance = measurementCovariance + predictedCovariance; - return std::pair(residual, residualCovariance); + return {residual, residualCovariance}; } /// Helper function to calculate the filtered residual and its covariance @@ -568,7 +568,7 @@ calculateFilteredResidual(track_state_proxy_t trackState) { MeasurementMatrix residualCovariance = measurementCovariance + filteredCovariance; - return std::pair(residual, residualCovariance); + return {residual, residualCovariance}; } /// Helper function to calculate the smoothed residual and its covariance @@ -605,7 +605,7 @@ calculateSmoothedResidual(track_state_proxy_t trackState) { MeasurementMatrix residualCovariance = measurementCovariance + smoothedCovariance; - return std::pair(residual, residualCovariance); + return {residual, residualCovariance}; } /// Helper function to calculate the predicted chi2 diff --git a/Core/src/Propagator/detail/CovarianceEngine.cpp b/Core/src/Propagator/detail/CovarianceEngine.cpp index a89016bce3c..ca2f57b88cf 100644 --- a/Core/src/Propagator/detail/CovarianceEngine.cpp +++ b/Core/src/Propagator/detail/CovarianceEngine.cpp @@ -97,8 +97,7 @@ CurvilinearState detail::curvilinearState( pos4, direction, freeParameters[eFreeQOverP], std::move(cov), particleHypothesis); // Create the curvilinear state - return std::make_tuple(std::move(curvilinearParams), fullTransportJacobian, - accumulatedPath); + return {std::move(curvilinearParams), fullTransportJacobian, accumulatedPath}; } void detail::transportCovarianceToBound( diff --git a/Core/src/Propagator/detail/SympyCovarianceEngine.cpp b/Core/src/Propagator/detail/SympyCovarianceEngine.cpp index f10171cc5ec..488a2d69ec9 100644 --- a/Core/src/Propagator/detail/SympyCovarianceEngine.cpp +++ b/Core/src/Propagator/detail/SympyCovarianceEngine.cpp @@ -86,8 +86,7 @@ CurvilinearState sympy::curvilinearState( pos4, direction, freeParameters[eFreeQOverP], std::move(cov), particleHypothesis); // Create the curvilinear state - return std::make_tuple(std::move(curvilinearParams), fullTransportJacobian, - accumulatedPath); + return {std::move(curvilinearParams), fullTransportJacobian, accumulatedPath}; } void sympy::transportCovarianceToBound( diff --git a/Core/src/Surfaces/detail/AlignmentHelper.cpp b/Core/src/Surfaces/detail/AlignmentHelper.cpp index 92c1fb7d2a1..b5308d60c84 100644 --- a/Core/src/Surfaces/detail/AlignmentHelper.cpp +++ b/Core/src/Surfaces/detail/AlignmentHelper.cpp @@ -87,6 +87,6 @@ Acts::detail::RotationToAxes Acts::detail::rotationToLocalAxesDerivative( rotToCompositeLocalYAxis * relRotation(1, 2) + rotToCompositeLocalZAxis * relRotation(2, 2); - return std::make_tuple(std::move(rotToLocalXAxis), std::move(rotToLocalYAxis), - std::move(rotToLocalZAxis)); + return {std::move(rotToLocalXAxis), std::move(rotToLocalYAxis), + std::move(rotToLocalZAxis)}; } diff --git a/Core/src/Surfaces/detail/AnnulusBoundsHelper.cpp b/Core/src/Surfaces/detail/AnnulusBoundsHelper.cpp index b46bfaf5b8a..4ceab6d594b 100644 --- a/Core/src/Surfaces/detail/AnnulusBoundsHelper.cpp +++ b/Core/src/Surfaces/detail/AnnulusBoundsHelper.cpp @@ -63,5 +63,5 @@ Acts::detail::AnnulusBoundsHelper::create(const Transform3& transform, auto annulusBounds = std::make_shared( rMin, rMax, phiMin, phiMax, originShift, phiShift); - return std::make_tuple(annulusBounds, boundsTransform); + return {annulusBounds, boundsTransform}; } diff --git a/Core/src/Utilities/SpacePointUtility.cpp b/Core/src/Utilities/SpacePointUtility.cpp index 32470e1ebb9..6f662fe20bd 100644 --- a/Core/src/Utilities/SpacePointUtility.cpp +++ b/Core/src/Utilities/SpacePointUtility.cpp @@ -99,7 +99,7 @@ SpacePointUtility::globalCoords( tcov = std::nullopt; } - return std::make_tuple(globalPos, globalTime, gcov, tcov); + return {globalPos, globalTime, gcov, tcov}; } Vector2 SpacePointUtility::calcRhoZVars( diff --git a/Core/src/Vertexing/AdaptiveGridTrackDensity.cpp b/Core/src/Vertexing/AdaptiveGridTrackDensity.cpp index d08b9db4913..31daae4b039 100644 --- a/Core/src/Vertexing/AdaptiveGridTrackDensity.cpp +++ b/Core/src/Vertexing/AdaptiveGridTrackDensity.cpp @@ -156,7 +156,7 @@ AdaptiveGridTrackDensity::getMaxZTPosition(DensityMap& densityMap) const { double maxZ = getSpatialBinCenter(bin.first); double maxT = getTemporalBinCenter(bin.second); - return std::make_pair(maxZ, maxT); + return std::pair(maxZ, maxT); } Result diff --git a/Core/src/Vertexing/ImpactPointEstimator.cpp b/Core/src/Vertexing/ImpactPointEstimator.cpp index df9f75fd9fa..51f0ebe24db 100644 --- a/Core/src/Vertexing/ImpactPointEstimator.cpp +++ b/Core/src/Vertexing/ImpactPointEstimator.cpp @@ -217,7 +217,7 @@ Result> getDistanceAndMomentumImpl( Vector4 deltaRStraightTrack{Vector4::Zero()}; deltaRStraightTrack.head() = pcaStraightTrack - vtxPos; - return std::make_pair(deltaRStraightTrack, momDirStraightTrack); + return std::pair(deltaRStraightTrack, momDirStraightTrack); } // Charged particles in a constant B field follow a helical trajectory. In @@ -291,7 +291,7 @@ Result> getDistanceAndMomentumImpl( Vector4 deltaR{Vector4::Zero()}; deltaR.head() = pca - vtxPos; - return std::make_pair(deltaR, momDir); + return std::pair(deltaR, momDir); } } // namespace diff --git a/Core/src/Vertexing/Vertex.cpp b/Core/src/Vertexing/Vertex.cpp index 7c2c54cc7ac..4368f3b2faa 100644 --- a/Core/src/Vertexing/Vertex.cpp +++ b/Core/src/Vertexing/Vertex.cpp @@ -74,7 +74,7 @@ const std::vector& Vertex::tracks() const { } std::pair Vertex::fitQuality() const { - return std::pair(m_chiSquared, m_numberDoF); + return {m_chiSquared, m_numberDoF}; } void Vertex::setPosition(const Vector3& position) { diff --git a/Examples/Detectors/ContextualDetector/src/AlignedDetector.cpp b/Examples/Detectors/ContextualDetector/src/AlignedDetector.cpp index 84e050c8470..9a9c5901543 100644 --- a/Examples/Detectors/ContextualDetector/src/AlignedDetector.cpp +++ b/Examples/Detectors/ContextualDetector/src/AlignedDetector.cpp @@ -106,8 +106,7 @@ auto AlignedDetector::finalize( } // return the pair of geometry and the alignment decorator(s) - return std::make_pair( - std::move(aTrackingGeometry), std::move(aContextDecorators)); + return {std::move(aTrackingGeometry), std::move(aContextDecorators)}; } } // namespace ActsExamples diff --git a/Examples/Detectors/DD4hepDetector/src/DD4hepDetector.cpp b/Examples/Detectors/DD4hepDetector/src/DD4hepDetector.cpp index 4ecae308134..a2c12dfaaa7 100644 --- a/Examples/Detectors/DD4hepDetector/src/DD4hepDetector.cpp +++ b/Examples/Detectors/DD4hepDetector/src/DD4hepDetector.cpp @@ -42,8 +42,7 @@ auto DD4hepDetector::finalize( } ContextDecorators dd4ContextDecorators = {}; // return the pair of geometry and empty decorators - return std::make_pair( - std::move(dd4tGeometry), std::move(dd4ContextDecorators)); + return {std::move(dd4tGeometry), std::move(dd4ContextDecorators)}; } auto DD4hepDetector::finalize( diff --git a/Examples/Detectors/GenericDetector/src/GenericDetector.cpp b/Examples/Detectors/GenericDetector/src/GenericDetector.cpp index bf033fc1e3e..b80b769708d 100644 --- a/Examples/Detectors/GenericDetector/src/GenericDetector.cpp +++ b/Examples/Detectors/GenericDetector/src/GenericDetector.cpp @@ -27,8 +27,7 @@ auto GenericDetector::finalize( cfg.volumeLogLevel); ContextDecorators gContextDecorators = {}; // return the pair of geometry and empty decorators - return std::make_pair( - std::move(gGeometry), std::move(gContextDecorators)); + return {std::move(gGeometry), std::move(gContextDecorators)}; } } // namespace ActsExamples diff --git a/Examples/Detectors/TGeoDetector/src/TGeoDetector.cpp b/Examples/Detectors/TGeoDetector/src/TGeoDetector.cpp index 0ece428a438..f594b681d49 100644 --- a/Examples/Detectors/TGeoDetector/src/TGeoDetector.cpp +++ b/Examples/Detectors/TGeoDetector/src/TGeoDetector.cpp @@ -375,8 +375,7 @@ auto TGeoDetector::finalize( ContextDecorators tgeoContextDecorators = {}; // Return the pair of geometry and empty decorators - return std::make_pair( - std::move(tgeoTrackingGeometry), std::move(tgeoContextDecorators)); + return {std::move(tgeoTrackingGeometry), std::move(tgeoContextDecorators)}; } void TGeoDetector::Config::readJson(const std::string& jsonFile) { diff --git a/Examples/Detectors/TelescopeDetector/src/TelescopeDetector.cpp b/Examples/Detectors/TelescopeDetector/src/TelescopeDetector.cpp index bbf1aff4106..ccba63a1c34 100644 --- a/Examples/Detectors/TelescopeDetector/src/TelescopeDetector.cpp +++ b/Examples/Detectors/TelescopeDetector/src/TelescopeDetector.cpp @@ -61,8 +61,7 @@ auto TelescopeDetector::finalize( static_cast(cfg.binValue)); ContextDecorators gContextDecorators = {}; // return the pair of geometry and empty decorators - return std::make_pair( - std::move(gGeometry), std::move(gContextDecorators)); + return {std::move(gGeometry), std::move(gContextDecorators)}; } } // namespace ActsExamples diff --git a/Examples/Framework/src/EventData/ScalingCalibrator.cpp b/Examples/Framework/src/EventData/ScalingCalibrator.cpp index 50e693e8b15..068f6221a25 100644 --- a/Examples/Framework/src/EventData/ScalingCalibrator.cpp +++ b/Examples/Framework/src/EventData/ScalingCalibrator.cpp @@ -52,22 +52,22 @@ std::pair parseMapKey( std::regex reg("^map_([0-9]+)-([0-9]+)-([0-9]+)_([xy]_.*)$"); std::smatch matches; - if (std::regex_search(mapkey, matches, reg) && matches.size() == 5) { - std::size_t vol = std::stoull(matches[1].str()); - std::size_t lyr = std::stoull(matches[2].str()); - std::size_t mod = std::stoull(matches[3].str()); + if (!std::regex_search(mapkey, matches, reg) || matches.size() != 5) { + throw std::runtime_error("Invalid map key: " + mapkey); + } - Acts::GeometryIdentifier geoId; - geoId.setVolume(vol); - geoId.setLayer(lyr); - geoId.setSensitive(mod); + std::size_t vol = std::stoull(matches[1].str()); + std::size_t lyr = std::stoull(matches[2].str()); + std::size_t mod = std::stoull(matches[3].str()); - std::string var(matches[4].str()); + Acts::GeometryIdentifier geoId; + geoId.setVolume(vol); + geoId.setLayer(lyr); + geoId.setSensitive(mod); - return std::make_pair(geoId, var); - } else { - throw std::runtime_error("Invalid map key: " + mapkey); - } + std::string var(matches[4].str()); + + return {geoId, var}; } std::map diff --git a/Examples/Framework/src/Utilities/Paths.cpp b/Examples/Framework/src/Utilities/Paths.cpp index 02bf5889c68..4de064d6eb0 100644 --- a/Examples/Framework/src/Utilities/Paths.cpp +++ b/Examples/Framework/src/Utilities/Paths.cpp @@ -110,7 +110,7 @@ std::pair ActsExamples::determineEventFilesRange( // should only occur if no files matched and the initial values persisted. if (eventMax < eventMin) { - return std::make_pair(0u, 0u); + return {0u, 0u}; } - return std::make_pair(eventMin, eventMax + 1); + return {eventMin, eventMax + 1}; } diff --git a/Examples/Io/Root/include/ActsExamples/Io/Root/RootMaterialDecorator.hpp b/Examples/Io/Root/include/ActsExamples/Io/Root/RootMaterialDecorator.hpp index f5bab09fb70..0cc10482c9e 100644 --- a/Examples/Io/Root/include/ActsExamples/Io/Root/RootMaterialDecorator.hpp +++ b/Examples/Io/Root/include/ActsExamples/Io/Root/RootMaterialDecorator.hpp @@ -128,7 +128,7 @@ class RootMaterialDecorator : public Acts::IMaterialDecorator { /// Return the maps const Acts::DetectorMaterialMaps materialMaps() const { - return std::make_pair(m_surfaceMaterialMap, m_volumeMaterialMap); + return {m_surfaceMaterialMap, m_volumeMaterialMap}; } /// Get readonly access to the config parameters diff --git a/Examples/Io/Root/src/RootNuclearInteractionParametersWriter.cpp b/Examples/Io/Root/src/RootNuclearInteractionParametersWriter.cpp index 995f7bdf57d..265fde166b9 100644 --- a/Examples/Io/Root/src/RootNuclearInteractionParametersWriter.cpp +++ b/Examples/Io/Root/src/RootNuclearInteractionParametersWriter.cpp @@ -121,7 +121,7 @@ buildNotNormalisedMap(TH1F const* hist) { if (integral == 0.) { histoBorders.clear(); temp_HistoContents.clear(); - return std::make_tuple(histoBorders, temp_HistoContents, integral); + return {histoBorders, temp_HistoContents, integral}; } // Set the bin borders @@ -130,7 +130,7 @@ buildNotNormalisedMap(TH1F const* hist) { } histoBorders[nBins] = hist->GetXaxis()->GetXmax(); - return std::make_tuple(histoBorders, temp_HistoContents, integral); + return {histoBorders, temp_HistoContents, integral}; } /// @brief This function combines neighbouring bins with the same value @@ -169,7 +169,7 @@ std::pair, std::vector> buildMap( // Fast exit if the histogram is empty if (histoContents.empty()) { - return std::make_pair(std::get<0>(map), std::vector()); + return {std::get<0>(map), std::vector()}; } // Set the bin content @@ -183,7 +183,7 @@ std::pair, std::vector> buildMap( auto histoBorders = std::get<0>(map); reduceMap(histoBorders, normalisedHistoContents); - return std::make_pair(histoBorders, normalisedHistoContents); + return {histoBorders, normalisedHistoContents}; } /// @brief This method transforms a probability distribution into components @@ -208,7 +208,7 @@ std::pair, std::vector> buildMap( // Fast exit if the histogram is empty if (histoContents.empty()) { - return std::make_pair(std::get<0>(map), std::vector()); + return {std::get<0>(map), std::vector()}; } // Set the bin content @@ -223,7 +223,7 @@ std::pair, std::vector> buildMap( std::vector histoBorders = std::get<0>(map); reduceMap(histoBorders, normalisedHistoContents); - return std::make_pair(histoBorders, normalisedHistoContents); + return {histoBorders, normalisedHistoContents}; } /// @brief This method builds decomposed cumulative probability distributions diff --git a/Examples/Io/Root/src/RootTrackStatesWriter.cpp b/Examples/Io/Root/src/RootTrackStatesWriter.cpp index 37d7cdf2fc9..ee199e48ff3 100644 --- a/Examples/Io/Root/src/RootTrackStatesWriter.cpp +++ b/Examples/Io/Root/src/RootTrackStatesWriter.cpp @@ -471,13 +471,13 @@ ProcessCode RootTrackStatesWriter::writeT(const AlgorithmContext& ctx, auto getTrackParams = [&](unsigned int ipar) -> std::optional> { if (ipar == ePredicted && state.hasPredicted()) { - return std::make_pair(state.predicted(), state.predictedCovariance()); + return std::pair(state.predicted(), state.predictedCovariance()); } if (ipar == eFiltered && state.hasFiltered()) { - return std::make_pair(state.filtered(), state.filteredCovariance()); + return std::pair(state.filtered(), state.filteredCovariance()); } if (ipar == eSmoothed && state.hasSmoothed()) { - return std::make_pair(state.smoothed(), state.smoothedCovariance()); + return std::pair(state.smoothed(), state.smoothedCovariance()); } if (ipar == eUnbiased && state.hasSmoothed() && state.hasProjector() && state.hasCalibrated()) { diff --git a/Examples/Io/Root/src/detail/NuclearInteractionParametrisation.cpp b/Examples/Io/Root/src/detail/NuclearInteractionParametrisation.cpp index 244c30ca039..ee89b828590 100644 --- a/Examples/Io/Root/src/detail/NuclearInteractionParametrisation.cpp +++ b/Examples/Io/Root/src/detail/NuclearInteractionParametrisation.cpp @@ -87,7 +87,7 @@ std::pair calculateMeanAndCovariance( } covariance /= events.size(); - return std::make_pair(mean, covariance); + return {mean, covariance}; } EigenspaceComponents calculateEigenspace(const Vector& mean, @@ -99,7 +99,7 @@ EigenspaceComponents calculateEigenspace(const Vector& mean, // Transform the mean vector into eigenspace Vector meanEigenspace = eigenvectors * mean; - return std::make_tuple(eigenvalues, eigenvectors, meanEigenspace); + return {eigenvalues, eigenvectors, meanEigenspace}; } Parametrisation buildMomentumParameters(const EventCollection& events, @@ -122,7 +122,7 @@ Parametrisation buildMomentumParameters(const EventCollection& events, EigenspaceComponents eigenspaceElements = calculateEigenspace(meanAndCovariance.first, meanAndCovariance.second); // Calculate the cumulative distributions - return std::make_pair(eigenspaceElements, histos); + return {eigenspaceElements, histos}; } EventProperties prepareMomenta(const EventCollection& events, @@ -255,7 +255,7 @@ Parametrisation buildInvariantMassParameters(const EventCollection& events, EigenspaceComponents eigenspaceElements = calculateEigenspace(meanAndCovariance.first, meanAndCovariance.second); // Calculate the cumulative distributions - return std::make_pair(eigenspaceElements, histos); + return {eigenspaceElements, histos}; } std::unordered_map> @@ -341,7 +341,7 @@ cumulativeMultiplicityProbability(const EventCollection& events, } } - return std::make_pair(softHisto, hardHisto); + return {softHisto, hardHisto}; } TVectorF softProbability(const EventCollection& events) { diff --git a/Examples/Scripts/compareRootFiles.hpp b/Examples/Scripts/compareRootFiles.hpp index 464230373be..a7043b15e96 100644 --- a/Examples/Scripts/compareRootFiles.hpp +++ b/Examples/Scripts/compareRootFiles.hpp @@ -34,8 +34,7 @@ class AnyVector { static std::pair*> create(Args&&... args) { std::vector* vector = new std::vector(std::forward(args)...); std::function deleter = [vector] { delete vector; }; - return std::make_pair( - AnyVector{static_cast(vector), std::move(deleter)}, vector); + return {AnyVector{static_cast(vector), std::move(deleter)}, vector}; } // Default-construct a null type-erased vector diff --git a/Fatras/include/ActsFatras/Physics/ElectroMagnetic/PhotonConversion.hpp b/Fatras/include/ActsFatras/Physics/ElectroMagnetic/PhotonConversion.hpp index af45481258e..582cc073bc4 100644 --- a/Fatras/include/ActsFatras/Physics/ElectroMagnetic/PhotonConversion.hpp +++ b/Fatras/include/ActsFatras/Physics/ElectroMagnetic/PhotonConversion.hpp @@ -129,8 +129,8 @@ std::pair PhotonConversion::generatePathLimits( // Fast exit if not a photon or the energy is too low if (particle.pdg() != Acts::PdgParticle::eGamma || particle.absoluteMomentum() < (2 * kElectronMass)) { - return std::make_pair(std::numeric_limits::infinity(), - std::numeric_limits::infinity()); + return {std::numeric_limits::infinity(), + std::numeric_limits::infinity()}; } // Use for the moment only Al data - Yung Tsai - Rev.Mod.Particle Physics Vol. @@ -155,11 +155,11 @@ std::pair PhotonConversion::generatePathLimits( std::uniform_real_distribution uniformDistribution{0., 1.}; // This is a transformation of eq. 3.75 - return std::make_pair(-9. / 7. * - std::log(conversionProbScaleFactor * - (1 - uniformDistribution(generator))) / - (1. - xi), - std::numeric_limits::infinity()); + return {-9. / 7. * + std::log(conversionProbScaleFactor * + (1 - uniformDistribution(generator))) / + (1. - xi), + std::numeric_limits::infinity()}; } template diff --git a/Fatras/include/ActsFatras/Physics/NuclearInteraction/NuclearInteraction.hpp b/Fatras/include/ActsFatras/Physics/NuclearInteraction/NuclearInteraction.hpp index d372cf8ffc9..d0a0d84c36c 100644 --- a/Fatras/include/ActsFatras/Physics/NuclearInteraction/NuclearInteraction.hpp +++ b/Fatras/include/ActsFatras/Physics/NuclearInteraction/NuclearInteraction.hpp @@ -58,8 +58,8 @@ struct NuclearInteraction { const Particle& particle) const { // Fast exit: No parameterisation provided if (multiParticleParameterisation.empty()) { - return std::make_pair(std::numeric_limits::infinity(), - std::numeric_limits::infinity()); + return {std::numeric_limits::infinity(), + std::numeric_limits::infinity()}; } // Find the parametrisation that corresponds to the particle type for (const auto& particleParametrisation : multiParticleParameterisation) { @@ -77,15 +77,13 @@ struct NuclearInteraction { // Set the L0 limit if not done already const auto& distribution = parametrisation.nuclearInteractionProbability; - auto limits = - std::make_pair(std::numeric_limits::infinity(), - sampleContinuousValues( - uniformDistribution(generator), distribution)); - return limits; + return {std::numeric_limits::infinity(), + sampleContinuousValues(uniformDistribution(generator), + distribution)}; } } - return std::make_pair(std::numeric_limits::infinity(), - std::numeric_limits::infinity()); + return {std::numeric_limits::infinity(), + std::numeric_limits::infinity()}; } /// This method performs a nuclear interaction. @@ -483,14 +481,14 @@ NuclearInteraction::sampleKinematics( if (trials == nMatchingTrialsTotal) { return std::nullopt; } - // Re-sampole invariant masses if no fitting momenta were found + // Re-sample invariant masses if no fitting momenta were found if (trials++ % nMatchingTrials == 0) { invariantMasses = sampleInvariantMasses(generator, parameters); } else { momenta = sampleMomenta(generator, parameters, momentum); } } - return std::make_pair(momenta, invariantMasses); + return std::pair(momenta, invariantMasses); } template diff --git a/Fatras/src/Physics/NuclearInteraction/NuclearInteraction.cpp b/Fatras/src/Physics/NuclearInteraction/NuclearInteraction.cpp index 84ab93921fe..ad1e0bbb6a6 100644 --- a/Fatras/src/Physics/NuclearInteraction/NuclearInteraction.cpp +++ b/Fatras/src/Physics/NuclearInteraction/NuclearInteraction.cpp @@ -141,7 +141,7 @@ std::pair NuclearInteraction::globalAngle(double phi1, const float theta = std::acos(vectorSum.z() / vectorSum.norm()); const float phi = std::atan2(vectorSum.y(), vectorSum.x()); - return std::make_pair(phi, theta); + return {phi, theta}; } bool NuclearInteraction::match(const Acts::ActsDynamicVector& momenta, diff --git a/Plugins/DD4hep/src/DD4hepBlueprintFactory.cpp b/Plugins/DD4hep/src/DD4hepBlueprintFactory.cpp index bf653fff801..06ff97153dd 100644 --- a/Plugins/DD4hep/src/DD4hepBlueprintFactory.cpp +++ b/Plugins/DD4hep/src/DD4hepBlueprintFactory.cpp @@ -207,7 +207,7 @@ Acts::Experimental::DD4hepBlueprintFactory::extractExternals( aux += "vol. binning : " + binningString; } // Return the tuple - return std::make_tuple(transform, bValueType, bValues, bBinning, aux); + return {transform, bValueType, bValues, bBinning, aux}; } std::tuple, @@ -309,6 +309,5 @@ Acts::Experimental::DD4hepBlueprintFactory::extractInternals( std::make_shared(geoIdCfg); } - return std::make_tuple(internalsBuilder, rootsFinderBuilder, geoIdGenerator, - aux, ext); + return {internalsBuilder, rootsFinderBuilder, geoIdGenerator, aux, ext}; } diff --git a/Plugins/Geant4/src/Geant4Converters.cpp b/Plugins/Geant4/src/Geant4Converters.cpp index 1608f45bb10..6db950f570a 100644 --- a/Plugins/Geant4/src/Geant4Converters.cpp +++ b/Plugins/Geant4/src/Geant4Converters.cpp @@ -110,7 +110,7 @@ Acts::Geant4ShapeConverter::cylinderBounds(const G4Tubs& g4Tubs) { } double thickness = g4Tubs.GetOuterRadius() - g4Tubs.GetInnerRadius(); auto cBounds = std::make_shared(tArray); - return std::make_tuple(std::move(cBounds), thickness); + return {std::move(cBounds), thickness}; } std::tuple, double> @@ -133,7 +133,7 @@ Acts::Geant4ShapeConverter::radialBounds(const G4Tubs& g4Tubs) { } double thickness = g4Tubs.GetZHalfLength() * 2; auto rBounds = std::make_shared(tArray); - return std::make_tuple(std::move(rBounds), thickness); + return {std::move(rBounds), thickness}; } std::shared_ptr Acts::Geant4ShapeConverter::lineBounds( @@ -173,7 +173,7 @@ Acts::Geant4ShapeConverter::rectangleBounds(const G4Box& g4Box) { } auto rBounds = std::make_shared(hG4XYZ[std::abs(rAxes[0u])], hG4XYZ[std::abs(rAxes[1u])]); - return std::make_tuple(std::move(rBounds), rAxes, thickness); + return {std::move(rBounds), rAxes, thickness}; } std::tuple, std::array, double> @@ -226,7 +226,7 @@ Acts::Geant4ShapeConverter::trapezoidBounds(const G4Trd& g4Trd) { auto tBounds = std::make_shared( halfLengthXminY, halfLengthXmaxY, halfLengthY); - return std::make_tuple(std::move(tBounds), rAxes, thickness); + return {std::move(tBounds), rAxes, thickness}; } std::tuple, std::array, double> @@ -234,19 +234,19 @@ Acts::Geant4ShapeConverter::planarBounds(const G4VSolid& g4Solid) { const G4Box* box = dynamic_cast(&g4Solid); if (box != nullptr) { auto [rBounds, axes, thickness] = rectangleBounds(*box); - return std::make_tuple(std::move(rBounds), axes, thickness); + return {std::move(rBounds), axes, thickness}; } const G4Trd* trd = dynamic_cast(&g4Solid); if (trd != nullptr) { auto [tBounds, axes, thickness] = trapezoidBounds(*trd); - return std::make_tuple(std::move(tBounds), axes, thickness); + return {std::move(tBounds), axes, thickness}; } std::shared_ptr pBounds = nullptr; std::array rAxes = {}; double rThickness = 0.; - return std::make_tuple(std::move(pBounds), rAxes, rThickness); + return {std::move(pBounds), rAxes, rThickness}; } namespace { diff --git a/Plugins/GeoModel/src/GeoModelBlueprintCreater.cpp b/Plugins/GeoModel/src/GeoModelBlueprintCreater.cpp index 429321828d6..081834d7069 100644 --- a/Plugins/GeoModel/src/GeoModelBlueprintCreater.cpp +++ b/Plugins/GeoModel/src/GeoModelBlueprintCreater.cpp @@ -320,7 +320,7 @@ Acts::GeoModelBlueprintCreater::createInternalStructureBuilder( const std::vector& internalConstraints) const { // Check if the internals entry is empty if (entry.internals.empty()) { - return std::make_tuple(nullptr, Extent()); + return {nullptr, Extent()}; } // Build a layer structure @@ -393,10 +393,10 @@ Acts::GeoModelBlueprintCreater::createInternalStructureBuilder( lsbCfg.nMinimalSurfaces = surfaces.size() + 1u; } - return std::make_tuple( + return { std::make_shared( lsbCfg, m_logger->clone(entry.name + "_LayerStructureBuilder")), - internalExtent); + internalExtent}; } else { throw std::invalid_argument( @@ -404,7 +404,7 @@ Acts::GeoModelBlueprintCreater::createInternalStructureBuilder( entry.internals[1u] + "' / or now kdt surfaces provided."); } } - return std::make_tuple(nullptr, Extent()); + return {nullptr, Extent()}; } std::tuple, @@ -434,5 +434,5 @@ Acts::GeoModelBlueprintCreater::parseBounds( "supported for the moment."); } - return std::make_tuple(boundsType, extent, boundValues, translation); + return {boundsType, extent, boundValues, translation}; } diff --git a/Plugins/GeoModel/src/detail/GeoModelExtentHelper.cpp b/Plugins/GeoModel/src/detail/GeoModelExtentHelper.cpp index daab4fd10e6..3734aefb8fe 100644 --- a/Plugins/GeoModel/src/detail/GeoModelExtentHelper.cpp +++ b/Plugins/GeoModel/src/detail/GeoModelExtentHelper.cpp @@ -111,7 +111,7 @@ Acts::detail::GeoModelExentHelper::extentFromTable( BinningValue bValue = bvCyl.at(iv); double val = std::numeric_limits::max(); bool isMin = (iv % 2 == 0); - // Case "e" : exxternal extent + // Case "e" : external extent if (value == "e") { // External parameters do not constrain it if (!externalExtent.constrains(bValue)) { @@ -157,5 +157,5 @@ Acts::detail::GeoModelExentHelper::extentFromTable( } } - return std::make_tuple(boundsType, extent); + return {boundsType, extent}; } diff --git a/Tests/UnitTests/Core/Geometry/LayerCreatorTests.cpp b/Tests/UnitTests/Core/Geometry/LayerCreatorTests.cpp index 13aec3ff545..20f43a3b68e 100644 --- a/Tests/UnitTests/Core/Geometry/LayerCreatorTests.cpp +++ b/Tests/UnitTests/Core/Geometry/LayerCreatorTests.cpp @@ -230,7 +230,7 @@ struct LayerCreatorFixture { } } - return std::make_pair(res, pairs); + return {res, pairs}; } }; diff --git a/Tests/UnitTests/Core/Geometry/SurfaceArrayCreatorTests.cpp b/Tests/UnitTests/Core/Geometry/SurfaceArrayCreatorTests.cpp index 00b6509ef25..6d69c1667da 100644 --- a/Tests/UnitTests/Core/Geometry/SurfaceArrayCreatorTests.cpp +++ b/Tests/UnitTests/Core/Geometry/SurfaceArrayCreatorTests.cpp @@ -228,7 +228,7 @@ struct SurfaceArrayCreatorFixture { } } - return std::make_pair(res, pairs); + return {res, pairs}; } }; diff --git a/Tests/UnitTests/Core/SpacePointFormation/SpacePointBuilderTests.cpp b/Tests/UnitTests/Core/SpacePointFormation/SpacePointBuilderTests.cpp index c20239bb078..6d043178320 100644 --- a/Tests/UnitTests/Core/SpacePointFormation/SpacePointBuilderTests.cpp +++ b/Tests/UnitTests/Core/SpacePointFormation/SpacePointBuilderTests.cpp @@ -93,7 +93,7 @@ std::pair stripEnds( auto gPos1 = surface->localToGlobal(gctx, lpos1, globalFakeMom); auto gPos2 = surface->localToGlobal(gctx, lpos2, globalFakeMom); - return std::make_pair(gPos1, gPos2); + return {gPos1, gPos2}; } // Create a test context diff --git a/Tests/UnitTests/Core/Vertexing/VertexingDataHelper.hpp b/Tests/UnitTests/Core/Vertexing/VertexingDataHelper.hpp index d984b4c8c44..383b5b84d2c 100644 --- a/Tests/UnitTests/Core/Vertexing/VertexingDataHelper.hpp +++ b/Tests/UnitTests/Core/Vertexing/VertexingDataHelper.hpp @@ -143,7 +143,7 @@ readTracksAndVertexCSV(const std::string& toolString, vertices.push_back(vertexInfo); } - return std::make_tuple(beamspotConstraint, vertices, tracks); + return {beamspotConstraint, vertices, tracks}; } } // namespace Acts::Test diff --git a/Tests/UnitTests/Plugins/Cuda/Seeding/SeedFinderCudaTest.cpp b/Tests/UnitTests/Plugins/Cuda/Seeding/SeedFinderCudaTest.cpp index 1b31f083fd8..87d61b1df71 100644 --- a/Tests/UnitTests/Plugins/Cuda/Seeding/SeedFinderCudaTest.cpp +++ b/Tests/UnitTests/Plugins/Cuda/Seeding/SeedFinderCudaTest.cpp @@ -231,7 +231,7 @@ int main(int argc, char** argv) { -> std::tuple> { Acts::Vector3 position(sp.x(), sp.y(), sp.z()); Acts::Vector2 variance(sp.varianceR, sp.varianceZ); - return std::make_tuple(position, variance, std::nullopt); + return {position, variance, std::nullopt}; }; // setup spacepoint grid config diff --git a/Tests/UnitTests/Plugins/Cuda/Seeding2/main.cpp b/Tests/UnitTests/Plugins/Cuda/Seeding2/main.cpp index b63d549e37f..3b134aca9a0 100644 --- a/Tests/UnitTests/Plugins/Cuda/Seeding2/main.cpp +++ b/Tests/UnitTests/Plugins/Cuda/Seeding2/main.cpp @@ -113,7 +113,7 @@ int main(int argc, char* argv[]) { -> std::tuple> { Acts::Vector3 position(sp.x(), sp.y(), sp.z()); Acts::Vector2 covariance(sp.m_varianceR, sp.m_varianceZ); - return std::make_tuple(position, covariance, std::nullopt); + return {position, covariance, std::nullopt}; }; // extent used to store r range for middle spacepoint diff --git a/Tests/UnitTests/Plugins/Geant4/Geant4SurfaceProviderTests.cpp b/Tests/UnitTests/Plugins/Geant4/Geant4SurfaceProviderTests.cpp index 49521ae786d..7508fe9a148 100644 --- a/Tests/UnitTests/Plugins/Geant4/Geant4SurfaceProviderTests.cpp +++ b/Tests/UnitTests/Plugins/Geant4/Geant4SurfaceProviderTests.cpp @@ -123,7 +123,7 @@ ConstructGeant4World() { parser.SetOutputFileOverwrite(true); parser.Write(gdmlPath.string(), physWorld); - return std::make_tuple(physWorld, names); + return {physWorld, names}; } auto gctx = Acts::GeometryContext();