From c4d903e0174e1284684502085f9f430e813d1868 Mon Sep 17 00:00:00 2001 From: ralfulrich <ralf.ulrich@kit.edu> Date: Sun, 2 Dec 2018 23:40:00 +0100 Subject: [PATCH] added first template-tracking code --- Processes/CMakeLists.txt | 2 ++ Processes/TrackingLine/CMakeLists.txt | 38 +++++++++++++++++++++++++++ Processes/TrackingLine/TrackingLine.h | 35 ++++++++++++++++++++++++ 3 files changed, 75 insertions(+) create mode 100644 Processes/TrackingLine/CMakeLists.txt create mode 100644 Processes/TrackingLine/TrackingLine.h diff --git a/Processes/CMakeLists.txt b/Processes/CMakeLists.txt index c8f8557b..41a8277d 100644 --- a/Processes/CMakeLists.txt +++ b/Processes/CMakeLists.txt @@ -2,9 +2,11 @@ add_subdirectory (NullModel) add_subdirectory (Sibyll) add_subdirectory (StackInspector) +add_subdirectory (TrackingLine) #add_custom_target(CORSIKAprocesses) add_library (CORSIKAprocesses INTERFACE) add_dependencies(CORSIKAprocesses ProcessNullModel) add_dependencies(CORSIKAprocesses ProcessSibyll) add_dependencies(CORSIKAprocesses ProcessStackInspector) +add_dependencies(CORSIKAprocesses ProcessTrackingLine) diff --git a/Processes/TrackingLine/CMakeLists.txt b/Processes/TrackingLine/CMakeLists.txt new file mode 100644 index 00000000..2911c9b7 --- /dev/null +++ b/Processes/TrackingLine/CMakeLists.txt @@ -0,0 +1,38 @@ + +set ( + MODEL_HEADERS + TrackingLine.h + ) + +set ( + MODEL_NAMESPACE + corsika/process/tracking_line + ) + +add_library (ProcessTrackingLine INTERFACE) +CORSIKA_COPY_HEADERS_TO_NAMESPACE (ProcessTrackingLine ${MODEL_NAMESPACE} ${MODEL_HEADERS}) + + +target_include_directories ( + ProcessTrackingLine + INTERFACE + $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include> + $<INSTALL_INTERFACE:include/include> + ) + +install (FILES ${MODEL_HEADERS} DESTINATION include/${MODEL_NAMESPACE}) + + + +# # -------------------- +# # code unit testing +# add_executable (testStackInspector testStackInspector.cc) + +# target_link_libraries ( +# testStackInspector +# CORSIKAunits +# CORSIKAthirdparty # for catch2 +# ) + +# add_test (NAME testStackInspector COMMAND testStackInspector) + diff --git a/Processes/TrackingLine/TrackingLine.h b/Processes/TrackingLine/TrackingLine.h new file mode 100644 index 00000000..602d5473 --- /dev/null +++ b/Processes/TrackingLine/TrackingLine.h @@ -0,0 +1,35 @@ +#ifndef _include_corsika_processes_TrackinLine_h_ +#define _include_corsika_processes_TrackinLine_h_ + +#include <corsika/geometry/Vector.h> +#include <corsika/geometry/Point.h> + +#include <corsika/units/PhysicalUnits.h> + +#include <corsika/setup/SetupStack.h> +#include <corsika/setup/SetupTrajectory.h> + +using namespace corsika; + +namespace corsika::process { + + namespace tracking_line { + + template <typename Stack> + class TrackingLine { // Newton-step, naja.. not yet + typedef typename Stack::ParticleType Particle; + + public: + void Init() {} + setup::Trajectory GetTrack(Particle& p) { + geometry::Vector<SpeedType::dimension_type> v = p.GetDirection(); + geometry::Line traj(p.GetPosition(), v); + return geometry::Trajectory<corsika::geometry::Line>(traj, 100_ns); + } + }; + + } // namespace stack_inspector + +} // namespace corsika::process + +#endif -- GitLab