From 7d8606929c4a0f1fad341a2fdf53b3df8be837d5 Mon Sep 17 00:00:00 2001
From: Maximilian Reininghaus <maximilian.reininghaus@kit.edu>
Date: Thu, 4 Apr 2019 11:26:42 -0300
Subject: [PATCH] some cleanup

---
 Environment/BaseExponential.h               | 13 ++++++-------
 Environment/FlatAtmosphere/FlatAtmosphere.h | 10 ----------
 Environment/FlatExponential.h               | 21 ++++++++++-----------
 Environment/SlidingPlanarExponential.h      | 19 +++++++++----------
 4 files changed, 25 insertions(+), 38 deletions(-)
 delete mode 100644 Environment/FlatAtmosphere/FlatAtmosphere.h

diff --git a/Environment/BaseExponential.h b/Environment/BaseExponential.h
index 028aa79a..ba9f85d5 100644
--- a/Environment/BaseExponential.h
+++ b/Environment/BaseExponential.h
@@ -50,16 +50,15 @@ namespace corsika::environment {
      */
     // clang-format on
     units::si::GrammageType IntegratedGrammage(
-        geometry::Trajectory<geometry::Line> const& line,
-        units::si::LengthType pTo,
+        geometry::Trajectory<geometry::Line> const& line, units::si::LengthType to,
         geometry::Vector<units::si::dimensionless_d> const& axis) const {
       auto const vDotA = line.NormalizedDirection().dot(axis).magnitude();
       auto const rhoStart = GetImplementation().GetMassDensity(line.GetR0());
 
       if (vDotA == 0) {
-        return pTo * rhoStart;
+        return to * rhoStart;
       } else {
-        return rhoStart * (fLambda / vDotA) * (exp(vDotA * pTo * fInvLambda) - 1);
+        return rhoStart * (fLambda / vDotA) * (exp(vDotA * to * fInvLambda) - 1);
       }
     }
 
@@ -83,15 +82,15 @@ namespace corsika::environment {
     // clang-format on
     units::si::LengthType ArclengthFromGrammage(
         geometry::Trajectory<corsika::geometry::Line> const& line,
-        units::si::GrammageType pGrammage,
+        units::si::GrammageType grammage,
         geometry::Vector<units::si::dimensionless_d> const& axis) const {
       auto const vDotA = line.NormalizedDirection().dot(axis).magnitude();
       auto const rhoStart = GetImplementation().GetMassDensity(line.GetR0());
 
       if (vDotA == 0) {
-        return pGrammage / rhoStart;
+        return grammage / rhoStart;
       } else {
-        auto const logArg = pGrammage * fInvLambda * vDotA / rhoStart + 1;
+        auto const logArg = grammage * fInvLambda * vDotA / rhoStart + 1;
         if (logArg > 0) {
           return fLambda / vDotA * log(logArg);
         } else {
diff --git a/Environment/FlatAtmosphere/FlatAtmosphere.h b/Environment/FlatAtmosphere/FlatAtmosphere.h
deleted file mode 100644
index 6839def4..00000000
--- a/Environment/FlatAtmosphere/FlatAtmosphere.h
+++ /dev/null
@@ -1,10 +0,0 @@
-
-/*
- * (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu
- *
- * See file AUTHORS for a list of contributors.
- *
- * This software is distributed under the terms of the GNU General Public
- * Licence version 3 (GPL Version 3). See file LICENSE for a full version of
- * the license.
- */
diff --git a/Environment/FlatExponential.h b/Environment/FlatExponential.h
index ef8cdc9a..123d0d0d 100644
--- a/Environment/FlatExponential.h
+++ b/Environment/FlatExponential.h
@@ -20,7 +20,7 @@
 #include <corsika/units/PhysicalUnits.h>
 
 namespace corsika::environment {
-  
+
   //clang-format off
   /**
    * flat exponential density distribution with
@@ -48,23 +48,22 @@ namespace corsika::environment {
         , fAxis(axis)
         , fNuclComp(nuclComp) {}
 
-    corsika::units::si::MassDensityType GetMassDensity(
-        corsika::geometry::Point const& p) const override {
+    units::si::MassDensityType GetMassDensity(geometry::Point const& p) const override {
       return Base::fRho0 * exp(Base::fInvLambda * (p - Base::fP0).dot(fAxis));
     }
 
     NuclearComposition const& GetNuclearComposition() const override { return fNuclComp; }
 
-    corsika::units::si::GrammageType IntegratedGrammage(
-        corsika::geometry::Trajectory<corsika::geometry::Line> const& line,
-        corsika::units::si::LengthType pTo) const override {
-      return Base::IntegratedGrammage(line, pTo, fAxis);
+    units::si::GrammageType IntegratedGrammage(
+        geometry::Trajectory<geometry::Line> const& line,
+        units::si::LengthType to) const override {
+      return Base::IntegratedGrammage(line, to, fAxis);
     }
 
-    corsika::units::si::LengthType ArclengthFromGrammage(
-        corsika::geometry::Trajectory<corsika::geometry::Line> const& line,
-        corsika::units::si::GrammageType pGrammage) const override {
-      return Base::ArclengthFromGrammage(line, pGrammage, fAxis);
+    units::si::LengthType ArclengthFromGrammage(
+        geometry::Trajectory<geometry::Line> const& line,
+        units::si::GrammageType grammage) const override {
+      return Base::ArclengthFromGrammage(line, grammage, fAxis);
     }
   };
 } // namespace corsika::environment
diff --git a/Environment/SlidingPlanarExponential.h b/Environment/SlidingPlanarExponential.h
index faa36339..476bb016 100644
--- a/Environment/SlidingPlanarExponential.h
+++ b/Environment/SlidingPlanarExponential.h
@@ -45,26 +45,25 @@ namespace corsika::environment {
         : Base(p0, rho, lambda)
         , fNuclComp(nuclComp) {}
 
-    corsika::units::si::MassDensityType GetMassDensity(
-        corsika::geometry::Point const& p) const override {
+    units::si::MassDensityType GetMassDensity(geometry::Point const& p) const override {
       auto const height = (p - Base::fP0).norm();
       return Base::fRho0 * exp(Base::fInvLambda * height);
     }
 
     NuclearComposition const& GetNuclearComposition() const override { return fNuclComp; }
 
-    corsika::units::si::GrammageType IntegratedGrammage(
-        corsika::geometry::Trajectory<corsika::geometry::Line> const& line,
-        corsika::units::si::LengthType pTo) const override {
+    units::si::GrammageType IntegratedGrammage(
+        geometry::Trajectory<geometry::Line> const& line,
+        units::si::LengthType to) const override {
       auto const axis = (line.GetR0() - Base::fP0).normalized();
-      return Base::IntegratedGrammage(line, pTo, axis);
+      return Base::IntegratedGrammage(line, to, axis);
     }
 
-    corsika::units::si::LengthType ArclengthFromGrammage(
-        corsika::geometry::Trajectory<corsika::geometry::Line> const& line,
-        corsika::units::si::GrammageType pGrammage) const override {
+    units::si::LengthType ArclengthFromGrammage(
+        geometry::Trajectory<geometry::Line> const& line,
+        units::si::GrammageType grammage) const override {
       auto const axis = (line.GetR0() - Base::fP0).normalized();
-      return Base::ArclengthFromGrammage(line, pGrammage, axis);
+      return Base::ArclengthFromGrammage(line, grammage, axis);
     }
   };
 
-- 
GitLab