IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 834b8841 authored by Felix Riehn's avatar Felix Riehn
Browse files

added sibyll masses to list

parent a32b6b5b
No related branches found
No related tags found
No related merge requests found
...@@ -9,10 +9,10 @@ ...@@ -9,10 +9,10 @@
*/ */
#include <corsika/particles/ParticleProperties.h> #include <corsika/particles/ParticleProperties.h>
#include <corsika/units/PhysicalUnits.h>
#include <corsika/process/ProcessSequence.h> #include <corsika/process/ProcessSequence.h>
#include <corsika/setup/SetupEnvironment.h>
#include <corsika/process/sibyll/ParticleConversion.h> #include <corsika/process/sibyll/ParticleConversion.h>
#include <corsika/setup/SetupEnvironment.h>
#include <corsika/units/PhysicalUnits.h>
#include <iomanip> #include <iomanip>
#include <iostream> #include <iostream>
...@@ -30,18 +30,19 @@ int main() { ...@@ -30,18 +30,19 @@ int main() {
<< "--------------------" << endl; << "--------------------" << endl;
cout << std::setw(20) << "Name" cout << std::setw(20) << "Name"
<< " | " << std::setw(10) << "PDG-id" << " | " << std::setw(10) << "PDG-id"
<< " | " << std::setw(10) << "mass (GeV)"
<< " | " << std::setw(10) << "SIBYLL-id" << " | " << std::setw(10) << "SIBYLL-id"
<< endl; << " | " << std::setw(18) << "PDG-mass (GeV)"
<< " | " << std::setw(18) << "SIBYLL-mass (GeV)"
<< " | " << endl;
cout << std::setw(58) << std::setfill('-') << "-" << endl; cout << std::setw(58) << std::setfill('-') << "-" << endl;
for (auto p : corsika::particles::detail::all_particles) { for (auto p : corsika::particles::detail::all_particles) {
if (p != Code::Unknown && !IsNucleus(p)) if (p != Code::Unknown && !IsNucleus(p))
cout << std::setw(20) << std::setfill(' ') << p << " | " cout << std::setw(20) << std::setfill(' ') << p << " | " << std::setw(10)
<< std::setw(10) << static_cast<int>(GetPDG(p)) << " | " << static_cast<int>(GetPDG(p)) << " | " << std::setw(10)
<< std::setw(10) << GetMass(p) / 1_GeV << " | " << static_cast<int>(corsika::process::sibyll::ConvertToSibyll(p)) << " | "
<< std::setw(10) << static_cast<int>(corsika::process::sibyll::ConvertToSibyll(p)) << " | " << std::setw(18) << GetMass(p) / 1_GeV << " | "
<< std::setw(18) << corsika::process::sibyll::GetSibyllMass(p) / 1_GeV << " | "
<< endl; << endl;
} }
cout << std::setw(54) << std::setfill('-') << "-" << endl; cout << std::setw(54) << std::setfill('-') << "-" << endl;
} }
...@@ -13,6 +13,15 @@ ...@@ -13,6 +13,15 @@
using namespace corsika::process::sibyll; using namespace corsika::process::sibyll;
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);
return sqrt(get_sibyll_mass2(sCode)) * 1_GeV;
}
// const std::map<sibyll::PID, ParticleProperties::InternalParticleCode> // const std::map<sibyll::PID, ParticleProperties::InternalParticleCode>
// process::sibyll::Sibyll2Corsika = { // process::sibyll::Sibyll2Corsika = {
// {PID::E_MINUS, InternalParticleCode::Electron}, // {PID::E_MINUS, InternalParticleCode::Electron},
......
...@@ -11,7 +11,9 @@ ...@@ -11,7 +11,9 @@
#ifndef _include_processes_sibyll_particles_h_ #ifndef _include_processes_sibyll_particles_h_
#define _include_processes_sibyll_particles_h_ #define _include_processes_sibyll_particles_h_
#include <corsika/units/PhysicalUnits.h>
#include <corsika/particles/ParticleProperties.h> #include <corsika/particles/ParticleProperties.h>
#include <corsika/process/sibyll/sibyll2.3c.h>
#include <string> #include <string>
...@@ -50,6 +52,9 @@ namespace corsika::process::sibyll { ...@@ -50,6 +52,9 @@ namespace corsika::process::sibyll {
return GetSibyllXSCode(pCode) > 0; return GetSibyllXSCode(pCode) > 0;
} }
corsika::units::si::HEPMassType GetSibyllMass(corsika::particles::Code const);
} // namespace corsika::process::sibyll } // namespace corsika::process::sibyll
#endif #endif
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
using namespace corsika; using namespace corsika;
using namespace corsika::process::sibyll; using namespace corsika::process::sibyll;
using namespace corsika::units;
using namespace corsika::units::si;
TEST_CASE("Sibyll", "[processes]") { TEST_CASE("Sibyll", "[processes]") {
...@@ -57,6 +59,12 @@ TEST_CASE("Sibyll", "[processes]") { ...@@ -57,6 +59,12 @@ TEST_CASE("Sibyll", "[processes]") {
REQUIRE(process::sibyll::GetSibyllXSCode(particles::Code::SigmaPlus) == 1); REQUIRE(process::sibyll::GetSibyllXSCode(particles::Code::SigmaPlus) == 1);
REQUIRE(process::sibyll::GetSibyllXSCode(particles::Code::PiMinus) == 2); 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> #include <corsika/geometry/Point.h>
......
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