From ef699275e0a2f5d67daacff40ed47a0b2cf71752 Mon Sep 17 00:00:00 2001
From: Frederik <frederik.barba@hotmail.com>
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 <typename metadata_t, typename container_t>
-inline std::map<Acts::GeometryIdentifier::Value, detray::geometry::barcode> createBarcodeMap(
-    const detray::detector<metadata_t, container_t>& detector) {
+inline std::map<Acts::GeometryIdentifier::Value, detray::geometry::barcode>
+createBarcodeMap(const detray::detector<metadata_t, container_t>& detector) {
   // Construct a map from Acts surface identifiers to Detray barcodes.
-  std::map<Acts::GeometryIdentifier::Value, detray::geometry::barcode> barcodeMap;
+  std::map<Acts::GeometryIdentifier::Value, detray::geometry::barcode>
+      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<traccc::cell_collection_types::host, traccc::cell_module_collection_types::host> createCellsAndModules(
+std::tuple<traccc::cell_collection_types::host,
+           traccc::cell_module_collection_types::host>
+createCellsAndModules(
     vecmem::memory_resource* mr,
-    std::map<Acts::GeometryIdentifier::Value, std::vector<traccc::cell>> cellsMap,
+    std::map<Acts::GeometryIdentifier::Value, std::vector<traccc::cell>>
+        cellsMap,
     const traccc::geometry* geom, const traccc::digitization_config* dconfig,
-    const std::map<Acts::GeometryIdentifier::Value, detray::geometry::barcode>* barcodeMap);
+    const std::map<Acts::GeometryIdentifier::Value, detray::geometry::barcode>*
+        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 <typename algebra_t, typename metadata_t, typename container_t>
 inline auto newParams(const detray::bound_track_parameters<algebra_t>& dparams,
                       const detray::detector<metadata_t, container_t>& detector,
                       const Acts::TrackingGeometry& trackingGeometry) {
-  constexpr std::size_t kFullSize = Acts::detail::kParametersSize<Acts::BoundIndices>;
+  constexpr std::size_t kFullSize =
+      Acts::detail::kParametersSize<Acts::BoundIndices>;
   Acts::ActsVector<kFullSize> parameterVector =
       detail::toActsVector<kFullSize>(dparams.vector()[0]);
   typename Acts::BoundTrackParameters::CovarianceMatrix cov =
@@ -109,8 +110,8 @@ inline void copyTrackState(
     Acts::TrackStateProxy<trajectory_t, M, false>& destination,
     const detray::detector<metadata_t, container_t>& detector,
     const Acts::TrackingGeometry& trackingGeometry) {
-
-  constexpr std::size_t kFullSize = Acts::detail::kParametersSize<Acts::BoundIndices>;
+  constexpr std::size_t kFullSize =
+      Acts::detail::kParametersSize<Acts::BoundIndices>;
   constexpr std::size_t kSize = 2UL;
 
   auto geoID =
@@ -123,23 +124,26 @@ inline void copyTrackState(
   using Covariance =
       typename Acts::TrackStateProxy<trajectory_t, M, false>::Covariance;
 
-  destination.predicted() =
-      Parameters(detail::toActsVector<kFullSize>(source.predicted().vector()[0]).data());
+  destination.predicted() = Parameters(
+      detail::toActsVector<kFullSize>(source.predicted().vector()[0]).data());
   destination.predictedCovariance() = Covariance(
-      detail::toActsSquareMatrix<kFullSize>(source.predicted().covariance()).data());
+      detail::toActsSquareMatrix<kFullSize>(source.predicted().covariance())
+          .data());
 
-  destination.smoothed() =
-      Parameters(detail::toActsVector<kFullSize>(source.smoothed().vector()[0]).data());
+  destination.smoothed() = Parameters(
+      detail::toActsVector<kFullSize>(source.smoothed().vector()[0]).data());
   destination.smoothedCovariance() = Covariance(
-      detail::toActsSquareMatrix<kFullSize>(source.smoothed().covariance()).data());
+      detail::toActsSquareMatrix<kFullSize>(source.smoothed().covariance())
+          .data());
 
-  destination.filtered() =
-      Parameters(detail::toActsVector<kFullSize>(source.filtered().vector()[0]).data());
+  destination.filtered() = Parameters(
+      detail::toActsVector<kFullSize>(source.filtered().vector()[0]).data());
   destination.filteredCovariance() = Covariance(
-      detail::toActsSquareMatrix<kFullSize>(source.filtered().covariance()).data());
+      detail::toActsSquareMatrix<kFullSize>(source.filtered().covariance())
+          .data());
 
-  destination.jacobian() =
-      Covariance(detail::toActsSquareMatrix<kFullSize>(source.jacobian()).data());
+  destination.jacobian() = Covariance(
+      detail::toActsSquareMatrix<kFullSize>(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<kSize>() = detail::toActsVector<kSize>(measurement.local);
+
+  destination.template calibrated<kSize>() =
+      detail::toActsVector<kSize>(measurement.local);
 
   auto cov = Eigen::DiagonalMatrix<Acts::ActsScalar, kSize>(
                  detail::toActsVector<kSize>(measurement.variance))
                  .toDenseMatrix();
   destination.template calibratedCovariance<kSize>() = cov;
 
-  Acts::detail::FixedSizeSubspace<kFullSize, kSize> subspace(measurement.subs.get_indices());
+  Acts::detail::FixedSizeSubspace<kFullSize, kSize> subspace(
+      measurement.subs.get_indices());
   destination.setProjector(subspace.template projector<Acts::ActsScalar>());
 }
 
@@ -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 <typename traccc_track_container_t, typename track_container_t, typename trajectory_t, template <typename> class holder_t, typename metadata_t, typename container_t>
+template <typename traccc_track_container_t, typename track_container_t,
+          typename trajectory_t, template <typename> class holder_t,
+          typename metadata_t, typename container_t>
 inline void makeTracks(
-    const traccc_track_container_t& tracccTrackContainer, 
-    Acts::TrackContainer<track_container_t, trajectory_t, holder_t>& trackContainer, 
-    const detray::detector<metadata_t, container_t>& detector, 
+    const traccc_track_container_t& tracccTrackContainer,
+    Acts::TrackContainer<track_container_t, trajectory_t, holder_t>&
+        trackContainer,
+    const detray::detector<metadata_t, container_t>& 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<traccc::cell_collection_types::host, traccc::cell_module_collection_types::host> createCellsAndModules(
+std::tuple<traccc::cell_collection_types::host,
+           traccc::cell_module_collection_types::host>
+createCellsAndModules(
     vecmem::memory_resource* mr,
-    std::map<Acts::GeometryIdentifier::Value, std::vector<traccc::cell>> cellsMap,
+    std::map<Acts::GeometryIdentifier::Value, std::vector<traccc::cell>>
+        cellsMap,
     const traccc::geometry* geom, const traccc::digitization_config* dconfig,
-    const std::map<Acts::GeometryIdentifier::Value, detray::geometry::barcode>* barcodeMap) {
-      
+    const std::map<Acts::GeometryIdentifier::Value, detray::geometry::barcode>*
+        barcodeMap) {
   traccc::io::cell_reader_output out(mr);
 
   // Sort the cells.
@@ -72,9 +75,9 @@ std::tuple<traccc::cell_collection_types::host, traccc::cell_module_collection_t
   for (const auto& [originalGeometryID, cells] : cellsMap) {
     // Modify the geometry ID of the module if a barcode map is
     // provided.
-    Acts::GeometryIdentifier::Value geometryID = (barcodeMap != nullptr)
-                                                 ? barcodeMap->at(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};