diff --git a/Processes/TrackingLine/testTrackingLine.cc b/Processes/TrackingLine/testTrackingLine.cc index 00ad3e8e52e2d8c62f89fb3a22d3e4a31d956ab5..d0c2259992449b5c683e049598b8d87919eb58b5 100644 --- a/Processes/TrackingLine/testTrackingLine.cc +++ b/Processes/TrackingLine/testTrackingLine.cc @@ -69,14 +69,16 @@ TEST_CASE("TrackingLine") { //~ std::cout << env.GetUniverse().get() << std::endl; - DummyParticle p(1_GeV, Vector<MOMENTUM>(cs, 0_GeV, 0_GeV, 1_GeV), - Point(cs, 0_m, 0_m, 0_m)); - auto const radius = 20_m; auto theMedium = corsika::environment::Environment::CreateNode<Sphere>( Point{env.GetCoordinateSystem(), 0_m, 0_m, 0_m}, radius); universe.AddChild(std::move(theMedium)); + + Point p0(cs, 0_m, 0_m, 0_m); + auto* const node = universe.GetContainingNode(p0); + DummyParticle p(1_GeV, Vector<MOMENTUM>(cs, 0_GeV, 0_GeV, 1_GeV), + p0, node); Point const origin(cs, {0_m, 0_m, 0_m}); Vector<corsika::units::si::SpeedType::dimension_type> v(cs, 0_m / second, diff --git a/Processes/TrackingLine/testTrackingLineStack.h b/Processes/TrackingLine/testTrackingLineStack.h index b825bc2f17b684e5fd753557296015d748181e57..819934d48dfd6c310e9590743c3defdc9ede1fe4 100644 --- a/Processes/TrackingLine/testTrackingLineStack.h +++ b/Processes/TrackingLine/testTrackingLineStack.h @@ -13,6 +13,7 @@ #define _include_process_trackinling_teststack_h_ #include <corsika/geometry/Point.h> +#include <corsika/environment/Environment.h> #include <corsika/geometry/Vector.h> #include <corsika/particles/ParticleProperties.h> #include <corsika/units/PhysicalUnits.h> @@ -23,18 +24,22 @@ struct DummyParticle { corsika::units::si::HEPEnergyType fEnergy; corsika::geometry::Vector<MOMENTUM> fMomentum; corsika::geometry::Point fPosition; + corsika::environment::BaseNodeType const* fNodePtr; DummyParticle(corsika::units::si::HEPEnergyType pEnergy, corsika::geometry::Vector<MOMENTUM> pMomentum, - corsika::geometry::Point pPosition) + corsika::geometry::Point pPosition, + corsika::environment::BaseNodeType const* pNodePtr) : fEnergy(pEnergy) , fMomentum(pMomentum) - , fPosition(pPosition) {} + , fPosition(pPosition) + , fNodePtr(pNodePtr) {} auto GetEnergy() const { return fEnergy; } auto GetMomentum() const { return fMomentum; } auto GetPosition() const { return fPosition; } auto GetPID() const { return corsika::particles::Code::Unknown; } + auto* GetNode() const { return fNodePtr; } }; struct DummyStack {