From f25124e3a4f1397720a3d85e3a36c36ca017be6c Mon Sep 17 00:00:00 2001
From: Maximilian Reininghaus <maximilian.reininghaus@tu-dortmund.de>
Date: Fri, 2 Dec 2022 21:18:05 +0100
Subject: [PATCH] contd.

---
 .../detail/modules/thinning/EMThinning.inl    | 29 +++++++++++++++++++
 corsika/modules/thinning/EMThinning.hpp       | 13 +++++++--
 2 files changed, 40 insertions(+), 2 deletions(-)
 create mode 100644 corsika/detail/modules/thinning/EMThinning.inl

diff --git a/corsika/detail/modules/thinning/EMThinning.inl b/corsika/detail/modules/thinning/EMThinning.inl
new file mode 100644
index 000000000..9eea31d14
--- /dev/null
+++ b/corsika/detail/modules/thinning/EMThinning.inl
@@ -0,0 +1,29 @@
+/*
+ * (c) Copyright 2022 CORSIKA Project, corsika-project@lists.kit.edu
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include <corsika/framework/core/PhysicalUnits.hpp>
+#include <corsika/framework/process/SecondariesProcess.hpp>
+
+namespace corsika {
+
+EMThinning::EMThinning(HEPEnergyType threshold, double maxWeight) : threshold_{threshold}, maxWeight_{maxWeight} {}
+
+template <typename TStackView>
+    void EMThinning::doSecondaries(TStackView& view) {
+    if (view.size() != 2) return;
+    auto particle1 = view.begin();
+    auto particle2 = std::next(particle1);
+
+    if (.getCode())
+	corsika::HEPEnergyType const E0 = 
+    
+}
+
+}
diff --git a/corsika/modules/thinning/EMThinning.hpp b/corsika/modules/thinning/EMThinning.hpp
index 43ffe1bb9..017d0b770 100644
--- a/corsika/modules/thinning/EMThinning.hpp
+++ b/corsika/modules/thinning/EMThinning.hpp
@@ -17,17 +17,26 @@ namespace corsika {
  
 class EMThinning : public SecondariesProcess<EMThinning> {
 public:
-    
+	/**
+	 * Construct a new EMThinning process.
+	 * 
+	 * @param threshold: thinning applied below this energy
+	 * @param maxWeight: maximum allowed weight
+	 */
+    EMThinning(HEPEnergyType threshold, double maxWeight);
 
 
     /**
-     * Apply thinning to secondaries.
+     * Apply thinning to secondaries. Only EM primaries with two EM secondaries are considered.
      *
      * @tparam TStackView
      */
     template <typename TStackView>
     void doSecondaries(TStackView&);
 
+private:
+	HEPEnergyType const threshold_;
+	double const maxWeight_;
 };
 }
 
-- 
GitLab