IAP GITLAB

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

added field for Environment to Sibyll process

parent 30fd83ab
No related branches found
No related tags found
1 merge request!55Resolve "use target composition from environment in sibyll interface"
......@@ -223,7 +223,7 @@ int main() {
// setup processes, decays and interactions
tracking_line::TrackingLine<setup::Stack> tracking(env);
stack_inspector::StackInspector<setup::Stack> p0(true);
corsika::process::sibyll::Interaction sibyll;
corsika::process::sibyll::Interaction sibyll(env);
corsika::process::sibyll::Decay decay;
ProcessCut cut(8_GeV);
corsika::process::TrackWriter::TrackWriter trackWriter("tracks.dat");
......
......@@ -69,6 +69,7 @@ target_link_libraries (
CORSIKAunits
CORSIKAthirdparty
CORSIKAgeometry
CORSIKAenvironment
)
target_include_directories (
......
......@@ -21,6 +21,7 @@
#include <corsika/particles/ParticleProperties.h>
#include <corsika/random/RNGManager.h>
#include <corsika/units/PhysicalUnits.h>
#include <corsika/environment/Environment.h>
namespace corsika::process::sibyll {
......@@ -28,9 +29,8 @@ namespace corsika::process::sibyll {
int fCount = 0;
int fNucCount = 0;
public:
Interaction() {}
Interaction(corsika::environment::Environment const& env) : fEnvironment(env) { }
~Interaction() {
std::cout << "Sibyll::Interaction n=" << fCount << " Nnuc=" << fNucCount
<< std::endl;
......@@ -337,6 +337,10 @@ namespace corsika::process::sibyll {
}
return process::EProcessReturn::eOk;
}
private:
corsika::environment::Environment const& fEnvironment;
};
} // namespace corsika::process::sibyll
......
......@@ -18,6 +18,10 @@
#include <corsika/geometry/Point.h>
#include <corsika/units/PhysicalUnits.h>
#include <corsika/environment/Environment.h>
#include <corsika/environment/HomogeneousMedium.h>
#include <corsika/environment/NuclearComposition.h>
#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one
// cpp file
#include <catch2/catch.hpp>
......@@ -79,20 +83,39 @@ using namespace corsika::units;
TEST_CASE("SibyllInterface", "[processes]") {
auto const& cs =
geometry::RootCoordinateSystem::GetInstance().GetRootCoordinateSystem();
// setup environment, geometry
corsika::environment::Environment env;
auto& universe = *(env.GetUniverse());
auto theMedium = corsika::environment::Environment::CreateNode<geometry::Sphere>(
geometry::Point{env.GetCoordinateSystem(), 0_m, 0_m, 0_m},
1_km * std::numeric_limits<double>::infinity());
using MyHomogeneousModel =
corsika::environment::HomogeneousMedium<corsika::environment::IMediumModel>;
theMedium->SetModelProperties<MyHomogeneousModel>(
1_kg / (1_m * 1_m * 1_m),
corsika::environment::NuclearComposition(
std::vector<corsika::particles::Code>{corsika::particles::Code::Oxygen},
std::vector<float>{1.}));
universe.AddChild(std::move(theMedium));
const geometry::CoordinateSystem& cs = env.GetCoordinateSystem();
geometry::Point const origin(cs, {0_m, 0_m, 0_m});
geometry::Vector<corsika::units::si::SpeedType::dimension_type> v(
cs, 0_m / second, 0_m / second, 1_m / second);
geometry::Line line(origin, v);
geometry::Trajectory<geometry::Line> track(line, 10_s);
SECTION("InteractionInterface") {
setup::Stack stack;
auto particle = stack.NewParticle();
Interaction model;
Interaction model(env);
model.Init();
[[maybe_unused]] const process::EProcessReturn ret =
......
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