From 545d51fcfee14d6c2efeaf6cf0e3d351f1004157 Mon Sep 17 00:00:00 2001 From: Frederik Date: Thu, 20 Jun 2024 17:19:56 +0200 Subject: [PATCH] Format --- .../Acts/Plugins/Traccc/BarcodeMap.hpp | 7 ++- .../Acts/Plugins/Traccc/CellConversion.hpp | 10 ++- .../Acts/Plugins/Traccc/Detail/Module.hpp | 8 +-- .../Acts/Plugins/Traccc/TrackConversion.hpp | 62 +++++++++++-------- Plugins/Traccc/src/CellConversion.cpp | 17 ++--- Plugins/Traccc/src/Detail/Module.cpp | 8 +-- 6 files changed, 65 insertions(+), 47 deletions(-) diff --git a/Plugins/Traccc/include/Acts/Plugins/Traccc/BarcodeMap.hpp b/Plugins/Traccc/include/Acts/Plugins/Traccc/BarcodeMap.hpp index 2c777059c85c..d468da4db827 100644 --- a/Plugins/Traccc/include/Acts/Plugins/Traccc/BarcodeMap.hpp +++ b/Plugins/Traccc/include/Acts/Plugins/Traccc/BarcodeMap.hpp @@ -28,10 +28,11 @@ namespace Acts::TracccPlugin { /// @param detector the detray detector. /// @return A map (key = geometry ID value, value = detray geometry barcode). template -inline std::map createBarcodeMap( - const detray::detector& detector) { +inline std::map +createBarcodeMap(const detray::detector& detector) { // Construct a map from Acts surface identifiers to Detray barcodes. - std::map barcodeMap; + std::map + barcodeMap; for (const auto& surface : detector.surfaces()) { barcodeMap[surface.source] = surface.barcode(); } diff --git a/Plugins/Traccc/include/Acts/Plugins/Traccc/CellConversion.hpp b/Plugins/Traccc/include/Acts/Plugins/Traccc/CellConversion.hpp index d0f4f3745b51..9570f85aeb0b 100644 --- a/Plugins/Traccc/include/Acts/Plugins/Traccc/CellConversion.hpp +++ b/Plugins/Traccc/include/Acts/Plugins/Traccc/CellConversion.hpp @@ -43,10 +43,14 @@ namespace Acts::TracccPlugin { /// @param dconfig The traccc digitization configuration. /// @param barcode_map A map from Acts geometry ID value to detray barcode. /// @return A tuple containing the traccc cells (first item) and traccc modules (second item). -std::tuple createCellsAndModules( +std::tuple +createCellsAndModules( vecmem::memory_resource* mr, - std::map> cellsMap, + std::map> + cellsMap, const traccc::geometry* geom, const traccc::digitization_config* dconfig, - const std::map* barcodeMap); + const std::map* + barcodeMap); } // namespace Acts::TracccPlugin diff --git a/Plugins/Traccc/include/Acts/Plugins/Traccc/Detail/Module.hpp b/Plugins/Traccc/include/Acts/Plugins/Traccc/Detail/Module.hpp index c14e97b0090c..58d06333fcec 100644 --- a/Plugins/Traccc/include/Acts/Plugins/Traccc/Detail/Module.hpp +++ b/Plugins/Traccc/include/Acts/Plugins/Traccc/Detail/Module.hpp @@ -21,9 +21,9 @@ namespace Acts::TracccPlugin::detail { /// @brief Helper function which finds module from csv::cell in the geometry and /// digitization config, and initializes the modules limits with the cell's /// properties. -traccc::cell_module getModule(const Acts::GeometryIdentifier::Value geometryID, - const traccc::geometry* geom, - const traccc::digitization_config* dconfig, - const Acts::GeometryIdentifier::Value originalGeometryID); +traccc::cell_module getModule( + const Acts::GeometryIdentifier::Value geometryID, + const traccc::geometry* geom, const traccc::digitization_config* dconfig, + const Acts::GeometryIdentifier::Value originalGeometryID); } // namespace Acts::TracccPlugin::detail diff --git a/Plugins/Traccc/include/Acts/Plugins/Traccc/TrackConversion.hpp b/Plugins/Traccc/include/Acts/Plugins/Traccc/TrackConversion.hpp index 4c8f9711e7f0..da46de10b58e 100644 --- a/Plugins/Traccc/include/Acts/Plugins/Traccc/TrackConversion.hpp +++ b/Plugins/Traccc/include/Acts/Plugins/Traccc/TrackConversion.hpp @@ -14,12 +14,12 @@ // Acts include(s) #include "Acts/Definitions/Algebra.hpp" #include "Acts/Definitions/TrackParametrization.hpp" -#include "Acts/EventData/detail/ParameterTraits.hpp" -#include "Acts/EventData/SourceLink.hpp" #include "Acts/EventData/ParticleHypothesis.hpp" +#include "Acts/EventData/SourceLink.hpp" #include "Acts/EventData/TrackContainer.hpp" #include "Acts/EventData/TrackParameters.hpp" #include "Acts/EventData/TrackProxy.hpp" +#include "Acts/EventData/detail/ParameterTraits.hpp" #include "Acts/Geometry/TrackingGeometry.hpp" #include "Acts/Utilities/detail/Subspace.hpp" @@ -49,7 +49,8 @@ template inline auto newParams(const detray::bound_track_parameters& dparams, const detray::detector& detector, const Acts::TrackingGeometry& trackingGeometry) { - constexpr std::size_t kFullSize = Acts::detail::kParametersSize; + constexpr std::size_t kFullSize = + Acts::detail::kParametersSize; Acts::ActsVector parameterVector = detail::toActsVector(dparams.vector()[0]); typename Acts::BoundTrackParameters::CovarianceMatrix cov = @@ -109,8 +110,8 @@ inline void copyTrackState( Acts::TrackStateProxy& destination, const detray::detector& detector, const Acts::TrackingGeometry& trackingGeometry) { - - constexpr std::size_t kFullSize = Acts::detail::kParametersSize; + constexpr std::size_t kFullSize = + Acts::detail::kParametersSize; constexpr std::size_t kSize = 2UL; auto geoID = @@ -123,23 +124,26 @@ inline void copyTrackState( using Covariance = typename Acts::TrackStateProxy::Covariance; - destination.predicted() = - Parameters(detail::toActsVector(source.predicted().vector()[0]).data()); + destination.predicted() = Parameters( + detail::toActsVector(source.predicted().vector()[0]).data()); destination.predictedCovariance() = Covariance( - detail::toActsSquareMatrix(source.predicted().covariance()).data()); + detail::toActsSquareMatrix(source.predicted().covariance()) + .data()); - destination.smoothed() = - Parameters(detail::toActsVector(source.smoothed().vector()[0]).data()); + destination.smoothed() = Parameters( + detail::toActsVector(source.smoothed().vector()[0]).data()); destination.smoothedCovariance() = Covariance( - detail::toActsSquareMatrix(source.smoothed().covariance()).data()); + detail::toActsSquareMatrix(source.smoothed().covariance()) + .data()); - destination.filtered() = - Parameters(detail::toActsVector(source.filtered().vector()[0]).data()); + destination.filtered() = Parameters( + detail::toActsVector(source.filtered().vector()[0]).data()); destination.filteredCovariance() = Covariance( - detail::toActsSquareMatrix(source.filtered().covariance()).data()); + detail::toActsSquareMatrix(source.filtered().covariance()) + .data()); - destination.jacobian() = - Covariance(detail::toActsSquareMatrix(source.jacobian()).data()); + destination.jacobian() = Covariance( + detail::toActsSquareMatrix(source.jacobian()).data()); destination.chi2() = source.smoothed_chi2(); @@ -158,15 +162,17 @@ inline void copyTrackState( destination.setUncalibratedSourceLink(Acts::SourceLink{measurement}); destination.allocateCalibrated(kSize); - - destination.template calibrated() = detail::toActsVector(measurement.local); + + destination.template calibrated() = + detail::toActsVector(measurement.local); auto cov = Eigen::DiagonalMatrix( detail::toActsVector(measurement.variance)) .toDenseMatrix(); destination.template calibratedCovariance() = cov; - Acts::detail::FixedSizeSubspace subspace(measurement.subs.get_indices()); + Acts::detail::FixedSizeSubspace subspace( + measurement.subs.get_indices()); destination.setProjector(subspace.template projector()); } @@ -214,15 +220,19 @@ inline auto makeTrack( /// @param detector The detray detector. /// @param trackingGeometry The Acts tracking geometry. /// @note Sets the uncalibrated source link and calibrated measurement to the traccc measurement. -template class holder_t, typename metadata_t, typename container_t> +template class holder_t, + typename metadata_t, typename container_t> inline void makeTracks( - const traccc_track_container_t& tracccTrackContainer, - Acts::TrackContainer& trackContainer, - const detray::detector& detector, + const traccc_track_container_t& tracccTrackContainer, + Acts::TrackContainer& + trackContainer, + const detray::detector& detector, const Acts::TrackingGeometry& trackingGeometry) { - for (std::size_t i = 0; i < tracccTrackContainer.size(); i++) { - makeTrack(tracccTrackContainer[i], trackContainer, detector, trackingGeometry); - } + for (std::size_t i = 0; i < tracccTrackContainer.size(); i++) { + makeTrack(tracccTrackContainer[i], trackContainer, detector, + trackingGeometry); + } } } // namespace Acts::TracccPlugin diff --git a/Plugins/Traccc/src/CellConversion.cpp b/Plugins/Traccc/src/CellConversion.cpp index bb3943968308..8a5baaa6c5be 100644 --- a/Plugins/Traccc/src/CellConversion.cpp +++ b/Plugins/Traccc/src/CellConversion.cpp @@ -55,12 +55,15 @@ struct CellOrder { namespace Acts::TracccPlugin { -std::tuple createCellsAndModules( +std::tuple +createCellsAndModules( vecmem::memory_resource* mr, - std::map> cellsMap, + std::map> + cellsMap, const traccc::geometry* geom, const traccc::digitization_config* dconfig, - const std::map* barcodeMap) { - + const std::map* + barcodeMap) { traccc::io::cell_reader_output out(mr); // Sort the cells. @@ -72,9 +75,9 @@ std::tupleat(originalGeometryID).value() - : originalGeometryID; + Acts::GeometryIdentifier::Value geometryID = + (barcodeMap != nullptr) ? barcodeMap->at(originalGeometryID).value() + : originalGeometryID; // Add the module and its cells to the output. out.modules.push_back( diff --git a/Plugins/Traccc/src/Detail/Module.cpp b/Plugins/Traccc/src/Detail/Module.cpp index cbdbf5cde1eb..08d9e3c3395d 100644 --- a/Plugins/Traccc/src/Detail/Module.cpp +++ b/Plugins/Traccc/src/Detail/Module.cpp @@ -33,10 +33,10 @@ namespace Acts::TracccPlugin::detail { -traccc::cell_module getModule(const Acts::GeometryIdentifier::Value geometryID, - const traccc::geometry* geom, - const traccc::digitization_config* dconfig, - const Acts::GeometryIdentifier::Value originalGeometryID) { +traccc::cell_module getModule( + const Acts::GeometryIdentifier::Value geometryID, + const traccc::geometry* geom, const traccc::digitization_config* dconfig, + const Acts::GeometryIdentifier::Value originalGeometryID) { traccc::cell_module result; result.surface_link = detray::geometry::barcode{geometryID};