From 22cfe3a5257bfcd38398179a912c8b9a9c2475e0 Mon Sep 17 00:00:00 2001
From: Felix Riehn <friehn@lip.pt>
Date: Wed, 18 Sep 2024 13:58:49 +0200
Subject: [PATCH] clang

---
 applications/c8_air_shower.cpp                |  4 +--
 corsika/detail/modules/radio/CoREAS.inl       |  4 +--
 corsika/detail/modules/radio/RadioProcess.inl |  4 +--
 corsika/detail/modules/radio/ZHS.inl          | 25 +++++++++++--------
 .../radio/detectors/ObserverCollection.inl    |  6 +++--
 .../radio/observers/TimeDomainObserver.inl    | 12 ++++-----
 .../radio/propagators/DummyTestPropagator.inl |  3 ++-
 .../NumericalIntegratingPropagator.inl        |  3 ++-
 .../TabulatedFlatAtmospherePropagator.inl     |  3 ++-
 corsika/modules/radio/observers/Observer.hpp  |  7 +++---
 examples/cascade_examples/radio_em_shower.cpp |  7 +++---
 .../synchrotron_clover_leaf.cpp               |  6 ++---
 .../synchrotron_test_manual_tracking.cpp      |  4 +--
 tests/modules/testRadio.cpp                   |  6 ++---
 14 files changed, 52 insertions(+), 42 deletions(-)

diff --git a/applications/c8_air_shower.cpp b/applications/c8_air_shower.cpp
index 5383e95c2..8dc0f00ec 100644
--- a/applications/c8_air_shower.cpp
+++ b/applications/c8_air_shower.cpp
@@ -555,7 +555,7 @@ int main(int argc, char** argv) {
       std::string name_1 = "CoREAS_R=" + std::to_string(rr_) +
                            "_m--Phi=" + std::to_string(phi_1) + "degrees";
       TimeDomainObserver observer_1(name_1, point_1, rootCS, triggertime_1, duration_,
-                                   sampleRate_, triggertime_1);
+                                    sampleRate_, triggertime_1);
       detectorCoREAS.addObserver(observer_1);
     }
 
@@ -570,7 +570,7 @@ int main(int argc, char** argv) {
       std::string name_ =
           "ZHS_R=" + std::to_string(rr_) + "_m--Phi=" + std::to_string(phi_) + "degrees";
       TimeDomainObserver observer_2(name_, point_, rootCS, triggertime_, duration_,
-                                  sampleRate_, triggertime_);
+                                    sampleRate_, triggertime_);
       detectorZHS.addObserver(observer_2);
     }
   }
diff --git a/corsika/detail/modules/radio/CoREAS.inl b/corsika/detail/modules/radio/CoREAS.inl
index a779311db..2a0a06ecd 100644
--- a/corsika/detail/modules/radio/CoREAS.inl
+++ b/corsika/detail/modules/radio/CoREAS.inl
@@ -202,8 +202,8 @@ namespace corsika {
 
               // CoREAS calculation -> get ElectricFieldVector for "midPoint"
               ElectricFieldVector EVmid_ = (path.emit_.cross(path.emit_.cross(beta_))) /
-                                            midDoppler_ / path.R_distance_ * constants_ *
-                                            observer.getSampleRate();
+                                           midDoppler_ / path.R_distance_ * constants_ *
+                                           observer.getSampleRate();
 
               ElectricFieldVector EV1_{EVmid_};
               ElectricFieldVector EV2_{EVmid_ * (-1.0)};
diff --git a/corsika/detail/modules/radio/RadioProcess.inl b/corsika/detail/modules/radio/RadioProcess.inl
index d38bed0a0..b77b78cb6 100644
--- a/corsika/detail/modules/radio/RadioProcess.inl
+++ b/corsika/detail/modules/radio/RadioProcess.inl
@@ -150,8 +150,8 @@ namespace corsika {
   }
 
   template <typename TObserverCollection, typename TRadioImpl, typename TPropagator>
-  inline YAML::Node RadioProcess<TObserverCollection, TRadioImpl, TPropagator>::getConfig()
-      const {
+  inline YAML::Node
+  RadioProcess<TObserverCollection, TRadioImpl, TPropagator>::getConfig() const {
 
     // top-level YAML node
     YAML::Node config;
diff --git a/corsika/detail/modules/radio/ZHS.inl b/corsika/detail/modules/radio/ZHS.inl
index 7881f6a5a..a3c180e25 100644
--- a/corsika/detail/modules/radio/ZHS.inl
+++ b/corsika/detail/modules/radio/ZHS.inl
@@ -97,12 +97,14 @@ namespace corsika {
                   sign = -1.;
                 } // end if statement for time structure
 
-                double const startBin{std::floor(
-                    (detectionTime1 - observer.getStartTime()) * observer.getSampleRate() +
-                    0.5)};
-                double const endBin{std::floor((detectionTime2 - observer.getStartTime()) *
-                                                   observer.getSampleRate() +
-                                               0.5)};
+                double const startBin{
+                    std::floor((detectionTime1 - observer.getStartTime()) *
+                                   observer.getSampleRate() +
+                               0.5)};
+                double const endBin{
+                    std::floor((detectionTime2 - observer.getStartTime()) *
+                                   observer.getSampleRate() +
+                               0.5)};
 
                 auto const betaPerp{
                     newMidPaths[k].emit_.cross(beta.cross(newMidPaths[k].emit_))};
@@ -112,8 +114,9 @@ namespace corsika {
                   // track contained in bin
                   // if not in Cerenkov angle then
                   if (std::fabs(denominator) > 1.e-15) {
-                    double const f{std::fabs((detectionTime2 * observer.getSampleRate() -
-                                              detectionTime1 * observer.getSampleRate()))};
+                    double const f{
+                        std::fabs((detectionTime2 * observer.getSampleRate() -
+                                   detectionTime1 * observer.getSampleRate()))};
                     VectorPotential const Vp = betaPerp * sign * constants * f /
                                                denominator / newMidPaths[k].R_distance_;
                     observer.receive(detectionTime2, betaPerp, Vp);
@@ -137,9 +140,9 @@ namespace corsika {
                   // intermidiate contributions
                   for (int it{1}; it < numberOfBins; ++it) {
                     Vp = betaPerp * constants / denominator / newMidPaths[k].R_distance_;
-                    observer.receive(detectionTime1 +
-                                        static_cast<double>(it) / observer.getSampleRate(),
-                                    betaPerp, Vp);
+                    observer.receive(detectionTime1 + static_cast<double>(it) /
+                                                          observer.getSampleRate(),
+                                     betaPerp, Vp);
                   } // end loop over bins in which potential vector is not zero
                   // final contribution// f +0.5 from new observer rounding
                   f = std::fabs((detectionTime2 - observer.getStartTime()) *
diff --git a/corsika/detail/modules/radio/detectors/ObserverCollection.inl b/corsika/detail/modules/radio/detectors/ObserverCollection.inl
index c754581a2..f9232bc13 100644
--- a/corsika/detail/modules/radio/detectors/ObserverCollection.inl
+++ b/corsika/detail/modules/radio/detectors/ObserverCollection.inl
@@ -12,7 +12,8 @@
 namespace corsika {
 
   template <typename TObserverImpl>
-  inline void ObserverCollection<TObserverImpl>::addObserver(TObserverImpl const& observer) {
+  inline void ObserverCollection<TObserverImpl>::addObserver(
+      TObserverImpl const& observer) {
     observers_.push_back(observer);
   }
 
@@ -39,7 +40,8 @@ namespace corsika {
 
   template <typename TObserverImpl>
   inline void ObserverCollection<TObserverImpl>::reset() {
-    std::for_each(observers_.begin(), observers_.end(), std::mem_fn(&TObserverImpl::reset));
+    std::for_each(observers_.begin(), observers_.end(),
+                  std::mem_fn(&TObserverImpl::reset));
   }
 
 } // namespace corsika
diff --git a/corsika/detail/modules/radio/observers/TimeDomainObserver.inl b/corsika/detail/modules/radio/observers/TimeDomainObserver.inl
index 1f228caae..0597aee88 100644
--- a/corsika/detail/modules/radio/observers/TimeDomainObserver.inl
+++ b/corsika/detail/modules/radio/observers/TimeDomainObserver.inl
@@ -12,12 +12,12 @@
 namespace corsika {
 
   inline TimeDomainObserver::TimeDomainObserver(std::string const& name,
-                                              Point const& location,
-                                              CoordinateSystemPtr coordinateSystem,
-                                              TimeType const& start_time,
-                                              TimeType const& duration,
-                                              InverseTimeType const& sample_rate,
-                                              TimeType const ground_hit_time)
+                                                Point const& location,
+                                                CoordinateSystemPtr coordinateSystem,
+                                                TimeType const& start_time,
+                                                TimeType const& duration,
+                                                InverseTimeType const& sample_rate,
+                                                TimeType const ground_hit_time)
       : Observer(name, location, coordinateSystem)
       , start_time_(start_time)
       , duration_(std::abs(duration / 1_s) * 1_s)
diff --git a/corsika/detail/modules/radio/propagators/DummyTestPropagator.inl b/corsika/detail/modules/radio/propagators/DummyTestPropagator.inl
index e953556ed..fcbb1b241 100644
--- a/corsika/detail/modules/radio/propagators/DummyTestPropagator.inl
+++ b/corsika/detail/modules/radio/propagators/DummyTestPropagator.inl
@@ -31,7 +31,8 @@ namespace corsika {
      *
      */
 
-    // these are used for the direction of emission and reception of signal at the observer
+    // these are used for the direction of emission and reception of signal at the
+    // observer
     auto const emit_{(destination - source).normalized()};
     auto const receive_{-emit_};
 
diff --git a/corsika/detail/modules/radio/propagators/NumericalIntegratingPropagator.inl b/corsika/detail/modules/radio/propagators/NumericalIntegratingPropagator.inl
index 8883c7e40..8e1ebea4a 100644
--- a/corsika/detail/modules/radio/propagators/NumericalIntegratingPropagator.inl
+++ b/corsika/detail/modules/radio/propagators/NumericalIntegratingPropagator.inl
@@ -31,7 +31,8 @@ namespace corsika {
      * so they are both called direction
      */
 
-    // these are used for the direction of emission and reception of signal at the observer
+    // these are used for the direction of emission and reception of signal at the
+    // observer
     auto const emit{(destination - source).normalized()};
     auto const receive{-emit};
 
diff --git a/corsika/detail/modules/radio/propagators/TabulatedFlatAtmospherePropagator.inl b/corsika/detail/modules/radio/propagators/TabulatedFlatAtmospherePropagator.inl
index 5fae478fb..8e138298e 100644
--- a/corsika/detail/modules/radio/propagators/TabulatedFlatAtmospherePropagator.inl
+++ b/corsika/detail/modules/radio/propagators/TabulatedFlatAtmospherePropagator.inl
@@ -86,7 +86,8 @@ namespace corsika {
      *
      */
 
-    // these are used for the direction of emission and reception of signal at the observer
+    // these are used for the direction of emission and reception of signal at the
+    // observer
     auto const emit_{(destination - source).normalized()};
     auto const receive_{-emit_};
 
diff --git a/corsika/modules/radio/observers/Observer.hpp b/corsika/modules/radio/observers/Observer.hpp
index 9d57e6a3b..65e946a8e 100644
--- a/corsika/modules/radio/observers/Observer.hpp
+++ b/corsika/modules/radio/observers/Observer.hpp
@@ -25,9 +25,10 @@ namespace corsika {
   class Observer {
 
   protected:
-    std::string const name_;                     ///< The name/identifier of this observer.
-    Point const location_;                       ///< The location of this observer.
-    CoordinateSystemPtr const coordinateSystem_; ///< The coordinate system of the observer
+    std::string const name_; ///< The name/identifier of this observer.
+    Point const location_;   ///< The location of this observer.
+    CoordinateSystemPtr const
+        coordinateSystem_; ///< The coordinate system of the observer
 
   public:
     using axistype = std::vector<long double>;
diff --git a/examples/cascade_examples/radio_em_shower.cpp b/examples/cascade_examples/radio_em_shower.cpp
index 860da4582..f4d5d4524 100644
--- a/examples/cascade_examples/radio_em_shower.cpp
+++ b/examples/cascade_examples/radio_em_shower.cpp
@@ -202,8 +202,9 @@ int main(int argc, char** argv) {
   auto triggertime_coreas{(triggerpoint - point_coreas).getNorm() / constants::c};
   std::string name_coreas = "CoREAS_R=" + std::to_string(rr_coreas) +
                             "_m--Phi=" + std::to_string(phi_coreas) + "degrees";
-  TimeDomainObserver observer_coreas(name_coreas, point_coreas, rootCS, triggertime_coreas,
-                                    duration, sampleRate, triggertime_coreas);
+  TimeDomainObserver observer_coreas(name_coreas, point_coreas, rootCS,
+                                     triggertime_coreas, duration, sampleRate,
+                                     triggertime_coreas);
   detectorCoREAS.addObserver(observer_coreas);
   //   }
   // }
@@ -222,7 +223,7 @@ int main(int argc, char** argv) {
   std::string name_zhs = "ZHS_R=" + std::to_string(rr_zhs) +
                          "_m--Phi=" + std::to_string(phi_zhs) + "degrees";
   TimeDomainObserver observer_zhs(name_zhs, point_zhs, rootCS, triggertime_zhs, duration,
-                                 sampleRate, triggertime_zhs);
+                                  sampleRate, triggertime_zhs);
   detectorZHS.addObserver(observer_zhs);
   //   }
   // }
diff --git a/examples/physics_examples/synchrotron_clover_leaf.cpp b/examples/physics_examples/synchrotron_clover_leaf.cpp
index 3cd743c51..a453a2158 100644
--- a/examples/physics_examples/synchrotron_clover_leaf.cpp
+++ b/examples/physics_examples/synchrotron_clover_leaf.cpp
@@ -111,8 +111,8 @@ int main() {
 
   std::string name_center = "CoREAS_R=0_m--Phi=0degrees";
   auto triggertime_center{((triggerpoint_ - center).getNorm() / constants::c) - 500_ns};
-  TimeDomainObserver observer(name_center, center, rootCS, triggertime_center,
-                                    duration_, sampleRate_, triggertime_center);
+  TimeDomainObserver observer(name_center, center, rootCS, triggertime_center, duration_,
+                              sampleRate_, triggertime_center);
   detectorCoREAS.addObserver(observer_center);
 
   for (auto radius_1 = 25_m; radius_1 <= 1000_m; radius_1 += 25_m) {
@@ -126,7 +126,7 @@ int main() {
       std::string name_1 = "CoREAS_R=" + std::to_string(rr_1) +
                            "_m--Phi=" + std::to_string(phi_1) + "degrees";
       TimeDomainObserver observer_1(name_1, point_1, rootCS, triggertime_1, duration_,
-                                   sampleRate_, triggertime_1);
+                                    sampleRate_, triggertime_1);
       detectorCoREAS.addObserver(observer_1);
     }
   }
diff --git a/examples/physics_examples/synchrotron_test_manual_tracking.cpp b/examples/physics_examples/synchrotron_test_manual_tracking.cpp
index b688d8a76..4b43e8e71 100644
--- a/examples/physics_examples/synchrotron_test_manual_tracking.cpp
+++ b/examples/physics_examples/synchrotron_test_manual_tracking.cpp
@@ -86,9 +86,9 @@ int main() {
 
   // create 2 observers
   TimeDomainObserver obs1("CoREAS observer", point1, rootCS, start, duration, sampleRate_,
-                           start);
+                          start);
   TimeDomainObserver obs2("ZHS observer", point1, rootCS, start, duration, sampleRate_,
-                           start);
+                          start);
 
   // construct a radio detector instance to store our observers
   ObserverCollection<TimeDomainObserver> detectorCoREAS;
diff --git a/tests/modules/testRadio.cpp b/tests/modules/testRadio.cpp
index 6a031b5de..ccd71042c 100644
--- a/tests/modules/testRadio.cpp
+++ b/tests/modules/testRadio.cpp
@@ -697,7 +697,7 @@ TEST_CASE("observers") {
     TimeType const groundHitTime(1e3_ns);
 
     TimeDomainObserver const observer("observer", obsPos, rootCS, tStart, duration,
-                                    sampleRate, groundHitTime);
+                                      sampleRate, groundHitTime);
 
     // All waveforms are of equal non-zero size
     CHECK(observer.getWaveformX().size() == observer.getWaveformY().size());
@@ -732,8 +732,8 @@ TEST_CASE("observers") {
                                            sampleRate, groundHitTime);
     TimeDomainObserver const observer_bad2("bad_observer", obsPos, rootCS, tStart, 0_ns,
                                            sampleRate, groundHitTime);
-    TimeDomainObserver const observer_bad3("bad_observer", obsPos, rootCS, tStart, duration,
-                                           -1_GHz, groundHitTime);
+    TimeDomainObserver const observer_bad3("bad_observer", obsPos, rootCS, tStart,
+                                           duration, -1_GHz, groundHitTime);
   } // END: SECTION("TimeDomainObserver Bad Constructor")
 
   SECTION("TimeDomainObserver Receive Efield") {
-- 
GitLab