IAP GITLAB

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

fixed GetSibyllMass, do clang

parent 5436ad2b
No related branches found
No related tags found
1 merge request!186Resolve "particle list example"
......@@ -20,7 +20,10 @@ corsika::units::si::HEPMassType corsika::process::sibyll::GetSibyllMass(
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;
if (sCode == 0)
return std::numeric_limits<double>::quiet_NaN() * 1_GeV;
else
return sqrt(get_sibyll_mass2(sCode)) * 1_GeV;
}
// const std::map<sibyll::PID, ParticleProperties::InternalParticleCode>
......
......@@ -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 =
......
......@@ -40,7 +40,6 @@ TEST_CASE("Sibyll", "[processes]") {
REQUIRE(process::sibyll::ConvertToSibyllRaw(particles::Proton::GetCode()) == 13);
REQUIRE(process::sibyll::ConvertToSibyll(particles::XiStarC0::GetCode()) ==
process::sibyll::SibyllCode::XiStarC0);
}
SECTION("canInteractInSibyll") {
......
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