diff --git a/corsika/detail/modules/conex/CONEXhybrid.inl b/corsika/detail/modules/conex/CONEXhybrid.inl index 1e84975f4c6904351f5be1af56c190e5a1eab156..95b47ace8557957b9a0ca7ec96a9a304f9699f9a 100644 --- a/corsika/detail/modules/conex/CONEXhybrid.inl +++ b/corsika/detail/modules/conex/CONEXhybrid.inl @@ -80,7 +80,9 @@ namespace corsika { CORSIKA_LOG_DEBUG("showerCore (C8): {}", showerCore_.getCoordinates(center.getCoordinateSystem())); - int randomSeeds[3] = {1234, 0, 0}; // will be overwritten later?? + int randomSeeds[3] = {1234, 0, + 0}; // SEEDS ARE NOT USED. All random numbers are obtained from + // the CORSIKA 8 stream "conex" and "epos"! int heModel = eSibyll23; int nShower = 1; // large to avoid final stats. @@ -118,13 +120,13 @@ namespace corsika { theta, phi); int ipart = static_cast<int>(primaryPDG_); - auto rng = RNGManager<>::getInstance().getRandomStream("conex"); double dimpact = 0.; // valid only if shower core is fixed on the observation plane; // for skimming showers an offset is needed like in CONEX - std::array<int, 3> ioseed{static_cast<int>(rng()), static_cast<int>(rng()), - static_cast<int>(rng())}; + // SEEDS ARE NOT USED. All random numbers are obtained from + // the CORSIKA 8 stream "conex" and "epos"! + std::array<int, 3> ioseed{1,1,1}; double xminp = injectionHeight_ / 1_m; diff --git a/corsika/modules/conex/Random.hpp b/corsika/modules/conex/Random.hpp index a638a330857ebc2c011c82237df2dd4a1a1f08eb..9532eace8ed29d4322def04b5ad5fee64761b366 100644 --- a/corsika/modules/conex/Random.hpp +++ b/corsika/modules/conex/Random.hpp @@ -17,6 +17,19 @@ * This file is an integral part of the epos interface. It must be * linked to the executable linked to epos exactly once * + * Note, that the fortran random numbe interface functions are all + * defined in the epos corsika 8 interface: + * + * ranfst, ranfgt, rmmaqd, ranfini, ranfcv, rmmard, rangen, drangen + * + * All of them use the epos_random_interface registered as "epos" stream. + * + * Thus, the fortran part of CONEX will use the "epos" CORSIKA 8 random stream, + * only the CONEX c++ part will use the "conex" random stream. + * + * Since EPOS and CONEX use the same fortran symbols for access to + * random numbers this can only be changed by renaming inside the + * fortran part. */ namespace conex { diff --git a/tests/modules/testCONEX.cpp b/tests/modules/testCONEX.cpp index f86dd7b2d642c58278995823b9a250d27b36926c..5a943cd0119a19373a6ff224220494fc268de804 100644 --- a/tests/modules/testCONEX.cpp +++ b/tests/modules/testCONEX.cpp @@ -101,7 +101,8 @@ TEST_CASE("CONEXSourceCut") { [[maybe_unused]] corsika::sibyll::NuclearInteraction sibyllNuc(sibyll, env); CONEXhybrid conex(center, showerAxis, t, injectionHeight, E0, get_PDG(Code::Proton)); - + conex.init(); + HEPEnergyType const Eem{1_PeV}; auto const momentum = showerAxis.getDirection() * Eem;