From 6f2cbd143c27154b6381944d850484c0f80de39f Mon Sep 17 00:00:00 2001
From: Remy Prechelt <prechelt@hawaii.edu>
Date: Fri, 22 Oct 2021 03:17:53 +0200
Subject: [PATCH] Moved eprima closer to use in CONEX.

---
 corsika/detail/modules/conex/CONEXhybrid.inl | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/corsika/detail/modules/conex/CONEXhybrid.inl b/corsika/detail/modules/conex/CONEXhybrid.inl
index be172091f..00e79005e 100644
--- a/corsika/detail/modules/conex/CONEXhybrid.inl
+++ b/corsika/detail/modules/conex/CONEXhybrid.inl
@@ -101,8 +101,6 @@ namespace corsika {
 
   inline void CONEXhybrid::initCascadeEquations() {
 
-    double eprima = primaryEnergy_ / 1_GeV;
-
     // set phi, theta
     Vector<length_d> ez{conexObservationCS_, {0._m, 0._m, -1_m}};
     auto const c = showerAxis_.getDirection().dot(ez) / 1_m;
@@ -128,6 +126,7 @@ namespace corsika {
     // the CORSIKA 8 stream "conex" and "epos"!
     std::array<int, 3> ioseed{1, 1, 1};
 
+    double eprima = primaryEnergy_ / 1_GeV;
     double xminp = injectionHeight_ / 1_m;
 
     ::conex::conexrun_(ipart, eprima, theta, phi, xminp, dimpact, ioseed.data());
-- 
GitLab