diff --git a/corsika/detail/modules/sophia/ParticleConversion.inl b/corsika/detail/modules/sophia/ParticleConversion.inl index 0c9de7b2d06a7bdd00aaa9810c7a470b74e46773..3f41fb0071377c627f85f2beeb3d517b5d236d1e 100644 --- a/corsika/detail/modules/sophia/ParticleConversion.inl +++ b/corsika/detail/modules/sophia/ParticleConversion.inl @@ -10,7 +10,7 @@ #include <corsika/framework/core/ParticleProperties.hpp> -//#include <sibyll2.3d.hpp> +#include <sophia.hpp> namespace corsika::sophia { diff --git a/corsika/modules/sophia/ParticleConversion.hpp b/corsika/modules/sophia/ParticleConversion.hpp index a76dadb8cdd255e62a250c3cce80d3264819caa2..cd09b1df268a098a738ea77b73d1ce2856f4fb9b 100644 --- a/corsika/modules/sophia/ParticleConversion.hpp +++ b/corsika/modules/sophia/ParticleConversion.hpp @@ -1,5 +1,5 @@ /* - * (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu + * (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 @@ -11,7 +11,7 @@ #include <corsika/framework/core/ParticleProperties.hpp> #include <corsika/framework/core/PhysicalUnits.hpp> -//#include <sophia.hpp> +#include <sophia.hpp> #include <string> @@ -29,7 +29,7 @@ namespace corsika::sophia { // Pion = 2, // Kaon = 3, // }; - // using SibyllXSClassIntType = std::underlying_type<SibyllXSClass>::type; + //using SophiaXSClassIntType = std::underlying_type<SophiaXSClass>::type; #include <corsika/modules/sophia/Generated.inc> @@ -52,15 +52,15 @@ namespace corsika::sophia { return static_cast<int>(convertToSophia(code)); } - // int constexpr getSibyllXSCode(Code const code) { + // int constexpr getSophiaXSCode(Code const code) { // if (is_nucleus(code)) - // return static_cast<SibyllXSClassIntType>(SibyllXSClass::CannotInteract); - // return static_cast<SibyllXSClassIntType>( - // corsika2sibyllXStype[static_cast<CodeIntType>(code)]); + // return static_cast<SophiaXSClassIntType>(SophiaXSClass::CannotInteract); + // return static_cast<SophiaXSClassIntType>( + // corsika2sophiaXStype[static_cast<CodeIntType>(code)]); // } bool constexpr canInteract(Code const pCode) { - return (pCode == Code::Photon ? True : False); + return (pCode == Code::Photon ? true : false); } HEPMassType getSophiaMass(Code const); diff --git a/modules/sophia/CMakeLists.txt b/modules/sophia/CMakeLists.txt index 21ed06548a6cd30158bfb72b5088f8b67bc54ca8..49e6f3f6a07b828d3a33e9e7c7d33018b6a095a2 100644 --- a/modules/sophia/CMakeLists.txt +++ b/modules/sophia/CMakeLists.txt @@ -1,18 +1,17 @@ set ( MODEL_SOURCES -# sibyll2.3d.cpp eventgen.f - inpoutput.f + #inpoutput.f jetset74dp.f - sampling.f - SOPHIA20.f + #sampling.f + #SOPHIA20.f + sophia.cpp ) -#set ( -# MODEL_HEADERS -# sibyll2.3d.hpp -# nuclib.hpp -# ) +set ( + MODEL_HEADERS + sophia.hpp + ) enable_language (Fortran) add_library (Sophia_static STATIC ${MODEL_SOURCES}) diff --git a/modules/sophia/eventgen.f b/modules/sophia/eventgen.f index d9e31d561054e5bac7df64ee5c58ebac7c530335..037a7c33249d5bd5acbd048672ba58e2d621cabe 100644 --- a/modules/sophia/eventgen.f +++ b/modules/sophia/eventgen.f @@ -135,7 +135,7 @@ C IDB(23) = -ABS(IDB(23)) C**anfe 2016/01/20 Initialize the non-default RMMARD C** random number generator with default C** seed, if necessary - if (.not.(U(1,1).gt.0D0)) Call INIT_RMMARD(12345) +c if (.not.(U(1,1).gt.0D0)) Call INIT_RMMARD(12345) C incoming nucleon pm = AM(L0) P_nuc(1) = 0.D0 @@ -1268,7 +1268,7 @@ c ... for D1950: END C-> - DOUBLE PRECISION FUNCTION GAUSS (FUN, A,B) + DOUBLE PRECISION FUNCTION SO_GAUSS (FUN, A,B) c********************************************************* C Returns the 8 points Gauss-Legendre integral C of function FUN from A to B @@ -1298,7 +1298,7 @@ C........................................................... DX = XR*X(NJ) SS = SS + W(NJ) * (FUN(XM+DX) + FUN(XM-DX)) ENDDO - GAUSS = XR*SS + SO_GAUSS = XR*SS RETURN END @@ -1311,7 +1311,7 @@ c*************************** c** last change: 12/10/98 ** c** author: A.Muecke ** c*************************** - BLOCK DATA DATDEC + BLOCK DATA SO_DATDEC IMPLICIT DOUBLE PRECISION (A-H,O-Z) IMPLICIT INTEGER (I-N) SAVE diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d1c1d25c6c6b1e7d381c09513880e9eeabae41f2..f8d5df55a95bd8e4547d58322fecb6cc23e5f262 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,6 @@ add_subdirectory (framework/core) add_subdirectory (media) add_subdirectory (modules/sibyll) +add_subdirectory (modules/sophia) add_subdirectory (modules/qgsjetII) add_subdirectory (modules/epos) diff --git a/src/modules/sophia/code_generator.py b/src/modules/sophia/code_generator.py index b341dc1d699708ebba51a2ffa30e4e8186488711..8bc487989bcbc8737671dfed7cb22129c2534ff0 100755 --- a/src/modules/sophia/code_generator.py +++ b/src/modules/sophia/code_generator.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# (c) Copyright 2018-2019 CORSIKA Project, corsika-project@lists.kit.edu +# (c) Copyright 2022 CORSIKA Project, corsika-project@lists.kit.edu # # See file AUTHORS for a list of contributors. # @@ -48,7 +48,7 @@ def generate_sophia_enum(particle_db): ''' generates the enum to access sophia particles by readable names ''' - output = "enum class sophiaCode : int8_t {\n" + output = "enum class SophiaCode : int8_t {\n" for identifier, pData in particle_db.items(): if 'sophia_code' in pData: output += " {:s} = {:d},\n".format(identifier, pData['sophia_code']) @@ -61,13 +61,13 @@ def generate_corsika2sophia(particle_db): ''' generates the look-up table to convert corsika codes to sophia codes ''' - string = "std::array<sophiaCode, {:d}> constexpr corsika2sophia = {{\n".format(len(particle_db)) + string = "std::array<SophiaCode, {:d}> constexpr corsika2sophia = {{\n".format(len(particle_db)) for identifier, pData in particle_db.items(): if pData['isNucleus']: continue if 'sophia_code' in pData: - string += " sophiaCode::{:s}, \n".format(identifier) + string += " SophiaCode::{:s}, \n".format(identifier) else: - string += " sophiaCode::Unknown, // {:s}\n".format(identifier + ' not implemented in sophia') + string += " SophiaCode::Unknown, // {:s}\n".format(identifier + ' not implemented in sophia') string += "};\n" return string @@ -77,13 +77,13 @@ def generate_corsika2sophia_xsType(particle_db): ''' generates the look-up table to convert corsika codes to sophia codes ''' - string = "std::array<sophiaXSClass, {:d}> constexpr corsika2sophiaXStype = {{\n".format(len(particle_db)) + string = "std::array<SophiaXSClass, {:d}> constexpr corsika2sophiaXStype = {{\n".format(len(particle_db)) for identifier, pData in particle_db.items(): if pData['isNucleus']: continue if 'sophia_xsType' in pData: - string += " sophiaXSClass::{:s}, // {:s}\n".format(pData['sophia_xsType'], identifier) + string += " SophiaXSClass::{:s}, // {:s}\n".format(pData['sophia_xsType'], identifier) else: - string += " sophiaXSClass::CannotInteract, // {:s}\n".format(identifier + ' not implemented in sophia') + string += " SophiaXSClass::CannotInteract, // {:s}\n".format(identifier + ' not implemented in sophia') string += "};\n" return string @@ -99,7 +99,7 @@ def generate_sophia2corsika(particle_db) : if 'sophia_code' in pData: minID = min(minID, pData['sophia_code']) - string += "sophiaCodeIntType constexpr minsophia = {:d};\n\n".format(minID) + string += "SophiaCodeIntType constexpr minSophia = {:d};\n\n".format(minID) pDict = {} for identifier, pData in particle_db.items() : @@ -135,4 +135,4 @@ if __name__ == "__main__": print(generate_sophia_enum(particle_db), file=f) print(generate_corsika2sophia(particle_db), file=f) print(generate_sophia2corsika(particle_db), file=f) - print(generate_corsika2sophia_xsType(particle_db), file=f) + #print(generate_corsika2sophia_xsType(particle_db), file=f)