IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 0649f830 authored by ralfulrich's avatar ralfulrich
Browse files

epos test

parent d753ea42
No related branches found
No related tags found
No related merge requests found
......@@ -73,7 +73,7 @@ namespace corsika::epos {
void setParticlesStable() const;
private:
default_prng_type& RNG_ = RNGManager::getInstance().getRandomStream("epos");
default_prng_type& RNG_ = RNGManager<>::getInstance().getRandomStream("epos");
std::shared_ptr<spdlog::logger> logger_ = get_logger("corsika_epos_Interaction");
HEPEnergyType const minEnergyCoM_ = 6 * 1e9 * electronvolt;
HEPEnergyType const maxEnergyCoM_ = 2.e6 * 1e9 * electronvolt;
......
......@@ -23,14 +23,14 @@ namespace epos {
float rndm_interface() {
static corsika::default_prng_type& rng =
corsika::RNGManager::getInstance().getRandomStream("epos");
corsika::RNGManager<>::getInstance().getRandomStream("epos");
std::uniform_real_distribution<float> dist;
return dist(rng);
}
double double_rndm_interface() {
static corsika::default_prng_type& rng =
corsika::RNGManager::getInstance().getRandomStream("epos");
corsika::RNGManager<>::getInstance().getRandomStream("epos");
std::uniform_real_distribution<double> dist;
return dist(rng);
}
......
......@@ -298,7 +298,7 @@ TEST_CASE("Geometry Trajectories") {
CHECK(base.getDuration() / 1_s == Approx(10));
StraightTrajectory base2(line,
std::numeric_limits<TimeType::value_type>::infinity() * 1_);
std::numeric_limits<TimeType::value_type>::infinity() * 1_s);
base2.setDuration(10_s);
CHECK(base2.getDuration() / 1_s == Approx(10));
}
......
......@@ -127,7 +127,7 @@ TEST_CASE("EposInterface", "[processes]") {
auto const& cs = *csPtr;
[[maybe_unused]] auto const& env_dummy = env;
RNGManager::getInstance().registerRandomStream("epos");
RNGManager<>::getInstance().registerRandomStream("epos");
SECTION("InteractionInterface - random number") {
auto const rndm = ::epos::rangen_();
......@@ -166,18 +166,21 @@ TEST_CASE("EposInterface", "[processes]") {
model.getCrossSectionLab(Code::Proton, 1, 1, Code::Proton, 1, 1,
sqs2elab(7_TeV, Proton::mass, Proton::mass));
CHECK(xs_prod / 1_mb == Approx(70.7).margin(2.1));
{ [[maybe_unused]] auto const& dum_xs = xs_ela; }
// pi-n at 7TeV
auto const [xs_prod1, xs_ela1] =
model.getCrossSectionLab(Code::PiPlus, 0, 0, Code::Neutron, 1, 0,
sqs2elab(7_TeV, PiPlus::mass, Neutron::mass));
CHECK(xs_prod1 / 1_mb == Approx(52.7).margin(2.1));
{ [[maybe_unused]] auto const& dum_xs = xs_ela1; }
// k-p at 7TeV
auto const [xs_prod2, xs_ela2] =
model.getCrossSectionLab(Code::KPlus, 0, 0, Code::Proton, 1, 1,
sqs2elab(7_TeV, KPlus::mass, Proton::mass));
CHECK(xs_prod2 / 1_mb == Approx(45.7).margin(2.1));
{ [[maybe_unused]] auto const& dum_xs = xs_ela2; }
}
SECTION("InteractionInterface - nuclear cross sections") {
......@@ -187,17 +190,20 @@ TEST_CASE("EposInterface", "[processes]") {
auto const [xs_prod, xs_ela] = model.getCrossSectionLab(
Code::Proton, 1, 1, Code::Oxygen, Oxygen::nucleus_A, Oxygen::nucleus_Z, 100_GeV);
CHECK(xs_prod / 1_mb == Approx(287.0).margin(5.1));
{ [[maybe_unused]] auto const& dum_xs = xs_ela; }
auto const [xs_prod2, xs_ela2] = model.getCrossSectionLab(
Code::Nitrogen, Nitrogen::nucleus_A, Nitrogen::nucleus_Z, Code::Oxygen,
Oxygen::nucleus_A, Oxygen::nucleus_Z, 400_GeV);
CHECK(xs_prod2 / 1_mb == Approx(1076.7).margin(3.1));
{ [[maybe_unused]] auto const& dum_xs = xs_ela2; }
// nuclear stack extension, particle "Nucleus"
auto const [xs_prod3, xs_ela3] = model.getCrossSectionLab(
Code::Nucleus, Nitrogen::nucleus_A, Nitrogen::nucleus_Z, Code::Oxygen,
Oxygen::nucleus_A, Oxygen::nucleus_Z, 400_GeV);
CHECK(xs_prod2 / xs_prod3 == 1);
{ [[maybe_unused]] auto const& dum_xs = xs_ela3; }
}
SECTION("InteractionInterface - low energy") {
......
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