IAP GITLAB

Skip to content
Snippets Groups Projects
Commit e1a332f3 authored by Maximilian Reininghaus's avatar Maximilian Reininghaus :vulcan:
Browse files

Merge branch '203-release-type-tests-fail-for-cascade_example' into 'master'

Resolve "Release-type tests fail for cascade_example"

Closes #203

See merge request AirShowerPhysics/corsika!153
parents 45dc98c8 8bab4ad0
No related branches found
No related tags found
No related merge requests found
......@@ -135,7 +135,8 @@ int main() {
process::sibyll::Interaction sibyll;
process::sibyll::NuclearInteraction sibyllNuc(sibyll, env);
process::sibyll::Decay decay;
process::particle_cut::ParticleCut cut(20_GeV);
// cascade with only HE model ==> HE cut
process::particle_cut::ParticleCut cut(80_GeV);
process::track_writer::TrackWriter trackWriter("tracks.dat");
process::energy_loss::EnergyLoss eLoss;
......@@ -158,8 +159,4 @@ int main() {
<< "relative difference (%): " << (Efinal / E0 - 1) * 100 << endl;
cout << "total dEdX energy (GeV): " << eLoss.GetTotal() / 1_GeV << endl
<< "relative difference (%): " << eLoss.GetTotal() / E0 * 100 << endl;
// basic check for unit-tests
assert(cut.GetNumberEmParticles() == 127);
assert(cut.GetNumberInvParticles() == 116);
}
......@@ -860,6 +860,7 @@
<channel onMode="1" bRatio="0.0016900" products="111 111 111"/>
<channel onMode="1" bRatio="0.0001076" products="13 -13 22"/>
</particle>
-->
<particle id="333" name="phi" spinType="3" chargeType="0" colType="0"
m0="1.01946" mWidth="0.00426" mMin="1.00000" mMax="1.04000">
......@@ -878,6 +879,7 @@
<channel onMode="1" bRatio="0.0000470" products="223 111"/>
</particle>
<!--
<particle id="335" name="f'_2(1525)" spinType="5" chargeType="0" colType="0"
m0="1.52500" mWidth="0.07300" mMin="1.10000" mMax="2.00000">
<channel onMode="1" bRatio="0.4444000" products="321 -321"/>
......
......@@ -13,7 +13,7 @@
#include <corsika/particles/ParticleProperties.h>
#include <map>
#include <string>
namespace corsika::process::sibyll {
......@@ -28,7 +28,14 @@ namespace corsika::process::sibyll {
}
corsika::particles::Code constexpr ConvertFromSibyll(SibyllCode pCode) {
return sibyll2corsika[static_cast<SibyllCodeIntType>(pCode) - minSibyll];
auto const s = static_cast<SibyllCodeIntType>(pCode);
auto const corsikaCode = sibyll2corsika[s - minSibyll];
if (corsikaCode == corsika::particles::Code::Unknown) {
throw std::runtime_error(std::string("SIBYLL/CORSIKA conversion of ")
.append(std::to_string(s))
.append(" impossible"));
}
return corsikaCode;
}
int constexpr ConvertToSibyllRaw(corsika::particles::Code pCode) {
......@@ -40,7 +47,7 @@ namespace corsika::process::sibyll {
}
bool constexpr CanInteract(corsika::particles::Code pCode) {
return GetSibyllXSCode(pCode) != 0;
return GetSibyllXSCode(pCode) > 0;
}
} // namespace corsika::process::sibyll
......
......@@ -64,7 +64,7 @@ def generate_corsika2sibyll(particle_db):
def generate_corsika2sibyll_xsType(particle_db):
string = "std::array<int, {:d}> constexpr corsika2sibyllXStype = {{\n".format(len(particle_db))
for identifier, pData in particle_db.items():
sibCodeXS = pData.get("sibyll_xsType", -1)
sibCodeXS = pData.get("sibyll_xsType", 0)
string += " {:d}, // {:s}\n".format(sibCodeXS, identifier if sibCodeXS else identifier + " (not implemented in SIBYLL)")
string += "};\n"
return string
......
......@@ -90,4 +90,5 @@ XiCMinusBar -87 1 1
OmegaC0 99 0 0
OmegaC0Bar -99 0 0
Jpsi 83 0 0
Phi 33 0 0
#Unknown 0 0 0
......@@ -45,6 +45,9 @@ TEST_CASE("Sibyll", "[processes]") {
REQUIRE_FALSE(process::sibyll::CanInteract(particles::Electron::GetCode()));
REQUIRE_FALSE(process::sibyll::CanInteract(particles::SigmaC0::GetCode()));
REQUIRE_FALSE(process::sibyll::CanInteract(particles::Nucleus::GetCode()));
REQUIRE_FALSE(process::sibyll::CanInteract(particles::Helium::GetCode()));
}
SECTION("cross-section type") {
......
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