From 56859348f37ce5d2611ee308865e76eed430c90a Mon Sep 17 00:00:00 2001
From: ralfulrich <ralf.ulrich@kit.edu>
Date: Fri, 7 Sep 2018 12:53:31 +0200
Subject: [PATCH] started to copy header files to namesapce directories in
 build dir

---
 CMakeLists.txt                             | 30 +++++----
 CMakeModules/CorsikaUtilities.cmake        | 44 +++++++++++++
 Documentation/Examples/geometry_example.cc | 10 +--
 Documentation/Examples/helix_example.cc    | 16 ++---
 Documentation/Examples/logger_example.cc   | 14 ++--
 Documentation/Examples/stack_example.cc    |  1 +
 Framework/Cascade/Cascade.cc               |  5 +-
 Framework/Geometry/BaseVector.h            |  8 ++-
 Framework/Geometry/CMakeLists.txt          | 77 ++++++++++++++++------
 Framework/Geometry/Helix.h                 |  8 ++-
 Framework/Geometry/LineTrajectory.h        |  8 ++-
 Framework/Geometry/Point.h                 | 35 +++++-----
 Framework/Geometry/Sphere.h                |  6 +-
 Framework/Geometry/Vector.h                | 12 ++--
 Framework/Logging/BufferedSink.h           |  2 +-
 Framework/Logging/CMakeLists.txt           | 59 +++++++++++++----
 Framework/Logging/Logger.h                 | 16 +++--
 Framework/Logging/MessageOff.h             |  2 +-
 Framework/Logging/MessageOn.h              |  2 +-
 Framework/Logging/NoSink.h                 |  2 +-
 Framework/Logging/Sink.h                   |  2 +-
 Framework/Logging/testLogging.cc           |  2 +-
 Framework/ParticleStack/CMakeLists.txt     | 24 +++++--
 Framework/ParticleStack/StackOne.h         |  5 +-
 Framework/Particles/CMakeLists.txt         | 74 ++++++++++++++++-----
 Framework/Particles/pdxml_reader.py        |  2 +
 Framework/StackInterface/CMakeLists.txt    | 33 ++++++++--
 Framework/StackInterface/Stack.h           |  1 +
 28 files changed, 369 insertions(+), 131 deletions(-)
 create mode 100644 CMakeModules/CorsikaUtilities.cmake

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d44825bc..9def1d5e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,29 +1,35 @@
 cmake_minimum_required (VERSION 3.4.3)
 
-project (corsika VERSION 8.0.0 DESCRIPTION "CORSIKA C++ project" LANGUAGES CXX)
+project (
+  corsika
+  VERSION 8.0.0
+  DESCRIPTION "CORSIKA C++ project"
+  LANGUAGES CXX
+  )
 
 # ignore many irrelevant Up-to-date messages during install
 set (CMAKE_INSTALL_MESSAGE LAZY)
 
 # directory for local cmake modules
 set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules)
+include (CorsikaUtilities) # a few cmake function
 
 # --std=c++14
 set (CMAKE_CXX_STANDARD 17)
 enable_testing ()
 set (CTEST_OUTPUT_ON_FAILURE 1)
 
-# testing coverage
-include(CodeCoverage)
-#set(COVERAGE_LCOV_EXCLUDES 'Documentation/*')
-#setup_target_for_coverage(${PROJECT_NAME}_coverage ${PROJECT_TEST_NAME} coverage)
-SETUP_TARGET_FOR_COVERAGE_GCOVR_HTML(
-     NAME corsika_coverage
-     EXECUTABLE ctest
-     #-j ${PROCESSOR_COUNT}
-#     DEPENDENCIES corsika
-     )
-
+# unit testing coverage, does not work yet
+#include (CodeCoverage)
+##set(COVERAGE_LCOV_EXCLUDES 'Documentation/*')
+##setup_target_for_coverage(${PROJECT_NAME}_coverage ${PROJECT_TEST_NAME} coverage)
+#SETUP_TARGET_FOR_COVERAGE_GCOVR_HTML (
+#  NAME corsika_coverage
+#  EXECUTABLE ctest
+#  #-j ${PROCESSOR_COUNT}
+#  #     DEPENDENCIES corsika
+#  )
+   
 #add_custom_target (corsika_pre_build)
 #add_custom_command (TARGET corsika_pre_build PRE_BUILD COMMAND "${PROJECT_SOURCE_DIR}/pre_compile.py")
 
diff --git a/CMakeModules/CorsikaUtilities.cmake b/CMakeModules/CorsikaUtilities.cmake
new file mode 100644
index 00000000..c247c631
--- /dev/null
+++ b/CMakeModules/CorsikaUtilities.cmake
@@ -0,0 +1,44 @@
+
+#
+# takes a list of input files and prepends a path
+#
+
+function (CORSIKA_PREPEND_PATH return prefix)
+  set (listVar "")
+  foreach (f ${ARGN})
+    list (APPEND listVar "${prefix}/${f}")
+  endforeach (f)
+  set (${return} "${listVar}" PARENT_SCOPE)
+endfunction (CORSIKA_PREPEND_PATH)
+
+
+#
+# use: CORSIKA_COPY_HEADERS_TO_NAMESPACE theLib theNamesapce header1.h header2.h ...
+#
+# creates a dependence of theLib on the presence of all listed header files in the
+# build-directory include/theNamespace directory
+#
+# if needed, create symbolic links from the source files to this build-directory location
+#
+function (CORSIKA_COPY_HEADERS_TO_NAMESPACE for_library in_namespace)
+  CORSIKA_PREPEND_PATH (HEADERS_BUILD "${PROJECT_BINARY_DIR}/include/${in_namespace}" ${ARGN})
+  foreach (HEADER ${ARGN})
+    add_custom_command (
+      OUTPUT ${PROJECT_BINARY_DIR}/include/${in_namespace}/${HEADER}
+      COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/include/${in_namespace}
+      COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_CURRENT_SOURCE_DIR}/${HEADER} ${PROJECT_BINARY_DIR}/include/${in_namespace}/${HEADER}
+      COMMENT "Generate link: ${PROJECT_BINARY_DIR}/include/${in_namespace}/${HEADER}"
+      #      VERBATIM
+      )
+  endforeach (HEADER)
+  
+  # main target for this library, depends on header files in build area
+  add_custom_target (
+    ${for_library}_BUILD
+    DEPENDS ${HEADERS_BUILD}
+    )
+  
+  add_dependencies (${for_library} ${for_library}_BUILD)
+
+endfunction (CORSIKA_COPY_HEADERS_TO_NAMESPACE)
+
diff --git a/Documentation/Examples/geometry_example.cc b/Documentation/Examples/geometry_example.cc
index b2c24049..73063442 100644
--- a/Documentation/Examples/geometry_example.cc
+++ b/Documentation/Examples/geometry_example.cc
@@ -1,7 +1,7 @@
-#include <Geometry/Vector.h>
-#include <Geometry/Sphere.h>
-#include <Geometry/Point.h>
-#include <Geometry/CoordinateSystem.h>
+#include <fwk/Vector.h>
+#include <fwk/Sphere.h>
+#include <fwk/Point.h>
+#include <fwk/CoordinateSystem.h>
 #include <Units/PhysicalUnits.h>
 
 #include <iostream>
@@ -12,6 +12,8 @@ using namespace phys::units;
 using namespace phys::units::io; // support stream << unit
 using namespace phys::units::literals; // support unit literals like 5_m;
 
+using namespace fwk;
+
 int main()
 {
     // define the root coordinate system
diff --git a/Documentation/Examples/helix_example.cc b/Documentation/Examples/helix_example.cc
index ae7250b1..46b9f716 100644
--- a/Documentation/Examples/helix_example.cc
+++ b/Documentation/Examples/helix_example.cc
@@ -1,8 +1,8 @@
 #include <Units/PhysicalUnits.h>
-#include <Geometry/Vector.h>
-#include <Geometry/CoordinateSystem.h>
-#include <Geometry/Point.h>
-#include <Geometry/Helix.h>
+#include <fwk/Vector.h>
+#include <fwk/CoordinateSystem.h>
+#include <fwk/Point.h>
+#include <fwk/Helix.h>
 #include <cstdlib>
 #include <iostream>
 #include <array>
@@ -15,12 +15,12 @@ int main()
 {
     CoordinateSystem root;
     
-    Point const r0(root, {0_m, 0_m, 0_m});
+    fwk::Point const r0(root, {0_m, 0_m, 0_m});
     auto const omegaC = 2 * M_PI * 1_Hz;
-    Vector<speed_d> vPar(root, {0_m / second, 0_m / second, 10_cm / second});
-    Vector<speed_d> vPerp(root, {1_m / second, 0_m / second, 0_m / second});
+    fwk::Vector<speed_d> vPar(root, {0_m / second, 0_m / second, 10_cm / second});
+    fwk::Vector<speed_d> vPerp(root, {1_m / second, 0_m / second, 0_m / second});
     
-    Helix h(r0, omegaC, vPar, vPerp);
+    fwk::Helix h(r0, omegaC, vPar, vPerp);
     
     auto constexpr t0 = 0_s;
     auto constexpr t1 = 1_s;
diff --git a/Documentation/Examples/logger_example.cc b/Documentation/Examples/logger_example.cc
index d8212e66..219358ab 100644
--- a/Documentation/Examples/logger_example.cc
+++ b/Documentation/Examples/logger_example.cc
@@ -1,4 +1,4 @@
-#include <Logging/Logger.h>
+#include <fwk/Logger.h>
 
 #include <string>
 #include <iostream>
@@ -14,10 +14,10 @@ main()
   {
     cout << "writing to \"another.log\"" << endl;
     ofstream logfile("another.log");
-    logger::sink::SinkStream unbuffered_sink(logfile);
-    logger::sink::BufferedSinkStream sink(logfile, logger::sink::StdBuffer(10000));
-    logger::Logger<logger::MessageOn, logger::sink::BufferedSinkStream> info("\033[32m", "info", sink);
-    logger::Logger<logger::MessageOn, logger::sink::BufferedSinkStream> err("\033[31m", "error", sink);
+    fwk::sink::SinkStream unbuffered_sink(logfile);
+    fwk::sink::BufferedSinkStream sink(logfile, fwk::sink::StdBuffer(10000));
+    fwk::Logger<fwk::MessageOn, fwk::sink::BufferedSinkStream> info("\033[32m", "info", sink);
+    fwk::Logger<fwk::MessageOn, fwk::sink::BufferedSinkStream> err("\033[31m", "error", sink);
     //logger<ostream,messageconst,StdBuffer> info(std::cout, StdBuffer(10000));
     
     /*
@@ -33,8 +33,8 @@ main()
   }
   
   {
-    logger::sink::NoSink off;
-    logger::Logger<logger::MessageOff> info("", "", off);
+    fwk::sink::NoSink off;
+    fwk::Logger<fwk::MessageOff> info("", "", off);
     
     for (int i=0; i<100000; ++i) {
       LOG(info, "irgendwas", string("and more"), boost::format("error: %i message: %s. done."), i, "stupido", "a-number:", 8.99, "ENDE" );
diff --git a/Documentation/Examples/stack_example.cc b/Documentation/Examples/stack_example.cc
index d27467f5..c526b588 100644
--- a/Documentation/Examples/stack_example.cc
+++ b/Documentation/Examples/stack_example.cc
@@ -1,4 +1,5 @@
 #include <ParticleStack/StackOne.h>
+//#include <corsika/StackOne.h>
 
 #include <iostream>
 #include <iomanip>
diff --git a/Framework/Cascade/Cascade.cc b/Framework/Cascade/Cascade.cc
index ffd46070..d4e1320a 100644
--- a/Framework/Cascade/Cascade.cc
+++ b/Framework/Cascade/Cascade.cc
@@ -4,8 +4,9 @@ namespace cascade;
 
 template<typename Sequence, typename Trajectory>
 void
-Cascade::Cascade()
-{
+Cascade::Cascade() {
+  kkk;
+  kk;
 }
 
 
diff --git a/Framework/Geometry/BaseVector.h b/Framework/Geometry/BaseVector.h
index 02edb6fa..2ed634df 100644
--- a/Framework/Geometry/BaseVector.h
+++ b/Framework/Geometry/BaseVector.h
@@ -1,8 +1,10 @@
 #ifndef _include_BASEVECTOR_H_
 #define _include_BASEVECTOR_H_
 
-#include <Geometry/QuantityVector.h>
-#include <Geometry/CoordinateSystem.h>
+#include <fwk/QuantityVector.h>
+#include <fwk/CoordinateSystem.h>
+
+namespace fwk {
 
 /*!
  * Common base class for Vector and Point. Currently it does basically nothing.
@@ -22,4 +24,6 @@ public:
     }
 };
 
+} // end namesapce
+ 
 #endif
diff --git a/Framework/Geometry/CMakeLists.txt b/Framework/Geometry/CMakeLists.txt
index 16dce730..61abfdc6 100644
--- a/Framework/Geometry/CMakeLists.txt
+++ b/Framework/Geometry/CMakeLists.txt
@@ -1,31 +1,68 @@
 
-set (GEOMETRY_SOURCES CoordinateSystem.cc)
-set (GEOMETRY_HEADERS Vector.h Point.h Sphere.h CoordinateSystem.h Helix.h)
+set (
+  GEOMETRY_SOURCES
+  CoordinateSystem.cc
+  )
+
+set (
+  GEOMETRY_HEADERS
+  Vector.h
+  Point.h
+  Sphere.h
+  CoordinateSystem.h
+  Helix.h
+  BaseVector.h
+  QuantityVector.h
+  )
+
+set (
+  GEOMETRY_NAMESPACE
+  fwk
+  )
 
 add_library (CORSIKAgeometry STATIC ${GEOMETRY_SOURCES})
+CORSIKA_COPY_HEADERS_TO_NAMESPACE (CORSIKAgeometry ${GEOMETRY_NAMESPACE} ${GEOMETRY_HEADERS})
 
-set_target_properties (CORSIKAgeometry PROPERTIES VERSION ${PROJECT_VERSION})
-set_target_properties (CORSIKAgeometry PROPERTIES SOVERSION 1)
+set_target_properties (
+  CORSIKAgeometry
+  PROPERTIES
+  VERSION ${PROJECT_VERSION}
+  SOVERSION 1
+  PUBLIC_HEADER "${GEOMETRY_HEADERS}"
+  )
 
-set_target_properties (CORSIKAgeometry PROPERTIES PUBLIC_HEADER "${GEOMETRY_HEADERS}")
-                                                    
-# target dependencies on other libraries (also header only)
-target_link_libraries (CORSIKAgeometry CORSIKAunits)
+# target dependencies on other libraries (also the header onlys)
+target_link_libraries (
+  CORSIKAgeometry
+  CORSIKAunits
+  )
 
-target_include_directories (CORSIKAgeometry PRIVATE   ${EIGEN3_INCLUDE_DIR})
-target_include_directories (CORSIKAgeometry INTERFACE ${EIGEN3_INCLUDE_DIR})
-target_include_directories (CORSIKAgeometry INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/Framework>
-                                                      $<INSTALL_INTERFACE:include/Framework>
-                                                      )
+target_include_directories (
+  CORSIKAgeometry
+  PRIVATE   ${EIGEN3_INCLUDE_DIR}
+  INTERFACE ${EIGEN3_INCLUDE_DIR}
+  $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
+  $<INSTALL_INTERFACE:include/include>
+  )
 
-install (TARGETS CORSIKAgeometry
-         LIBRARY DESTINATION lib
-         ARCHIVE DESTINATION lib
-         PUBLIC_HEADER DESTINATION include/Geometry)
+install (
+  TARGETS CORSIKAgeometry
+  LIBRARY DESTINATION lib
+  ARCHIVE DESTINATION lib
+  PUBLIC_HEADER DESTINATION include/${GEOMETRY_NAMESPACE}
+  )
 
 
-# code testing
+# --------------------
+# code unit testing
 add_executable (testGeometry testGeometry.cc)
-target_link_libraries (testGeometry CORSIKAgeometry CORSIKAunits CORSIKAthirdparty) # for catch2
-add_test (NAME testGeometry COMMAND testGeometry -o report.xml -r junit)
+
+target_link_libraries (
+  testGeometry
+  CORSIKAgeometry
+  CORSIKAunits
+  CORSIKAthirdparty # for catch2
+  )
+
+add_test (NAME testGeometry COMMAND testGeometry)
 
diff --git a/Framework/Geometry/Helix.h b/Framework/Geometry/Helix.h
index 10480c00..1234940b 100644
--- a/Framework/Geometry/Helix.h
+++ b/Framework/Geometry/Helix.h
@@ -1,12 +1,14 @@
 #ifndef _include_HELIX_H_
 #define _include_HELIX_H_
 
-#include <Geometry/Vector.h>
-#include <Geometry/Point.h>
+#include <fwk/Vector.h>
+#include <fwk/Point.h>
 #include <Units/PhysicalUnits.h>
 
 #include <cmath>
 
+namespace fwk {
+
 class Helix // TODO: inherit from to-be-implemented "Trajectory"
 {
     using SpeedVec = Vector<Speed::dimension_type>;
@@ -38,4 +40,6 @@ public:
     }
 };
 
+} // end namesapce
+ 
 #endif
diff --git a/Framework/Geometry/LineTrajectory.h b/Framework/Geometry/LineTrajectory.h
index f9efee6e..3313eb8c 100644
--- a/Framework/Geometry/LineTrajectory.h
+++ b/Framework/Geometry/LineTrajectory.h
@@ -1,10 +1,12 @@
 #ifndef _include_LINETRAJECTORY_H
 #define _include_LINETRAJECTORY_H
 
-#include <Framework/Geometry/Point.h>
-#include <Framework/Geometry/Vector.h>
+#include <fwk/Point.h>
+#include <fwk/Vector.h>
 #include <Units/PhysicalUnits.h>
 
+namesapce fwk {
+
 class LineTrajectory // TODO: inherit from Trajectory
 {
     using SpeedVec = Vector<Speed::dimension_type>;
@@ -23,4 +25,6 @@ class LineTrajectory // TODO: inherit from Trajectory
     }
 };
 
+} // end namesapce
+
 #endif
diff --git a/Framework/Geometry/Point.h b/Framework/Geometry/Point.h
index f5efef09..6607f1bd 100644
--- a/Framework/Geometry/Point.h
+++ b/Framework/Geometry/Point.h
@@ -1,24 +1,27 @@
 #ifndef _include_POINT_H_
 #define _include_POINT_H_
 
-#include <Geometry/BaseVector.h>
-#include <Geometry/QuantityVector.h>
-#include <Geometry/Vector.h>
+#include <fwk/BaseVector.h>
+#include <fwk/QuantityVector.h>
+#include <fwk/Vector.h>
 #include <Units/PhysicalUnits.h>
 
-/*!
- * A Point represents a point in position space. It is defined by its
- * coordinates with respect to some CoordinateSystem.
- */
-class Point : public BaseVector<phys::units::length_d>
-{
-public:
-    Point(CoordinateSystem const& pCS, QuantityVector<phys::units::length_d> pQVector) :
-        BaseVector<phys::units::length_d>(pCS, pQVector)
-    {
-    }
 
-    Point(CoordinateSystem const& cs, Length x, Length y, Length z) :
+namespace fwk {
+
+  /*!
+   * A Point represents a point in position space. It is defined by its
+   * coordinates with respect to some CoordinateSystem.
+   */
+  class Point : public BaseVector<phys::units::length_d>
+  {
+  public:
+  Point(CoordinateSystem const& pCS, QuantityVector<phys::units::length_d> pQVector) :
+    BaseVector<phys::units::length_d>(pCS, pQVector)
+      {
+      }
+    
+  Point(CoordinateSystem const& cs, Length x, Length y, Length z) :
         BaseVector<phys::units::length_d>(cs, {x, y, z})
     {
     }
@@ -65,4 +68,6 @@ public:
     }
 };
 
+} // end namespace
+  
 #endif
diff --git a/Framework/Geometry/Sphere.h b/Framework/Geometry/Sphere.h
index cc87e108..634ffe31 100644
--- a/Framework/Geometry/Sphere.h
+++ b/Framework/Geometry/Sphere.h
@@ -1,9 +1,11 @@
 #ifndef _include_SPHERE_H_
 #define _include_SPHERE_H_
 
-#include <Geometry/Point.h>
+#include <fwk/Point.h>
 #include <Units/PhysicalUnits.h>
 
+namespace fwk {
+
 class Sphere
 {
     Point center;
@@ -23,4 +25,6 @@ public:
 
 };
 
+}// end namespace
+
 #endif
diff --git a/Framework/Geometry/Vector.h b/Framework/Geometry/Vector.h
index 3c48f9df..113d8701 100644
--- a/Framework/Geometry/Vector.h
+++ b/Framework/Geometry/Vector.h
@@ -1,8 +1,8 @@
 #ifndef _include_VECTOR_H_
 #define _include_VECTOR_H_
 
-#include <Geometry/BaseVector.h>
-#include <Geometry/QuantityVector.h>
+#include <fwk/BaseVector.h>
+#include <fwk/QuantityVector.h>
 #include <Units/PhysicalUnits.h>
 
 /*!
@@ -15,8 +15,10 @@
  * part only and invariant under translations.
  */
 
-template <typename dim>
-class Vector : public BaseVector<dim>
+namespace fwk {
+
+  template <typename dim>
+    class Vector : public BaseVector<dim>
 {
     using Quantity = phys::units::quantity<dim, double>;
     
@@ -200,4 +202,6 @@ public:
     
 };
 
+} // end namespace
+  
 #endif
diff --git a/Framework/Logging/BufferedSink.h b/Framework/Logging/BufferedSink.h
index 9934744d..86e7db4b 100644
--- a/Framework/Logging/BufferedSink.h
+++ b/Framework/Logging/BufferedSink.h
@@ -1,7 +1,7 @@
 #ifndef _include_BufferedSink_h_
 #define _include_BufferedSink_h_
 
-namespace logger {
+namespace fwk {
 
   namespace sink {
     
diff --git a/Framework/Logging/CMakeLists.txt b/Framework/Logging/CMakeLists.txt
index 581df617..7486c499 100644
--- a/Framework/Logging/CMakeLists.txt
+++ b/Framework/Logging/CMakeLists.txt
@@ -1,18 +1,55 @@
 
-
 add_library (CORSIKAlogging INTERFACE)
 
-target_include_directories (CORSIKAlogging INTERFACE ${PROJECT_SOURCE_DIR}/Framework)
+# namespace of library -> location of header files
+set (
+  CORSIKAlogging_NAMESPACE
+  fwk
+  )
+
+# header files of this library
+set (
+  CORSIKAlogging_HEADERS
+  Logger.h
+  Sink.h
+  MessageOn.h
+  MessageOff.h
+  NoSink.h
+  Sink.h
+  BufferedSink.h
+  )
+
+CORSIKA_COPY_HEADERS_TO_NAMESPACE (CORSIKAlogging ${CORSIKAlogging_NAMESPACE} ${CORSIKAlogging_HEADERS})
+
+# include directive for upstream code
+target_include_directories (
+  CORSIKAlogging
+  INTERFACE
+  $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
+  $<INSTALL_INTERFACE:include/>
+  )
+
+# install library
+install (
+  FILES ${CORSIKAlogging_HEADERS}
+  DESTINATION include/${CORSIKAlogging_NAMESPACE}
+  )
 
-target_include_directories (CORSIKAlogging INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/Framework>
-                                                     $<INSTALL_INTERFACE:include/Framework>
-                                                     )
+# ----------------
+# code unit testing
+add_executable (
+  testLogging
+  testLogging.cc
+  )
 
-install (FILES Logger.h Sink.h MessageOn.h MessageOff.h NoSink.h Sink.h BufferedSink.h
-         DESTINATION include/Logging)
+target_link_libraries (
+  testLogging
+  CORSIKAlogging
+  CORSIKAthirdparty # for catch2
+  )
 
-# code testing
-add_executable (testLogging testLogging.cc)
-target_link_libraries (testLogging CORSIKAlogging CORSIKAthirdparty) # for catch2
-add_test (NAME testLogging COMMAND testLogging -o report.xml -r junit)
+add_test (
+  NAME testLogging
+  COMMAND testLogging
+  )
 
diff --git a/Framework/Logging/Logger.h b/Framework/Logging/Logger.h
index b98654d3..6b8acd2c 100644
--- a/Framework/Logging/Logger.h
+++ b/Framework/Logging/Logger.h
@@ -1,3 +1,7 @@
+/**
+   @File Logger.h
+ */
+
 #ifndef _include_logger_h_
 #define _include_logger_h_
 
@@ -8,11 +12,11 @@
 
 #include <boost/format.hpp>
 
-#include <Logging/MessageOn.h>
-#include <Logging/MessageOff.h>
-#include <Logging/Sink.h>
-#include <Logging/NoSink.h>
-#include <Logging/BufferedSink.h>
+#include <fwk/MessageOn.h>
+#include <fwk/MessageOff.h>
+#include <fwk/Sink.h>
+#include <fwk/NoSink.h>
+#include <fwk/BufferedSink.h>
 
 
 using namespace std;
@@ -22,7 +26,7 @@ using namespace boost;
    Everything around logfile generation and text output.
 */
 
-namespace logger {
+namespace fwk {
   
   /**
      Defines one stream to accept messages, and to wrote those into
diff --git a/Framework/Logging/MessageOff.h b/Framework/Logging/MessageOff.h
index ef62e257..d54b675b 100644
--- a/Framework/Logging/MessageOff.h
+++ b/Framework/Logging/MessageOff.h
@@ -1,7 +1,7 @@
 #ifndef _include_MessageOff_h_
 #define _include_MessageOff_h_
 
-namespace logger {
+namespace fwk {
 
   /**
      Helper class to ignore all arguments to MessagesOn::Message and
diff --git a/Framework/Logging/MessageOn.h b/Framework/Logging/MessageOn.h
index 43b84744..d53ec05c 100644
--- a/Framework/Logging/MessageOn.h
+++ b/Framework/Logging/MessageOn.h
@@ -2,7 +2,7 @@
 #define _include_MessageOn_h_
 
 
-namespace logger {
+namespace fwk {
 
   /**
      Helper class to convert all input arguments of MessageOn::Message
diff --git a/Framework/Logging/NoSink.h b/Framework/Logging/NoSink.h
index 13e37f3b..c5932499 100644
--- a/Framework/Logging/NoSink.h
+++ b/Framework/Logging/NoSink.h
@@ -1,7 +1,7 @@
 #ifndef _include_NoSink_h_
 #define _include_NoSink_h_
 
-namespace logger {
+namespace fwk {
 
   namespace sink {
 
diff --git a/Framework/Logging/Sink.h b/Framework/Logging/Sink.h
index 6ee61517..7950f05b 100644
--- a/Framework/Logging/Sink.h
+++ b/Framework/Logging/Sink.h
@@ -1,7 +1,7 @@
 #ifndef _include_Sink_h_
 #define _include_Sink_h_
 
-namespace logger {
+namespace fwk {
 
   /**
      a sink for the logger must implement the two functions
diff --git a/Framework/Logging/testLogging.cc b/Framework/Logging/testLogging.cc
index 7d2ccb56..f4113483 100644
--- a/Framework/Logging/testLogging.cc
+++ b/Framework/Logging/testLogging.cc
@@ -1,7 +1,7 @@
 #define CATCH_CONFIG_MAIN  // This tells Catch to provide a main() - only do this in one cpp file
 #include <catch2/catch.hpp>
 
-#include <Logging/Logger.h>
+#include <fwk/Logger.h>
 
 TEST_CASE( "Logging", "[Logging]" )
 {  
diff --git a/Framework/ParticleStack/CMakeLists.txt b/Framework/ParticleStack/CMakeLists.txt
index 93b5280e..66534852 100644
--- a/Framework/ParticleStack/CMakeLists.txt
+++ b/Framework/ParticleStack/CMakeLists.txt
@@ -1,5 +1,5 @@
 
-set (STACK_HEADERS StackOne.h)
+set (PUBLIC_HEADER_FILES StackOne.h)
 
 add_library (CORSIKAstack INTERFACE)
 
@@ -11,8 +11,22 @@ add_library (CORSIKAstack INTERFACE)
 #target_link_libraries (CORSIKAstackinterface CORSIKAunits)
 
 #target_include_directories (CORSIKAstack PRIVATE   ${EIGEN3_INCLUDE_DIR})
-target_include_directories (CORSIKAstack INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/Framework>
-                                                      $<INSTALL_INTERFACE:include/Framework>
-                                                      )
+target_include_directories (
+  CORSIKAstack
+  INTERFACE
+  $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
+  $<INSTALL_INTERFACE:include>
+  )
 
-install (FILES StackOne.h DESTINATION include/Stack)
+#add_custom_command (
+#  CORSIKAstack
+#  PRE_BUILD
+#  COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PUBLIC_HEADER_FILES} ${PROJECT_BINARY_DIR}/include/corsika})
+#  )
+
+install (
+  FILES
+  StackOne.h
+  DESTINATION
+  include/Stack
+  )
diff --git a/Framework/ParticleStack/StackOne.h b/Framework/ParticleStack/StackOne.h
index 0d8ab006..e41007a6 100644
--- a/Framework/ParticleStack/StackOne.h
+++ b/Framework/ParticleStack/StackOne.h
@@ -5,6 +5,7 @@
 #include <string>
 
 #include <StackInterface/Stack.h>
+//#include <corsika/Stack.h>
 
 
 namespace stack {
@@ -24,8 +25,8 @@ namespace stack {
       void SetId(const int id) { GetStack().SetId(GetIndex(), id); }
       void SetEnergy(const double e) { GetStack().SetEnergy(GetIndex(), e); }
       
-      int GetId() const { GetStack().GetId(GetIndex()); }
-      double GetEnergy() const { GetStack().GetEnergy(GetIndex()); }
+      int GetId() const { return  GetStack().GetId(GetIndex()); }
+      double GetEnergy() const { return GetStack().GetEnergy(GetIndex()); }
       
       double GetPDG() const { return 0; } // ConvertToPDG(GetId()); }  
       void SetPDG(double v) { GetStack().SetId(0, 0); } //fIndex, ConvertFromPDG(v)); }
diff --git a/Framework/Particles/CMakeLists.txt b/Framework/Particles/CMakeLists.txt
index b408a769..f4305b5d 100644
--- a/Framework/Particles/CMakeLists.txt
+++ b/Framework/Particles/CMakeLists.txt
@@ -1,14 +1,27 @@
 
-add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/Framework/Particles/GeneratedParticleProperties.inc
-                   COMMAND ${PROJECT_SOURCE_DIR}/Framework/Particles/pdxml_reader.py ${PROJECT_SOURCE_DIR}/Framework/Particles/ParticleData.xml ${PROJECT_SOURCE_DIR}/Framework/Particles/ParticleClassNames.xml
-                   DEPENDS pdxml_reader.py ParticleData.xml ParticleClassNames.xml
-                   WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/Framework/Particles/
-                   COMMENT "Read PYTHIA8 particle data and produce C++ source code GeneratedParticleProperties.inc"
-                   VERBATIM)
+add_custom_command (
+  OUTPUT
+  ${PROJECT_BINARY_DIR}/Framework/Particles/GeneratedParticleProperties.inc
+  COMMAND
+  ${PROJECT_SOURCE_DIR}/Framework/Particles/pdxml_reader.py ${PROJECT_SOURCE_DIR}/Framework/Particles/ParticleData.xml ${PROJECT_SOURCE_DIR}/Framework/Particles/ParticleClassNames.xml
+  DEPENDS
+  pdxml_reader.py
+  ParticleData.xml
+  ParticleClassNames.xml
+  WORKING_DIRECTORY
+  ${PROJECT_BINARY_DIR}/Framework/Particles/
+  COMMENT
+  "Read PYTHIA8 particle data and produce C++ source code GeneratedParticleProperties.inc"
+  VERBATIM
+  )
 
 
 #set (PARTICLES_SOURCES )
-set (PARTICLE_HEADERS Particles.h ${PROJECT_BINARY_DIR}/Framework/Particles/GeneratedParticleProperties.inc)
+set (
+  PARTICLE_HEADERS
+  Particles.h
+  ${PROJECT_BINARY_DIR}/Framework/Particles/GeneratedParticleProperties.inc
+  )
 
 add_library (CORSIKAparticles INTERFACE)
 
@@ -21,21 +34,50 @@ add_library (CORSIKAparticles INTERFACE)
 #target_link_libraries (CORSIKAparticles CORSIKAunits)
 
 #target_include_directories (CORSIKAparticles PRIVATE   ${EIGEN3_INCLUDE_DIR})
-target_include_directories (CORSIKAparticles INTERFACE ${EIGEN3_INCLUDE_DIR})
-target_include_directories (CORSIKAparticles INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/Framework>
-                                                       $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/Framework>
-                                                       $<INSTALL_INTERFACE:include/Framework>
-                                                      )
+target_include_directories (
+  CORSIKAparticles
+  INTERFACE
+  ${EIGEN3_INCLUDE_DIR}
+  )
+
+target_include_directories (
+  CORSIKAparticles
+  INTERFACE
+  $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/Framework>
+  $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/Framework>
+  $<INSTALL_INTERFACE:include/Framework>
+  )
 
 #install (TARGETS CORSIKAparticles
 #         LIBRARY DESTINATION lib
 #         ARCHIVE DESTINATION lib
 #         PUBLIC_HEADER DESTINATION include/Particles)
 
-install (FILES ${PARTICLE_HEADERS} DESTINATION include/Particles)
+install (
+  FILES
+  ${PARTICLE_HEADERS}
+  DESTINATION
+  include/Particles
+  )
 
 # code testing
-add_executable (testParticles testParticles.cc ${PROJECT_BINARY_DIR}/Framework/Particles/GeneratedParticleProperties.inc)
-target_link_libraries (testParticles CORSIKAparticles CORSIKAunits CORSIKAthirdparty) # for catch2
-add_test (NAME testParticles COMMAND testParticles)
+add_executable (
+  testParticles
+  testParticles.cc
+  ${PROJECT_BINARY_DIR}/Framework/Particles/GeneratedParticleProperties.inc
+  )
+
+target_link_libraries (
+  testParticles
+  CORSIKAparticles
+  CORSIKAunits
+  CORSIKAthirdparty # for catch2
+  )
+
+add_test (
+  NAME
+  testParticles
+  COMMAND
+  testParticles
+  )
 
diff --git a/Framework/Particles/pdxml_reader.py b/Framework/Particles/pdxml_reader.py
index 62d24c7f..1394ed42 100755
--- a/Framework/Particles/pdxml_reader.py
+++ b/Framework/Particles/pdxml_reader.py
@@ -203,6 +203,8 @@ def gen_classes(pythia_db):
                 break
         
         string += "\n";
+        string += "/** @class " + cname + "\n"
+        string += "*/\n\n"
         string += "struct " + cname + "{\n"
         string += "   static InternalParticleCode GetType() { return Type; }\n"
         string += "   static quantity<energy_d> GetMass() { return masses[TypeIndex]; }\n"
diff --git a/Framework/StackInterface/CMakeLists.txt b/Framework/StackInterface/CMakeLists.txt
index f37313a2..21e15604 100644
--- a/Framework/StackInterface/CMakeLists.txt
+++ b/Framework/StackInterface/CMakeLists.txt
@@ -1,10 +1,31 @@
+set (
+  PUBLIC_HEADER_FILES
+  Stack.h
+  StackIterator.h
+  )
 
-add_library (CORSIKAstackinterface INTERFACE)
+add_library (
+  CORSIKAstackinterface
+  INTERFACE
+  )
 
-target_include_directories (CORSIKAstackinterface INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/Framework>
-                                                            $<INSTALL_INTERFACE:include/Framework>
-                                                            )
+target_include_directories (
+  CORSIKAstackinterface
+  INTERFACE
+  $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
+  $<INSTALL_INTERFACE:include>
+  )
 
-install (FILES Stack.h StackIterator.h
-         DESTINATION include/StackInterface)
+#add_custom_command (
+#  TARGET
+#  CORSIKAstackinterface
+#  PRE_BUILD
+#  COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PUBLIC_HEADER_FILES} ${PROJECT_BINARY_DIR}/include/corsika
+#  )
 
+install (
+  FILES
+  ${PUBLIC_HEADER_FILES}
+  DESTINATION
+  include/corsika
+  )
diff --git a/Framework/StackInterface/Stack.h b/Framework/StackInterface/Stack.h
index 9b9065d7..9412286b 100644
--- a/Framework/StackInterface/Stack.h
+++ b/Framework/StackInterface/Stack.h
@@ -2,6 +2,7 @@
 #define _include_Stack_h__
 
 #include <StackInterface/StackIterator.h> // to help application programmres
+//#include <corsika/StackIterator.h> // to help application programmres
 
 /**
    All classes around management of particles on a stack.
-- 
GitLab