diff --git a/Documentation/Examples/CMakeLists.txt b/Documentation/Examples/CMakeLists.txt index 81c6fc535538d6789ee6170fbe44e6b2fb7fedd5..3cce0678741508b8de9453dd482e7626cd1cd7f9 100644 --- a/Documentation/Examples/CMakeLists.txt +++ b/Documentation/Examples/CMakeLists.txt @@ -2,6 +2,10 @@ CORSIKA_ADD_TEST (helix_example) target_link_libraries (helix_example CORSIKAgeometry CORSIKAunits) install (TARGETS helix_example DESTINATION share/examples) +CORSIKA_ADD_TEST (particle_list_example) +target_link_libraries (particle_list_example CORSIKAparticles CORSIKAunits CORSIKAprocesses ProcessSibyll ProcessQGSJetII) +install (TARGETS particle_list_example DESTINATION share/examples) + CORSIKA_ADD_TEST (geometry_example) target_link_libraries (geometry_example CORSIKAgeometry CORSIKAunits) install (TARGETS geometry_example DESTINATION share/examples) diff --git a/Documentation/Examples/particle_list_example.cc b/Documentation/Examples/particle_list_example.cc new file mode 100644 index 0000000000000000000000000000000000000000..659b0d0e0ae50a35bda1411efb33f3ea2b0ad130 --- /dev/null +++ b/Documentation/Examples/particle_list_example.cc @@ -0,0 +1,66 @@ +/* + * (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu + * + * See file AUTHORS for a list of contributors. + * + * 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. + */ + +#include <corsika/particles/ParticleProperties.h> +#include <corsika/process/ProcessSequence.h> +#include <corsika/process/qgsjetII/ParticleConversion.h> +#include <corsika/process/sibyll/ParticleConversion.h> +#include <corsika/setup/SetupEnvironment.h> +#include <corsika/units/PhysicalUnits.h> + +#include <iomanip> +#include <iostream> +#include <string> +using namespace corsika::units; +using namespace corsika::units::si; +using namespace corsika::particles; +using namespace std; + +// +// The example main program for a particle list +// +int main() { + cout << "------------------------------------------" + << "particles in CORSIKA" + << "------------------------------------------" << endl; + cout << std::setw(20) << "Name" + << " | " << std::setw(10) << "PDG-id" + << " | " << std::setw(10) << "SIBYLL-id" + << " | " << std::setw(10) << "QGSJETII-id" + << " | " << std::setw(18) << "PDG-mass (GeV)" + << " | " << std::setw(18) << "SIBYLL-mass (GeV)" + << " | " << endl; + cout << std::setw(104) << std::setfill('-') << "-" << endl; + for (auto p : getAllParticles()) { + if (!IsNucleus(p)) { + corsika::process::sibyll::SibyllCode sib_id = + corsika::process::sibyll::ConvertToSibyll(p); + auto const sib_mass = + (sib_id != corsika::process::sibyll::SibyllCode::Unknown + ? to_string(corsika::process::sibyll::GetSibyllMass(p) / 1_GeV) + : "--"); + auto const qgs_id = + corsika::process::qgsjetII::ConvertToQgsjetII(p); + cout << std::setw(20) << std::setfill(' ') << p << " | " << std::setw(10) + << static_cast<int>(GetPDG(p)) << " | " << std::setw(10) + << (sib_id != corsika::process::sibyll::SibyllCode::Unknown + ? to_string(static_cast<int>(sib_id)) + : "--") + << " | " << std::setw(10) + << (qgs_id != corsika::process::qgsjetII::QgsjetIICode::Unknown + ? to_string(static_cast<int>(qgs_id)) + : "--") + << " | " + << std::setw(18) << std::setprecision(5) << GetMass(p) / 1_GeV << " | " + << std::setw(18) << std::setprecision(5) << sib_mass << " | " << endl; + } + } + cout << std::setw(104) << std::setfill('-') << "-" << endl; +} diff --git a/Framework/Particles/ParticleProperties.h b/Framework/Particles/ParticleProperties.h index dbac43ac444f7411d63827655fd233a1b828ebf0..baafb57e754014f10ff9741d91af00fd1427f0fe 100644 --- a/Framework/Particles/ParticleProperties.h +++ b/Framework/Particles/ParticleProperties.h @@ -152,6 +152,10 @@ namespace corsika::particles { return Proton::GetMass() * vZ + (vA - vZ) * Neutron::GetMass(); } + std::initializer_list<Code> constexpr getAllParticles() { + return detail::all_particles; + } + } // namespace corsika::particles #endif diff --git a/Framework/Particles/pdxml_reader.py b/Framework/Particles/pdxml_reader.py index 7d1d3588a51d4117780e748ca96b565af2bd3af1..8c80bec9021cc2f798443c806f7bdd794d0752d5 100755 --- a/Framework/Particles/pdxml_reader.py +++ b/Framework/Particles/pdxml_reader.py @@ -316,6 +316,13 @@ def gen_properties(particle_db): # number of particles, size of tables string = "static constexpr std::size_t size = {size:d};\n".format(size = len(particle_db)) string += "\n" + + # all particle initializer_list + string += "constexpr std::initializer_list<Code> all_particles = {" + for k in particle_db: + string += " Code::{name:s},\n".format(name = k) + string += "};\n" + string += "\n" # particle masses table string += "static constexpr std::array<corsika::units::si::HEPMassType const, size> masses = {\n" diff --git a/Processes/QGSJetII/ParticleConversion.h b/Processes/QGSJetII/ParticleConversion.h index 9ee005390ef7fa7cd932f2773abb7ac146f644df..352db6b5f8047061c8fffca337d7ce54c62d9477 100644 --- a/Processes/QGSJetII/ParticleConversion.h +++ b/Processes/QGSJetII/ParticleConversion.h @@ -58,8 +58,7 @@ namespace corsika::process::qgsjetII { #include <corsika/process/qgsjetII/Generated.inc> QgsjetIICode constexpr ConvertToQgsjetII(corsika::particles::Code pCode) { - return static_cast<QgsjetIICode>( - corsika2qgsjetII[static_cast<corsika::particles::CodeIntType>(pCode)]); + return corsika2qgsjetII[static_cast<corsika::particles::CodeIntType>(pCode)]; } corsika::particles::Code constexpr ConvertFromQgsjetII(QgsjetIICode pCode) { diff --git a/Processes/QGSJetII/code_generator.py b/Processes/QGSJetII/code_generator.py index d8f9a46937c01cd2576731bd7fad002da9eb77bb..6fd456083b4b669c046c93b2e4dfe57eebed0e49 100755 --- a/Processes/QGSJetII/code_generator.py +++ b/Processes/QGSJetII/code_generator.py @@ -13,15 +13,26 @@ import pickle, sys, itertools -# loads the pickled particle_db (which is an OrderedDict) -# definition of particle_db dict is: "name", "antiName", "pdg", "mass", "electric_charge", "lifetime", "ngc_code", "isNucleus", "isHadron" def load_particledb(filename): + ''' + loads the pickled particle_db (which is an OrderedDict) + definition of particle_db dict is: "name", "antiName", "pdg", "mass", "electric_charge", "lifetime", "ngc_code", "isNucleus", "isHadron" + ''' with open(filename, "rb") as f: particle_db = pickle.load(f) return particle_db def set_default_qgsjetII_definition(particle_db): + ''' + Also particles not explicitly known by QGSJetII may in fact interact via mapping + to cross section types (xsType) and hadron type (hadronType) + + This is achieved here. + + The function return nothing, but modified the input particle_db by adding the + fields 'xsType' and 'hadronType' + ''' for identifier, pData in particle_db.items(): # the cross-section types xsType = "CannotInteract" @@ -43,7 +54,7 @@ def set_default_qgsjetII_definition(particle_db): hadronType = "PiPlusType" else: hadronType = "PiMinusType" - elif ((pdg>=300 and pdg<400) or pdg in [130, 10313, 10323]): # kanos + elif ((pdg>=300 and pdg<400) or pdg in [130, 10313, 10323]): # kaons xsType = "Kaons" if (charge>0): hadronType = "KaonPlusType" @@ -69,13 +80,15 @@ def set_default_qgsjetII_definition(particle_db): hadronType = "AntiProtonType" # all othe not-captured cased are hopefully irrelevant - pData['qgsjetII_xsType'] = xsType pData['qgsjetII_hadronType'] = hadronType -# read the qgsjet-codes data file def read_qgsjetII_codes(filename, particle_db): + ''' + reads the qgsjet-codes data file. For particles known to QGSJetII the 'qgsjetII_code' is set in the particle_db, as + well as the 'xsType' is updated in case it is different from its default value set above. + ''' with open(filename) as f: for line in f: line = line.strip() @@ -91,28 +104,36 @@ def read_qgsjetII_codes(filename, particle_db): raise Exception("Identifier '{:s}' not found in particle_db".format(identifier)) -# generates the enum to access qgsjetII particles by readable names def generate_qgsjetII_enum(particle_db): + ''' + generates the enum to access qgsjetII particles by readable names + ''' output = "enum class QgsjetIICode : int8_t {\n" for identifier, pData in particle_db.items(): - if pData.get('qgsjetII_code') != None: + if 'qgsjetII_code' in pData: output += " {:s} = {:d},\n".format(identifier, pData['qgsjetII_code']) output += "};\n" return output -# generates the look-up table to convert corsika codes to qgsjetII codes def generate_corsika2qgsjetII(particle_db): - string = "std::array<QgsjetIICodeIntType, {:d}> constexpr corsika2qgsjetII = {{\n".format(len(particle_db)) + ''' + generates the look-up table to convert corsika codes to qgsjetII codes + ''' + string = "std::array<QgsjetIICode, {:d}> constexpr corsika2qgsjetII = {{\n".format(len(particle_db)) for identifier, pData in particle_db.items(): - modelCode = pData.get("qgsjetII_code", 0) - string += " {:d}, // {:s}\n".format(modelCode, identifier if modelCode else identifier + " (not implemented in QGSJETII)") + if 'qgsjetII_code' in pData: + string += " QgsjetIICode::{:s}, \n".format(identifier) + else: + string += " QgsjetIICode::Unknown, // {:s}\n".format(identifier + ' not implemented in QGSJetII') string += "};\n" return string -# generates the look-up table to convert corsika codes to qgsjetII codes def generate_corsika2qgsjetII_xsType(particle_db): + ''' + generates the look-up table to convert corsika codes to qgsjetII codes + ''' string = "std::array<QgsjetIIXSClass, {:d}> constexpr corsika2qgsjetIIXStype = {{\n".format(len(particle_db)) for identifier, pData in particle_db.items(): modelCodeXS = pData.get("qgsjetII_xsType", "CannotInteract") @@ -121,8 +142,10 @@ def generate_corsika2qgsjetII_xsType(particle_db): return string -# generates the look-up table to convert corsika codes to qgsjetII codes def generate_corsika2qgsjetII_hadronType(particle_db): + ''' + generates the look-up table to convert corsika codes to qgsjetII codes + ''' string = "std::array<QgsjetIIHadronType, {:d}> constexpr corsika2qgsjetIIHadronType = {{\n".format(len(particle_db)) for identifier, pData in particle_db.items(): modelCode = pData.get("qgsjetII_hadronType", "UndefinedType") @@ -131,8 +154,10 @@ def generate_corsika2qgsjetII_hadronType(particle_db): return string -# generates the look-up table to convert qgsjetII codes to corsika codes def generate_qgsjetII2corsika(particle_db) : + ''' + generates the look-up table to convert qgsjetII codes to corsika codes + ''' minID = 0 for identifier, pData in particle_db.items() : if 'qgsjetII_code' in pData: diff --git a/Processes/QGSJetII/qgsjet-II-04-codes.dat b/Processes/QGSJetII/qgsjet-II-04-codes.dat index ff0595bf1173d91cb1b732c2f99c0b9c8264d233..8b1bee7c74fe678c6d8c1ca05f12d92c7fd634ad 100644 --- a/Processes/QGSJetII/qgsjet-II-04-codes.dat +++ b/Processes/QGSJetII/qgsjet-II-04-codes.dat @@ -1,6 +1,13 @@ # input file for particle conversion to/from QGSJet # the format of this file is: "corsika-identifier" "qgsjet-id" "xs-class" +# The 'Unknown' particle is needed to mark all particles qgsjetII does +# not know +# IMPORTANT Note: the code "20" MAY NOT BE USED by qgsjetII. Change to +# another positive integer if a conflict arises. Since we use std::array +# to store PID data keep the number as low as reasonable. +Unknown 20 CannotInteract + # Note, we list here only the particles, which are produced by # QGSJetII as secondaries. There is additional mapping of corsika # particles on QGSJetII "xs-class"es and "hadron-type"s, which are diff --git a/Processes/Sibyll/ParticleConversion.cc b/Processes/Sibyll/ParticleConversion.cc index 4a19f2fb92fc91880f93812f8215119c5772ea09..15a7c05b2bcfa3901ec988ed37ff4afca897fc6b 100644 --- a/Processes/Sibyll/ParticleConversion.cc +++ b/Processes/Sibyll/ParticleConversion.cc @@ -13,7 +13,15 @@ using namespace corsika::process::sibyll; -// const std::map<sibyll::PID, ParticleProperties::InternalParticleCode> -// process::sibyll::Sibyll2Corsika = { -// {PID::E_MINUS, InternalParticleCode::Electron}, -//}; +corsika::units::si::HEPMassType corsika::process::sibyll::GetSibyllMass( + corsika::particles::Code const pCode) { + using namespace corsika::units; + using namespace corsika::units::si; + if (pCode == corsika::particles::Code::Nucleus) + throw std::runtime_error("Cannot GetMass() of particle::Nucleus -> unspecified"); + auto sCode = ConvertToSibyllRaw(pCode); + if (sCode == 0) + throw std::runtime_error("GetSibyllMass: unknown particle!"); + else + return sqrt(get_sibyll_mass2(sCode)) * 1_GeV; +} diff --git a/Processes/Sibyll/ParticleConversion.h b/Processes/Sibyll/ParticleConversion.h index 62ccdda99f9a6d2f57a0e2b53437d8389f2e71e6..3cc31817212d4bb12606dd99ae88f5a31264e888 100644 --- a/Processes/Sibyll/ParticleConversion.h +++ b/Processes/Sibyll/ParticleConversion.h @@ -12,6 +12,8 @@ #define _include_processes_sibyll_particles_h_ #include <corsika/particles/ParticleProperties.h> +#include <corsika/process/sibyll/sibyll2.3c.h> +#include <corsika/units/PhysicalUnits.h> #include <string> @@ -20,11 +22,23 @@ namespace corsika::process::sibyll { enum class SibyllCode : int8_t; using SibyllCodeIntType = std::underlying_type<SibyllCode>::type; + /** + These are the possible projectile for which Sibyll knows the cross section + */ + enum class SibyllXSClass : int8_t { + CannotInteract = 0, + Baryon = 1, + Pion = 2, + Kaon = 3, + }; + using SibyllXSClassIntType = std::underlying_type<SibyllXSClass>::type; + + #include <corsika/process/sibyll/Generated.inc> SibyllCode constexpr ConvertToSibyll(corsika::particles::Code pCode) { - return static_cast<SibyllCode>( - corsika2sibyll[static_cast<corsika::particles::CodeIntType>(pCode)]); + return + corsika2sibyll[static_cast<corsika::particles::CodeIntType>(pCode)]; } corsika::particles::Code constexpr ConvertFromSibyll(SibyllCode pCode) { @@ -43,13 +57,15 @@ namespace corsika::process::sibyll { } int constexpr GetSibyllXSCode(corsika::particles::Code pCode) { - return corsika2sibyllXStype[static_cast<corsika::particles::CodeIntType>(pCode)]; + return static_cast<SibyllXSClassIntType>(corsika2sibyllXStype[static_cast<corsika::particles::CodeIntType>(pCode)]); } bool constexpr CanInteract(corsika::particles::Code pCode) { return GetSibyllXSCode(pCode) > 0; } + corsika::units::si::HEPMassType GetSibyllMass(corsika::particles::Code const); + } // namespace corsika::process::sibyll #endif diff --git a/Processes/Sibyll/code_generator.py b/Processes/Sibyll/code_generator.py index d2ca87c6f221bf169ad080a5dd06295016e025e4..7044c95e01df1c5507f8b1dd45b89d4634189ffa 100755 --- a/Processes/Sibyll/code_generator.py +++ b/Processes/Sibyll/code_generator.py @@ -13,65 +13,83 @@ import pickle, sys, itertools -# loads the pickled particle_db (which is an OrderedDict) def load_particledb(filename): + ''' + loads the pickled particle_db (which is an OrderedDict) + ''' with open(filename, "rb") as f: particle_db = pickle.load(f) return particle_db -# def read_sibyll_codes(filename, particle_db): + ''' + reads to sibyll codes data file + + For particls known to sibyll, add 'sibyll_code' and 'sibyll_xsType' to particle_db + ''' with open(filename) as f: for line in f: line = line.strip() - if line[0] == '#': + if len(line)==0 or line[0] == '#': continue identifier, sib_code, canInteractFlag, xsType = line.split() try: particle_db[identifier]["sibyll_code"] = int(sib_code) - particle_db[identifier]["sibyll_xsType"] = int(xsType) + particle_db[identifier]["sibyll_xsType"] = xsType except KeyError as e: raise Exception("Identifier '{:s}' not found in particle_db".format(identifier)) -# generates the enum to access sibyll particles by readable names def generate_sibyll_enum(particle_db): + ''' + generates the enum to access sibyll particles by readable names + ''' output = "enum class SibyllCode : int8_t {\n" for identifier, pData in particle_db.items(): - if pData.get('sibyll_code') != None: + if 'sibyll_code' in pData: output += " {:s} = {:d},\n".format(identifier, pData['sibyll_code']) output += "};\n" return output -# generates the look-up table to convert corsika codes to sibyll codes def generate_corsika2sibyll(particle_db): - string = "std::array<SibyllCodeIntType, {:d}> constexpr corsika2sibyll = {{\n".format(len(particle_db)) + ''' + generates the look-up table to convert corsika codes to sibyll codes + ''' + string = "std::array<SibyllCode, {:d}> constexpr corsika2sibyll = {{\n".format(len(particle_db)) for identifier, pData in particle_db.items(): - sibCode = pData.get("sibyll_code", 0) - string += " {:d}, // {:s}\n".format(sibCode, identifier if sibCode else identifier + " (not implemented in SIBYLL)") + if 'sibyll_code' in pData: + string += " SibyllCode::{:s}, \n".format(identifier) + else: + string += " SibyllCode::Unknown, // {:s}\n".format(identifier + ' not implemented in SIBYLL') string += "};\n" return string -# generates the look-up table to convert corsika codes to sibyll codes def generate_corsika2sibyll_xsType(particle_db): - string = "std::array<int, {:d}> constexpr corsika2sibyllXStype = {{\n".format(len(particle_db)) + ''' + generates the look-up table to convert corsika codes to sibyll codes + ''' + string = "std::array<SibyllXSClass, {:d}> constexpr corsika2sibyllXStype = {{\n".format(len(particle_db)) for identifier, pData in particle_db.items(): - sibCodeXS = pData.get("sibyll_xsType", 0) - string += " {:d}, // {:s}\n".format(sibCodeXS, identifier if sibCodeXS else identifier + " (not implemented in SIBYLL)") + if 'sibyll_xsType' in pData: + string += " SibyllXSClass::{:s}, // {:s}\n".format(pData['sibyll_xsType'], identifier) + else: + string += " SibyllXSClass::CannotInteract, // {:s}\n".format(identifier + ' not implemented in SIBYLL') string += "};\n" return string -# generates the look-up table to convert sibyll codes to corsika codes def generate_sibyll2corsika(particle_db) : + ''' + generates the look-up table to convert sibyll codes to corsika codes + ''' string = "" minID = 0 diff --git a/Processes/Sibyll/sibyll2.3d.cc b/Processes/Sibyll/sibyll2.3d.cc index 2bfb2ef9c078c0b871f8c0a89567bd67cda75c76..87469d719f4705fd7407e830d1d1e250ebe070c9 100644 --- a/Processes/Sibyll/sibyll2.3d.cc +++ b/Processes/Sibyll/sibyll2.3d.cc @@ -14,7 +14,7 @@ #include <random> int get_nwounded() { return s_chist_.nwd; } -double get_sibyll_mass2(int& id) { return s_mass1_.am2[id]; } +double get_sibyll_mass2(int& id) { return s_mass1_.am2[abs(id) - 1]; } double s_rndm_(int&) { static corsika::random::RNG& rng = diff --git a/Processes/Sibyll/sibyll_codes.dat b/Processes/Sibyll/sibyll_codes.dat index 3926dbab60629f56cfb0e7b6bb1ffda14b84737b..d8cce42e494585023d460a0a50635a12d44139fd 100644 --- a/Processes/Sibyll/sibyll_codes.dat +++ b/Processes/Sibyll/sibyll_codes.dat @@ -1,126 +1,132 @@ # input file for particle conversion to/from SIBYLL # the format of this file is: "corsika-identifier" "sibyll-id" "can-interact-in-sibyll" "cross-section-type" -Electron 3 0 0 -Positron 2 0 0 -NuE 15 0 0 -NuEBar 16 0 0 -MuMinus 5 0 0 -MuPlus 4 0 0 -NuMu 17 0 0 -NuMuBar 18 0 0 -TauMinus 91 0 0 -TauPlus 90 0 0 -NuTau 92 0 0 -NuTauBar 93 0 0 -Gamma 1 0 0 -Pi0 6 1 2 -# rho0 could interact but sibyll has no cross section/interaction length. was used for gamma had int -Rho0 27 0 0 -K0Long 11 1 3 -K0 21 0 3 -K0Bar 22 0 3 -PiPlus 7 1 2 -PiMinus 8 1 2 -RhoPlus 25 0 0 -RhoMinus 26 0 0 -Eta 23 0 0 -EtaPrime 24 0 0 -Pi1300Plus 62 0 0 -Pi1300Minus 63 0 0 -Pi1300_0 61 0 0 -Omega 32 0 0 -K0Short 12 1 3 -KStar0 30 0 0 -KStar0Bar 31 0 0 -KPlus 9 1 3 -KMinus 10 1 3 -KStarPlus 28 0 0 -KStarMinus 29 0 0 -KStar0_1430_0 66 0 0 -KStar0_1430_0Bar 67 0 0 -KStar0_1430_Plus 64 0 0 -KStar0_1430_MinusBar 65 0 0 -DPlus 59 1 3 -DMinus 60 1 3 -DStarPlus 78 0 0 -DStarMinus 79 0 0 -D0 71 1 3 -D0Bar 72 1 3 -DStar0 80 0 0 -DStar0Bar 81 0 0 -DsPlus 74 1 3 -DsMinus 75 1 3 -DStarSPlus 76 0 0 -DStarSMinus 77 0 0 -EtaC 73 0 0 -Neutron 14 1 1 -AntiNeutron -14 1 1 -Delta0 42 0 0 -Delta0Bar -42 0 0 -DeltaMinus 43 0 0 -DeltaPlusBar -43 0 0 -Proton 13 1 1 -AntiProton -13 1 1 -N1440Plus 51 0 0 -N1440MinusBar -51 0 0 -N1440_0 52 0 0 -N1440_0Bar -52 0 0 -N1710Plus 53 0 0 -N1710MinusBar -53 0 0 -N1710_0 54 0 0 -N1710_0Bar -54 0 0 -DeltaPlus 41 0 0 -DeltaMinusBar -41 0 0 -DeltaPlusPlus 40 0 0 -DeltaMinusMinusBar -40 0 0 -SigmaMinus 36 1 1 -SigmaPlusBar -36 1 1 -SigmaStarMinus 46 0 0 -SigmaStarPlusBar -46 0 0 -SigmaStarPlus 44 0 0 -SigmaStarMinusBar -44 0 0 -SigmaStar0 45 0 0 -SigmaStar0Bar -45 0 0 -Lambda0 39 1 1 -Lambda0Bar -39 1 1 -Sigma0 35 1 1 -Sigma0Bar -35 1 1 -SigmaPlus 34 1 1 -SigmaMinusBar -34 1 1 -XiMinus 38 1 1 -XiPlusBar -38 1 1 -Xi0 37 1 1 -Xi0Bar -37 1 1 -XiStarMinus 48 0 0 -XiStarPlusBar -48 0 0 -XiStar0 47 0 0 -XiStar0Bar -47 0 0 -OmegaMinus 49 0 0 -OmegaPlusBar -49 0 0 -SigmaC0 86 0 0 -SigmaC0Bar -86 0 0 -SigmaStarC0 96 0 0 -SigmaStarC0Bar -96 0 0 -LambdaCPlus 89 1 1 -LambdaCMinusBar -89 1 1 -XiC0 88 1 1 -XiC0Bar -88 1 1 -SigmaCPlus 85 0 0 -SigmaCMinusBar -85 0 0 -SigmaStarCPlus 95 0 0 -SigmaStarCMinusBar -95 0 0 -SigmaCPlusPlus 84 0 0 -SigmaCMinusMinusBar -84 0 0 -SigmaStarCPlusPlus 94 0 0 -SigmaStarCMinusMinusBar -94 0 0 -XiCPlus 87 1 1 -XiCMinusBar -87 1 1 -XiStarCPlus 97 0 0 -XiStarCMinusBar -97 0 0 -XiStarC0 98 0 0 -XiStarC0Bar -98 0 0 -OmegaC0 99 0 0 -OmegaC0Bar -99 0 0 -Jpsi 83 0 0 -Phi 33 0 0 -#Unknown 0 0 0 + +# The unknown particle is to handle all particles that are not known to SIBYLL. +# It is important that sibyll-id does not overlap with any existing sibyll particle! +# Be careful +Unknown 0 0 CannotInteract + +# Here is the list of particles known to sibyll +Electron 3 0 CannotInteract +Positron 2 0 CannotInteract +NuE 15 0 CannotInteract +NuEBar 16 0 CannotInteract +MuMinus 5 0 CannotInteract +MuPlus 4 0 CannotInteract +NuMu 17 0 CannotInteract +NuMuBar 18 0 CannotInteract +TauMinus 91 0 CannotInteract +TauPlus 90 0 CannotInteract +NuTau 92 0 CannotInteract +NuTauBar 93 0 CannotInteract +Gamma 1 0 CannotInteract +Pi0 6 1 Pion +# rho0 could interact but sibyll has no cross section/interaction length. was used for gamma had int +Rho0 27 0 CannotInteract +K0Long 11 1 Kaon +K0 21 0 Kaon +K0Bar 22 0 Kaon +PiPlus 7 1 Pion +PiMinus 8 1 Pion +RhoPlus 25 0 CannotInteract +RhoMinus 26 0 CannotInteract +Eta 23 0 CannotInteract +EtaPrime 24 0 CannotInteract +Pi1300Plus 62 0 CannotInteract +Pi1300Minus 63 0 CannotInteract +Pi1300_0 61 0 CannotInteract +Omega 32 0 CannotInteract +K0Short 12 1 Kaon +KStar0 30 0 CannotInteract +KStar0Bar 31 0 CannotInteract +KPlus 9 1 Kaon +KMinus 10 1 Kaon +KStarPlus 28 0 CannotInteract +KStarMinus 29 0 CannotInteract +KStar0_1430_0 66 0 CannotInteract +KStar0_1430_0Bar 67 0 CannotInteract +KStar0_1430_Plus 64 0 CannotInteract +KStar0_1430_MinusBar 65 0 CannotInteract +DPlus 59 1 Kaon +DMinus 60 1 Kaon +DStarPlus 78 0 CannotInteract +DStarMinus 79 0 CannotInteract +D0 71 1 Kaon +D0Bar 72 1 Kaon +DStar0 80 0 CannotInteract +DStar0Bar 81 0 CannotInteract +DsPlus 74 1 Kaon +DsMinus 75 1 Kaon +DStarSPlus 76 0 CannotInteract +DStarSMinus 77 0 CannotInteract +EtaC 73 0 CannotInteract +Neutron 14 1 Baryon +AntiNeutron -14 1 Baryon +Delta0 42 0 CannotInteract +Delta0Bar -42 0 CannotInteract +DeltaMinus 43 0 CannotInteract +DeltaPlusBar -43 0 CannotInteract +Proton 13 1 Baryon +AntiProton -13 1 Baryon +N1440Plus 51 0 CannotInteract +N1440MinusBar -51 0 CannotInteract +N1440_0 52 0 CannotInteract +N1440_0Bar -52 0 CannotInteract +N1710Plus 53 0 CannotInteract +N1710MinusBar -53 0 CannotInteract +N1710_0 54 0 CannotInteract +N1710_0Bar -54 0 CannotInteract +DeltaPlus 41 0 CannotInteract +DeltaMinusBar -41 0 CannotInteract +DeltaPlusPlus 40 0 CannotInteract +DeltaMinusMinusBar -40 0 CannotInteract +SigmaMinus 36 1 Baryon +SigmaPlusBar -36 1 Baryon +SigmaStarMinus 46 0 CannotInteract +SigmaStarPlusBar -46 0 CannotInteract +SigmaStarPlus 44 0 CannotInteract +SigmaStarMinusBar -44 0 CannotInteract +SigmaStar0 45 0 CannotInteract +SigmaStar0Bar -45 0 CannotInteract +Lambda0 39 1 Baryon +Lambda0Bar -39 1 Baryon +Sigma0 35 1 Baryon +Sigma0Bar -35 1 Baryon +SigmaPlus 34 1 Baryon +SigmaMinusBar -34 1 Baryon +XiMinus 38 1 Baryon +XiPlusBar -38 1 Baryon +Xi0 37 1 Baryon +Xi0Bar -37 1 Baryon +XiStarMinus 48 0 CannotInteract +XiStarPlusBar -48 0 CannotInteract +XiStar0 47 0 CannotInteract +XiStar0Bar -47 0 CannotInteract +OmegaMinus 49 0 CannotInteract +OmegaPlusBar -49 0 CannotInteract +SigmaC0 86 0 CannotInteract +SigmaC0Bar -86 0 CannotInteract +SigmaStarC0 96 0 CannotInteract +SigmaStarC0Bar -96 0 CannotInteract +LambdaCPlus 89 1 Baryon +LambdaCMinusBar -89 1 Baryon +XiC0 88 1 Baryon +XiC0Bar -88 1 Baryon +SigmaCPlus 85 0 CannotInteract +SigmaCMinusBar -85 0 CannotInteract +SigmaStarCPlus 95 0 CannotInteract +SigmaStarCMinusBar -95 0 CannotInteract +SigmaCPlusPlus 84 0 CannotInteract +SigmaCMinusMinusBar -84 0 CannotInteract +SigmaStarCPlusPlus 94 0 CannotInteract +SigmaStarCMinusMinusBar -94 0 CannotInteract +XiCPlus 87 1 Baryon +XiCMinusBar -87 1 Baryon +XiStarCPlus 97 0 CannotInteract +XiStarCMinusBar -97 0 CannotInteract +XiStarC0 98 0 CannotInteract +XiStarC0Bar -98 0 CannotInteract +OmegaC0 99 0 CannotInteract +OmegaC0Bar -99 0 CannotInteract +Jpsi 83 0 CannotInteract +Phi 33 0 CannotInteract diff --git a/Processes/Sibyll/testSibyll.cc b/Processes/Sibyll/testSibyll.cc index 38be32690dbee80fd15352e9298f6300741a2a16..779529e765e42aa97e10d4ec64ea7c992979f38d 100644 --- a/Processes/Sibyll/testSibyll.cc +++ b/Processes/Sibyll/testSibyll.cc @@ -24,6 +24,8 @@ using namespace corsika; using namespace corsika::process::sibyll; +using namespace corsika::units; +using namespace corsika::units::si; TEST_CASE("Sibyll", "[processes]") { @@ -59,6 +61,11 @@ TEST_CASE("Sibyll", "[processes]") { REQUIRE(process::sibyll::GetSibyllXSCode(particles::Code::SigmaPlus) == 1); REQUIRE(process::sibyll::GetSibyllXSCode(particles::Code::PiMinus) == 2); } + + SECTION("sibyll mass") { + + REQUIRE_FALSE(process::sibyll::GetSibyllMass(particles::Code::Electron) == 0_GeV); + } } #include <corsika/geometry/Point.h>