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