IAP GITLAB

Skip to content
Snippets Groups Projects
Commit bebde23f authored by Felix Riehn's avatar Felix Riehn Committed by Maximilian Reininghaus
Browse files

fixes

parent 61106845
No related branches found
No related tags found
1 merge request!465Resolve "SOPHIA for low energy photo-hadronic interaction"
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <corsika/framework/core/ParticleProperties.hpp> #include <corsika/framework/core/ParticleProperties.hpp>
//#include <sibyll2.3d.hpp> #include <sophia.hpp>
namespace corsika::sophia { namespace corsika::sophia {
......
/* /*
* (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 * 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 * Licence version 3 (GPL Version 3). See file LICENSE for a full version of
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include <corsika/framework/core/ParticleProperties.hpp> #include <corsika/framework/core/ParticleProperties.hpp>
#include <corsika/framework/core/PhysicalUnits.hpp> #include <corsika/framework/core/PhysicalUnits.hpp>
//#include <sophia.hpp> #include <sophia.hpp>
#include <string> #include <string>
...@@ -29,7 +29,7 @@ namespace corsika::sophia { ...@@ -29,7 +29,7 @@ namespace corsika::sophia {
// Pion = 2, // Pion = 2,
// Kaon = 3, // Kaon = 3,
// }; // };
// using SibyllXSClassIntType = std::underlying_type<SibyllXSClass>::type; //using SophiaXSClassIntType = std::underlying_type<SophiaXSClass>::type;
#include <corsika/modules/sophia/Generated.inc> #include <corsika/modules/sophia/Generated.inc>
...@@ -52,15 +52,15 @@ namespace corsika::sophia { ...@@ -52,15 +52,15 @@ namespace corsika::sophia {
return static_cast<int>(convertToSophia(code)); return static_cast<int>(convertToSophia(code));
} }
// int constexpr getSibyllXSCode(Code const code) { // int constexpr getSophiaXSCode(Code const code) {
// if (is_nucleus(code)) // if (is_nucleus(code))
// return static_cast<SibyllXSClassIntType>(SibyllXSClass::CannotInteract); // return static_cast<SophiaXSClassIntType>(SophiaXSClass::CannotInteract);
// return static_cast<SibyllXSClassIntType>( // return static_cast<SophiaXSClassIntType>(
// corsika2sibyllXStype[static_cast<CodeIntType>(code)]); // corsika2sophiaXStype[static_cast<CodeIntType>(code)]);
// } // }
bool constexpr canInteract(Code const pCode) { bool constexpr canInteract(Code const pCode) {
return (pCode == Code::Photon ? True : False); return (pCode == Code::Photon ? true : false);
} }
HEPMassType getSophiaMass(Code const); HEPMassType getSophiaMass(Code const);
......
set ( set (
MODEL_SOURCES MODEL_SOURCES
# sibyll2.3d.cpp
eventgen.f eventgen.f
inpoutput.f #inpoutput.f
jetset74dp.f jetset74dp.f
sampling.f #sampling.f
SOPHIA20.f #SOPHIA20.f
sophia.cpp
) )
#set ( set (
# MODEL_HEADERS MODEL_HEADERS
# sibyll2.3d.hpp sophia.hpp
# nuclib.hpp )
# )
enable_language (Fortran) enable_language (Fortran)
add_library (Sophia_static STATIC ${MODEL_SOURCES}) add_library (Sophia_static STATIC ${MODEL_SOURCES})
......
...@@ -135,7 +135,7 @@ C IDB(23) = -ABS(IDB(23)) ...@@ -135,7 +135,7 @@ C IDB(23) = -ABS(IDB(23))
C**anfe 2016/01/20 Initialize the non-default RMMARD C**anfe 2016/01/20 Initialize the non-default RMMARD
C** random number generator with default C** random number generator with default
C** seed, if necessary 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 C incoming nucleon
pm = AM(L0) pm = AM(L0)
P_nuc(1) = 0.D0 P_nuc(1) = 0.D0
...@@ -1268,7 +1268,7 @@ c ... for D1950: ...@@ -1268,7 +1268,7 @@ c ... for D1950:
END END
C-> C->
DOUBLE PRECISION FUNCTION GAUSS (FUN, A,B) DOUBLE PRECISION FUNCTION SO_GAUSS (FUN, A,B)
c********************************************************* c*********************************************************
C Returns the 8 points Gauss-Legendre integral C Returns the 8 points Gauss-Legendre integral
C of function FUN from A to B C of function FUN from A to B
...@@ -1298,7 +1298,7 @@ C........................................................... ...@@ -1298,7 +1298,7 @@ C...........................................................
DX = XR*X(NJ) DX = XR*X(NJ)
SS = SS + W(NJ) * (FUN(XM+DX) + FUN(XM-DX)) SS = SS + W(NJ) * (FUN(XM+DX) + FUN(XM-DX))
ENDDO ENDDO
GAUSS = XR*SS SO_GAUSS = XR*SS
RETURN RETURN
END END
...@@ -1311,7 +1311,7 @@ c*************************** ...@@ -1311,7 +1311,7 @@ c***************************
c** last change: 12/10/98 ** c** last change: 12/10/98 **
c** author: A.Muecke ** c** author: A.Muecke **
c*************************** c***************************
BLOCK DATA DATDEC BLOCK DATA SO_DATDEC
IMPLICIT DOUBLE PRECISION (A-H,O-Z) IMPLICIT DOUBLE PRECISION (A-H,O-Z)
IMPLICIT INTEGER (I-N) IMPLICIT INTEGER (I-N)
SAVE SAVE
......
add_subdirectory (framework/core) add_subdirectory (framework/core)
add_subdirectory (media) add_subdirectory (media)
add_subdirectory (modules/sibyll) add_subdirectory (modules/sibyll)
add_subdirectory (modules/sophia)
add_subdirectory (modules/qgsjetII) add_subdirectory (modules/qgsjetII)
add_subdirectory (modules/epos) add_subdirectory (modules/epos)
#!/usr/bin/env python3 #!/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. # See file AUTHORS for a list of contributors.
# #
...@@ -48,7 +48,7 @@ def generate_sophia_enum(particle_db): ...@@ -48,7 +48,7 @@ def generate_sophia_enum(particle_db):
''' '''
generates the enum to access sophia particles by readable names 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(): for identifier, pData in particle_db.items():
if 'sophia_code' in pData: if 'sophia_code' in pData:
output += " {:s} = {:d},\n".format(identifier, pData['sophia_code']) output += " {:s} = {:d},\n".format(identifier, pData['sophia_code'])
...@@ -61,13 +61,13 @@ def generate_corsika2sophia(particle_db): ...@@ -61,13 +61,13 @@ def generate_corsika2sophia(particle_db):
''' '''
generates the look-up table to convert corsika codes to sophia codes 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(): for identifier, pData in particle_db.items():
if pData['isNucleus']: continue if pData['isNucleus']: continue
if 'sophia_code' in pData: if 'sophia_code' in pData:
string += " sophiaCode::{:s}, \n".format(identifier) string += " SophiaCode::{:s}, \n".format(identifier)
else: 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" string += "};\n"
return string return string
...@@ -77,13 +77,13 @@ def generate_corsika2sophia_xsType(particle_db): ...@@ -77,13 +77,13 @@ def generate_corsika2sophia_xsType(particle_db):
''' '''
generates the look-up table to convert corsika codes to sophia codes 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(): for identifier, pData in particle_db.items():
if pData['isNucleus']: continue if pData['isNucleus']: continue
if 'sophia_xsType' in pData: 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: 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" string += "};\n"
return string return string
...@@ -99,7 +99,7 @@ def generate_sophia2corsika(particle_db) : ...@@ -99,7 +99,7 @@ def generate_sophia2corsika(particle_db) :
if 'sophia_code' in pData: if 'sophia_code' in pData:
minID = min(minID, pData['sophia_code']) 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 = {} pDict = {}
for identifier, pData in particle_db.items() : for identifier, pData in particle_db.items() :
...@@ -135,4 +135,4 @@ if __name__ == "__main__": ...@@ -135,4 +135,4 @@ if __name__ == "__main__":
print(generate_sophia_enum(particle_db), file=f) print(generate_sophia_enum(particle_db), file=f)
print(generate_corsika2sophia(particle_db), file=f) print(generate_corsika2sophia(particle_db), file=f)
print(generate_sophia2corsika(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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment