From 389920406bdc078f2405352cff58ab35f7e9b0a5 Mon Sep 17 00:00:00 2001
From: "s.zharko@gsi.de" <s.zharko@gsi.de>
Date: Fri, 29 Nov 2024 14:22:18 +0100
Subject: [PATCH 1/6] Algo: moving the PartitionedVector, PartitionedSpan and
 PODVector into a separate header-only library

---
 algo/CMakeLists.txt                         | 44 +++------------------
 algo/base/CMakeLists.txt                    |  1 +
 algo/base/pvector/CMakeLists.txt            | 21 ++++++++++
 algo/base/{util => pvector}/PODAllocator.h  |  0
 algo/base/{ => pvector}/PODVector.h         |  2 +-
 algo/base/{ => pvector}/PartitionedSpan.h   | 27 ++++++-------
 algo/base/{ => pvector}/PartitionedVector.h | 23 ++++++-----
 algo/test/_GTestPartitionedSpan.cxx         |  3 ++
 algo/test/_GTestPartitionedVector.cxx       |  2 +
 9 files changed, 57 insertions(+), 66 deletions(-)
 create mode 100644 algo/base/pvector/CMakeLists.txt
 rename algo/base/{util => pvector}/PODAllocator.h (100%)
 rename algo/base/{ => pvector}/PODVector.h (96%)
 rename algo/base/{ => pvector}/PartitionedSpan.h (88%)
 rename algo/base/{ => pvector}/PartitionedVector.h (91%)

diff --git a/algo/CMakeLists.txt b/algo/CMakeLists.txt
index 612c11a1a5..4f7f9b50ef 100644
--- a/algo/CMakeLists.txt
+++ b/algo/CMakeLists.txt
@@ -52,13 +52,12 @@ if (CBM_ONLINE_STANDALONE)
   add_subdirectory(../external external)
 endif()
 
-add_subdirectory(kfp)
+add_subdirectory(base)
 add_subdirectory(log)
+add_subdirectory(ca)
 add_subdirectory(data)
 add_subdirectory(kf)
-add_subdirectory(ca)
-add_subdirectory(base)
-#add_subdirectory(kfp) # For KFParticleOnline
+add_subdirectory(kfp)
 
 # exclude unittests from being build inside the container
 if (NOT CBM_ONLINE_STANDALONE)
@@ -217,6 +216,7 @@ target_include_directories(Algo
 
 target_link_libraries(Algo
   PUBLIC    OnlineData
+            PVector
             KfCore
             CaCore
             ROOT::GenVector
@@ -294,6 +294,7 @@ if (NOT CBM_ONLINE_STANDALONE)
 
   target_link_libraries(AlgoOffline
     PUBLIC    CbmData
+              PVector
               KfCoreOffline
               CaCoreOffline
               ROOT::GenVector
@@ -361,46 +362,11 @@ install(DIRECTORY evbuild TYPE INCLUDE FILES_MATCHING PATTERN "*.h")
 
 install(
   FILES
-    base/ChainContext.h
-    base/Definitions.h
-    base/HistogramSender.h
-    base/Options.h
-    base/RecoParams.h
-    base/SubChain.h
-    base/System.h
-    base/PartitionedVector.h
-    base/PartitionedSpan.h
-    base/DigiData.h
-    base/PODVector.h
-    base/AlgoTraits.h
-    base/AuxDigiData.h
-    base/BuildInfo.h
-    base/Exceptions.h
-    base/MainConfig.h
-    evselector/DigiEventSelector.h
-    evselector/DigiEventSelectorConfig.h
-    trigger/DigiTriggerConfig.h
-    trigger/HitMultTrigger.h
-    trigger/TimeClusterTrigger.h
-    trigger/V0Trigger.h
-    trigger/V0TriggerConfig.h
-    unpack/CommonUnpacker.h
-    unpack/UnpackMSBase.h
-    global/ParFiles.h
     global/Reco.h
     global/RecoResults.h
     global/RecoResultsInputArchive.h
     global/RecoResultsOutputArchive.h
     global/StorableRecoResults.h
-    qa/Accumulators.h
-    qa/Histogram.h
-    ca/TrackingChain.h
-    ca/TrackingChainConfig.h
-    ca/TrackingDefs.h
-    ca/TrackingSetup.h
-    # NOTE: SZh 20.11.2023:
-    #       The ca/qa directory depends on the online qa classes, so for now it has to be a part of the Algo library.
-    ca/qa/CaQa.h
   DESTINATION
     include/
 )
diff --git a/algo/base/CMakeLists.txt b/algo/base/CMakeLists.txt
index 93b295fe0a..ec043f688c 100644
--- a/algo/base/CMakeLists.txt
+++ b/algo/base/CMakeLists.txt
@@ -1 +1,2 @@
 add_subdirectory(yaml)
+add_subdirectory(pvector)
diff --git a/algo/base/pvector/CMakeLists.txt b/algo/base/pvector/CMakeLists.txt
new file mode 100644
index 0000000000..dd79d38da0
--- /dev/null
+++ b/algo/base/pvector/CMakeLists.txt
@@ -0,0 +1,21 @@
+set(INCLUDE_DIRECTORIES
+  ${CMAKE_CURRENT_SOURCE_DIR}
+)
+
+add_library(PVector INTERFACE)
+
+target_include_directories(PVector
+  INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
+)
+
+target_link_libraries(PVector
+  INTERFACE GSL
+)
+
+install(
+  FILES 
+    PartitionedVector.h
+    PartitionedSpan.h
+  DESTINATION
+    include/
+)
diff --git a/algo/base/util/PODAllocator.h b/algo/base/pvector/PODAllocator.h
similarity index 100%
rename from algo/base/util/PODAllocator.h
rename to algo/base/pvector/PODAllocator.h
diff --git a/algo/base/PODVector.h b/algo/base/pvector/PODVector.h
similarity index 96%
rename from algo/base/PODVector.h
rename to algo/base/pvector/PODVector.h
index 16f1ceed51..587f50bce1 100644
--- a/algo/base/PODVector.h
+++ b/algo/base/pvector/PODVector.h
@@ -4,7 +4,7 @@
 #ifndef CBM_ALGO_BASE_POD_VECTOR_H
 #define CBM_ALGO_BASE_POD_VECTOR_H
 
-#include "util/PODAllocator.h"
+#include "PODAllocator.h"
 
 #include <vector>
 
diff --git a/algo/base/PartitionedSpan.h b/algo/base/pvector/PartitionedSpan.h
similarity index 88%
rename from algo/base/PartitionedSpan.h
rename to algo/base/pvector/PartitionedSpan.h
index c626b75552..beac6c2a7f 100644
--- a/algo/base/PartitionedSpan.h
+++ b/algo/base/pvector/PartitionedSpan.h
@@ -4,12 +4,11 @@
 #ifndef CBM_ALGO_BASE_PARTITIONED_SPAN_H
 #define CBM_ALGO_BASE_PARTITIONED_SPAN_H
 
-#include "Definitions.h"
-
 #include <array>
 #include <gsl/span>
 #include <stdexcept>
 #include <vector>
+#include <cstdint>
 
 namespace cbm::algo
 {
@@ -36,7 +35,7 @@ namespace cbm::algo
     // #if  defined(__INTELLISENSE__) || defined(__clang__)
     template<typename Allocator>
     PartitionedSpan(std::vector<T, Allocator>& container, gsl::span<const size_t> offsets,
-                    gsl::span<const u32> addresses)
+                    gsl::span<const uint32_t> addresses)
       : fData(container)
       , fOffsets(offsets)
       , fAdresses(addresses)
@@ -47,7 +46,7 @@ namespace cbm::algo
     // FIXME disable if T is non-const via SFINAE, otherwise get misleading compiler errors
     template<typename Allocator>
     PartitionedSpan(const std::vector<T, Allocator>& container, gsl::span<const size_t> offsets,
-                    gsl::span<const u32> addresses)
+                    gsl::span<const uint32_t> addresses)
       : fData(container)
       , fOffsets(offsets)
       , fAdresses(addresses)
@@ -56,7 +55,7 @@ namespace cbm::algo
     }
 
     template<size_t N>
-    PartitionedSpan(std::array<T, N>& container, gsl::span<const size_t> offsets, gsl::span<const u32> addresses)
+    PartitionedSpan(std::array<T, N>& container, gsl::span<const size_t> offsets, gsl::span<const uint32_t> addresses)
       : fData(container)
       , fOffsets(offsets)
       , fAdresses(addresses)
@@ -66,7 +65,7 @@ namespace cbm::algo
 
     // FIXME disable if T is non-const via SFINAE
     template<size_t N>
-    PartitionedSpan(const std::array<T, N>& container, gsl::span<const size_t> offsets, gsl::span<const u32> addresses)
+    PartitionedSpan(const std::array<T, N>& container, gsl::span<const size_t> offsets, gsl::span<const uint32_t> addresses)
       : fData(container)
       , fOffsets(offsets)
       , fAdresses(addresses)
@@ -75,7 +74,7 @@ namespace cbm::algo
     }
     // #endif
 
-    PartitionedSpan(gsl::span<T> data, gsl::span<const size_t> offsets, gsl::span<const u32> addresses)
+    PartitionedSpan(gsl::span<T> data, gsl::span<const size_t> offsets, gsl::span<const uint32_t> addresses)
       : fData(data)
       , fOffsets(offsets)
       , fAdresses(addresses)
@@ -115,16 +114,16 @@ namespace cbm::algo
       return UnsafePartitionSpan(i);
     }
 
-    u32 Address(size_t i) const
+    uint32_t Address(size_t i) const
     {
       EnsureBounds(i);
       return fAdresses[i];
     }
 
-    std::pair<gsl::span<T>, u32> Partition(size_t i) const
+    std::pair<gsl::span<T>, uint32_t> Partition(size_t i) const
     {
       EnsureBounds(i);
-      return std::pair<gsl::span<T>, u32>(UnsafePartitionSpan(i), fAdresses[i]);
+      return std::pair<gsl::span<T>, uint32_t>(UnsafePartitionSpan(i), fAdresses[i]);
     }
 
     size_t NPartitions() const { return fAdresses.size(); }
@@ -139,7 +138,7 @@ namespace cbm::algo
 
     gsl::span<T> Data() const { return fData; }
 
-    gsl::span<const u32> Addresses() const { return fAdresses; }
+    gsl::span<const uint32_t> Addresses() const { return fAdresses; }
 
     gsl::span<const size_t> Offsets() const { return fOffsets; }
 
@@ -149,7 +148,7 @@ namespace cbm::algo
 
     gsl::span<T> fData;
     gsl::span<const size_t> fOffsets;
-    gsl::span<const u32> fAdresses;
+    gsl::span<const uint32_t> fAdresses;
 
     // FIXME code duplication with PartitionedVector
 
@@ -176,10 +175,10 @@ namespace cbm::algo
 
   // template auto deduction
   template<typename T, template<typename> class Container>
-  PartitionedSpan(Container<T>&, gsl::span<const size_t>, gsl::span<const u32>) -> PartitionedSpan<T>;
+  PartitionedSpan(Container<T>&, gsl::span<const size_t>, gsl::span<const uint32_t>) -> PartitionedSpan<T>;
 
   template<typename T, template<typename> class Container>
-  PartitionedSpan(const Container<T>&, gsl::span<const size_t>, gsl::span<const u32>) -> PartitionedSpan<const T>;
+  PartitionedSpan(const Container<T>&, gsl::span<const size_t>, gsl::span<const uint32_t>) -> PartitionedSpan<const T>;
 
   template<typename T, typename Allocator>
   PartitionedSpan(PartitionedVector<T, Allocator>&) -> PartitionedSpan<T>;
diff --git a/algo/base/PartitionedVector.h b/algo/base/pvector/PartitionedVector.h
similarity index 91%
rename from algo/base/PartitionedVector.h
rename to algo/base/pvector/PartitionedVector.h
index 6aa91585c0..6c8cab3b5f 100644
--- a/algo/base/PartitionedVector.h
+++ b/algo/base/pvector/PartitionedVector.h
@@ -4,8 +4,7 @@
 #ifndef CBM_ALGO_BASE_PARTITIONED_VECTOR_H
 #define CBM_ALGO_BASE_PARTITIONED_VECTOR_H
 
-#include "Definitions.h"
-#include "util/PODAllocator.h"
+#include "PODAllocator.h"
 
 #include <boost/serialization/access.hpp>
 #include <boost/serialization/vector.hpp>
@@ -46,7 +45,7 @@ namespace cbm::algo
      *
      * @note Requires sizes.size() == addresses.size()
      */
-    PartitionedVector(Container_t&& data, gsl::span<const size_t> sizes, gsl::span<const u32> addresses)
+    PartitionedVector(Container_t&& data, gsl::span<const size_t> sizes, gsl::span<const uint32_t> addresses)
       : fData(std::move(data))
       , fOffsets()
       , fAddresses(addresses.begin(), addresses.end())
@@ -149,7 +148,7 @@ namespace cbm::algo
     /**
      * @brief Get the hardware address of partition i.
      */
-    u32 Address(size_t i) const
+    uint32_t Address(size_t i) const
     {
       EnsureBounds(i);
       return fAddresses[i];
@@ -169,19 +168,19 @@ namespace cbm::algo
     /**
      * @brief Get a pair of the data and the hardware address of partition i.
      */
-    std::pair<gsl::span<T>, u32> Partition(size_t i)
+    std::pair<gsl::span<T>, uint32_t> Partition(size_t i)
     {
       EnsureBounds(i);
-      return std::pair<gsl::span<T>, u32>(UnsafePartitionSpan(i), fAddresses[i]);
+      return std::pair<gsl::span<T>, uint32_t>(UnsafePartitionSpan(i), fAddresses[i]);
     }
 
     /**
      * @brief Get a pair of the data and the hardware address of partition i.
      */
-    std::pair<gsl::span<const T>, u32> Partition(size_t i) const
+    std::pair<gsl::span<const T>, uint32_t> Partition(size_t i) const
     {
       EnsureBounds(i);
-      return std::pair<gsl::span<const T>, u32>(UnsafePartitionSpan(i), fAddresses[i]);
+      return std::pair<gsl::span<const T>, uint32_t>(UnsafePartitionSpan(i), fAddresses[i]);
     }
 
     /**
@@ -221,7 +220,7 @@ namespace cbm::algo
     /**
      * @brief Get the addresses.
      */
-    const std::vector<u32>& Addresses() const { return fAddresses; }
+    const std::vector<uint32_t>& Addresses() const { return fAddresses; }
 
     /**
      * @brief Get the underlying offsets.
@@ -230,9 +229,9 @@ namespace cbm::algo
 
 
    private:
-    Container_t fData;             //< Data
-    std::vector<size_t> fOffsets;  // < Offsets of the partitions in fData
-    std::vector<u32> fAddresses;   //< Hardware addresses of the partitions
+    Container_t fData;                 ///< Data
+    std::vector<size_t> fOffsets;      ///< Offsets of the partitions in fData
+    std::vector<uint32_t> fAddresses;  ///< Addresses of the partitions
 
     void EnsureDimensions() const
     {
diff --git a/algo/test/_GTestPartitionedSpan.cxx b/algo/test/_GTestPartitionedSpan.cxx
index ccc3823250..3da8519974 100644
--- a/algo/test/_GTestPartitionedSpan.cxx
+++ b/algo/test/_GTestPartitionedSpan.cxx
@@ -1,6 +1,9 @@
 /* Copyright (C) 2023 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer] */
+
+#include "Definitions.h"
+
 #include "PartitionedSpan.h"
 #include "PartitionedVector.h"
 
diff --git a/algo/test/_GTestPartitionedVector.cxx b/algo/test/_GTestPartitionedVector.cxx
index 49ab5b1760..61876f6c3c 100644
--- a/algo/test/_GTestPartitionedVector.cxx
+++ b/algo/test/_GTestPartitionedVector.cxx
@@ -2,6 +2,8 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer] */
 
+#include "Definitions.h"
+
 #include "PODVector.h"
 #include "PartitionedVector.h"
 #include "gtest/gtest.h"
-- 
GitLab


From aa3d366f49db4dd3739d2805d8ec3c332eb548fe Mon Sep 17 00:00:00 2001
From: "s.zharko@gsi.de" <s.zharko@gsi.de>
Date: Thu, 19 Dec 2024 01:39:41 +0100
Subject: [PATCH 2/6] - Moving contents of PVector into the
 CbmContainers/OnlineContainers library; - the PartitionedVector and co. are
 moved from cbm::algo to the cbm namespace; - the CMake rule for building the
 OnlineData is moved from algo/data to algo/online/data directory

---
 algo/CMakeLists.txt                           | 44 +++++++++++++++++--
 algo/base/CMakeLists.txt                      |  1 -
 algo/base/pvector/CMakeLists.txt              | 21 ---------
 algo/detectors/bmon/Clusterizer.h             |  2 +-
 algo/detectors/sts/HitfinderChain.cxx         |  2 +
 algo/online/CMakeLists.txt                    |  6 +++
 algo/online/containers/CMakeLists.txt         | 17 +++++++
 algo/{ => online}/data/CMakeLists.txt         |  2 +-
 algo/test/_GTestPartitionedSpan.cxx           |  4 +-
 algo/test/_GTestPartitionedVector.cxx         |  5 ++-
 core/CMakeLists.txt                           |  1 +
 core/containers/CMakeLists.txt                | 36 +++++++++++++++
 .../containers}/PODAllocator.h                |  4 +-
 .../pvector => core/containers}/PODVector.h   |  4 +-
 .../containers}/PartitionedSpan.h             |  9 ++--
 .../containers}/PartitionedVector.h           |  4 +-
 reco/steer/CbmSourceRecoTimeslice.cxx         |  8 ++--
 reco/steer/CbmSourceRecoTimeslice.h           |  8 ++--
 reco/tasks/CbmTaskInspectRecoTimeslice.h      |  8 ++--
 19 files changed, 135 insertions(+), 51 deletions(-)
 delete mode 100644 algo/base/pvector/CMakeLists.txt
 create mode 100644 algo/online/CMakeLists.txt
 create mode 100644 algo/online/containers/CMakeLists.txt
 rename algo/{ => online}/data/CMakeLists.txt (96%)
 create mode 100644 core/containers/CMakeLists.txt
 rename {algo/base/pvector => core/containers}/PODAllocator.h (96%)
 rename {algo/base/pvector => core/containers}/PODVector.h (94%)
 rename {algo/base/pvector => core/containers}/PartitionedSpan.h (98%)
 rename {algo/base/pvector => core/containers}/PartitionedVector.h (99%)

diff --git a/algo/CMakeLists.txt b/algo/CMakeLists.txt
index 4f7f9b50ef..c08f4afc82 100644
--- a/algo/CMakeLists.txt
+++ b/algo/CMakeLists.txt
@@ -55,7 +55,7 @@ endif()
 add_subdirectory(base)
 add_subdirectory(log)
 add_subdirectory(ca)
-add_subdirectory(data)
+add_subdirectory(online)
 add_subdirectory(kf)
 add_subdirectory(kfp)
 
@@ -216,7 +216,7 @@ target_include_directories(Algo
 
 target_link_libraries(Algo
   PUBLIC    OnlineData
-            PVector
+            OnlineContainers
             KfCore
             CaCore
             ROOT::GenVector
@@ -294,7 +294,7 @@ if (NOT CBM_ONLINE_STANDALONE)
 
   target_link_libraries(AlgoOffline
     PUBLIC    CbmData
-              PVector
+              CbmContainers
               KfCoreOffline
               CaCoreOffline
               ROOT::GenVector
@@ -362,11 +362,49 @@ install(DIRECTORY evbuild TYPE INCLUDE FILES_MATCHING PATTERN "*.h")
 
 install(
   FILES
+    base/ChainContext.h
+    base/Definitions.h
+    base/HistogramSender.h
+    base/Options.h
+    base/RecoParams.h
+    base/SubChain.h
+    base/System.h
+    base/PartitionedVector.h
+    base/PartitionedSpan.h
+    base/DigiData.h
+    base/PODVector.h
+    base/AlgoTraits.h
+    base/AuxDigiData.h
+    base/BuildInfo.h
+    base/Exceptions.h
+    base/MainConfig.h
+    evselector/DigiEventSelector.h
+    evselector/DigiEventSelectorConfig.h
+    trigger/DigiTriggerConfig.h
+    trigger/HitMultTrigger.h
+    trigger/TimeClusterTrigger.h
+    trigger/V0Trigger.h
+    trigger/V0TriggerConfig.h
+    unpack/CommonUnpacker.h
+    unpack/UnpackMSBase.h
+    global/ParFiles.h
     global/Reco.h
     global/RecoResults.h
     global/RecoResultsInputArchive.h
     global/RecoResultsOutputArchive.h
     global/StorableRecoResults.h
+    qa/Accumulators.h
+    qa/Histogram.h
+    ca/TrackingChain.h
+    ca/TrackingChainConfig.h
+    ca/TrackingDefs.h
+    ca/TrackingSetup.h
+    # NOTE: SZh 20.11.2023:
+    #       The ca/qa directory depends on the online qa classes, so for now it has to be a part of the Algo library.
+    ca/qa/CaQa.h
+  
   DESTINATION
     include/
 )
+
+
diff --git a/algo/base/CMakeLists.txt b/algo/base/CMakeLists.txt
index ec043f688c..93b295fe0a 100644
--- a/algo/base/CMakeLists.txt
+++ b/algo/base/CMakeLists.txt
@@ -1,2 +1 @@
 add_subdirectory(yaml)
-add_subdirectory(pvector)
diff --git a/algo/base/pvector/CMakeLists.txt b/algo/base/pvector/CMakeLists.txt
deleted file mode 100644
index dd79d38da0..0000000000
--- a/algo/base/pvector/CMakeLists.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-set(INCLUDE_DIRECTORIES
-  ${CMAKE_CURRENT_SOURCE_DIR}
-)
-
-add_library(PVector INTERFACE)
-
-target_include_directories(PVector
-  INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
-)
-
-target_link_libraries(PVector
-  INTERFACE GSL
-)
-
-install(
-  FILES 
-    PartitionedVector.h
-    PartitionedSpan.h
-  DESTINATION
-    include/
-)
diff --git a/algo/detectors/bmon/Clusterizer.h b/algo/detectors/bmon/Clusterizer.h
index 86b3c76e3b..276f28d1ba 100644
--- a/algo/detectors/bmon/Clusterizer.h
+++ b/algo/detectors/bmon/Clusterizer.h
@@ -9,7 +9,7 @@
 
 #pragma once
 
-#include "base/PODVector.h"
+#include "PODVector.h"
 #include "bmon/ClusterizerPars.h"
 #include "bmon/Hit.h"
 
diff --git a/algo/detectors/sts/HitfinderChain.cxx b/algo/detectors/sts/HitfinderChain.cxx
index 6f65f46212..2b4a4324b1 100644
--- a/algo/detectors/sts/HitfinderChain.cxx
+++ b/algo/detectors/sts/HitfinderChain.cxx
@@ -12,6 +12,8 @@
 #include <numeric>
 
 using namespace cbm::algo;
+using cbm::PartitionedSpan;
+using cbm::PartitionedVector;
 
 void sts::HitfinderChain::SetParameters(const HitfinderChainPars& parameters)
 {
diff --git a/algo/online/CMakeLists.txt b/algo/online/CMakeLists.txt
new file mode 100644
index 0000000000..f72fc4858c
--- /dev/null
+++ b/algo/online/CMakeLists.txt
@@ -0,0 +1,6 @@
+# A rule to build the online versions of CbmRoot core libraries
+#
+add_subdirectory(containers)
+add_subdirectory(data)
+
+
diff --git a/algo/online/containers/CMakeLists.txt b/algo/online/containers/CMakeLists.txt
new file mode 100644
index 0000000000..34a95ef9d3
--- /dev/null
+++ b/algo/online/containers/CMakeLists.txt
@@ -0,0 +1,17 @@
+# Online version of libCbmContainers
+
+set(OFFLINE_CONTAINERS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../core/containers)
+
+add_library(OnlineContainers INTERFACE)
+
+target_include_directories(OnlineContainers
+  INTERFACE ${OFFLINE_CONTAINERS_DIR}
+)
+
+target_compile_definitions(OnlineContainers INTERFACE NO_ROOT)
+
+target_link_libraries(OnlineContainers 
+  INTERFACE GSL
+)
+
+install(TARGETS OnlineContainers DESTINATION lib)
diff --git a/algo/data/CMakeLists.txt b/algo/online/data/CMakeLists.txt
similarity index 96%
rename from algo/data/CMakeLists.txt
rename to algo/online/data/CMakeLists.txt
index 717ba53896..0d99f1d5fa 100644
--- a/algo/data/CMakeLists.txt
+++ b/algo/online/data/CMakeLists.txt
@@ -2,7 +2,7 @@
 # the array .
 # The extension is already found.  Any number of sources could be listed here.
 
-set(OFFLINE_DATA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../core/data)
+set(OFFLINE_DATA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../core/data)
 
 set(SRCS
   ${OFFLINE_DATA_DIR}/CbmDefs.cxx
diff --git a/algo/test/_GTestPartitionedSpan.cxx b/algo/test/_GTestPartitionedSpan.cxx
index 3da8519974..08bd000939 100644
--- a/algo/test/_GTestPartitionedSpan.cxx
+++ b/algo/test/_GTestPartitionedSpan.cxx
@@ -3,7 +3,6 @@
    Authors: Felix Weiglhofer [committer] */
 
 #include "Definitions.h"
-
 #include "PartitionedSpan.h"
 #include "PartitionedVector.h"
 
@@ -11,6 +10,9 @@
 
 using namespace cbm::algo;
 
+using cbm::PartitionedSpan;
+using cbm::PartitionedVector;
+
 template<typename T>
 void EXPECT_CONTAINER_EQ(gsl::span<T> a, std::vector<i32> b)
 {
diff --git a/algo/test/_GTestPartitionedVector.cxx b/algo/test/_GTestPartitionedVector.cxx
index 61876f6c3c..5eda3d2f97 100644
--- a/algo/test/_GTestPartitionedVector.cxx
+++ b/algo/test/_GTestPartitionedVector.cxx
@@ -3,13 +3,16 @@
    Authors: Felix Weiglhofer [committer] */
 
 #include "Definitions.h"
-
 #include "PODVector.h"
 #include "PartitionedVector.h"
 #include "gtest/gtest.h"
 
 using namespace cbm::algo;
 
+using cbm::PartitionedPODVector;
+using cbm::PartitionedVector;
+using cbm::PODAllocator;
+
 template<typename T>
 void EXPECT_CONTAINER_EQ(gsl::span<const T> a, std::vector<T> b)
 {
diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt
index 7fa667426b..320b0dc4d6 100644
--- a/core/CMakeLists.txt
+++ b/core/CMakeLists.txt
@@ -2,6 +2,7 @@
 set(CBMDATA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/data)
 set(CBMBASE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/base)
 
+add_subdirectory(containers)
 add_subdirectory(data)
 add_subdirectory(field)
 add_subdirectory(base)
diff --git a/core/containers/CMakeLists.txt b/core/containers/CMakeLists.txt
new file mode 100644
index 0000000000..d1987b2815
--- /dev/null
+++ b/core/containers/CMakeLists.txt
@@ -0,0 +1,36 @@
+# Library: CbmContainers
+# 
+set(INCLUDE_DIRECTORIES
+  ${CMAKE_CURRENT_SOURCE_DIR}
+)
+
+set(HEADERS 
+  PartitionedVector.h
+  PartitionedSpan.h
+  PODVector.h
+  PODAllocator.h
+)
+
+set(LIBRARY_NAME CbmContainers)
+
+add_library(${LIBRARY_NAME} INTERFACE)
+
+target_include_directories(${LIBRARY_NAME}
+  INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
+)
+
+target_link_libraries(${LIBRARY_NAME}
+  INTERFACE GSL
+)
+
+install(TARGETS CbmContainers DESTINATION lib)
+
+install(
+  FILES 
+    PartitionedVector.h
+    PartitionedSpan.h
+    PODAllocator.h
+    PODVector.h
+  DESTINATION
+    include/
+)
diff --git a/algo/base/pvector/PODAllocator.h b/core/containers/PODAllocator.h
similarity index 96%
rename from algo/base/pvector/PODAllocator.h
rename to core/containers/PODAllocator.h
index 45f1ea89f3..8c0dcbc064 100644
--- a/algo/base/pvector/PODAllocator.h
+++ b/core/containers/PODAllocator.h
@@ -8,7 +8,7 @@
 #include <type_traits>
 #include <utility>
 
-namespace cbm::algo
+namespace cbm
 {
   /**
   * @brief Allocator for plain old data types.
@@ -39,6 +39,6 @@ namespace cbm::algo
     bool operator==(const PODAllocator&) const { return true; }
     bool operator!=(const PODAllocator&) const { return false; }
   };
-}  // namespace cbm::algo
+}  // namespace cbm
 
 #endif  // CBM_ALGO_BASE_POD_ALLOCATOR_H
diff --git a/algo/base/pvector/PODVector.h b/core/containers/PODVector.h
similarity index 94%
rename from algo/base/pvector/PODVector.h
rename to core/containers/PODVector.h
index 587f50bce1..d63f042c93 100644
--- a/algo/base/pvector/PODVector.h
+++ b/core/containers/PODVector.h
@@ -8,7 +8,7 @@
 
 #include <vector>
 
-namespace cbm::algo
+namespace cbm
 {
   /**
   * @brief PODVector is a std::vector that doesn't initialize its elements.
@@ -28,6 +28,6 @@ namespace cbm::algo
     return PODVector<T>(vec.begin(), vec.end());
   }
 
-}  // namespace cbm::algo
+}  // namespace cbm
 
 #endif  // CBM_ALGO_BASE_POD_VECTOR_H
diff --git a/algo/base/pvector/PartitionedSpan.h b/core/containers/PartitionedSpan.h
similarity index 98%
rename from algo/base/pvector/PartitionedSpan.h
rename to core/containers/PartitionedSpan.h
index beac6c2a7f..20cb76f12b 100644
--- a/algo/base/pvector/PartitionedSpan.h
+++ b/core/containers/PartitionedSpan.h
@@ -5,12 +5,12 @@
 #define CBM_ALGO_BASE_PARTITIONED_SPAN_H
 
 #include <array>
+#include <cstdint>
 #include <gsl/span>
 #include <stdexcept>
 #include <vector>
-#include <cstdint>
 
-namespace cbm::algo
+namespace cbm
 {
 
   template<typename T, typename Allocator>
@@ -65,7 +65,8 @@ namespace cbm::algo
 
     // FIXME disable if T is non-const via SFINAE
     template<size_t N>
-    PartitionedSpan(const std::array<T, N>& container, gsl::span<const size_t> offsets, gsl::span<const uint32_t> addresses)
+    PartitionedSpan(const std::array<T, N>& container, gsl::span<const size_t> offsets,
+                    gsl::span<const uint32_t> addresses)
       : fData(container)
       , fOffsets(offsets)
       , fAdresses(addresses)
@@ -186,6 +187,6 @@ namespace cbm::algo
   template<typename T, typename Allocator>
   PartitionedSpan(const PartitionedVector<T, Allocator>&) -> PartitionedSpan<const T>;
 
-}  // namespace cbm::algo
+}  // namespace cbm
 
 #endif
diff --git a/algo/base/pvector/PartitionedVector.h b/core/containers/PartitionedVector.h
similarity index 99%
rename from algo/base/pvector/PartitionedVector.h
rename to core/containers/PartitionedVector.h
index 6c8cab3b5f..c059986094 100644
--- a/algo/base/pvector/PartitionedVector.h
+++ b/core/containers/PartitionedVector.h
@@ -12,7 +12,7 @@
 #include <gsl/span>
 #include <vector>
 
-namespace cbm::algo
+namespace cbm
 {
   template<typename T>
   class PartitionedSpan;
@@ -284,6 +284,6 @@ namespace cbm::algo
   template<typename T>
   using PartitionedPODVector = PartitionedVector<T, PODAllocator<T>>;
 
-}  // namespace cbm::algo
+}  // namespace cbm
 
 #endif
diff --git a/reco/steer/CbmSourceRecoTimeslice.cxx b/reco/steer/CbmSourceRecoTimeslice.cxx
index a94565dfcb..f429905509 100644
--- a/reco/steer/CbmSourceRecoTimeslice.cxx
+++ b/reco/steer/CbmSourceRecoTimeslice.cxx
@@ -79,22 +79,22 @@ Bool_t CbmSourceRecoTimeslice::Init()
   };
 
   // TODO: replace individual vectors with reco-timeslice objects
-  fBmonHits = new PartitionedVector<bmon::Hit>();
+  fBmonHits = new cbm::PartitionedVector<bmon::Hit>();
   if (!RegisterVector(fBmonHits, "OnlineBmonHit")) {
     return kFALSE;
   }
 
-  fStsHits = new PartitionedVector<sts::Hit>();
+  fStsHits = new cbm::PartitionedVector<sts::Hit>();
   if (!RegisterVector(fStsHits, "OnlineStsHit")) {
     return kFALSE;
   }
 
-  fTrdHits = new PartitionedVector<trd::Hit>();
+  fTrdHits = new cbm::PartitionedVector<trd::Hit>();
   if (!RegisterVector(fTrdHits, "OnlineTrdHit")) {
     return kFALSE;
   }
 
-  fTofHits = new PartitionedVector<tof::Hit>();
+  fTofHits = new cbm::PartitionedVector<tof::Hit>();
   if (!RegisterVector(fTofHits, "OnlineTofHit")) {
     return kFALSE;
   }
diff --git a/reco/steer/CbmSourceRecoTimeslice.h b/reco/steer/CbmSourceRecoTimeslice.h
index 1d0b907a6e..1b2763ab2a 100644
--- a/reco/steer/CbmSourceRecoTimeslice.h
+++ b/reco/steer/CbmSourceRecoTimeslice.h
@@ -81,10 +81,10 @@ class CbmSourceRecoTimeslice : public FairSource {
   void ClearOutputVectors();
 
   //* Data containers
-  cbm::algo::PartitionedVector<cbm::algo::bmon::Hit>* fBmonHits{nullptr};
-  cbm::algo::PartitionedVector<cbm::algo::sts::Hit>* fStsHits{nullptr};
-  cbm::algo::PartitionedVector<cbm::algo::trd::Hit>* fTrdHits{nullptr};
-  cbm::algo::PartitionedVector<cbm::algo::tof::Hit>* fTofHits{nullptr};
+  cbm::PartitionedVector<cbm::algo::bmon::Hit>* fBmonHits{nullptr};
+  cbm::PartitionedVector<cbm::algo::sts::Hit>* fStsHits{nullptr};
+  cbm::PartitionedVector<cbm::algo::trd::Hit>* fTrdHits{nullptr};
+  cbm::PartitionedVector<cbm::algo::tof::Hit>* fTofHits{nullptr};
   cbm::algo::ca::Vector<cbm::algo::ca::Track>* fTracks{nullptr};
   cbm::algo::StorableRecoResults::TrackHitIndexContainer_t* fTrackStsHitIndices{nullptr};
   cbm::algo::StorableRecoResults::TrackHitIndexContainer_t* fTrackTrdHitIndices{nullptr};
diff --git a/reco/tasks/CbmTaskInspectRecoTimeslice.h b/reco/tasks/CbmTaskInspectRecoTimeslice.h
index 16365d5f41..d1722a851b 100644
--- a/reco/tasks/CbmTaskInspectRecoTimeslice.h
+++ b/reco/tasks/CbmTaskInspectRecoTimeslice.h
@@ -53,10 +53,10 @@ class CbmTaskInspectRecoTimeslice : public FairTask {
   virtual InitStatus Init();
 
   //* Data containers
-  const cbm::algo::PartitionedVector<cbm::algo::bmon::Hit>* fBmonHits{nullptr};
-  const cbm::algo::PartitionedVector<cbm::algo::sts::Hit>* fStsHits{nullptr};
-  const cbm::algo::PartitionedVector<cbm::algo::trd::Hit>* fTrdHits{nullptr};
-  const cbm::algo::PartitionedVector<cbm::algo::tof::Hit>* fTofHits{nullptr};
+  const cbm::PartitionedVector<cbm::algo::bmon::Hit>* fBmonHits{nullptr};
+  const cbm::PartitionedVector<cbm::algo::sts::Hit>* fStsHits{nullptr};
+  const cbm::PartitionedVector<cbm::algo::trd::Hit>* fTrdHits{nullptr};
+  const cbm::PartitionedVector<cbm::algo::tof::Hit>* fTofHits{nullptr};
   const cbm::algo::ca::Vector<cbm::algo::ca::Track>* fTracks{nullptr};
   const cbm::algo::StorableRecoResults::TrackHitIndexContainer_t* fTrackStsHitIndices{nullptr};
   const cbm::algo::StorableRecoResults::TrackHitIndexContainer_t* fTrackTrdHitIndices{nullptr};
-- 
GitLab


From ba37ad6cc3b7d25a6ed33b92f8b2af7df4bc6ceb Mon Sep 17 00:00:00 2001
From: "s.zharko@gsi.de" <s.zharko@gsi.de>
Date: Fri, 18 Apr 2025 08:05:50 +0200
Subject: [PATCH 3/6] PODAllocator: loosen the requirements on T to
 non-polymorphic

This does not break the allocation mechanism, but allows to use the PODAllocator
with derived classes, which still do not rely on virtual functions.
---
 algo/CMakeLists.txt            | 3 ---
 core/containers/PODAllocator.h | 2 +-
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/algo/CMakeLists.txt b/algo/CMakeLists.txt
index c08f4afc82..1f32b344d6 100644
--- a/algo/CMakeLists.txt
+++ b/algo/CMakeLists.txt
@@ -369,10 +369,7 @@ install(
     base/RecoParams.h
     base/SubChain.h
     base/System.h
-    base/PartitionedVector.h
-    base/PartitionedSpan.h
     base/DigiData.h
-    base/PODVector.h
     base/AlgoTraits.h
     base/AuxDigiData.h
     base/BuildInfo.h
diff --git a/core/containers/PODAllocator.h b/core/containers/PODAllocator.h
index 8c0dcbc064..c276655e06 100644
--- a/core/containers/PODAllocator.h
+++ b/core/containers/PODAllocator.h
@@ -22,7 +22,7 @@ namespace cbm
     // static_assert(std::is_trivially_constructible_v<T>, "PODAllocator only works for POD types");
 
     // Ensure T has no vtable
-    static_assert(std::is_standard_layout_v<T>, "PODAllocator only works with types with standard layout");
+    static_assert(!std::is_polymorphic_v<T>, "PODAllocator only works with types with non-polymorphic types");
 
     using value_type = T;
 
-- 
GitLab


From 3041236d1f9d3870893af8082049a1d88f2b3ce1 Mon Sep 17 00:00:00 2001
From: "s.zharko@gsi.de" <s.zharko@gsi.de>
Date: Tue, 22 Apr 2025 21:12:27 +0200
Subject: [PATCH 4/6] Moving cbm::algo::EnumDict to CbmUtility library as
 cbm::util::EnumDict

---
 algo/CMakeLists.txt                           |  9 +++---
 algo/base/CMakeLists.txt                      |  1 -
 algo/base/Definitions.h                       | 20 ++++++------
 algo/base/RecoParams.h                        | 11 +++----
 algo/base/util/ProfilingLevel.h               |  2 +-
 algo/detectors/sts/HitfinderChain.cxx         |  2 +-
 algo/global/ParFiles.cxx                      |  2 +-
 algo/global/Reco.cxx                          |  2 +-
 algo/unpack/CommonUnpacker.cxx                |  4 +--
 algo/unpack/CommonUnpacker.h                  |  4 +--
 core/CMakeLists.txt                           |  1 +
 core/containers/CMakeLists.txt                |  3 ++
 core/qa/CMakeLists.txt                        |  1 -
 core/utility/CMakeLists.txt                   | 31 +++++++++++++++++++
 .../utility/CbmEnumDict.cxx                   |  4 +--
 .../EnumDict.h => core/utility/CbmEnumDict.h  | 20 ++++++------
 {algo/base => core/utility}/yaml/BaseTypes.h  |  0
 .../base => core/utility}/yaml/CMakeLists.txt |  5 +--
 {algo/base => core/utility}/yaml/Property.h   |  2 --
 {algo/base => core/utility}/yaml/Yaml.h       | 27 +++++++++++-----
 20 files changed, 98 insertions(+), 53 deletions(-)
 delete mode 100644 algo/base/CMakeLists.txt
 create mode 100644 core/utility/CMakeLists.txt
 rename algo/base/util/EnumDict.cxx => core/utility/CbmEnumDict.cxx (85%)
 rename algo/base/util/EnumDict.h => core/utility/CbmEnumDict.h (87%)
 rename {algo/base => core/utility}/yaml/BaseTypes.h (100%)
 rename {algo/base => core/utility}/yaml/CMakeLists.txt (68%)
 rename {algo/base => core/utility}/yaml/Property.h (99%)
 rename {algo/base => core/utility}/yaml/Yaml.h (93%)

diff --git a/algo/CMakeLists.txt b/algo/CMakeLists.txt
index 1f32b344d6..c4100eca53 100644
--- a/algo/CMakeLists.txt
+++ b/algo/CMakeLists.txt
@@ -50,9 +50,9 @@ if (CBM_ONLINE_STANDALONE)
   include(CbmMacros) # for 'download_project_if_needed', 'Gen_Exe_Script' macro
 
   add_subdirectory(../external external)
+  add_subdirectory(../core/utility utility)
 endif()
 
-add_subdirectory(base)
 add_subdirectory(log)
 add_subdirectory(ca)
 add_subdirectory(online)
@@ -81,7 +81,6 @@ set(SRCS
   base/compat/Algorithm.cxx
   base/util/MemoryLogger.cxx
   base/util/StlUtils.cxx
-  base/util/EnumDict.cxx
   base/util/TimingsFormat.cxx
   data/sts/HitfinderPars.cxx
   data/sts/LandauTable.cxx
@@ -216,6 +215,8 @@ target_include_directories(Algo
 
 target_link_libraries(Algo
   PUBLIC    OnlineData
+            CbmUtility
+            CbmYamlInterface
             OnlineContainers
             KfCore
             CaCore
@@ -234,7 +235,6 @@ target_link_libraries(Algo
             cppzmq
             poolstl
   PRIVATE   CbmKFParticleOnlineInterface
-  INTERFACE CbmYamlInterface
 )
 target_compile_definitions(Algo PUBLIC NO_ROOT)
 xpu_attach(Algo ${DEVICE_SRCS})
@@ -294,6 +294,8 @@ if (NOT CBM_ONLINE_STANDALONE)
 
   target_link_libraries(AlgoOffline
     PUBLIC    CbmData
+              CbmYamlInterface
+              CbmUtility
               CbmContainers
               KfCoreOffline
               CaCoreOffline
@@ -312,7 +314,6 @@ if (NOT CBM_ONLINE_STANDALONE)
               cppzmq
               poolstl
     PRIVATE   CbmKFParticleOnlineInterface
-    INTERFACE CbmYamlInterface
   )
   xpu_attach(AlgoOffline ${DEVICE_SRCS})
 
diff --git a/algo/base/CMakeLists.txt b/algo/base/CMakeLists.txt
deleted file mode 100644
index 93b295fe0a..0000000000
--- a/algo/base/CMakeLists.txt
+++ /dev/null
@@ -1 +0,0 @@
-add_subdirectory(yaml)
diff --git a/algo/base/Definitions.h b/algo/base/Definitions.h
index c9cac7a917..73cc85bf77 100644
--- a/algo/base/Definitions.h
+++ b/algo/base/Definitions.h
@@ -4,8 +4,8 @@
 #ifndef CBM_BASE_TYPES_H
 #define CBM_BASE_TYPES_H
 
+#include "CbmEnumDict.h"
 #include "MicrosliceDescriptor.hpp"  // For fles::Subsystem
-#include "util/EnumDict.h"
 
 #include <cstdint>
 
@@ -108,18 +108,18 @@ CBM_ENUM_DICT(fles::Subsystem,
 );
 
 CBM_ENUM_DICT(cbm::algo::Step,
-  {"Unpack", Step::Unpack},
-  {"DigiTrigger", Step::DigiTrigger},
-  {"LocalReco", Step::LocalReco},
-  {"Tracking", Step::Tracking}
+  {"Unpack", cbm::algo::Step::Unpack},
+  {"DigiTrigger", cbm::algo::Step::DigiTrigger},
+  {"LocalReco", cbm::algo::Step::LocalReco},
+  {"Tracking", cbm::algo::Step::Tracking}
 );
 
 CBM_ENUM_DICT(cbm::algo::RecoData,
-  {"DigiTimeslice", RecoData::DigiTimeslice},
-  {"DigiEvent", RecoData::DigiEvent},
-  {"Cluster", RecoData::Cluster},
-  {"Hit", RecoData::Hit},
-  {"Track", RecoData::Track}
+  {"DigiTimeslice", cbm::algo::RecoData::DigiTimeslice},
+  {"DigiEvent", cbm::algo::RecoData::DigiEvent},
+  {"Cluster", cbm::algo::RecoData::Cluster},
+  {"Hit", cbm::algo::RecoData::Hit},
+  {"Track", cbm::algo::RecoData::Track}
 );
 
 CBM_ENUM_DICT(cbm::algo::Setup,
diff --git a/algo/base/RecoParams.h b/algo/base/RecoParams.h
index db747f189c..c933c63de1 100644
--- a/algo/base/RecoParams.h
+++ b/algo/base/RecoParams.h
@@ -5,7 +5,6 @@
 #define CBM_ALGO_BASE_RECOPARAMS_H
 
 #include "Definitions.h"
-#include "util/EnumDict.h"
 #include "yaml/Property.h"
 #include "yaml/Yaml.h"
 
@@ -106,14 +105,14 @@ namespace cbm::algo
 CBM_YAML_EXTERN_DECL(cbm::algo::RecoParams);
 
 CBM_ENUM_DICT(cbm::algo::RecoParams::SortMode,
-  {"BlockSort", RecoParams::SortMode::BlockSort},
-  {"CUBSegmentedSort", RecoParams::SortMode::CUBSegmentedSort}
+  {"BlockSort", cbm::algo::RecoParams::SortMode::BlockSort},
+  {"CUBSegmentedSort", cbm::algo::RecoParams::SortMode::CUBSegmentedSort}
 );
 
 CBM_ENUM_DICT(cbm::algo::RecoParams::AllocationMode,
-  {"Auto", RecoParams::AllocationMode::Auto},
-  {"Static", RecoParams::AllocationMode::Static},
-  {"Dynamic", RecoParams::AllocationMode::Dynamic}
+  {"Auto", cbm::algo::RecoParams::AllocationMode::Auto},
+  {"Static", cbm::algo::RecoParams::AllocationMode::Static},
+  {"Dynamic", cbm::algo::RecoParams::AllocationMode::Dynamic}
 );
 
 #endif  // CBM_ALGO_BASE_RECOPARAMS_H
diff --git a/algo/base/util/ProfilingLevel.h b/algo/base/util/ProfilingLevel.h
index d358bd36c9..5d9469359e 100644
--- a/algo/base/util/ProfilingLevel.h
+++ b/algo/base/util/ProfilingLevel.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include "EnumDict.h"
+#include "CbmEnumDict.h"
 
 namespace cbm::algo
 {
diff --git a/algo/detectors/sts/HitfinderChain.cxx b/algo/detectors/sts/HitfinderChain.cxx
index 2b4a4324b1..5796cfa54b 100644
--- a/algo/detectors/sts/HitfinderChain.cxx
+++ b/algo/detectors/sts/HitfinderChain.cxx
@@ -32,7 +32,7 @@ void sts::HitfinderChain::SetParameters(const HitfinderChainPars& parameters)
 
   if (!memoryPars.IsDynamic() && !memoryPars.IsStatic()) {
     throw std::runtime_error(
-      fmt::format("STS Hitfinder Chain: Unknown allocation mode: {}", ToString(memoryPars.allocationMode)));
+      fmt::format("STS Hitfinder Chain: Unknown allocation mode: {}", util::ToString(memoryPars.allocationMode)));
   }
 
   if (memoryPars.IsStatic()) {
diff --git a/algo/global/ParFiles.cxx b/algo/global/ParFiles.cxx
index 9d4e8ee2cd..85134bd4bb 100644
--- a/algo/global/ParFiles.cxx
+++ b/algo/global/ParFiles.cxx
@@ -124,6 +124,6 @@ ParFiles::ParFiles(uint32_t runId)
       kfp.V0FinderConfig = "mcbm2025_02/kfp_lambda_v25a.yaml";
       break;
 
-    default: throw FatalError("Unknown setup: {}", ToString(setup));
+    default: throw FatalError("Unknown setup: {}", util::ToString(setup));
   }
 }
diff --git a/algo/global/Reco.cxx b/algo/global/Reco.cxx
index 1554da152a..3736872a02 100644
--- a/algo/global/Reco.cxx
+++ b/algo/global/Reco.cxx
@@ -646,7 +646,7 @@ void Reco::QueueUnpackerMetricsDet(const UnpackMonitor<MSMonitor>& monitor)
     return;
   }
 
-  std::string_view det = ToString(monitor.system);
+  std::string_view det = util::ToString(monitor.system);
 
   auto MkKey = [&](std::string_view key) { return fmt::format("{}{}", key, Capitalize(det)); };
 
diff --git a/algo/unpack/CommonUnpacker.cxx b/algo/unpack/CommonUnpacker.cxx
index d7cc52db07..ba737260e9 100644
--- a/algo/unpack/CommonUnpacker.cxx
+++ b/algo/unpack/CommonUnpacker.cxx
@@ -23,7 +23,7 @@ detail::MSData::MSData(const fles::Timeslice& ts, fles::Subsystem subsystem, gsl
 
     if (std::find(legalEqIds.begin(), legalEqIds.end(), componentId) == legalEqIds.end()) {
       L_(error) << "Invalid equipment id 0x" << std::hex << std::setw(4) << componentId << std::dec << " for subsystem "
-                << ToString(subsystem);
+                << util::ToString(subsystem);
       monitor.errInvalidEqId++;
       continue;
     }
@@ -36,5 +36,5 @@ detail::MSData::MSData(const fles::Timeslice& ts, fles::Subsystem subsystem, gsl
       msContent.push_back(ts.content(comp, mslice));
     }
   }
-  L_(debug) << "Found " << monitor.numMs << " microslices for subsystem " << ToString(subsystem);
+  L_(debug) << "Found " << monitor.numMs << " microslices for subsystem " << util::ToString(subsystem);
 }
diff --git a/algo/unpack/CommonUnpacker.h b/algo/unpack/CommonUnpacker.h
index 3db3952e78..3d644c1c9b 100644
--- a/algo/unpack/CommonUnpacker.h
+++ b/algo/unpack/CommonUnpacker.h
@@ -118,12 +118,12 @@ namespace cbm::algo
         if (algo == fAlgos.end()) {
           if (!Contains(legalEqIds, msDesc.eq_id)) {
             L_(error) << "Invalid equip id " << std::hex << int{msDesc.eq_id} << std::dec << " for subsystem "
-                      << ToString(subsystem);
+                      << util::ToString(subsystem);
             monitorOut.errInvalidEqId++;
           }
           else {
             L_(error) << "Invalid system version " << std::hex << int{msDesc.sys_ver} << std::dec << " for subsystem "
-                      << ToString(subsystem);
+                      << util::ToString(subsystem);
             monitorOut.errInvalidSysVer++;
           }
           continue;
diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt
index 320b0dc4d6..c574819054 100644
--- a/core/CMakeLists.txt
+++ b/core/CMakeLists.txt
@@ -7,6 +7,7 @@ add_subdirectory(data)
 add_subdirectory(field)
 add_subdirectory(base)
 add_subdirectory(qa)
+add_subdirectory(utility)
 
 add_subdirectory(detectors/trd)
 add_subdirectory(detectors/rich)
diff --git a/core/containers/CMakeLists.txt b/core/containers/CMakeLists.txt
index d1987b2815..6de870b63a 100644
--- a/core/containers/CMakeLists.txt
+++ b/core/containers/CMakeLists.txt
@@ -1,5 +1,8 @@
 # Library: CbmContainers
 # 
+
+message("!!!! BUILDING CbmContainers")
+
 set(INCLUDE_DIRECTORIES
   ${CMAKE_CURRENT_SOURCE_DIR}
 )
diff --git a/core/qa/CMakeLists.txt b/core/qa/CMakeLists.txt
index 9b022d7bb8..18f04ce3ab 100644
--- a/core/qa/CMakeLists.txt
+++ b/core/qa/CMakeLists.txt
@@ -2,7 +2,6 @@ set(INCLUDE_DIRECTORIES
   ${CMAKE_CURRENT_SOURCE_DIR}/checker
   ${CMAKE_CURRENT_SOURCE_DIR}/report
   ${CMAKE_CURRENT_SOURCE_DIR}
-  ${CMAKE_SOURCE_DIR}/algo/base  # For "algo/base/yaml/*.h" included as relative "yaml/?????.h" to fit install tree
   )
 
 set(SRCS
diff --git a/core/utility/CMakeLists.txt b/core/utility/CMakeLists.txt
new file mode 100644
index 0000000000..f4e2b13683
--- /dev/null
+++ b/core/utility/CMakeLists.txt
@@ -0,0 +1,31 @@
+# A library for CBM common utilities. The utilities include generic functions and classes
+# to extend the STL and BOOST C++. The library is not a place for a detector- or analysis-specific
+# software.
+#
+add_subdirectory(yaml)
+
+set(SRCS 
+  CbmEnumDict.cxx
+)
+
+add_library(CbmUtility SHARED ${SRCS})
+
+target_include_directories(CbmUtility
+  PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
+)
+
+target_link_libraries(CbmUtility
+  PUBLIC GSL
+         fmt::fmt
+         xpu
+)
+
+install(TARGETS CbmUtility DESTINATION lib)
+
+install(
+  FILES 
+    CbmEnumDict.h
+  DESTINATION
+    include/
+)
+
diff --git a/algo/base/util/EnumDict.cxx b/core/utility/CbmEnumDict.cxx
similarity index 85%
rename from algo/base/util/EnumDict.cxx
rename to core/utility/CbmEnumDict.cxx
index a0ffd40f36..960d54df60 100644
--- a/algo/base/util/EnumDict.cxx
+++ b/core/utility/CbmEnumDict.cxx
@@ -1,11 +1,11 @@
 /* Copyright (C) 2023 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer] */
-#include "EnumDict.h"
+#include "CbmEnumDict.h"
 
 #include <sstream>
 
-void cbm::algo::detail::RaiseUnknownEntry(std::string_view str, const std::vector<std::string_view>& validEntries)
+void cbm::util::detail::RaiseUnknownEntry(std::string_view str, const std::vector<std::string_view>& validEntries)
 {
   std::ostringstream oss;
   oss << "Could not parse '" << str << "'. Valid entries are: ";
diff --git a/algo/base/util/EnumDict.h b/core/utility/CbmEnumDict.h
similarity index 87%
rename from algo/base/util/EnumDict.h
rename to core/utility/CbmEnumDict.h
index fde2d6d785..c60ab8a5a0 100644
--- a/algo/base/util/EnumDict.h
+++ b/core/utility/CbmEnumDict.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2023 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
+/* Copyright (C) 2023-2025 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer] */
 #ifndef CBM_ALGO_BASE_UTIL_SERIALIZABLEENUM_H
@@ -16,7 +16,7 @@
 #include <fmt/format.h>
 #include <xpu/defines.h>
 
-namespace cbm::algo
+namespace cbm::util
 {
   namespace detail
   {
@@ -68,7 +68,7 @@ namespace cbm::algo
     if (it == dict.end()) throw std::runtime_error(fmt::format("Entry {} for enum missing!", static_cast<int>(t)));
     return it->first;
   }
-}  // namespace cbm::algo
+}  // namespace cbm::util
 
 #if XPU_IS_CPU
 /**
@@ -97,9 +97,9 @@ namespace cbm::algo
    */
 #define CBM_ENUM_DICT(type, ...)                                                                                       \
   template<>                                                                                                           \
-  inline const cbm::algo::detail::EnumDict_t<type> cbm::algo::detail::EnumDict<type> = {__VA_ARGS__};                  \
+  inline const cbm::util::detail::EnumDict_t<type> cbm::util::detail::EnumDict<type> = {__VA_ARGS__};                  \
   template<>                                                                                                           \
-  struct cbm::algo::detail::EnumHasDict<type> : std::true_type {                                                       \
+  struct cbm::util::detail::EnumHasDict<type> : std::true_type {                                                       \
   }
 #else  // XPU_IS_CPU
 // Disable macro in GPU code, causes some issues with nvcc
@@ -110,22 +110,22 @@ namespace cbm::algo
 // Placed in global namespace to be found by ADL e.g. for std::ostream_iterator
 namespace std
 {
-  template<typename T, typename = std::enable_if_t<cbm::algo::detail::EnumHasDict_v<T>>>
+  template<typename T, typename = std::enable_if_t<cbm::util::detail::EnumHasDict_v<T>>>
   std::ostream& operator<<(std::ostream& os, T t)
   {
-    os << cbm::algo::ToString(t);
+    os << cbm::util::ToString(t);
     return os;
   }
 
-  template<typename T, typename = std::enable_if_t<cbm::algo::detail::EnumHasDict_v<T>>>
+  template<typename T, typename = std::enable_if_t<cbm::util::detail::EnumHasDict_v<T>>>
   std::istream& operator>>(std::istream& is, T& t)
   {
     std::string str;
     is >> str;
-    auto maybet = cbm::algo::FromString<T>(str);
+    auto maybet = cbm::util::FromString<T>(str);
 
     if (!maybet) {
-      cbm::algo::detail::RaiseUnknownEntry(str, cbm::algo::detail::ValidEntries<T>());
+      cbm::util::detail::RaiseUnknownEntry(str, cbm::util::detail::ValidEntries<T>());
     }
     t = *maybet;
 
diff --git a/algo/base/yaml/BaseTypes.h b/core/utility/yaml/BaseTypes.h
similarity index 100%
rename from algo/base/yaml/BaseTypes.h
rename to core/utility/yaml/BaseTypes.h
diff --git a/algo/base/yaml/CMakeLists.txt b/core/utility/yaml/CMakeLists.txt
similarity index 68%
rename from algo/base/yaml/CMakeLists.txt
rename to core/utility/yaml/CMakeLists.txt
index 756401d832..992fcfc5cc 100644
--- a/algo/base/yaml/CMakeLists.txt
+++ b/core/utility/yaml/CMakeLists.txt
@@ -1,15 +1,16 @@
 set(INCLUDE_DIRECTORIES
-  ${CMAKE_SOURCE_DIR}/algo/base  # For "algo/base/yaml/*.h" included as relative "yaml/?????.h" to fit install tree
+  ${CMAKE_CURRENT_SOURCE_DIR}/..  # For inclusions like "yaml/Yaml.h"
 )
 
 add_library(CbmYamlInterface INTERFACE)
 
 target_include_directories(CbmYamlInterface
-  INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
+  INTERFACE ${INCLUDE_DIRECTORIES}
 )
 
 target_link_libraries(CbmYamlInterface
   INTERFACE GSL
+            CbmUtility
             xpu
             fmt::fmt
             external::yaml-cpp
diff --git a/algo/base/yaml/Property.h b/core/utility/yaml/Property.h
similarity index 99%
rename from algo/base/yaml/Property.h
rename to core/utility/yaml/Property.h
index 223a978542..95ef674408 100644
--- a/algo/base/yaml/Property.h
+++ b/core/utility/yaml/Property.h
@@ -5,8 +5,6 @@
 #define CBM_YAML_PROPERTY_H
 #pragma once
 
-#include "Definitions.h"
-
 #include <optional>
 #include <string_view>
 #include <tuple>
diff --git a/algo/base/yaml/Yaml.h b/core/utility/yaml/Yaml.h
similarity index 93%
rename from algo/base/yaml/Yaml.h
rename to core/utility/yaml/Yaml.h
index e5dfa3d33a..13cbbf58d4 100644
--- a/algo/base/yaml/Yaml.h
+++ b/core/utility/yaml/Yaml.h
@@ -5,12 +5,12 @@
 #define CBM_YAML_YAML_H
 #pragma once
 
-#include "Definitions.h"
-#include "compat/Filesystem.h"
-#include "util/EnumDict.h"
+#include "CbmEnumDict.h"
 #include "yaml/BaseTypes.h"
 #include "yaml/Property.h"
 
+#include <boost/filesystem.hpp>
+
 #include <sstream>
 #include <string_view>
 
@@ -19,6 +19,19 @@
 
 namespace cbm::algo::yaml
 {
+  namespace fs = boost::filesystem;
+
+  // typealias for Rust-like fixed size integer types
+  using i8  = std::int8_t;
+  using u8  = std::uint8_t;
+  using i16 = std::int16_t;
+  using u16 = std::uint16_t;
+  using i32 = std::int32_t;
+  using u32 = std::uint32_t;
+  using i64 = std::int64_t;
+  using u64 = std::uint64_t;
+  using f32 = float;
+  using f64 = double;
 
   template<typename T>
   T Read(const YAML::Node& node);
@@ -71,14 +84,14 @@ namespace cbm::algo::yaml
 #endif
     using Type = std::remove_cv_t<std::remove_reference_t<T>>;
 
-    static_assert(!IsEnum<T> || detail::EnumHasDict_v<T>, "Enum must have a dictionary to be deserializable");
+    static_assert(!IsEnum<T> || util::detail::EnumHasDict_v<T>, "Enum must have a dictionary to be deserializable");
 
     // TODO: error handling
     if constexpr (IsFundamental<Type>) {
       return node.as<Type>();
     }
     else if constexpr (IsEnum<Type>) {
-      std::optional<T> maybet = FromString<T>(node.as<std::string>());
+      std::optional<T> maybet = util::FromString<T>(node.as<std::string>());
       if (!maybet) {
         throw std::runtime_error(fmt::format("Invalid enum value: {}", node.as<std::string>()));
       }
@@ -207,7 +220,7 @@ namespace cbm::algo::yaml
     template<typename T>
     void DoDump(const T& object, YAML::Emitter& ss, std::optional<YAML::EMITTER_MANIP> formatEntries = {})
     {
-      static_assert(!IsEnum<T> || detail::EnumHasDict_v<T>, "Enum must have a dictionary");
+      static_assert(!IsEnum<T> || util::detail::EnumHasDict_v<T>, "Enum must have a dictionary");
 
       if constexpr (IsFundamental<T>) {
         // Take care that i8 and u8 are printed as integers not as characters
@@ -217,7 +230,7 @@ namespace cbm::algo::yaml
           ss << object;
       }
       else if constexpr (IsEnum<T>) {
-        ss << std::string{ToString<T>(object)};
+        ss << std::string{util::ToString<T>(object)};
       }
       else if constexpr (IsVector<T> || IsArray<T> || IsSet<T>) {
         ss << YAML::BeginSeq;
-- 
GitLab


From a849d4867081ea0f80ee811cfdc0155ef1925864 Mon Sep 17 00:00:00 2001
From: "s.zharko@gsi.de" <s.zharko@gsi.de>
Date: Thu, 19 Dec 2024 01:39:41 +0100
Subject: [PATCH 5/6] Moving contents of PVector into the CbmContainers
 library, the PartitionedVector and co. are moved from cbm::algo to the cbm
 namespace

---
 algo/CMakeLists.txt | 33 ---------------------------------
 1 file changed, 33 deletions(-)

diff --git a/algo/CMakeLists.txt b/algo/CMakeLists.txt
index c4100eca53..6cbf7dab5e 100644
--- a/algo/CMakeLists.txt
+++ b/algo/CMakeLists.txt
@@ -363,44 +363,11 @@ install(DIRECTORY evbuild TYPE INCLUDE FILES_MATCHING PATTERN "*.h")
 
 install(
   FILES
-    base/ChainContext.h
-    base/Definitions.h
-    base/HistogramSender.h
-    base/Options.h
-    base/RecoParams.h
-    base/SubChain.h
-    base/System.h
-    base/DigiData.h
-    base/AlgoTraits.h
-    base/AuxDigiData.h
-    base/BuildInfo.h
-    base/Exceptions.h
-    base/MainConfig.h
-    evselector/DigiEventSelector.h
-    evselector/DigiEventSelectorConfig.h
-    trigger/DigiTriggerConfig.h
-    trigger/HitMultTrigger.h
-    trigger/TimeClusterTrigger.h
-    trigger/V0Trigger.h
-    trigger/V0TriggerConfig.h
-    unpack/CommonUnpacker.h
-    unpack/UnpackMSBase.h
-    global/ParFiles.h
     global/Reco.h
     global/RecoResults.h
     global/RecoResultsInputArchive.h
     global/RecoResultsOutputArchive.h
     global/StorableRecoResults.h
-    qa/Accumulators.h
-    qa/Histogram.h
-    ca/TrackingChain.h
-    ca/TrackingChainConfig.h
-    ca/TrackingDefs.h
-    ca/TrackingSetup.h
-    # NOTE: SZh 20.11.2023:
-    #       The ca/qa directory depends on the online qa classes, so for now it has to be a part of the Algo library.
-    ca/qa/CaQa.h
-  
   DESTINATION
     include/
 )
-- 
GitLab


From b48b7cd377da7b2c72d5e8a404e2c1b58a078f22 Mon Sep 17 00:00:00 2001
From: "s.zharko@gsi.de" <s.zharko@gsi.de>
Date: Thu, 17 Apr 2025 01:01:25 +0200
Subject: [PATCH 6/6] algo: providing full pathes of headers to include

---
 algo/CMakeLists.txt                           | 90 +++++--------------
 algo/base/AuxDigiData.h                       | 16 ++--
 algo/base/BuildInfo.cxx.in                    |  2 +-
 algo/base/ChainContext.cxx                    |  2 +-
 algo/base/ChainContext.h                      |  4 +-
 algo/base/DigiData.cxx                        |  2 +-
 algo/base/MainConfig.cxx                      |  2 +-
 algo/base/Options.cxx                         |  4 +-
 algo/base/Options.h                           |  6 +-
 algo/base/RecoParams.cxx                      |  2 +-
 algo/base/SubChain.h                          |  2 +-
 algo/base/System.cxx                          |  2 +-
 algo/base/compat/Algorithm.h                  |  2 +-
 algo/base/compat/OpenMP.h                     |  2 +-
 algo/base/gpu/DeviceImage.cxx                 |  2 +-
 algo/base/gpu/Params.cxx                      |  2 +-
 algo/base/gpu/Params.h                        |  4 +-
 algo/base/util/MemoryLogger.cxx               |  4 +-
 algo/base/util/StlUtils.cxx                   |  2 +-
 algo/base/util/TimingsFormat.cxx              |  2 +-
 algo/base/util/TimingsFormat.h                |  2 +-
 algo/ca/TrackingChain.cxx                     |  7 +-
 algo/ca/TrackingChain.h                       | 14 ++-
 algo/ca/TrackingSetup.cxx                     |  2 +-
 algo/ca/TrackingSetup.h                       |  8 +-
 algo/ca/qa/CaQa.cxx                           |  2 +-
 algo/ca/qa/CaQa.h                             |  2 +-
 algo/data/sts/Cluster.h                       |  2 +-
 algo/data/sts/Hit.h                           |  2 +-
 algo/data/sts/HitfinderPars.cxx               |  2 +-
 algo/data/sts/HitfinderPars.h                 |  4 +-
 algo/data/sts/LandauTable.cxx                 |  2 +-
 algo/data/sts/LandauTable.h                   |  4 +-
 algo/detectors/bmon/Calibrate.cxx             |  2 +-
 algo/detectors/bmon/Calibrate.h               |  4 +-
 algo/detectors/bmon/CalibrateSetup.h          |  2 +-
 algo/detectors/bmon/Clusterizer.cxx           |  2 +-
 algo/detectors/bmon/Clusterizer.h             |  4 +-
 algo/detectors/bmon/Hitfind.cxx               |  6 +-
 algo/detectors/bmon/Hitfind.h                 |  6 +-
 algo/detectors/bmon/HitfindSetup.h            |  2 +-
 algo/detectors/bmon/ReadoutConfig.cxx         |  4 +-
 algo/detectors/bmon/ReadoutConfig.h           |  2 +-
 algo/detectors/bmon/Unpack.cxx                |  2 +-
 algo/detectors/bmon/Unpack.h                  |  6 +-
 algo/detectors/bmon/UnpackMS.cxx              |  2 +-
 algo/detectors/bmon/UnpackMS.h                |  2 +-
 algo/detectors/much/ReadoutConfig.cxx         |  2 +-
 algo/detectors/much/Unpack.cxx                |  2 +-
 algo/detectors/much/Unpack.h                  |  6 +-
 algo/detectors/much/UnpackMS.cxx              |  2 +-
 algo/detectors/much/UnpackMS.h                |  2 +-
 algo/detectors/rich/ReadoutConfig.cxx         |  2 +-
 algo/detectors/rich/Unpack.cxx                |  2 +-
 algo/detectors/rich/Unpack.h                  |  6 +-
 algo/detectors/rich/UnpackMS.cxx              |  2 +-
 algo/detectors/rich/UnpackMS.h                |  4 +-
 algo/detectors/sts/ChannelMaskSet.cxx         |  2 +-
 algo/detectors/sts/ChannelMaskSet.h           |  4 +-
 algo/detectors/sts/Hitfinder.cxx              |  2 +-
 algo/detectors/sts/Hitfinder.h                | 14 +--
 algo/detectors/sts/HitfinderChain.cxx         |  6 +-
 algo/detectors/sts/HitfinderChain.h           |  8 +-
 algo/detectors/sts/ReadoutConfig.cxx          |  6 +-
 algo/detectors/sts/ReadoutConfig.h            |  2 +-
 algo/detectors/sts/StsRecoUtils.h             |  2 +-
 algo/detectors/sts/TrackingInterface.cxx      |  2 +-
 algo/detectors/sts/TrackingInterface.h        |  2 +-
 algo/detectors/sts/Unpack.cxx                 |  2 +-
 algo/detectors/sts/Unpack.h                   |  8 +-
 algo/detectors/sts/UnpackMS.cxx               |  4 +-
 algo/detectors/sts/UnpackMS.h                 |  4 +-
 algo/detectors/sts/WalkMap.cxx                |  2 +-
 algo/detectors/sts/WalkMap.h                  |  2 +-
 algo/detectors/tof/Calibrate.cxx              |  4 +-
 algo/detectors/tof/Calibrate.h                |  4 +-
 algo/detectors/tof/CalibrateSetup.h           |  2 +-
 algo/detectors/tof/Clusterizer.cxx            |  2 +-
 algo/detectors/tof/Clusterizer.h              |  4 +-
 algo/detectors/tof/Hit.h                      |  4 +-
 algo/detectors/tof/HitFinder.cxx              |  2 +-
 algo/detectors/tof/Hitfind.cxx                |  6 +-
 algo/detectors/tof/Hitfind.h                  |  4 +-
 algo/detectors/tof/HitfindSetup.h             |  2 +-
 algo/detectors/tof/ReadoutConfig.cxx          |  4 +-
 algo/detectors/tof/ReadoutConfig.h            |  2 +-
 algo/detectors/tof/TrackingInterface.cxx      |  9 +-
 algo/detectors/tof/TrackingInterface.h        |  2 +-
 algo/detectors/tof/Unpack.cxx                 |  2 +-
 algo/detectors/tof/Unpack.h                   |  6 +-
 algo/detectors/tof/UnpackMS.cxx               |  2 +-
 algo/detectors/tof/UnpackMS.h                 |  4 +-
 algo/detectors/trd/Cluster.cxx                |  2 +-
 algo/detectors/trd/Cluster2D.cxx              |  2 +-
 algo/detectors/trd/Cluster2D.h                |  4 +-
 algo/detectors/trd/Clusterizer.cxx            |  2 +-
 algo/detectors/trd/Clusterizer.h              |  4 +-
 algo/detectors/trd/Clusterizer2D.cxx          |  2 +-
 algo/detectors/trd/Clusterizer2D.h            |  4 +-
 algo/detectors/trd/DigiRec.cxx                |  2 +-
 algo/detectors/trd/DigiRec.h                  |  2 +-
 algo/detectors/trd/HitFactory2D.cxx           |  2 +-
 algo/detectors/trd/HitFactory2D.h             |  2 +-
 algo/detectors/trd/HitFinder.cxx              |  2 +-
 algo/detectors/trd/HitFinder.h                | 10 +--
 algo/detectors/trd/HitFinder2D.cxx            |  2 +-
 algo/detectors/trd/HitFinder2D.h              | 10 +--
 algo/detectors/trd/HitMerger.cxx              |  2 +-
 algo/detectors/trd/HitMerger.h                |  6 +-
 algo/detectors/trd/HitMerger2D.cxx            |  2 +-
 algo/detectors/trd/HitMerger2D.h              |  8 +-
 algo/detectors/trd/Hitfind.cxx                |  6 +-
 algo/detectors/trd/Hitfind.h                  | 18 ++--
 algo/detectors/trd/Hitfind2DSetup.h           |  2 +-
 algo/detectors/trd/HitfindSetup.h             |  2 +-
 algo/detectors/trd/ReadoutConfig.cxx          |  2 +-
 algo/detectors/trd/TrackingInterface.cxx      |  2 +-
 algo/detectors/trd/TrackingInterface.h        |  2 +-
 algo/detectors/trd/Unpack.cxx                 |  2 +-
 algo/detectors/trd/Unpack.h                   |  6 +-
 algo/detectors/trd/UnpackMS.cxx               |  2 +-
 algo/detectors/trd/UnpackMS.h                 |  2 +-
 algo/detectors/trd2d/ReadoutConfig.cxx        |  2 +-
 algo/detectors/trd2d/ReadoutConfig.h          |  2 +-
 algo/detectors/trd2d/Unpack.cxx               |  2 +-
 algo/detectors/trd2d/Unpack.h                 |  6 +-
 algo/detectors/trd2d/UnpackMS.cxx             |  2 +-
 algo/detectors/trd2d/UnpackMS.h               |  2 +-
 algo/evbuild/Config.cxx                       |  2 +-
 algo/evbuild/Config.h                         |  8 +-
 algo/evbuild/EventBuilder.cxx                 |  2 +-
 algo/evbuild/EventBuilder.h                   |  6 +-
 algo/evbuild/EventBuilderConfig.cxx           |  2 +-
 algo/evbuild/EventbuildChain.cxx              |  8 +-
 algo/evbuild/EventbuildChain.h                | 20 ++---
 algo/evselector/DigiEventSelector.cxx         |  2 +-
 algo/evselector/DigiEventSelector.h           |  6 +-
 algo/evselector/DigiEventSelectorConfig.cxx   |  2 +-
 algo/global/ParFiles.cxx                      |  4 +-
 algo/global/ParFiles.h                        |  4 +-
 algo/global/Reco.cxx                          | 70 +++++++--------
 algo/global/Reco.h                            |  8 +-
 algo/global/RecoResults.h                     | 17 ++--
 algo/global/RecoResultsInputArchive.cxx       |  2 +-
 algo/global/RecoResultsInputArchive.h         |  2 +-
 algo/global/RecoResultsOutputArchive.cxx      |  2 +-
 algo/global/RecoResultsOutputArchive.h        |  2 +-
 algo/global/StorableRecoResults.cxx           |  2 +-
 algo/global/StorableRecoResults.h             | 14 +--
 algo/kfp/KfpV0Finder.cxx                      |  4 +-
 algo/kfp/KfpV0Finder.h                        |  4 +-
 algo/kfp/KfpV0FinderChain.cxx                 |  8 +-
 algo/kfp/KfpV0FinderChain.h                   | 10 +--
 algo/kfp/KfpV0FinderConfig.cxx                |  2 +-
 algo/kfp/KfpV0FinderQa.cxx                    |  6 +-
 algo/kfp/KfpV0FinderQa.h                      |  3 +-
 algo/online/data/CMakeLists.txt               |  1 +
 algo/qa/CanvasConfig.cxx                      |  2 +-
 algo/qa/CanvasConfig.h                        |  2 +-
 algo/qa/DigiEventQa.cxx                       |  4 +-
 algo/qa/DigiEventQa.h                         |  6 +-
 algo/qa/Histo1D.cxx                           |  2 +-
 algo/qa/Histogram.h                           |  2 +-
 algo/qa/HistogramContainer.cxx                |  2 +-
 algo/qa/HistogramContainer.h                  |  2 +-
 algo/qa/PadConfig.cxx                         |  2 +-
 algo/qa/PadConfig.h                           |  2 +-
 algo/qa/QaData.cxx                            |  2 +-
 algo/qa/QaData.h                              |  8 +-
 algo/qa/QaManager.cxx                         |  2 +-
 algo/qa/QaManager.h                           |  6 +-
 algo/qa/QaTaskHeader.h                        |  2 +-
 algo/qa/RecoGeneralQa.cxx                     |  2 +-
 algo/qa/RecoGeneralQa.h                       |  4 +-
 algo/qa/TaskProperties.h                      |  2 +-
 algo/qa/hitfind/BmonHitfindQa.cxx             |  6 +-
 algo/qa/hitfind/BmonHitfindQa.h               |  4 +-
 algo/qa/hitfind/BmonHitfindQaParameters.cxx   |  2 +-
 algo/qa/hitfind/BmonHitfindQaParameters.h     |  4 +-
 algo/qa/hitfind/TofHitfindQa.cxx              |  6 +-
 algo/qa/hitfind/TofHitfindQa.h                |  4 +-
 algo/qa/hitfind/TofHitfindQaParameters.cxx    |  2 +-
 algo/qa/hitfind/TofHitfindQaParameters.h      |  2 +-
 algo/qa/trigger/V0TriggerQa.cxx               |  4 +-
 algo/qa/trigger/V0TriggerQa.h                 |  2 +-
 algo/qa/unpack/QaBase.h                       |  4 +-
 algo/qa/unpack/StsDigiQa.cxx                  |  2 +-
 algo/qa/unpack/StsDigiQa.h                    |  6 +-
 algo/test/_GTestChannelMapping.cxx            |  4 +-
 algo/test/_GTestDigiEventSelector.cxx         |  4 +-
 algo/test/_GTestEventBuilder.cxx              |  2 +-
 algo/test/_GTestPartitionedSpan.cxx           |  2 +-
 algo/test/_GTestPartitionedVector.cxx         |  2 +-
 algo/test/_GTestTimeClusterTrigger.cxx        |  2 +-
 algo/test/_GTestTrdClusterizer.cxx            |  5 +-
 algo/trigger/DigiTriggerConfig.cxx            |  2 +-
 algo/trigger/HitMultTrigger.cxx               |  3 +-
 algo/trigger/HitMultTrigger.h                 |  6 +-
 algo/trigger/TimeClusterTrigger.cxx           |  2 +-
 algo/trigger/TimeClusterTrigger.h             |  4 +-
 algo/trigger/V0Trigger.cxx                    |  4 +-
 algo/trigger/V0Trigger.h                      |  4 +-
 algo/trigger/V0TriggerConfig.cxx              |  2 +-
 algo/unpack/CommonUnpacker.cxx                |  2 +-
 algo/unpack/CommonUnpacker.h                  | 10 +--
 core/containers/CMakeLists.txt                |  2 -
 core/qa/CbmQaOnlineInterface.h                |  2 +-
 core/utility/yaml/BaseTypes.h                 |  2 +-
 core/utility/yaml/CMakeLists.txt              |  2 +
 reco/KF/CbmKFV0FinderTask.cxx                 |  2 +-
 reco/app/cbmreco/main.cxx                     | 22 ++---
 reco/app/cbmreco_fairrun/Application.cxx      |  2 +-
 reco/detectors/sts/CbmRecoSts.cxx             |  2 +-
 reco/detectors/sts/CbmRecoSts.h               |  2 +-
 reco/steer/CbmOnlineParWrite.h                |  2 +-
 reco/steer/CbmSourceDigiEvents.h              |  4 +-
 reco/steer/CbmSourceDigiTimeslice.h           |  4 +-
 reco/steer/CbmSourceRecoTimeslice.h           |  2 +-
 reco/tasks/CMakeLists.txt                     |  5 +-
 reco/tasks/CbmReco.cxx                        |  4 +-
 reco/tasks/CbmReco.h                          |  2 +-
 reco/tasks/CbmTaskBuildEvents.h               |  6 +-
 reco/tasks/CbmTaskDigiEventQa.cxx             |  1 -
 reco/tasks/CbmTaskDigiEventQa.h               |  5 +-
 reco/tasks/CbmTaskInspectRecoTimeslice.h      |  4 +-
 reco/tasks/CbmTaskStsHitFinderParWrite.cxx    |  2 +-
 reco/tasks/CbmTaskTofClusterizer.cxx          |  2 +-
 reco/tasks/CbmTaskTofClusterizer.h            |  6 +-
 reco/tasks/CbmTaskTofClusterizerParWrite.cxx  |  8 +-
 reco/tasks/CbmTaskTofClusterizerParWrite.h    |  2 +-
 reco/tasks/CbmTaskTofHitFinder.h              |  2 +-
 reco/tasks/CbmTaskTrdHitFinder.cxx            |  2 +-
 reco/tasks/CbmTaskTrdHitFinder.h              |  4 +-
 reco/tasks/CbmTaskTrdHitFinderParWrite.cxx    |  4 +-
 reco/tasks/CbmTaskTrdHitFinderParWrite.h      | 10 +--
 reco/tasks/CbmTaskTrdUnpackParWrite.cxx       |  4 +-
 reco/tasks/CbmTaskTrdUnpackParWrite.h         |  2 +-
 reco/tasks/CbmTaskTriggerDigi.cxx             |  2 +-
 reco/tasks/CbmTaskTriggerDigi.h               |  2 +-
 reco/tasks/CbmTaskUnpack.cxx                  |  8 +-
 reco/tasks/CbmTaskUnpack.h                    | 20 ++---
 services/archive_explorer/app/Application.cxx |  6 +-
 services/archive_explorer/app/Histograms.cxx  |  4 +-
 services/archive_explorer/app/Options.h       |  4 +-
 services/archive_explorer/lib/Server.h        |  6 +-
 services/histserv/app/Application.cxx         |  2 +-
 services/histserv/app/Application.h           |  2 +-
 services/histserv/tester/Application.cxx      |  8 +-
 services/histserv/tester/Application.h        |  2 +-
 services/online_par_dump/ProgramOptions.h     |  2 +-
 250 files changed, 542 insertions(+), 588 deletions(-)

diff --git a/algo/CMakeLists.txt b/algo/CMakeLists.txt
index 6cbf7dab5e..6bdea89fa6 100644
--- a/algo/CMakeLists.txt
+++ b/algo/CMakeLists.txt
@@ -190,26 +190,7 @@ add_custom_target(generateBuildInfo
 add_library(Algo SHARED ${SRCS})
 
 target_include_directories(Algo
-  PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/data
-         ${CMAKE_CURRENT_SOURCE_DIR}/base
-         ${CMAKE_CURRENT_SOURCE_DIR}/evbuild
-         ${CMAKE_CURRENT_SOURCE_DIR}/global
-         ${CMAKE_CURRENT_SOURCE_DIR}/trigger
-         ${CMAKE_CURRENT_SOURCE_DIR}/evselector
-         ${CMAKE_CURRENT_SOURCE_DIR}/unpack
-         ${CMAKE_CURRENT_SOURCE_DIR}/detectors
-         ${CMAKE_CURRENT_SOURCE_DIR}/qa
-         ${CMAKE_CURRENT_SOURCE_DIR}/qa/unpack
-         ${CMAKE_CURRENT_SOURCE_DIR}/qa/hitfind
-         ${CMAKE_CURRENT_SOURCE_DIR}/qa/trigger
-         ${CMAKE_CURRENT_SOURCE_DIR}/kf
-         ${CMAKE_CURRENT_SOURCE_DIR}/kf/core
-         ${CMAKE_CURRENT_SOURCE_DIR}/kf/core/utils
-         ${CMAKE_CURRENT_SOURCE_DIR}/kfp
-         ${CMAKE_CURRENT_SOURCE_DIR}/ca
-         ${CMAKE_CURRENT_SOURCE_DIR}/ca/qa
-         ${CMAKE_CURRENT_SOURCE_DIR}/ca/core/data
-         ${CMAKE_CURRENT_SOURCE_DIR}
+  PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/..
          ${CMAKE_SOURCE_DIR}/core/data/global
 )
 
@@ -218,6 +199,7 @@ target_link_libraries(Algo
             CbmUtility
             CbmYamlInterface
             OnlineContainers
+            CbmYamlInterface
             KfCore
             CaCore
             ROOT::GenVector
@@ -269,26 +251,7 @@ if (NOT CBM_ONLINE_STANDALONE)
   add_library(AlgoOffline SHARED ${SRCS})
 
   target_include_directories(AlgoOffline
-    PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/data
-           ${CMAKE_CURRENT_SOURCE_DIR}/base
-           ${CMAKE_CURRENT_SOURCE_DIR}/evbuild
-           ${CMAKE_CURRENT_SOURCE_DIR}/global
-           ${CMAKE_CURRENT_SOURCE_DIR}/trigger
-           ${CMAKE_CURRENT_SOURCE_DIR}/evselector
-           ${CMAKE_CURRENT_SOURCE_DIR}/unpack
-           ${CMAKE_CURRENT_SOURCE_DIR}/detectors
-           ${CMAKE_CURRENT_SOURCE_DIR}/qa
-           ${CMAKE_CURRENT_SOURCE_DIR}/qa/unpack
-           ${CMAKE_CURRENT_SOURCE_DIR}/qa/hitfind
-           ${CMAKE_CURRENT_SOURCE_DIR}/qa/trigger
-           ${CMAKE_CURRENT_SOURCE_DIR}/kf
-           ${CMAKE_CURRENT_SOURCE_DIR}/kf/core
-           ${CMAKE_CURRENT_SOURCE_DIR}/kf/core/utils
-           ${CMAKE_CURRENT_SOURCE_DIR}/kfp
-           ${CMAKE_CURRENT_SOURCE_DIR}/ca
-           ${CMAKE_CURRENT_SOURCE_DIR}/ca/qa
-           ${CMAKE_CURRENT_SOURCE_DIR}/ca/core/data
-           ${CMAKE_CURRENT_SOURCE_DIR}
+    PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/..
            ${CMAKE_SOURCE_DIR}/core/data/global
   )
 
@@ -297,6 +260,7 @@ if (NOT CBM_ONLINE_STANDALONE)
               CbmYamlInterface
               CbmUtility
               CbmContainers
+              CbmYamlInterface
               KfCoreOffline
               CaCoreOffline
               ROOT::GenVector
@@ -341,35 +305,21 @@ endif()
 ########################################################################################################################
 
 install(TARGETS Algo DESTINATION lib)
-install(DIRECTORY base/compat TYPE INCLUDE FILES_MATCHING PATTERN "*.h")
-#install(DIRECTORY base/yaml TYPE INCLUDE FILES_MATCHING PATTERN "*.h")
-install(DIRECTORY base/util TYPE INCLUDE FILES_MATCHING PATTERN "*.h")
-install(DIRECTORY base/gpu TYPE INCLUDE FILES_MATCHING PATTERN "*.h")
-install(DIRECTORY data/sts TYPE INCLUDE FILES_MATCHING PATTERN "*.h")
-install(DIRECTORY detectors/bmon TYPE INCLUDE FILES_MATCHING PATTERN "*.h")
-install(DIRECTORY detectors/much TYPE INCLUDE FILES_MATCHING PATTERN "*.h")
-install(DIRECTORY detectors/sts TYPE INCLUDE FILES_MATCHING PATTERN "*.h")
-install(DIRECTORY detectors/tof TYPE INCLUDE FILES_MATCHING PATTERN "*.h")
-install(DIRECTORY detectors/trd TYPE INCLUDE FILES_MATCHING PATTERN "*.h")
-install(DIRECTORY detectors/trd2d TYPE INCLUDE FILES_MATCHING PATTERN "*.h")
-install(DIRECTORY detectors/rich TYPE INCLUDE FILES_MATCHING PATTERN "*.h")
-install(DIRECTORY ca/qa TYPE INCLUDE FILES_MATCHING PATTERN "*.h")
-install(DIRECTORY qa TYPE INCLUDE FILES_MATCHING PATTERN "*.h")
-install(DIRECTORY qa/unpack TYPE INCLUDE FILES_MATCHING PATTERN "*.h")
-install(DIRECTORY ca TYPE INCLUDE FILES_MATCHING PATTERN "*.h")
-install(DIRECTORY kfp TYPE INCLUDE FILES_MATCHING PATTERN "*.h")
-install(DIRECTORY evbuild TYPE INCLUDE FILES_MATCHING PATTERN "*.h")
-
-
-install(
-  FILES
-    global/Reco.h
-    global/RecoResults.h
-    global/RecoResultsInputArchive.h
-    global/RecoResultsOutputArchive.h
-    global/StorableRecoResults.h
-  DESTINATION
-    include/
-)
+
+install(DIRECTORY base DESTINATION include/algo PATTERN "*.h")
+install(DIRECTORY ca 
+        DESTINATION include/algo
+        FILES_MATCHING 
+        PATTERN "ca/core" EXCLUDE  # NOTE: installed from another library
+        PATTERN "*.h")
+install(DIRECTORY data        DESTINATION include/algo FILES_MATCHING PATTERN "*.h")
+install(DIRECTORY detectors   DESTINATION include/algo FILES_MATCHING PATTERN "*.h")
+install(DIRECTORY evbuild     DESTINATION include/algo FILES_MATCHING PATTERN "*.h")
+install(DIRECTORY evselector  DESTINATION include/algo FILES_MATCHING PATTERN "*.h")
+install(DIRECTORY global      DESTINATION include/algo FILES_MATCHING PATTERN "*.h")
+install(DIRECTORY qa          DESTINATION include/algo FILES_MATCHING PATTERN "*.h")
+install(DIRECTORY kfp         DESTINATION include/algo FILES_MATCHING PATTERN "*.h")
+install(DIRECTORY trigger     DESTINATION include/algo FILES_MATCHING PATTERN "*.h")
+install(DIRECTORY unpack      DESTINATION include/algo FILES_MATCHING PATTERN "*.h")
 
 
diff --git a/algo/base/AuxDigiData.h b/algo/base/AuxDigiData.h
index e464da7e28..7e24979c5c 100644
--- a/algo/base/AuxDigiData.h
+++ b/algo/base/AuxDigiData.h
@@ -9,14 +9,14 @@
 
 #pragma once
 
-#include "CommonUnpacker.h"
-#include "bmon/UnpackMS.h"
-#include "much/UnpackMS.h"
-#include "rich/UnpackMS.h"
-#include "sts/UnpackMS.h"
-#include "tof/UnpackMS.h"
-#include "trd/UnpackMS.h"
-#include "trd2d/UnpackMS.h"
+#include "algo/detectors/bmon/UnpackMS.h"
+#include "algo/detectors/much/UnpackMS.h"
+#include "algo/detectors/rich/UnpackMS.h"
+#include "algo/detectors/sts/UnpackMS.h"
+#include "algo/detectors/tof/UnpackMS.h"
+#include "algo/detectors/trd/UnpackMS.h"
+#include "algo/detectors/trd2d/UnpackMS.h"
+#include "algo/unpack/CommonUnpacker.h"
 
 #include <vector>
 
diff --git a/algo/base/BuildInfo.cxx.in b/algo/base/BuildInfo.cxx.in
index 22cc1d2ec9..2b9151f1e7 100644
--- a/algo/base/BuildInfo.cxx.in
+++ b/algo/base/BuildInfo.cxx.in
@@ -1,7 +1,7 @@
 /* Copyright (C) 2022 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer]*/
-#include "BuildInfo.h"
+#include "algo/base/BuildInfo.h"
 
 // GENERATED BY CMAKE.
 // DON'T CHANGE BY HAND. MODIFY .in-File INSTEAD.
diff --git a/algo/base/ChainContext.cxx b/algo/base/ChainContext.cxx
index 9e75e9d807..8050aa07e2 100644
--- a/algo/base/ChainContext.cxx
+++ b/algo/base/ChainContext.cxx
@@ -1,7 +1,7 @@
 /* Copyright (C) 2023 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer] */
-#include "ChainContext.h"
+#include "algo/base/ChainContext.h"
 
 #include <Monitor.hpp>
 
diff --git a/algo/base/ChainContext.h b/algo/base/ChainContext.h
index 6f8ae590c9..fa9f1c0947 100644
--- a/algo/base/ChainContext.h
+++ b/algo/base/ChainContext.h
@@ -4,8 +4,8 @@
 #ifndef CBM_ALGO_BASE_CHAINCONTEXT_H
 #define CBM_ALGO_BASE_CHAINCONTEXT_H
 
-#include "Options.h"
-#include "RecoParams.h"
+#include "algo/base/Options.h"
+#include "algo/base/RecoParams.h"
 
 #include <memory>
 #include <optional>
diff --git a/algo/base/DigiData.cxx b/algo/base/DigiData.cxx
index 79fd5a4836..6f67e43530 100644
--- a/algo/base/DigiData.cxx
+++ b/algo/base/DigiData.cxx
@@ -1,7 +1,7 @@
 /* Copyright (C) 2023 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer] */
-#include "DigiData.h"
+#include "algo/base/DigiData.h"
 
 using namespace cbm::algo;
 
diff --git a/algo/base/MainConfig.cxx b/algo/base/MainConfig.cxx
index 4039d89f8b..87e99da08e 100644
--- a/algo/base/MainConfig.cxx
+++ b/algo/base/MainConfig.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Volker Friese [committer] */
 
-#include "MainConfig.h"
+#include "algo/base/MainConfig.h"
 
 #include <fstream>
 
diff --git a/algo/base/Options.cxx b/algo/base/Options.cxx
index abce4f27d9..6702b4e4c8 100644
--- a/algo/base/Options.cxx
+++ b/algo/base/Options.cxx
@@ -1,9 +1,9 @@
 /* Copyright (C) 2023 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer] */
-#include "Options.h"
+#include "algo/base/Options.h"
 
-#include "util/StlUtils.h"
+#include "algo/base/util/StlUtils.h"
 
 #include <boost/program_options.hpp>
 
diff --git a/algo/base/Options.h b/algo/base/Options.h
index f1b508a069..7eaea4aa38 100644
--- a/algo/base/Options.h
+++ b/algo/base/Options.h
@@ -5,9 +5,9 @@
 #define CBM_ALGO_BASE_OPTIONS_H
 
 #include "AlgoFairloggerCompat.h"
-#include "Definitions.h"
-#include "compat/Filesystem.h"
-#include "util/ProfilingLevel.h"
+#include "algo/base/Definitions.h"
+#include "algo/base/compat/Filesystem.h"
+#include "algo/base/util/ProfilingLevel.h"
 
 #include <set>
 #include <string>
diff --git a/algo/base/RecoParams.cxx b/algo/base/RecoParams.cxx
index 851df115fa..41b06a908f 100644
--- a/algo/base/RecoParams.cxx
+++ b/algo/base/RecoParams.cxx
@@ -1,6 +1,6 @@
 /* Copyright (C) 2024 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer] */
-#include "RecoParams.h"
+#include "algo/base/RecoParams.h"
 
 CBM_YAML_INSTANTIATE(cbm::algo::RecoParams);
diff --git a/algo/base/SubChain.h b/algo/base/SubChain.h
index 63599cd9d4..2ee0abe482 100644
--- a/algo/base/SubChain.h
+++ b/algo/base/SubChain.h
@@ -4,7 +4,7 @@
 #ifndef CBM_ALGO_BASE_SUBCHAIN_H
 #define CBM_ALGO_BASE_SUBCHAIN_H
 
-#include "ChainContext.h"
+#include "algo/base/ChainContext.h"
 
 #include <gsl/pointers>
 
diff --git a/algo/base/System.cxx b/algo/base/System.cxx
index 88bf1ac516..4863ac537e 100644
--- a/algo/base/System.cxx
+++ b/algo/base/System.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer] */
 
-#include "System.h"
+#include "algo/base/System.h"
 
 #include <cstdio>
 
diff --git a/algo/base/compat/Algorithm.h b/algo/base/compat/Algorithm.h
index 7c02acaaf8..2d6068e9ce 100644
--- a/algo/base/compat/Algorithm.h
+++ b/algo/base/compat/Algorithm.h
@@ -15,7 +15,7 @@
  * If TBB is not available, we also falls back to sequential algorithms.
 **/
 
-#include "BuildInfo.h"
+#include "algo/base/BuildInfo.h"
 
 #include <algorithm>
 #include <poolstl/algorithm>
diff --git a/algo/base/compat/OpenMP.h b/algo/base/compat/OpenMP.h
index b535e43b37..249f086062 100644
--- a/algo/base/compat/OpenMP.h
+++ b/algo/base/compat/OpenMP.h
@@ -4,7 +4,7 @@
 #ifndef CBM_ALGO_BASE_COMPAT_OPENMP_H
 #define CBM_ALGO_BASE_COMPAT_OPENMP_H
 
-#include "BuildInfo.h"
+#include "algo/base/BuildInfo.h"
 
 #ifdef HAVE_OMP
 #include <omp.h>
diff --git a/algo/base/gpu/DeviceImage.cxx b/algo/base/gpu/DeviceImage.cxx
index c54939a1cb..a3a9b40eb6 100644
--- a/algo/base/gpu/DeviceImage.cxx
+++ b/algo/base/gpu/DeviceImage.cxx
@@ -1,6 +1,6 @@
 /* Copyright (C) 2023 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer] */
-#include "DeviceImage.h"
+#include "algo/base/gpu/DeviceImage.h"
 
 XPU_IMAGE(cbm::algo::GPUReco);
diff --git a/algo/base/gpu/Params.cxx b/algo/base/gpu/Params.cxx
index 7dacbf36d7..500f9aada4 100644
--- a/algo/base/gpu/Params.cxx
+++ b/algo/base/gpu/Params.cxx
@@ -1,6 +1,6 @@
 /* Copyright (C) 2022 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer]*/
-#include "Params.h"
+#include "algo/base/gpu/Params.h"
 
 XPU_EXPORT(cbm::algo::Params);
diff --git a/algo/base/gpu/Params.h b/algo/base/gpu/Params.h
index d14f15ec9b..2ed36f21d9 100644
--- a/algo/base/gpu/Params.h
+++ b/algo/base/gpu/Params.h
@@ -4,8 +4,8 @@
 #ifndef CBM_ALGO_GPU_CONFIG_H
 #define CBM_ALGO_GPU_CONFIG_H
 
-#include "DeviceImage.h"
-#include "RecoParams.h"
+#include "algo/base/RecoParams.h"
+#include "algo/base/gpu/DeviceImage.h"
 
 #include <xpu/device.h>
 
diff --git a/algo/base/util/MemoryLogger.cxx b/algo/base/util/MemoryLogger.cxx
index ac50ef9f8b..efd6f8c171 100644
--- a/algo/base/util/MemoryLogger.cxx
+++ b/algo/base/util/MemoryLogger.cxx
@@ -2,10 +2,10 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer] */
 
-#include "MemoryLogger.h"
+#include "algo/base/util/MemoryLogger.h"
 
 #include "AlgoFairloggerCompat.h"
-#include "System.h"
+#include "algo/base/System.h"
 
 using namespace cbm::algo;
 
diff --git a/algo/base/util/StlUtils.cxx b/algo/base/util/StlUtils.cxx
index e8db142cc3..b4025dda57 100644
--- a/algo/base/util/StlUtils.cxx
+++ b/algo/base/util/StlUtils.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer] */
 
-#include "StlUtils.h"
+#include "algo/base/util/StlUtils.h"
 
 using namespace cbm;
 
diff --git a/algo/base/util/TimingsFormat.cxx b/algo/base/util/TimingsFormat.cxx
index 0733bd6bf8..2955d7c030 100644
--- a/algo/base/util/TimingsFormat.cxx
+++ b/algo/base/util/TimingsFormat.cxx
@@ -1,7 +1,7 @@
 /* Copyright (C) 2023-2024 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer] */
-#include "TimingsFormat.h"
+#include "algo/base/util/TimingsFormat.h"
 
 #include <iomanip>
 #include <sstream>
diff --git a/algo/base/util/TimingsFormat.h b/algo/base/util/TimingsFormat.h
index 4c8ca275af..bc435991e1 100644
--- a/algo/base/util/TimingsFormat.h
+++ b/algo/base/util/TimingsFormat.h
@@ -4,7 +4,7 @@
 #ifndef CBM_ALGO_BASE_UTIL_TIMINGSFORMAT_H
 #define CBM_ALGO_BASE_UTIL_TIMINGSFORMAT_H
 
-#include "Definitions.h"
+#include "algo/base/Definitions.h"
 
 #include <string>
 #include <string_view>
diff --git a/algo/ca/TrackingChain.cxx b/algo/ca/TrackingChain.cxx
index 374c23bb1e..3d5aab5f3a 100644
--- a/algo/ca/TrackingChain.cxx
+++ b/algo/ca/TrackingChain.cxx
@@ -7,15 +7,16 @@
 /// \brief  A chain class to execute CA tracking algorithm in online reconstruction (implementation)
 /// \author S.Zharko <s.zharko@gsi.de>
 
-#include "TrackingChain.h"
+#include "algo/ca/TrackingChain.h"
 
 #include "CaDefs.h"
 #include "CaHit.h"
 #include "CaInitManager.h"
 #include "CaParameters.h"
 #include "KfSetupBuilder.h"
-#include "ParFiles.h"
-#include "compat/OpenMP.h"
+#include "PODVector.h"
+#include "algo/base/compat/OpenMP.h"
+#include "algo/global/ParFiles.h"
 #include "yaml/Yaml.h"
 
 #include <boost/archive/binary_oarchive.hpp>
diff --git a/algo/ca/TrackingChain.h b/algo/ca/TrackingChain.h
index 39ba48e26f..71a58b1244 100644
--- a/algo/ca/TrackingChain.h
+++ b/algo/ca/TrackingChain.h
@@ -11,18 +11,16 @@
 
 #include "CaDataManager.h"
 #include "CaFramework.h"
-#include "CaQa.h"
 #include "CaTrack.h"
 #include "CaTrackingMonitor.h"
 #include "CaVector.h"
 #include "PartitionedSpan.h"
-#include "RecoResults.h"
-#include "SubChain.h"
-#include "TrackingChainConfig.h"
-#include "TrackingDefs.h"
-#include "TrackingSetup.h"
-#include "sts/Hit.h"
-#include "tof/Hit.h"
+#include "algo/base/SubChain.h"
+#include "algo/ca/TrackingChainConfig.h"
+#include "algo/ca/TrackingDefs.h"
+#include "algo/ca/TrackingSetup.h"
+#include "algo/ca/qa/CaQa.h"
+#include "algo/global/RecoResults.h"
 
 #include <memory>
 #include <vector>
diff --git a/algo/ca/TrackingSetup.cxx b/algo/ca/TrackingSetup.cxx
index 109390a1f2..45142e2119 100644
--- a/algo/ca/TrackingSetup.cxx
+++ b/algo/ca/TrackingSetup.cxx
@@ -9,7 +9,7 @@
 
 #include "TrackingSetup.h"
 
-#include "Definitions.h"
+#include "algo/base/Definitions.h"
 
 using cbm::algo::TrackingSetup;
 using fles::Subsystem;
diff --git a/algo/ca/TrackingSetup.h b/algo/ca/TrackingSetup.h
index ba678c4e3b..b3d726526b 100644
--- a/algo/ca/TrackingSetup.h
+++ b/algo/ca/TrackingSetup.h
@@ -9,10 +9,10 @@
 
 #pragma once
 
-#include "SubChain.h"
-#include "sts/TrackingInterface.h"
-#include "tof/TrackingInterface.h"
-#include "trd/TrackingInterface.h"
+#include "algo/base/SubChain.h"
+#include "algo/detectors/sts/TrackingInterface.h"
+#include "algo/detectors/tof/TrackingInterface.h"
+#include "algo/detectors/trd/TrackingInterface.h"
 
 #include <type_traits>
 
diff --git a/algo/ca/qa/CaQa.cxx b/algo/ca/qa/CaQa.cxx
index b921d16813..f8d9181ac5 100644
--- a/algo/ca/qa/CaQa.cxx
+++ b/algo/ca/qa/CaQa.cxx
@@ -13,7 +13,7 @@
 #include "CaInputData.h"
 #include "CaParameters.h"
 #include "CaTrack.h"
-#include "TrackingDefs.h"
+#include "algo/ca/TrackingDefs.h"
 
 #include <algorithm>
 #include <fstream>
diff --git a/algo/ca/qa/CaQa.h b/algo/ca/qa/CaQa.h
index 90b7a9db01..7fe797745c 100644
--- a/algo/ca/qa/CaQa.h
+++ b/algo/ca/qa/CaQa.h
@@ -13,7 +13,7 @@
 #include "CaHit.h"  // for HitIndex_t
 #include "CaTimesliceHeader.h"
 #include "CaVector.h"
-#include "qa/QaTaskHeader.h"
+#include "algo/qa/QaTaskHeader.h"
 
 namespace cbm::algo
 {
diff --git a/algo/data/sts/Cluster.h b/algo/data/sts/Cluster.h
index 927d787e30..23bdd523a2 100644
--- a/algo/data/sts/Cluster.h
+++ b/algo/data/sts/Cluster.h
@@ -4,7 +4,7 @@
 #ifndef CBM_ALGO_DATA_STS_CLUSTER_H
 #define CBM_ALGO_DATA_STS_CLUSTER_H
 
-#include "Definitions.h"
+#include "algo/base/Definitions.h"
 
 #include <boost/serialization/access.hpp>
 
diff --git a/algo/data/sts/Hit.h b/algo/data/sts/Hit.h
index 2df0d8370f..ff3c3bf04b 100644
--- a/algo/data/sts/Hit.h
+++ b/algo/data/sts/Hit.h
@@ -5,7 +5,7 @@
 #ifndef CBM_ALGO_DATA_STS_HIT_H
 #define CBM_ALGO_DATA_STS_HIT_H
 
-#include "Definitions.h"
+#include "algo/base/Definitions.h"
 
 #include <boost/serialization/access.hpp>
 
diff --git a/algo/data/sts/HitfinderPars.cxx b/algo/data/sts/HitfinderPars.cxx
index ac6fe3baca..dcacb5149f 100644
--- a/algo/data/sts/HitfinderPars.cxx
+++ b/algo/data/sts/HitfinderPars.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer] */
 
-#include "HitfinderPars.h"
+#include "algo/data/sts/HitfinderPars.h"
 
 using namespace cbm::algo;
 CBM_YAML_INSTANTIATE(sts::HitfinderPars);
diff --git a/algo/data/sts/HitfinderPars.h b/algo/data/sts/HitfinderPars.h
index 3e58fa30e0..865e94884c 100644
--- a/algo/data/sts/HitfinderPars.h
+++ b/algo/data/sts/HitfinderPars.h
@@ -3,8 +3,8 @@
    Authors: Felix Weiglhofer [committer] */
 #pragma once
 
-#include "Definitions.h"
-#include "LandauTable.h"
+#include "algo/base/Definitions.h"
+#include "algo/data/sts/LandauTable.h"
 #include "yaml/Property.h"
 #include "yaml/Yaml.h"
 
diff --git a/algo/data/sts/LandauTable.cxx b/algo/data/sts/LandauTable.cxx
index 7d466c38ee..38fcc138c6 100644
--- a/algo/data/sts/LandauTable.cxx
+++ b/algo/data/sts/LandauTable.cxx
@@ -1,7 +1,7 @@
 /* Copyright (C) 2023 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer] */
-#include "LandauTable.h"
+#include "algo/data/sts/LandauTable.h"
 
 #include "AlgoFairloggerCompat.h"
 
diff --git a/algo/data/sts/LandauTable.h b/algo/data/sts/LandauTable.h
index 639e6b0044..04329dc647 100644
--- a/algo/data/sts/LandauTable.h
+++ b/algo/data/sts/LandauTable.h
@@ -4,8 +4,8 @@
 #ifndef CBM_ALGO_DATA_STS_LANDAUTABLE_H
 #define CBM_ALGO_DATA_STS_LANDAUTABLE_H
 
-#include "Definitions.h"
-#include "compat/Filesystem.h"
+#include "algo/base/Definitions.h"
+#include "algo/base/compat/Filesystem.h"
 
 #include <vector>
 
diff --git a/algo/detectors/bmon/Calibrate.cxx b/algo/detectors/bmon/Calibrate.cxx
index fc2a17f29c..631c1412c6 100644
--- a/algo/detectors/bmon/Calibrate.cxx
+++ b/algo/detectors/bmon/Calibrate.cxx
@@ -11,7 +11,7 @@
 
 #include "AlgoFairloggerCompat.h"
 #include "CbmTofAddress.h"
-#include "util/TimingsFormat.h"
+#include "algo/base/util/TimingsFormat.h"
 
 #include <bitset>
 #include <chrono>
diff --git a/algo/detectors/bmon/Calibrate.h b/algo/detectors/bmon/Calibrate.h
index 644fd20320..b7cb7ff0ac 100644
--- a/algo/detectors/bmon/Calibrate.h
+++ b/algo/detectors/bmon/Calibrate.h
@@ -11,8 +11,8 @@
 
 #include "CbmBmonDigi.h"
 #include "PartitionedVector.h"
-#include "bmon/CalibrateSetup.h"
-#include "tof/Calibrate.h"  // for the monitor data
+#include "algo/detectors/bmon/CalibrateSetup.h"
+#include "algo/detectors/tof/Calibrate.h"  // for the monitor data
 
 #include <gsl/span>
 #include <optional>
diff --git a/algo/detectors/bmon/CalibrateSetup.h b/algo/detectors/bmon/CalibrateSetup.h
index 975175a10e..02d58bb70d 100644
--- a/algo/detectors/bmon/CalibrateSetup.h
+++ b/algo/detectors/bmon/CalibrateSetup.h
@@ -9,7 +9,7 @@
 
 #pragma once
 
-#include "Definitions.h"
+#include "algo/base/Definitions.h"
 #include "yaml/Property.h"
 
 #include <array>
diff --git a/algo/detectors/bmon/Clusterizer.cxx b/algo/detectors/bmon/Clusterizer.cxx
index d3a8e3d4ab..b691644192 100644
--- a/algo/detectors/bmon/Clusterizer.cxx
+++ b/algo/detectors/bmon/Clusterizer.cxx
@@ -8,7 +8,7 @@
 /// \author Sergei Zharko <s.zharko@gsi.de>
 
 
-#include "bmon/Clusterizer.h"
+#include "algo/detectors/bmon/Clusterizer.h"
 
 #include "AlgoFairloggerCompat.h"
 #include "CbmBmonDigi.h"
diff --git a/algo/detectors/bmon/Clusterizer.h b/algo/detectors/bmon/Clusterizer.h
index 276f28d1ba..247f96ed41 100644
--- a/algo/detectors/bmon/Clusterizer.h
+++ b/algo/detectors/bmon/Clusterizer.h
@@ -10,8 +10,8 @@
 #pragma once
 
 #include "PODVector.h"
-#include "bmon/ClusterizerPars.h"
-#include "bmon/Hit.h"
+#include "algo/detectors/bmon/ClusterizerPars.h"
+#include "algo/detectors/bmon/Hit.h"
 
 #include <cmath>
 #include <cstdint>
diff --git a/algo/detectors/bmon/Hitfind.cxx b/algo/detectors/bmon/Hitfind.cxx
index d39a46f6c4..430968efab 100644
--- a/algo/detectors/bmon/Hitfind.cxx
+++ b/algo/detectors/bmon/Hitfind.cxx
@@ -8,11 +8,11 @@
 /// \author Sergei Zharko <s.zharko@gsi.de>
 
 
-#include "Hitfind.h"
+#include "algo/detectors/bmon/Hitfind.h"
 
 #include "AlgoFairloggerCompat.h"
-#include "compat/OpenMP.h"
-#include "util/TimingsFormat.h"
+#include "algo/base/compat/OpenMP.h"
+#include "algo/base/util/TimingsFormat.h"
 
 #include <chrono>
 
diff --git a/algo/detectors/bmon/Hitfind.h b/algo/detectors/bmon/Hitfind.h
index 0257a9b748..420b3396f2 100644
--- a/algo/detectors/bmon/Hitfind.h
+++ b/algo/detectors/bmon/Hitfind.h
@@ -12,9 +12,9 @@
 #include "CbmBmonDigi.h"
 #include "PODVector.h"
 #include "PartitionedVector.h"
-#include "bmon/Clusterizer.h"
-#include "bmon/HitfindSetup.h"
-#include "tof/Hitfind.h"  // for tof::HitfindMonitorData
+#include "algo/detectors/bmon/Clusterizer.h"
+#include "algo/detectors/bmon/HitfindSetup.h"
+#include "algo/detectors/tof/Hitfind.h"  // for tof::HitfindMonitorData
 
 #include <gsl/span>
 #include <optional>
diff --git a/algo/detectors/bmon/HitfindSetup.h b/algo/detectors/bmon/HitfindSetup.h
index 96431fb026..04e60047b9 100644
--- a/algo/detectors/bmon/HitfindSetup.h
+++ b/algo/detectors/bmon/HitfindSetup.h
@@ -9,7 +9,7 @@
 
 #pragma once
 
-#include "Definitions.h"
+#include "algo/base/Definitions.h"
 #include "yaml/Property.h"
 
 #include <string>
diff --git a/algo/detectors/bmon/ReadoutConfig.cxx b/algo/detectors/bmon/ReadoutConfig.cxx
index 99d4c4a3b5..81d2cf4c44 100644
--- a/algo/detectors/bmon/ReadoutConfig.cxx
+++ b/algo/detectors/bmon/ReadoutConfig.cxx
@@ -2,11 +2,11 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Dominik Smith [committer] */
 
-#include "ReadoutConfig.h"
+#include "algo/detectors/bmon/ReadoutConfig.h"
 
 #include "AlgoFairloggerCompat.h"
 #include "CbmTofAddress.h"
-#include "Exceptions.h"
+#include "algo/base/Exceptions.h"
 #include "gDpbMessv100.h"
 
 #include <bitset>
diff --git a/algo/detectors/bmon/ReadoutConfig.h b/algo/detectors/bmon/ReadoutConfig.h
index 88e0361d38..9ffdc3aec2 100644
--- a/algo/detectors/bmon/ReadoutConfig.h
+++ b/algo/detectors/bmon/ReadoutConfig.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include "Definitions.h"
+#include "algo/base/Definitions.h"
 #include "yaml/Property.h"
 #include "yaml/Yaml.h"
 
diff --git a/algo/detectors/bmon/Unpack.cxx b/algo/detectors/bmon/Unpack.cxx
index f7eaae2d5b..2ed13c45dd 100644
--- a/algo/detectors/bmon/Unpack.cxx
+++ b/algo/detectors/bmon/Unpack.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer], Dominik Smith */
 
-#include "Unpack.h"
+#include "algo/detectors/bmon/Unpack.h"
 
 #include "AlgoFairloggerCompat.h"
 
diff --git a/algo/detectors/bmon/Unpack.h b/algo/detectors/bmon/Unpack.h
index 0a35e0cd1b..6061acf757 100644
--- a/algo/detectors/bmon/Unpack.h
+++ b/algo/detectors/bmon/Unpack.h
@@ -4,9 +4,9 @@
 
 #pragma once
 
-#include "CommonUnpacker.h"
-#include "ReadoutConfig.h"
-#include "UnpackMS.h"
+#include "algo/detectors/bmon/ReadoutConfig.h"
+#include "algo/detectors/bmon/UnpackMS.h"
+#include "algo/unpack/CommonUnpacker.h"
 
 namespace cbm::algo::bmon
 {
diff --git a/algo/detectors/bmon/UnpackMS.cxx b/algo/detectors/bmon/UnpackMS.cxx
index 275ea3cb0d..9f792f9497 100644
--- a/algo/detectors/bmon/UnpackMS.cxx
+++ b/algo/detectors/bmon/UnpackMS.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Dominik Smith [committer] */
 
-#include "UnpackMS.h"
+#include "algo/detectors/bmon/UnpackMS.h"
 
 #include "AlgoFairloggerCompat.h"
 #include "CbmTofAddress.h"
diff --git a/algo/detectors/bmon/UnpackMS.h b/algo/detectors/bmon/UnpackMS.h
index 4930ab2ac3..97917035a0 100644
--- a/algo/detectors/bmon/UnpackMS.h
+++ b/algo/detectors/bmon/UnpackMS.h
@@ -7,7 +7,7 @@
 #include "CriGet4Mess001.h"
 #include "MicrosliceDescriptor.hpp"
 #include "Timeslice.hpp"
-#include "UnpackMSBase.h"
+#include "algo/unpack/UnpackMSBase.h"
 
 #include <cassert>
 #include <cstddef>
diff --git a/algo/detectors/much/ReadoutConfig.cxx b/algo/detectors/much/ReadoutConfig.cxx
index ccf994cc2f..5bb51832da 100644
--- a/algo/detectors/much/ReadoutConfig.cxx
+++ b/algo/detectors/much/ReadoutConfig.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Pierre-Alain Loizeau, Ajit Kumar, Florian Uhlig [committer] */
 
-#include "ReadoutConfig.h"
+#include "algo/detectors/much/ReadoutConfig.h"
 
 #include "AlgoFairloggerCompat.h"
 #include "CbmMuchAddress.h"
diff --git a/algo/detectors/much/Unpack.cxx b/algo/detectors/much/Unpack.cxx
index 4cc5efd443..4ad7fc4c66 100644
--- a/algo/detectors/much/Unpack.cxx
+++ b/algo/detectors/much/Unpack.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer], Dominik Smith */
 
-#include "Unpack.h"
+#include "algo/detectors/much/Unpack.h"
 
 #include "AlgoFairloggerCompat.h"
 
diff --git a/algo/detectors/much/Unpack.h b/algo/detectors/much/Unpack.h
index b89719afb7..5ee9be6aeb 100644
--- a/algo/detectors/much/Unpack.h
+++ b/algo/detectors/much/Unpack.h
@@ -4,9 +4,9 @@
 
 #pragma once
 
-#include "CommonUnpacker.h"
-#include "ReadoutConfig.h"
-#include "UnpackMS.h"
+#include "algo/detectors/much/ReadoutConfig.h"
+#include "algo/detectors/much/UnpackMS.h"
+#include "algo/unpack/CommonUnpacker.h"
 
 namespace cbm::algo::much
 {
diff --git a/algo/detectors/much/UnpackMS.cxx b/algo/detectors/much/UnpackMS.cxx
index 01ded68f85..7267b3ade2 100644
--- a/algo/detectors/much/UnpackMS.cxx
+++ b/algo/detectors/much/UnpackMS.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Pierre-Alain Loizeau, Volker Friese [committer] */
 
-#include "UnpackMS.h"
+#include "algo/detectors/much/UnpackMS.h"
 
 #include "StsXyterMessage.h"
 
diff --git a/algo/detectors/much/UnpackMS.h b/algo/detectors/much/UnpackMS.h
index c34b9e90b6..c9b6de285f 100644
--- a/algo/detectors/much/UnpackMS.h
+++ b/algo/detectors/much/UnpackMS.h
@@ -7,7 +7,7 @@
 #include "MicrosliceDescriptor.hpp"
 #include "StsXyterMessage.h"
 #include "Timeslice.hpp"
-#include "UnpackMSBase.h"
+#include "algo/unpack/UnpackMSBase.h"
 
 #include <cassert>
 #include <cstddef>
diff --git a/algo/detectors/rich/ReadoutConfig.cxx b/algo/detectors/rich/ReadoutConfig.cxx
index cddc2ed1cd..ccaa347b6a 100644
--- a/algo/detectors/rich/ReadoutConfig.cxx
+++ b/algo/detectors/rich/ReadoutConfig.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Volker Friese, Dominik Smith [committer], Martin Beyer */
 
-#include "ReadoutConfig.h"
+#include "algo/detectors/rich/ReadoutConfig.h"
 
 #include <cassert>
 #include <iomanip>
diff --git a/algo/detectors/rich/Unpack.cxx b/algo/detectors/rich/Unpack.cxx
index 3fb2dd4f50..40acb945da 100644
--- a/algo/detectors/rich/Unpack.cxx
+++ b/algo/detectors/rich/Unpack.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer], Dominik Smith */
 
-#include "Unpack.h"
+#include "algo/detectors/rich/Unpack.h"
 
 #include "AlgoFairloggerCompat.h"
 
diff --git a/algo/detectors/rich/Unpack.h b/algo/detectors/rich/Unpack.h
index 93f414f51a..40d749a93c 100644
--- a/algo/detectors/rich/Unpack.h
+++ b/algo/detectors/rich/Unpack.h
@@ -4,9 +4,9 @@
 
 #pragma once
 
-#include "CommonUnpacker.h"
-#include "ReadoutConfig.h"
-#include "UnpackMS.h"
+#include "algo/detectors/rich/ReadoutConfig.h"
+#include "algo/detectors/rich/UnpackMS.h"
+#include "algo/unpack/CommonUnpacker.h"
 
 namespace cbm::algo::rich
 {
diff --git a/algo/detectors/rich/UnpackMS.cxx b/algo/detectors/rich/UnpackMS.cxx
index 0fa5bb9d79..14a3d4b9e0 100644
--- a/algo/detectors/rich/UnpackMS.cxx
+++ b/algo/detectors/rich/UnpackMS.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Pascal Raisig, Dominik Smith [committer] */
 
-#include "UnpackMS.h"
+#include "algo/detectors/rich/UnpackMS.h"
 
 #include "AlgoFairloggerCompat.h"
 
diff --git a/algo/detectors/rich/UnpackMS.h b/algo/detectors/rich/UnpackMS.h
index 30e66555ab..d925134ed6 100644
--- a/algo/detectors/rich/UnpackMS.h
+++ b/algo/detectors/rich/UnpackMS.h
@@ -4,9 +4,9 @@
 #pragma once
 
 #include "CbmRichDigi.h"
-#include "Definitions.h"
 #include "Timeslice.hpp"
-#include "UnpackMSBase.h"
+#include "algo/base/Definitions.h"
+#include "algo/unpack/UnpackMSBase.h"
 
 #include <cstddef>
 #include <cstdint>
diff --git a/algo/detectors/sts/ChannelMaskSet.cxx b/algo/detectors/sts/ChannelMaskSet.cxx
index 10dce9224e..c33516a472 100644
--- a/algo/detectors/sts/ChannelMaskSet.cxx
+++ b/algo/detectors/sts/ChannelMaskSet.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer], Dominik Smith */
 
-#include "ChannelMaskSet.h"
+#include "algo/detectors/sts/ChannelMaskSet.h"
 
 using namespace cbm::algo;
 CBM_YAML_INSTANTIATE(sts::ChannelMaskSet);
diff --git a/algo/detectors/sts/ChannelMaskSet.h b/algo/detectors/sts/ChannelMaskSet.h
index bc0c0b83ad..efc5e022e0 100644
--- a/algo/detectors/sts/ChannelMaskSet.h
+++ b/algo/detectors/sts/ChannelMaskSet.h
@@ -4,8 +4,8 @@
 
 #pragma once
 
-#include "Definitions.h"
-#include "compat/Filesystem.h"
+#include "algo/base/Definitions.h"
+#include "algo/base/compat/Filesystem.h"
 #include "yaml/Property.h"
 #include "yaml/Yaml.h"
 
diff --git a/algo/detectors/sts/Hitfinder.cxx b/algo/detectors/sts/Hitfinder.cxx
index 3ddf2df2d6..a831e58388 100644
--- a/algo/detectors/sts/Hitfinder.cxx
+++ b/algo/detectors/sts/Hitfinder.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer], Kilian Hunold */
 
-#include "Hitfinder.h"
+#include "algo/detectors/sts/Hitfinder.h"
 
 using namespace cbm::algo;
 
diff --git a/algo/detectors/sts/Hitfinder.h b/algo/detectors/sts/Hitfinder.h
index c0accf7499..3bcd971621 100644
--- a/algo/detectors/sts/Hitfinder.h
+++ b/algo/detectors/sts/Hitfinder.h
@@ -6,13 +6,13 @@
 #define CBM_ALGO_STS_HITFINDER_H
 
 #include "CbmStsDigi.h"
-#include "Definitions.h"
-#include "gpu/DeviceImage.h"
-#include "gpu/PaddedValue.h"
-#include "gpu/Params.h"
-#include "sts/Cluster.h"
-#include "sts/Hit.h"
-#include "sts/HitfinderPars.h"
+#include "algo/base/Definitions.h"
+#include "algo/base/gpu/DeviceImage.h"
+#include "algo/base/gpu/PaddedValue.h"
+#include "algo/base/gpu/Params.h"
+#include "algo/data/sts/Cluster.h"
+#include "algo/data/sts/Hit.h"
+#include "algo/data/sts/HitfinderPars.h"
 
 #include <xpu/device.h>
 
diff --git a/algo/detectors/sts/HitfinderChain.cxx b/algo/detectors/sts/HitfinderChain.cxx
index 5796cfa54b..d9345d86ff 100644
--- a/algo/detectors/sts/HitfinderChain.cxx
+++ b/algo/detectors/sts/HitfinderChain.cxx
@@ -2,12 +2,12 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer], Kilian Hunold */
 
-#include "HitfinderChain.h"
+#include "algo/detectors/sts/HitfinderChain.h"
 
 #include "AlgoFairloggerCompat.h"
-#include "Exceptions.h"
 #include "PODVector.h"
-#include "compat/OpenMP.h"
+#include "algo/base/Exceptions.h"
+#include "algo/base/compat/OpenMP.h"
 
 #include <numeric>
 
diff --git a/algo/detectors/sts/HitfinderChain.h b/algo/detectors/sts/HitfinderChain.h
index 78f7b2c5c6..23417f3787 100644
--- a/algo/detectors/sts/HitfinderChain.h
+++ b/algo/detectors/sts/HitfinderChain.h
@@ -8,10 +8,10 @@
 #include "CbmStsDigi.h"
 #include "PartitionedSpan.h"
 #include "PartitionedVector.h"
-#include "SubChain.h"
-#include "sts/Hitfinder.h"
-#include "sts/HitfinderPars.h"
-#include "sts/LandauTable.h"
+#include "algo/base/SubChain.h"
+#include "algo/data/sts/HitfinderPars.h"
+#include "algo/data/sts/LandauTable.h"
+#include "algo/detectors/sts/Hitfinder.h"
 
 #include <array>
 #include <cstdint>
diff --git a/algo/detectors/sts/ReadoutConfig.cxx b/algo/detectors/sts/ReadoutConfig.cxx
index b972826504..f0534af855 100644
--- a/algo/detectors/sts/ReadoutConfig.cxx
+++ b/algo/detectors/sts/ReadoutConfig.cxx
@@ -1,12 +1,12 @@
 /* Copyright (C) 2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Volker Friese [committer], Felix Weiglhofer */
-#include "ReadoutConfig.h"
+#include "algo/detectors/sts/ReadoutConfig.h"
 
 #include "AlgoFairloggerCompat.h"
 #include "CbmStsAddress.h"
-#include "ChannelMaskSet.h"
-#include "Exceptions.h"
+#include "algo/base/Exceptions.h"
+#include "algo/detectors/sts/ChannelMaskSet.h"
 
 #include <cassert>
 #include <iomanip>
diff --git a/algo/detectors/sts/ReadoutConfig.h b/algo/detectors/sts/ReadoutConfig.h
index b3db24c219..20dd01db82 100644
--- a/algo/detectors/sts/ReadoutConfig.h
+++ b/algo/detectors/sts/ReadoutConfig.h
@@ -4,7 +4,7 @@
 #ifndef CBM_ALGO_DETECTOR_STS_READOUT_CONFIG_H
 #define CBM_ALGO_DETECTOR_STS_READOUT_CONFIG_H
 
-#include "Definitions.h"
+#include "algo/base/Definitions.h"
 #include "yaml/Property.h"
 #include "yaml/Yaml.h"
 
diff --git a/algo/detectors/sts/StsRecoUtils.h b/algo/detectors/sts/StsRecoUtils.h
index bc5fc07ba9..92446e7680 100644
--- a/algo/detectors/sts/StsRecoUtils.h
+++ b/algo/detectors/sts/StsRecoUtils.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include "Definitions.h"
+#include "algo/base/Definitions.h"
 
 #include <cassert>
 #include <cstdlib>
diff --git a/algo/detectors/sts/TrackingInterface.cxx b/algo/detectors/sts/TrackingInterface.cxx
index 0aedb2b958..660f5192f2 100644
--- a/algo/detectors/sts/TrackingInterface.cxx
+++ b/algo/detectors/sts/TrackingInterface.cxx
@@ -7,7 +7,7 @@
 /// \brief  A TOF-parameter and geometry interface used for tracking input data initialization (source)
 /// \author Sergei Zharko <s.zharko@gsi.de>
 
-#include "TrackingInterface.h"
+#include "algo/detectors/sts/TrackingInterface.h"
 
 #include "AlgoFairloggerCompat.h"
 #include "CbmStsAddress.h"
diff --git a/algo/detectors/sts/TrackingInterface.h b/algo/detectors/sts/TrackingInterface.h
index 472863eef1..9d0d7cc467 100644
--- a/algo/detectors/sts/TrackingInterface.h
+++ b/algo/detectors/sts/TrackingInterface.h
@@ -9,7 +9,7 @@
 
 #pragma once
 
-#include "SubChain.h"
+#include "algo/base/SubChain.h"
 
 namespace cbm::algo::sts
 {
diff --git a/algo/detectors/sts/Unpack.cxx b/algo/detectors/sts/Unpack.cxx
index e1ddecff19..2f5670ee0a 100644
--- a/algo/detectors/sts/Unpack.cxx
+++ b/algo/detectors/sts/Unpack.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer], Dominik Smith */
 
-#include "Unpack.h"
+#include "algo/detectors/sts/Unpack.h"
 
 #include "AlgoFairloggerCompat.h"
 
diff --git a/algo/detectors/sts/Unpack.h b/algo/detectors/sts/Unpack.h
index f8c09d6686..5aeefbce17 100644
--- a/algo/detectors/sts/Unpack.h
+++ b/algo/detectors/sts/Unpack.h
@@ -4,10 +4,10 @@
 
 #pragma once
 
-#include "CommonUnpacker.h"
-#include "ReadoutConfig.h"
-#include "UnpackMS.h"
-#include "WalkMap.h"
+#include "algo/detectors/sts/ReadoutConfig.h"
+#include "algo/detectors/sts/UnpackMS.h"
+#include "algo/detectors/sts/WalkMap.h"
+#include "algo/unpack/CommonUnpacker.h"
 
 namespace cbm::algo::sts
 {
diff --git a/algo/detectors/sts/UnpackMS.cxx b/algo/detectors/sts/UnpackMS.cxx
index 9c8af375ed..bc298c8c33 100644
--- a/algo/detectors/sts/UnpackMS.cxx
+++ b/algo/detectors/sts/UnpackMS.cxx
@@ -2,11 +2,11 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Pierre-Alain Loizeau, Volker Friese [committer] */
 
-#include "UnpackMS.h"
+#include "algo/detectors/sts/UnpackMS.h"
 
 #include "AlgoFairloggerCompat.h"
-#include "StsRecoUtils.h"
 #include "StsXyterMessage.h"
+#include "algo/detectors/sts/StsRecoUtils.h"
 
 #include <cassert>
 #include <cmath>
diff --git a/algo/detectors/sts/UnpackMS.h b/algo/detectors/sts/UnpackMS.h
index bee256ae62..447b876af2 100644
--- a/algo/detectors/sts/UnpackMS.h
+++ b/algo/detectors/sts/UnpackMS.h
@@ -4,10 +4,10 @@
 #pragma once
 
 #include "CbmStsDigi.h"
-#include "Definitions.h"
 #include "MicrosliceDescriptor.hpp"
 #include "StsXyterMessage.h"
-#include "UnpackMSBase.h"
+#include "algo/base/Definitions.h"
+#include "algo/unpack/UnpackMSBase.h"
 
 #include <cassert>
 #include <cstddef>
diff --git a/algo/detectors/sts/WalkMap.cxx b/algo/detectors/sts/WalkMap.cxx
index e97620a5d6..dd3e9e4109 100644
--- a/algo/detectors/sts/WalkMap.cxx
+++ b/algo/detectors/sts/WalkMap.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer], Dominik Smith */
 
-#include "WalkMap.h"
+#include "algo/detectors/sts/WalkMap.h"
 
 using namespace cbm::algo::sts;
 
diff --git a/algo/detectors/sts/WalkMap.h b/algo/detectors/sts/WalkMap.h
index 57a23d54a0..5f2411ae2b 100644
--- a/algo/detectors/sts/WalkMap.h
+++ b/algo/detectors/sts/WalkMap.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include "Definitions.h"
+#include "algo/base/Definitions.h"
 #include "yaml/Property.h"
 #include "yaml/Yaml.h"
 
diff --git a/algo/detectors/tof/Calibrate.cxx b/algo/detectors/tof/Calibrate.cxx
index 382ead1081..e99135bb83 100644
--- a/algo/detectors/tof/Calibrate.cxx
+++ b/algo/detectors/tof/Calibrate.cxx
@@ -2,10 +2,10 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Dominik Smith [committer] */
 
-#include "Calibrate.h"
+#include "algo/detectors/tof/Calibrate.h"
 
 #include "AlgoFairloggerCompat.h"
-#include "util/TimingsFormat.h"
+#include "algo/base/util/TimingsFormat.h"
 
 #include <chrono>
 
diff --git a/algo/detectors/tof/Calibrate.h b/algo/detectors/tof/Calibrate.h
index 03b27a34bd..480380e8f7 100644
--- a/algo/detectors/tof/Calibrate.h
+++ b/algo/detectors/tof/Calibrate.h
@@ -7,8 +7,8 @@
 
 #include "CbmTofDigi.h"
 #include "PartitionedVector.h"
-#include "tof/CalibrateSetup.h"
-#include "tof/Clusterizer.h"
+#include "algo/detectors/tof/CalibrateSetup.h"
+#include "algo/detectors/tof/Clusterizer.h"
 
 #include <gsl/span>
 #include <optional>
diff --git a/algo/detectors/tof/CalibrateSetup.h b/algo/detectors/tof/CalibrateSetup.h
index 89d806312b..4da2d68c6e 100644
--- a/algo/detectors/tof/CalibrateSetup.h
+++ b/algo/detectors/tof/CalibrateSetup.h
@@ -4,7 +4,7 @@
 #ifndef CBM_ALGO_DETECTOR_TOF_CALIBRATE_SETUP_H
 #define CBM_ALGO_DETECTOR_TOF_CALIBRATE_SETUP_H
 
-#include "Definitions.h"
+#include "algo/base/Definitions.h"
 #include "yaml/Property.h"
 
 #include <array>
diff --git a/algo/detectors/tof/Clusterizer.cxx b/algo/detectors/tof/Clusterizer.cxx
index fb36f7d47f..9ca25e6830 100644
--- a/algo/detectors/tof/Clusterizer.cxx
+++ b/algo/detectors/tof/Clusterizer.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Dominik Smith [committer], Pierre-Alain Loizeau */
 
-#include "Clusterizer.h"
+#include "algo/detectors/tof/Clusterizer.h"
 
 // TOF Classes and includes
 #include "CbmTofDigi.h"
diff --git a/algo/detectors/tof/Clusterizer.h b/algo/detectors/tof/Clusterizer.h
index 98942ee4a1..c2019c7992 100644
--- a/algo/detectors/tof/Clusterizer.h
+++ b/algo/detectors/tof/Clusterizer.h
@@ -12,8 +12,8 @@
 // TOF Classes and includes
 class CbmTofDigi;
 
-#include "ClusterizerPars.h"
-#include "Hit.h"
+#include "algo/detectors/tof/ClusterizerPars.h"
+#include "algo/detectors/tof/Hit.h"
 
 // C++ Classes and includes
 #include <cmath>
diff --git a/algo/detectors/tof/Hit.h b/algo/detectors/tof/Hit.h
index 8e3a1a0685..adceab18fa 100644
--- a/algo/detectors/tof/Hit.h
+++ b/algo/detectors/tof/Hit.h
@@ -3,10 +3,10 @@
    Authors: Dominik Smith [committer], Pierre-Alain Loizeau, Felix Weiglhofer */
 #pragma once
 
-#include "ClusterizerPars.h"
-#include "Definitions.h"
 #include "Math/Rotation3D.h"
 #include "Math/Vector3Dfwd.h"
+#include "algo/base/Definitions.h"
+#include "algo/detectors/tof/ClusterizerPars.h"
 
 #include <boost/serialization/access.hpp>
 #include <boost/serialization/split_member.hpp>
diff --git a/algo/detectors/tof/HitFinder.cxx b/algo/detectors/tof/HitFinder.cxx
index caca727cca..c171aa1d33 100644
--- a/algo/detectors/tof/HitFinder.cxx
+++ b/algo/detectors/tof/HitFinder.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Dominik Smith [committer], Pierre-Alain Loizeau */
 
-#include "HitFinder.h"
+#include "algo/detectors/tof/HitFinder.h"
 
 // TOF Classes and includes
 #include "CbmTofDigi.h"
diff --git a/algo/detectors/tof/Hitfind.cxx b/algo/detectors/tof/Hitfind.cxx
index 5abf282f3a..d6fdee35c3 100644
--- a/algo/detectors/tof/Hitfind.cxx
+++ b/algo/detectors/tof/Hitfind.cxx
@@ -2,11 +2,11 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Dominik Smith [committer] */
 
-#include "Hitfind.h"
+#include "algo/detectors/tof/Hitfind.h"
 
 #include "AlgoFairloggerCompat.h"
-#include "compat/OpenMP.h"
-#include "util/TimingsFormat.h"
+#include "algo/base/compat/OpenMP.h"
+#include "algo/base/util/TimingsFormat.h"
 
 #include <chrono>
 
diff --git a/algo/detectors/tof/Hitfind.h b/algo/detectors/tof/Hitfind.h
index 5cd1c669ac..02f784a6f6 100644
--- a/algo/detectors/tof/Hitfind.h
+++ b/algo/detectors/tof/Hitfind.h
@@ -8,8 +8,8 @@
 #include "CbmTofDigi.h"
 #include "PODVector.h"
 #include "PartitionedVector.h"
-#include "tof/Clusterizer.h"
-#include "tof/HitfindSetup.h"
+#include "algo/detectors/tof/Clusterizer.h"
+#include "algo/detectors/tof/HitfindSetup.h"
 
 #include <gsl/span>
 #include <optional>
diff --git a/algo/detectors/tof/HitfindSetup.h b/algo/detectors/tof/HitfindSetup.h
index c3138ad7d3..f23dce5bf2 100644
--- a/algo/detectors/tof/HitfindSetup.h
+++ b/algo/detectors/tof/HitfindSetup.h
@@ -4,7 +4,7 @@
 #ifndef CBM_ALGO_DETECTOR_TOF_HITFIND_SETUP_H
 #define CBM_ALGO_DETECTOR_TOF_HITFIND_SETUP_H
 
-#include "Definitions.h"
+#include "algo/base/Definitions.h"
 #include "yaml/Property.h"
 
 #include <array>
diff --git a/algo/detectors/tof/ReadoutConfig.cxx b/algo/detectors/tof/ReadoutConfig.cxx
index 36310a9d4b..58e1493617 100644
--- a/algo/detectors/tof/ReadoutConfig.cxx
+++ b/algo/detectors/tof/ReadoutConfig.cxx
@@ -2,11 +2,11 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Dominik Smith [committer] */
 
-#include "ReadoutConfig.h"
+#include "algo/detectors/tof/ReadoutConfig.h"
 
 #include "AlgoFairloggerCompat.h"
 #include "CbmTofAddress.h"
-#include "Exceptions.h"
+#include "algo/base/Exceptions.h"
 #include "gDpbMessv100.h"
 
 #include <bitset>
diff --git a/algo/detectors/tof/ReadoutConfig.h b/algo/detectors/tof/ReadoutConfig.h
index 6b9ac632fa..6d75ecd3b0 100644
--- a/algo/detectors/tof/ReadoutConfig.h
+++ b/algo/detectors/tof/ReadoutConfig.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include "Definitions.h"
+#include "algo/base/Definitions.h"
 #include "yaml/Property.h"
 #include "yaml/Yaml.h"
 
diff --git a/algo/detectors/tof/TrackingInterface.cxx b/algo/detectors/tof/TrackingInterface.cxx
index 0ed55e5096..b72a02c099 100644
--- a/algo/detectors/tof/TrackingInterface.cxx
+++ b/algo/detectors/tof/TrackingInterface.cxx
@@ -7,13 +7,14 @@
 /// \brief  A TOF-parameter and geometry interface used for tracking input data initialization (source)
 /// \author Sergei Zharko <s.zharko@gsi.de>
 
-#include "TrackingInterface.h"
+#include "algo/detectors/tof/TrackingInterface.h"
 
 #include "AlgoFairloggerCompat.h"
 #include "CbmTofAddress.h"
-#include "HitfindSetup.h"
-#include "ParFiles.h"
-#include "fmt/format.h"
+#include "algo/detectors/tof/HitfindSetup.h"
+#include "algo/global/ParFiles.h"
+
+#include <fmt/format.h>
 
 using cbm::algo::tof::HitfindSetup;
 using cbm::algo::tof::TrackingInterface;
diff --git a/algo/detectors/tof/TrackingInterface.h b/algo/detectors/tof/TrackingInterface.h
index c6ce0f937b..ca12e8e6cf 100644
--- a/algo/detectors/tof/TrackingInterface.h
+++ b/algo/detectors/tof/TrackingInterface.h
@@ -9,7 +9,7 @@
 
 #pragma once
 
-#include "SubChain.h"
+#include "algo/base/SubChain.h"
 
 namespace cbm::algo::tof
 {
diff --git a/algo/detectors/tof/Unpack.cxx b/algo/detectors/tof/Unpack.cxx
index 2409c772a2..fe89c377c7 100644
--- a/algo/detectors/tof/Unpack.cxx
+++ b/algo/detectors/tof/Unpack.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer], Dominik Smith */
 
-#include "Unpack.h"
+#include "algo/detectors/tof/Unpack.h"
 
 #include "AlgoFairloggerCompat.h"
 
diff --git a/algo/detectors/tof/Unpack.h b/algo/detectors/tof/Unpack.h
index a78ff079ab..1e2ecb7009 100644
--- a/algo/detectors/tof/Unpack.h
+++ b/algo/detectors/tof/Unpack.h
@@ -3,9 +3,9 @@
    Authors: Felix Weiglhofer [committer], Dominik Smith */
 #pragma once
 
-#include "CommonUnpacker.h"
-#include "tof/ReadoutConfig.h"
-#include "tof/UnpackMS.h"
+#include "algo/detectors/tof/ReadoutConfig.h"
+#include "algo/detectors/tof/UnpackMS.h"
+#include "algo/unpack/CommonUnpacker.h"
 
 namespace cbm::algo::tof
 {
diff --git a/algo/detectors/tof/UnpackMS.cxx b/algo/detectors/tof/UnpackMS.cxx
index ae0a4d37ca..37afaf0afa 100644
--- a/algo/detectors/tof/UnpackMS.cxx
+++ b/algo/detectors/tof/UnpackMS.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Dominik Smith [committer] */
 
-#include "UnpackMS.h"
+#include "algo/detectors/tof/UnpackMS.h"
 
 #include <cassert>
 #include <cmath>
diff --git a/algo/detectors/tof/UnpackMS.h b/algo/detectors/tof/UnpackMS.h
index 6f41bd674e..b8a65f54d1 100644
--- a/algo/detectors/tof/UnpackMS.h
+++ b/algo/detectors/tof/UnpackMS.h
@@ -5,10 +5,10 @@
 
 #include "CbmTofDigi.h"
 #include "CriGet4Mess001.h"
-#include "Definitions.h"
 #include "MicrosliceDescriptor.hpp"
 #include "Timeslice.hpp"
-#include "UnpackMSBase.h"
+#include "algo/base/Definitions.h"
+#include "algo/unpack/UnpackMSBase.h"
 
 #include <cassert>
 #include <cstddef>
diff --git a/algo/detectors/trd/Cluster.cxx b/algo/detectors/trd/Cluster.cxx
index 867cfe1ef9..6c9a0fa494 100644
--- a/algo/detectors/trd/Cluster.cxx
+++ b/algo/detectors/trd/Cluster.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Dominik Smith [committer], Alexandru Bercuci */
 
-#include "Cluster.h"
+#include "algo/detectors/trd/Cluster.h"
 
 #include "CbmTrdDigi.h"
 
diff --git a/algo/detectors/trd/Cluster2D.cxx b/algo/detectors/trd/Cluster2D.cxx
index b628531719..929ffe7100 100644
--- a/algo/detectors/trd/Cluster2D.cxx
+++ b/algo/detectors/trd/Cluster2D.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Dominik Smith [committer], Alexandru Bercuci */
 
-#include "Cluster2D.h"
+#include "algo/detectors/trd/Cluster2D.h"
 
 #include "AlgoFairloggerCompat.h"
 #include "CbmTrdDigi.h"
diff --git a/algo/detectors/trd/Cluster2D.h b/algo/detectors/trd/Cluster2D.h
index 40cf184475..493d4389c4 100644
--- a/algo/detectors/trd/Cluster2D.h
+++ b/algo/detectors/trd/Cluster2D.h
@@ -4,8 +4,8 @@
 
 #pragma once
 
-#include "DigiRec.h"
-#include "compat/RTypes.h"
+#include "algo/base/compat/RTypes.h"
+#include "algo/detectors/trd/DigiRec.h"
 
 #include <cstdint>
 #include <vector>  // for vector
diff --git a/algo/detectors/trd/Clusterizer.cxx b/algo/detectors/trd/Clusterizer.cxx
index dff15aa23e..a07dbcf72f 100644
--- a/algo/detectors/trd/Clusterizer.cxx
+++ b/algo/detectors/trd/Clusterizer.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Dominik Smith [committer], Etienne Bechtel, Florian Uhlig */
 
-#include "Clusterizer.h"
+#include "algo/detectors/trd/Clusterizer.h"
 
 #include <algorithm>
 #include <unordered_map>
diff --git a/algo/detectors/trd/Clusterizer.h b/algo/detectors/trd/Clusterizer.h
index 35a203b740..5d6bdfa67d 100644
--- a/algo/detectors/trd/Clusterizer.h
+++ b/algo/detectors/trd/Clusterizer.h
@@ -5,8 +5,8 @@
 #pragma once
 
 #include "CbmTrdDigi.h"
-#include "Cluster.h"
-#include "HitFinderPars.h"
+#include "algo/detectors/trd/Cluster.h"
+#include "algo/detectors/trd/HitFinderPars.h"
 
 #include <tuple>
 #include <vector>
diff --git a/algo/detectors/trd/Clusterizer2D.cxx b/algo/detectors/trd/Clusterizer2D.cxx
index e222a452ba..54587bad17 100644
--- a/algo/detectors/trd/Clusterizer2D.cxx
+++ b/algo/detectors/trd/Clusterizer2D.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Dominik Smith [committer], Alexandru Bercuci */
 
-#include "Clusterizer2D.h"
+#include "algo/detectors/trd/Clusterizer2D.h"
 
 #include "AlgoFairloggerCompat.h"
 
diff --git a/algo/detectors/trd/Clusterizer2D.h b/algo/detectors/trd/Clusterizer2D.h
index 1fcf3134ed..e54205bee0 100644
--- a/algo/detectors/trd/Clusterizer2D.h
+++ b/algo/detectors/trd/Clusterizer2D.h
@@ -5,8 +5,8 @@
 #pragma once
 
 #include "CbmTrdDigi.h"
-#include "Cluster2D.h"
-#include "HitFinder2DPars.h"
+#include "algo/detectors/trd/Cluster2D.h"
+#include "algo/detectors/trd/HitFinder2DPars.h"
 
 #include <tuple>
 #include <vector>
diff --git a/algo/detectors/trd/DigiRec.cxx b/algo/detectors/trd/DigiRec.cxx
index f74ccbce31..98191ba8b7 100644
--- a/algo/detectors/trd/DigiRec.cxx
+++ b/algo/detectors/trd/DigiRec.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Alexandru Bercuci[committer] */
 
-#include "DigiRec.h"
+#include "algo/detectors/trd/DigiRec.h"
 
 #include <cstring>
 
diff --git a/algo/detectors/trd/DigiRec.h b/algo/detectors/trd/DigiRec.h
index 135171e26d..95b0764e50 100644
--- a/algo/detectors/trd/DigiRec.h
+++ b/algo/detectors/trd/DigiRec.h
@@ -5,7 +5,7 @@
 #pragma once
 
 #include "CbmTrdDigi.h"
-#include "compat/RTypes.h"
+#include "algo/base/compat/RTypes.h"
 
 /** @class DigiRec
  ** @brief Extend the TRD(2D) digi class to incorporate FEE calibration.
diff --git a/algo/detectors/trd/HitFactory2D.cxx b/algo/detectors/trd/HitFactory2D.cxx
index 2c93cc1ad7..a9b5c13ec2 100644
--- a/algo/detectors/trd/HitFactory2D.cxx
+++ b/algo/detectors/trd/HitFactory2D.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Dominik Smith [committer], Alexandru Bercuci */
 
-#include "HitFactory2D.h"
+#include "algo/detectors/trd/HitFactory2D.h"
 
 #include "AlgoFairloggerCompat.h"
 
diff --git a/algo/detectors/trd/HitFactory2D.h b/algo/detectors/trd/HitFactory2D.h
index 4efed55530..f00ff846a7 100644
--- a/algo/detectors/trd/HitFactory2D.h
+++ b/algo/detectors/trd/HitFactory2D.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include "compat/RTypes.h"
+#include "algo/base/compat/RTypes.h"
 
 #include <cstdint>
 #include <vector>
diff --git a/algo/detectors/trd/HitFinder.cxx b/algo/detectors/trd/HitFinder.cxx
index 7ae1c39ad0..91b94466d2 100644
--- a/algo/detectors/trd/HitFinder.cxx
+++ b/algo/detectors/trd/HitFinder.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Dominik Smith [committer], Etienne Bechtel, Florian Uhlig */
 
-#include "HitFinder.h"
+#include "algo/detectors/trd/HitFinder.h"
 
 #include "AlgoFairloggerCompat.h"
 #include "CbmTrdDigi.h"
diff --git a/algo/detectors/trd/HitFinder.h b/algo/detectors/trd/HitFinder.h
index db5503c2db..e5d45a8ea5 100644
--- a/algo/detectors/trd/HitFinder.h
+++ b/algo/detectors/trd/HitFinder.h
@@ -4,12 +4,12 @@
 
 #pragma once
 
-#include "Cluster.h"
-#include "DigiRec.h"
-#include "Hit.h"
-#include "HitFinderPars.h"
 #include "Math/Rotation3D.h"
 #include "Math/Vector3Dfwd.h"
+#include "algo/detectors/trd/Cluster.h"
+#include "algo/detectors/trd/DigiRec.h"
+#include "algo/detectors/trd/Hit.h"
+#include "algo/detectors/trd/HitFinderPars.h"
 
 #include <tuple>
 #include <vector>
@@ -23,7 +23,7 @@ namespace cbm::algo::trd
   **/
   class HitFinder {
    public:
-    typedef std::pair<Hit, std::vector<DigiRec>> resultType;
+    typedef std::pair<trd::Hit, std::vector<DigiRec>> resultType;
 
     HitFinder(){};
     /**
diff --git a/algo/detectors/trd/HitFinder2D.cxx b/algo/detectors/trd/HitFinder2D.cxx
index bff1685914..69f6771576 100644
--- a/algo/detectors/trd/HitFinder2D.cxx
+++ b/algo/detectors/trd/HitFinder2D.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Dominik Smith [committer], Alexandru Bercuci */
 
-#include "HitFinder2D.h"
+#include "algo/detectors/trd/HitFinder2D.h"
 
 #include "AlgoFairloggerCompat.h"
 
diff --git a/algo/detectors/trd/HitFinder2D.h b/algo/detectors/trd/HitFinder2D.h
index 973f2f8ed9..5cabb18433 100644
--- a/algo/detectors/trd/HitFinder2D.h
+++ b/algo/detectors/trd/HitFinder2D.h
@@ -5,13 +5,13 @@
 #pragma once
 
 #include "CbmTrdDigi.h"
-#include "Cluster2D.h"
-#include "DigiRec.h"
-#include "Hit.h"
-#include "HitFactory2D.h"
-#include "HitFinder2DPars.h"
 #include "Math/Rotation3D.h"
 #include "Math/Vector3Dfwd.h"
+#include "algo/detectors/trd/Cluster2D.h"
+#include "algo/detectors/trd/DigiRec.h"
+#include "algo/detectors/trd/Hit.h"
+#include "algo/detectors/trd/HitFactory2D.h"
+#include "algo/detectors/trd/HitFinder2DPars.h"
 
 #include <cstdint>
 #include <tuple>
diff --git a/algo/detectors/trd/HitMerger.cxx b/algo/detectors/trd/HitMerger.cxx
index 9adddadc58..20eb03eb36 100644
--- a/algo/detectors/trd/HitMerger.cxx
+++ b/algo/detectors/trd/HitMerger.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Dominik Smith [committer], Etienne Bechtel, Florian Uhlig */
 
-#include "HitMerger.h"
+#include "algo/detectors/trd/HitMerger.h"
 
 namespace cbm::algo::trd
 {
diff --git a/algo/detectors/trd/HitMerger.h b/algo/detectors/trd/HitMerger.h
index 4d01c20e32..af809e289e 100644
--- a/algo/detectors/trd/HitMerger.h
+++ b/algo/detectors/trd/HitMerger.h
@@ -4,9 +4,9 @@
 
 #pragma once
 
-#include "DigiRec.h"
-#include "Hit.h"
-#include "HitFinderPars.h"
+#include "algo/detectors/trd/DigiRec.h"
+#include "algo/detectors/trd/Hit.h"
+#include "algo/detectors/trd/HitFinderPars.h"
 
 #include <tuple>
 #include <vector>
diff --git a/algo/detectors/trd/HitMerger2D.cxx b/algo/detectors/trd/HitMerger2D.cxx
index fc4e4a55d5..1bfde0d2f9 100644
--- a/algo/detectors/trd/HitMerger2D.cxx
+++ b/algo/detectors/trd/HitMerger2D.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Dominik Smith [committer], Alexandru Bercuci */
 
-#include "HitMerger2D.h"
+#include "algo/detectors/trd/HitMerger2D.h"
 
 #include "AlgoFairloggerCompat.h"
 
diff --git a/algo/detectors/trd/HitMerger2D.h b/algo/detectors/trd/HitMerger2D.h
index 113f029e0d..6be8542f44 100644
--- a/algo/detectors/trd/HitMerger2D.h
+++ b/algo/detectors/trd/HitMerger2D.h
@@ -5,12 +5,12 @@
 #pragma once
 
 #include "CbmTrdDigi.h"
-#include "DigiRec.h"
-#include "Hit.h"
-#include "HitFactory2D.h"
-#include "HitFinder2DPars.h"
 #include "Math/Rotation3D.h"
 #include "Math/Vector3Dfwd.h"
+#include "algo/detectors/trd/DigiRec.h"
+#include "algo/detectors/trd/Hit.h"
+#include "algo/detectors/trd/HitFactory2D.h"
+#include "algo/detectors/trd/HitFinder2DPars.h"
 
 #include <cstdint>
 #include <tuple>
diff --git a/algo/detectors/trd/Hitfind.cxx b/algo/detectors/trd/Hitfind.cxx
index d0cb3f36cd..e5b5056eb5 100644
--- a/algo/detectors/trd/Hitfind.cxx
+++ b/algo/detectors/trd/Hitfind.cxx
@@ -2,11 +2,11 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Dominik Smith [committer] */
 
-#include "Hitfind.h"
+#include "algo/detectors/trd/Hitfind.h"
 
 #include "AlgoFairloggerCompat.h"
-#include "compat/OpenMP.h"
-#include "util/TimingsFormat.h"
+#include "algo/base/compat/OpenMP.h"
+#include "algo/base/util/TimingsFormat.h"
 
 #include <chrono>
 
diff --git a/algo/detectors/trd/Hitfind.h b/algo/detectors/trd/Hitfind.h
index acf2138d0a..043270d108 100644
--- a/algo/detectors/trd/Hitfind.h
+++ b/algo/detectors/trd/Hitfind.h
@@ -5,17 +5,17 @@
 #pragma once
 
 #include "CbmTrdDigi.h"
-#include "DigiRec.h"
 #include "PODVector.h"
 #include "PartitionedVector.h"
-#include "trd/Clusterizer.h"
-#include "trd/Clusterizer2D.h"
-#include "trd/HitFinder.h"
-#include "trd/HitFinder2D.h"
-#include "trd/HitMerger.h"
-#include "trd/HitMerger2D.h"
-#include "trd/Hitfind2DSetup.h"
-#include "trd/HitfindSetup.h"
+#include "algo/detectors/trd/Clusterizer.h"
+#include "algo/detectors/trd/Clusterizer2D.h"
+#include "algo/detectors/trd/DigiRec.h"
+#include "algo/detectors/trd/HitFinder.h"
+#include "algo/detectors/trd/HitFinder2D.h"
+#include "algo/detectors/trd/HitMerger.h"
+#include "algo/detectors/trd/HitMerger2D.h"
+#include "algo/detectors/trd/Hitfind2DSetup.h"
+#include "algo/detectors/trd/HitfindSetup.h"
 
 #include <gsl/span>
 #include <optional>
diff --git a/algo/detectors/trd/Hitfind2DSetup.h b/algo/detectors/trd/Hitfind2DSetup.h
index a045abbc75..c9427c1030 100644
--- a/algo/detectors/trd/Hitfind2DSetup.h
+++ b/algo/detectors/trd/Hitfind2DSetup.h
@@ -3,7 +3,7 @@
    Authors: Dominik Smith [committer] */
 #pragma once
 
-#include "Definitions.h"
+#include "algo/base/Definitions.h"
 #include "yaml/Property.h"
 
 #include <array>
diff --git a/algo/detectors/trd/HitfindSetup.h b/algo/detectors/trd/HitfindSetup.h
index 68214432c7..79c8372aab 100644
--- a/algo/detectors/trd/HitfindSetup.h
+++ b/algo/detectors/trd/HitfindSetup.h
@@ -3,7 +3,7 @@
    Authors: Dominik Smith [committer] */
 #pragma once
 
-#include "Definitions.h"
+#include "algo/base/Definitions.h"
 #include "yaml/Property.h"
 
 #include <array>
diff --git a/algo/detectors/trd/ReadoutConfig.cxx b/algo/detectors/trd/ReadoutConfig.cxx
index 4ffa48492d..be47a816e5 100644
--- a/algo/detectors/trd/ReadoutConfig.cxx
+++ b/algo/detectors/trd/ReadoutConfig.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Volker Friese [committer] */
 
-#include "ReadoutConfig.h"
+#include "algo/detectors/trd/ReadoutConfig.h"
 
 //#include "CbmTrdAddress.h"
 
diff --git a/algo/detectors/trd/TrackingInterface.cxx b/algo/detectors/trd/TrackingInterface.cxx
index 97d67f8085..bbc6f43dcc 100644
--- a/algo/detectors/trd/TrackingInterface.cxx
+++ b/algo/detectors/trd/TrackingInterface.cxx
@@ -7,7 +7,7 @@
 /// \brief  A TRD-parameter and geometry interface used for tracking input data initialization (source)
 /// \author Sergei Zharko <s.zharko@gsi.de>
 
-#include "TrackingInterface.h"
+#include "algo/detectors/trd/TrackingInterface.h"
 
 #include "AlgoFairloggerCompat.h"
 #include "CbmTrdAddress.h"
diff --git a/algo/detectors/trd/TrackingInterface.h b/algo/detectors/trd/TrackingInterface.h
index e5f1bf05e8..915b4720e7 100644
--- a/algo/detectors/trd/TrackingInterface.h
+++ b/algo/detectors/trd/TrackingInterface.h
@@ -9,7 +9,7 @@
 
 #pragma once
 
-#include "SubChain.h"
+#include "algo/base/SubChain.h"
 
 namespace cbm::algo::trd
 {
diff --git a/algo/detectors/trd/Unpack.cxx b/algo/detectors/trd/Unpack.cxx
index 6e037ec986..e82b3e7cea 100644
--- a/algo/detectors/trd/Unpack.cxx
+++ b/algo/detectors/trd/Unpack.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer], Dominik Smith */
 
-#include "Unpack.h"
+#include "algo/detectors/trd/Unpack.h"
 
 #include "AlgoFairloggerCompat.h"
 
diff --git a/algo/detectors/trd/Unpack.h b/algo/detectors/trd/Unpack.h
index 91dc4d769c..0091f41d39 100644
--- a/algo/detectors/trd/Unpack.h
+++ b/algo/detectors/trd/Unpack.h
@@ -4,9 +4,9 @@
 
 #pragma once
 
-#include "CommonUnpacker.h"
-#include "ReadoutConfig.h"
-#include "UnpackMS.h"
+#include "algo/detectors/trd/ReadoutConfig.h"
+#include "algo/detectors/trd/UnpackMS.h"
+#include "algo/unpack/CommonUnpacker.h"
 
 namespace cbm::algo::trd
 {
diff --git a/algo/detectors/trd/UnpackMS.cxx b/algo/detectors/trd/UnpackMS.cxx
index d598336a23..bd4ecf86a3 100644
--- a/algo/detectors/trd/UnpackMS.cxx
+++ b/algo/detectors/trd/UnpackMS.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Pascal Raisig, Dominik Smith [committer], David Schledt */
 
-#include "UnpackMS.h"
+#include "algo/detectors/trd/UnpackMS.h"
 
 #include "AlgoFairloggerCompat.h"
 
diff --git a/algo/detectors/trd/UnpackMS.h b/algo/detectors/trd/UnpackMS.h
index e7832b93ca..528d719040 100644
--- a/algo/detectors/trd/UnpackMS.h
+++ b/algo/detectors/trd/UnpackMS.h
@@ -9,7 +9,7 @@
 #include "CbmTrdRawMessageSpadic.h"
 #include "MicrosliceDescriptor.hpp"
 #include "Timeslice.hpp"
-#include "UnpackMSBase.h"
+#include "algo/unpack/UnpackMSBase.h"
 
 #include <cmath>
 #include <memory>
diff --git a/algo/detectors/trd2d/ReadoutConfig.cxx b/algo/detectors/trd2d/ReadoutConfig.cxx
index a65ca1e2c0..7606200590 100644
--- a/algo/detectors/trd2d/ReadoutConfig.cxx
+++ b/algo/detectors/trd2d/ReadoutConfig.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Volker Friese, Dominik Smith [committer], Alex Bercuci */
 
-#include "ReadoutConfig.h"
+#include "algo/detectors/trd2d/ReadoutConfig.h"
 
 //#include "CbmTrdAddress.h"
 #include "AlgoFairloggerCompat.h"
diff --git a/algo/detectors/trd2d/ReadoutConfig.h b/algo/detectors/trd2d/ReadoutConfig.h
index 673b55f876..db9673da9b 100644
--- a/algo/detectors/trd2d/ReadoutConfig.h
+++ b/algo/detectors/trd2d/ReadoutConfig.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include "UnpackMS.h"
+#include "algo/detectors/trd2d/UnpackMS.h"
 #include "yaml/Property.h"
 #include "yaml/Yaml.h"
 
diff --git a/algo/detectors/trd2d/Unpack.cxx b/algo/detectors/trd2d/Unpack.cxx
index b0b57c45d5..a1147f0992 100644
--- a/algo/detectors/trd2d/Unpack.cxx
+++ b/algo/detectors/trd2d/Unpack.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer], Dominik Smith, Alex Bercuci */
 
-#include "Unpack.h"
+#include "algo/detectors/trd2d/Unpack.h"
 
 #include "AlgoFairloggerCompat.h"
 
diff --git a/algo/detectors/trd2d/Unpack.h b/algo/detectors/trd2d/Unpack.h
index 0495ddaa0a..443bd2e087 100644
--- a/algo/detectors/trd2d/Unpack.h
+++ b/algo/detectors/trd2d/Unpack.h
@@ -4,9 +4,9 @@
 
 #pragma once
 
-#include "CommonUnpacker.h"
-#include "ReadoutConfig.h"
-#include "UnpackMS.h"
+#include "algo/detectors/trd2d/ReadoutConfig.h"
+#include "algo/detectors/trd2d/UnpackMS.h"
+#include "algo/unpack/CommonUnpacker.h"
 
 namespace cbm::algo::trd2d
 {
diff --git a/algo/detectors/trd2d/UnpackMS.cxx b/algo/detectors/trd2d/UnpackMS.cxx
index b143ea98cb..382e6d4bee 100644
--- a/algo/detectors/trd2d/UnpackMS.cxx
+++ b/algo/detectors/trd2d/UnpackMS.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Pascal Raisig, Alexandru Bercuci, Dominik Smith [committer] */
 
-#include "UnpackMS.h"
+#include "algo/detectors/trd2d/UnpackMS.h"
 
 #include "AlgoFairloggerCompat.h"
 
diff --git a/algo/detectors/trd2d/UnpackMS.h b/algo/detectors/trd2d/UnpackMS.h
index 9696671b6a..a8f2168572 100644
--- a/algo/detectors/trd2d/UnpackMS.h
+++ b/algo/detectors/trd2d/UnpackMS.h
@@ -5,7 +5,7 @@
 
 #include "CbmTrdDigi.h"
 #include "MicrosliceDescriptor.hpp"
-#include "UnpackMSBase.h"
+#include "algo/unpack/UnpackMSBase.h"
 
 #include <array>
 #include <memory>
diff --git a/algo/evbuild/Config.cxx b/algo/evbuild/Config.cxx
index cf34f09388..f9d8dad1f8 100644
--- a/algo/evbuild/Config.cxx
+++ b/algo/evbuild/Config.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Volker Friese [committer] */
 
-#include "Config.h"
+#include "algo/evbuild/Config.h"
 
 #include <fstream>
 
diff --git a/algo/evbuild/Config.h b/algo/evbuild/Config.h
index 974e2b8b03..2137528e2d 100644
--- a/algo/evbuild/Config.h
+++ b/algo/evbuild/Config.h
@@ -6,10 +6,10 @@
 #ifndef ALGO_EVBUILD_CONFIG_H
 #define ALGO_EVBUILD_CONFIG_H 1
 
-#include "DigiEventSelectorConfig.h"
-#include "DigiTriggerConfig.h"
-#include "EventBuilderConfig.h"
-#include "V0Trigger.h"
+#include "algo/evbuild/EventBuilderConfig.h"
+#include "algo/evselector/DigiEventSelectorConfig.h"
+#include "algo/trigger/DigiTriggerConfig.h"
+#include "algo/trigger/V0Trigger.h"
 
 #include <yaml-cpp/yaml.h>
 
diff --git a/algo/evbuild/EventBuilder.cxx b/algo/evbuild/EventBuilder.cxx
index a53e8f2772..26279f97bc 100644
--- a/algo/evbuild/EventBuilder.cxx
+++ b/algo/evbuild/EventBuilder.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Volker Friese [committer] */
 
-#include "EventBuilder.h"
+#include "algo/evbuild/EventBuilder.h"
 
 #include <cassert>
 #include <iomanip>
diff --git a/algo/evbuild/EventBuilder.h b/algo/evbuild/EventBuilder.h
index b3837384a4..71e6d15e25 100644
--- a/algo/evbuild/EventBuilder.h
+++ b/algo/evbuild/EventBuilder.h
@@ -6,9 +6,9 @@
 #define CBM_ALGO_EVENTBUILDER_H 1
 
 #include "CbmDefs.h"
-#include "DigiData.h"
-#include "DigiEventSelector.h"
-#include "EventBuilderConfig.h"
+#include "algo/base/DigiData.h"
+#include "algo/evbuild/EventBuilderConfig.h"
+#include "algo/evselector/DigiEventSelector.h"
 
 #include <algorithm>
 #include <gsl/span>
diff --git a/algo/evbuild/EventBuilderConfig.cxx b/algo/evbuild/EventBuilderConfig.cxx
index e0817b04a4..94375b2035 100644
--- a/algo/evbuild/EventBuilderConfig.cxx
+++ b/algo/evbuild/EventBuilderConfig.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Volker Friese [committer] */
 
-#include "EventBuilderConfig.h"
+#include "algo/evbuild/EventBuilderConfig.h"
 
 
 namespace cbm::algo::evbuild
diff --git a/algo/evbuild/EventbuildChain.cxx b/algo/evbuild/EventbuildChain.cxx
index 7184a4a06c..b1e90679e9 100644
--- a/algo/evbuild/EventbuildChain.cxx
+++ b/algo/evbuild/EventbuildChain.cxx
@@ -2,12 +2,12 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Volker Friese [committer] */
 
-#include "EventbuildChain.h"
+#include "algo/evbuild/EventbuildChain.h"
 
 #include "CbmDigiTimeslice.h"
-#include "DigiData.h"
-#include "HistogramContainer.h"
-#include "evbuild/Config.h"
+#include "algo/base/DigiData.h"
+#include "algo/evbuild/Config.h"
+#include "algo/qa/HistogramContainer.h"
 
 #include <sstream>
 #include <string>
diff --git a/algo/evbuild/EventbuildChain.h b/algo/evbuild/EventbuildChain.h
index 32ae1e649c..2699a37ca0 100644
--- a/algo/evbuild/EventbuildChain.h
+++ b/algo/evbuild/EventbuildChain.h
@@ -6,16 +6,16 @@
 #define CBM_ALGO_EVBUILD_EVBUILDCHAIN_H 1
 
 #include "CbmDefs.h"
-#include "Config.h"
-#include "DigiEventQa.h"
-#include "DigiEventSelector.h"
-#include "EventBuilder.h"
-#include "HistogramSender.h"
-#include "HitMultTrigger.h"
-#include "RecoResults.h"
-#include "SubChain.h"
-#include "TimeClusterTrigger.h"
-#include "V0Trigger.h"
+#include "algo/base/HistogramSender.h"
+#include "algo/base/SubChain.h"
+#include "algo/evbuild/Config.h"
+#include "algo/evbuild/EventBuilder.h"
+#include "algo/evselector/DigiEventSelector.h"
+#include "algo/global/RecoResults.h"
+#include "algo/qa/DigiEventQa.h"
+#include "algo/trigger/HitMultTrigger.h"
+#include "algo/trigger/TimeClusterTrigger.h"
+#include "algo/trigger/V0Trigger.h"
 
 #include <memory>
 
diff --git a/algo/evselector/DigiEventSelector.cxx b/algo/evselector/DigiEventSelector.cxx
index 4411689bfb..ea54178306 100644
--- a/algo/evselector/DigiEventSelector.cxx
+++ b/algo/evselector/DigiEventSelector.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Shreya Roy [committer], Pierre-Alain Loizeau, Norbert Herrmann, Volker Friese, Dominik Smith */
 
-#include "DigiEventSelector.h"
+#include "algo/evselector/DigiEventSelector.h"
 
 #include "AlgoFairloggerCompat.h"
 #include "CbmStsDigi.h"
diff --git a/algo/evselector/DigiEventSelector.h b/algo/evselector/DigiEventSelector.h
index f12fd4ccd2..3cc7db7d29 100644
--- a/algo/evselector/DigiEventSelector.h
+++ b/algo/evselector/DigiEventSelector.h
@@ -5,9 +5,9 @@
 #ifndef CBM_ALGO_DIGIEVENTSELECTOR_H
 #define CBM_ALGO_DIGIEVENTSELECTOR_H 1
 
-#include "DigiData.h"
-#include "DigiEventSelectorConfig.h"
-#include "TrackingSetup.h"
+#include "algo/base/DigiData.h"
+#include "algo/ca/TrackingSetup.h"
+#include "algo/evselector/DigiEventSelectorConfig.h"
 
 #include <cstdint>
 #include <gsl/span>
diff --git a/algo/evselector/DigiEventSelectorConfig.cxx b/algo/evselector/DigiEventSelectorConfig.cxx
index 43399c74f0..5cde512db2 100644
--- a/algo/evselector/DigiEventSelectorConfig.cxx
+++ b/algo/evselector/DigiEventSelectorConfig.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Shreya Roy. Pierre-Alain Loizeau, Volker Friese [committer], Dominik Smith, Sergei Zharko */
 
-#include "DigiEventSelectorConfig.h"
+#include "algo/evselector/DigiEventSelectorConfig.h"
 
 #include "AlgoFairloggerCompat.h"
 
diff --git a/algo/global/ParFiles.cxx b/algo/global/ParFiles.cxx
index 85134bd4bb..a16db465aa 100644
--- a/algo/global/ParFiles.cxx
+++ b/algo/global/ParFiles.cxx
@@ -1,9 +1,9 @@
 /* Copyright (C) 2024 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer] */
-#include "ParFiles.h"
+#include "algo/global/ParFiles.h"
 
-#include "Exceptions.h"
+#include "algo/base/Exceptions.h"
 
 using namespace cbm::algo;
 
diff --git a/algo/global/ParFiles.h b/algo/global/ParFiles.h
index 0fe7b3094b..09100494a7 100644
--- a/algo/global/ParFiles.h
+++ b/algo/global/ParFiles.h
@@ -8,8 +8,8 @@
  * @brief This file contains the definition of the ParFiles class.
  */
 
-#include "Definitions.h"
-#include "compat/Filesystem.h"
+#include "algo/base/Definitions.h"
+#include "algo/base/compat/Filesystem.h"
 
 namespace cbm::algo
 {
diff --git a/algo/global/Reco.cxx b/algo/global/Reco.cxx
index 3736872a02..8967a7600b 100644
--- a/algo/global/Reco.cxx
+++ b/algo/global/Reco.cxx
@@ -1,44 +1,44 @@
 /* Copyright (C) 2023-2025 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer], P.-A. Loizeau, Sergei Zharko */
-#include "Reco.h"
+#include "algo/global/Reco.h"
 
 #include "AlgoFairloggerCompat.h"
-#include "AuxDigiData.h"
-#include "BuildInfo.h"
+#include "CaTrack.h"
 #include "CbmDigiEvent.h"
-#include "EventbuildChain.h"
-#include "Exceptions.h"
-#include "HistogramSender.h"
-#include "ParFiles.h"
-#include "RecoGeneralQa.h"
-#include "StsDigiQa.h"
-#include "TrackingSetup.h"
-#include "bmon/Calibrate.h"
-#include "bmon/Hitfind.h"
-#include "bmon/ReadoutConfig.h"
-#include "bmon/Unpack.h"
-#include "ca/TrackingChain.h"
-#include "ca/core/data/CaTrack.h"
-#include "compat/OpenMP.h"
-#include "evbuild/Config.h"
-#include "kfp/KfpV0FinderChain.h"
-#include "much/Unpack.h"
-#include "qa/QaManager.h"
-#include "qa/hitfind/BmonHitfindQa.h"
-#include "qa/hitfind/TofHitfindQa.h"
-#include "rich/Unpack.h"
-#include "sts/ChannelMaskSet.h"
-#include "sts/HitfinderChain.h"
-#include "sts/Unpack.h"
-#include "tof/Calibrate.h"
-#include "tof/Hitfind.h"
-#include "tof/Unpack.h"
-#include "trd/Hitfind.h"
-#include "trd/Unpack.h"
-#include "trd2d/Unpack.h"
-#include "util/TimingsFormat.h"
-#include "util/TsUtils.h"
+#include "algo/base/AuxDigiData.h"
+#include "algo/base/BuildInfo.h"
+#include "algo/base/Exceptions.h"
+#include "algo/base/HistogramSender.h"
+#include "algo/base/compat/OpenMP.h"
+#include "algo/base/util/TimingsFormat.h"
+#include "algo/base/util/TsUtils.h"
+#include "algo/ca/TrackingChain.h"
+#include "algo/ca/TrackingSetup.h"
+#include "algo/detectors/bmon/Calibrate.h"
+#include "algo/detectors/bmon/Hitfind.h"
+#include "algo/detectors/bmon/ReadoutConfig.h"
+#include "algo/detectors/bmon/Unpack.h"
+#include "algo/detectors/much/Unpack.h"
+#include "algo/detectors/rich/Unpack.h"
+#include "algo/detectors/sts/ChannelMaskSet.h"
+#include "algo/detectors/sts/HitfinderChain.h"
+#include "algo/detectors/sts/Unpack.h"
+#include "algo/detectors/tof/Calibrate.h"
+#include "algo/detectors/tof/Hitfind.h"
+#include "algo/detectors/tof/Unpack.h"
+#include "algo/detectors/trd/Hitfind.h"
+#include "algo/detectors/trd/Unpack.h"
+#include "algo/detectors/trd2d/Unpack.h"
+#include "algo/evbuild/Config.h"
+#include "algo/evbuild/EventbuildChain.h"
+#include "algo/global/ParFiles.h"
+#include "algo/kfp/KfpV0FinderChain.h"
+#include "algo/qa/QaManager.h"
+#include "algo/qa/RecoGeneralQa.h"
+#include "algo/qa/hitfind/BmonHitfindQa.h"
+#include "algo/qa/hitfind/TofHitfindQa.h"
+#include "algo/qa/unpack/StsDigiQa.h"
 #include "yaml/Yaml.h"
 
 #include <Monitor.hpp>
diff --git a/algo/global/Reco.h b/algo/global/Reco.h
index e5a8412151..b31e62f69a 100644
--- a/algo/global/Reco.h
+++ b/algo/global/Reco.h
@@ -3,10 +3,10 @@
    Authors: Felix Weiglhofer [committer] */
 #pragma once
 
-#include "AlgoTraits.h"
-#include "SubChain.h"
-#include "evselector/RecoEventSelectorMonitor.h"
-#include "global/RecoResults.h"
+#include "algo/base/AlgoTraits.h"
+#include "algo/base/SubChain.h"
+#include "algo/evselector/RecoEventSelectorMonitor.h"
+#include "algo/global/RecoResults.h"
 
 #include <xpu/host.h>
 
diff --git a/algo/global/RecoResults.h b/algo/global/RecoResults.h
index 3bcee8be6a..c445fbf91b 100644
--- a/algo/global/RecoResults.h
+++ b/algo/global/RecoResults.h
@@ -9,16 +9,17 @@
 
 #pragma once
 
-#include "DigiData.h"
+#include "CaTrack.h"
+#include "CaVector.h"
+#include "PODVector.h"
 #include "PartitionedSpan.h"
 #include "PartitionedVector.h"
-#include "bmon/Hit.h"
-#include "ca/core/data/CaTrack.h"
-#include "ca/core/utils/CaVector.h"
-#include "sts/Cluster.h"
-#include "sts/Hit.h"
-#include "tof/Hit.h"
-#include "trd/Hit.h"
+#include "algo/base/DigiData.h"
+#include "algo/data/sts/Cluster.h"
+#include "algo/data/sts/Hit.h"
+#include "algo/detectors/bmon/Hit.h"
+#include "algo/detectors/tof/Hit.h"
+#include "algo/detectors/trd/Hit.h"
 
 #include <vector>
 
diff --git a/algo/global/RecoResultsInputArchive.cxx b/algo/global/RecoResultsInputArchive.cxx
index 650f014e8a..52cfbca569 100644
--- a/algo/global/RecoResultsInputArchive.cxx
+++ b/algo/global/RecoResultsInputArchive.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer] */
 
-#include "RecoResultsInputArchive.h"
+#include "algo/global/RecoResultsInputArchive.h"
 
 namespace fles
 {
diff --git a/algo/global/RecoResultsInputArchive.h b/algo/global/RecoResultsInputArchive.h
index f73e338265..0240f18001 100644
--- a/algo/global/RecoResultsInputArchive.h
+++ b/algo/global/RecoResultsInputArchive.h
@@ -3,7 +3,7 @@
    Authors: Felix Weiglhofer [committer] */
 #pragma once
 
-#include "StorableRecoResults.h"
+#include "algo/global/StorableRecoResults.h"
 
 #include <InputArchive.hpp>
 
diff --git a/algo/global/RecoResultsOutputArchive.cxx b/algo/global/RecoResultsOutputArchive.cxx
index e1094f362b..596dd9bdd2 100644
--- a/algo/global/RecoResultsOutputArchive.cxx
+++ b/algo/global/RecoResultsOutputArchive.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer] */
 
-#include "RecoResultsOutputArchive.h"
+#include "algo/global/RecoResultsOutputArchive.h"
 
 namespace fles
 {
diff --git a/algo/global/RecoResultsOutputArchive.h b/algo/global/RecoResultsOutputArchive.h
index 8c673eb16d..7ac61d5872 100644
--- a/algo/global/RecoResultsOutputArchive.h
+++ b/algo/global/RecoResultsOutputArchive.h
@@ -3,7 +3,7 @@
    Authors: Felix Weiglhofer [committer] */
 #pragma once
 
-#include "StorableRecoResults.h"
+#include "algo/global/StorableRecoResults.h"
 
 #include <OutputArchive.hpp>
 
diff --git a/algo/global/StorableRecoResults.cxx b/algo/global/StorableRecoResults.cxx
index 22b072eb30..a3956307af 100644
--- a/algo/global/StorableRecoResults.cxx
+++ b/algo/global/StorableRecoResults.cxx
@@ -1,7 +1,7 @@
 /* Copyright (C) 2024 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer], P.-A. Loizeau */
-#include "StorableRecoResults.h"
+#include "algo/global/StorableRecoResults.h"
 
 using namespace cbm::algo;
 
diff --git a/algo/global/StorableRecoResults.h b/algo/global/StorableRecoResults.h
index 3dfd208b18..3269175dfb 100644
--- a/algo/global/StorableRecoResults.h
+++ b/algo/global/StorableRecoResults.h
@@ -4,15 +4,15 @@
 #ifndef CBM_ALGO_GLOBAL_STORABLE_RECO_RESULTS_H
 #define CBM_ALGO_GLOBAL_STORABLE_RECO_RESULTS_H
 
+#include "CaTrack.h"
+#include "CaVector.h"
 #include "CbmDigiEvent.h"
 #include "PartitionedVector.h"
-#include "bmon/Hit.h"
-#include "ca/core/data/CaTrack.h"
-#include "ca/core/utils/CaVector.h"
-#include "sts/Cluster.h"
-#include "sts/Hit.h"
-#include "tof/Hit.h"
-#include "trd/Hit.h"
+#include "algo/data/sts/Cluster.h"
+#include "algo/data/sts/Hit.h"
+#include "algo/detectors/bmon/Hit.h"
+#include "algo/detectors/tof/Hit.h"
+#include "algo/detectors/trd/Hit.h"
 
 #include <boost/serialization/access.hpp>
 #include <boost/serialization/utility.hpp>
diff --git a/algo/kfp/KfpV0Finder.cxx b/algo/kfp/KfpV0Finder.cxx
index 820078945d..2e27c577dc 100644
--- a/algo/kfp/KfpV0Finder.cxx
+++ b/algo/kfp/KfpV0Finder.cxx
@@ -7,9 +7,9 @@
 /// \brief  A V0 finding algorithm (implementation)
 /// \author Sergei Zharko <s.zharko@gsi.de>
 
-#include "kfp/KfpV0Finder.h"
+#include "algo/kfp/KfpV0Finder.h"
 
-#include "global/RecoResults.h"
+#include "algo/global/RecoResults.h"
 
 #include <algorithm>
 #include <limits>
diff --git a/algo/kfp/KfpV0Finder.h b/algo/kfp/KfpV0Finder.h
index 9605b581b2..39e3c5653a 100644
--- a/algo/kfp/KfpV0Finder.h
+++ b/algo/kfp/KfpV0Finder.h
@@ -11,8 +11,8 @@
 
 #include "CbmEventTriggers.h"
 #include "KFParticleTopoReconstructor.h"
-#include "global/RecoResults.h"
-#include "kfp/KfpV0FinderMonitor.h"
+#include "algo/global/RecoResults.h"
+#include "algo/kfp/KfpV0FinderMonitor.h"
 
 #include <limits>
 #include <memory>
diff --git a/algo/kfp/KfpV0FinderChain.cxx b/algo/kfp/KfpV0FinderChain.cxx
index 96dc60a593..ee298cfb7e 100644
--- a/algo/kfp/KfpV0FinderChain.cxx
+++ b/algo/kfp/KfpV0FinderChain.cxx
@@ -7,11 +7,11 @@
 /// \brief  A chain for V0 finding (implementation)
 /// \author Sergei Zharko <s.zharko@gsi.de>
 
-#include "kfp/KfpV0FinderChain.h"
+#include "algo/kfp/KfpV0FinderChain.h"
 
-#include "global/ParFiles.h"
-#include "kfp/KfpV0FinderConfig.h"
-#include "log/AlgoFairloggerCompat.h"
+#include "AlgoFairloggerCompat.h"
+#include "algo/global/ParFiles.h"
+#include "algo/kfp/KfpV0FinderConfig.h"
 #include "yaml/Yaml.h"
 
 #include <sstream>
diff --git a/algo/kfp/KfpV0FinderChain.h b/algo/kfp/KfpV0FinderChain.h
index 42580e7456..89ecdd0091 100644
--- a/algo/kfp/KfpV0FinderChain.h
+++ b/algo/kfp/KfpV0FinderChain.h
@@ -11,11 +11,11 @@
 
 #include "CbmEventTriggers.h"
 #include "PODVector.h"
-#include "RecoResults.h"
-#include "SubChain.h"
-#include "kfp/KfpV0Finder.h"
-#include "kfp/KfpV0FinderMonitor.h"
-#include "kfp/KfpV0FinderQa.h"
+#include "algo/base/SubChain.h"
+#include "algo/global/RecoResults.h"
+#include "algo/kfp/KfpV0Finder.h"
+#include "algo/kfp/KfpV0FinderMonitor.h"
+#include "algo/kfp/KfpV0FinderQa.h"
 
 namespace cbm::algo
 {
diff --git a/algo/kfp/KfpV0FinderConfig.cxx b/algo/kfp/KfpV0FinderConfig.cxx
index d74e4d8b2c..5f026bc839 100644
--- a/algo/kfp/KfpV0FinderConfig.cxx
+++ b/algo/kfp/KfpV0FinderConfig.cxx
@@ -7,7 +7,7 @@
 /// \brief  Configuration structure for V0 selector in mCBM (implementation)
 /// \author Sergei Zharko <s.zharko@gsi.de>
 
-#include "KfpV0FinderConfig.h"
+#include "algo/kfp/KfpV0FinderConfig.h"
 
 #include <iomanip>
 #include <sstream>
diff --git a/algo/kfp/KfpV0FinderQa.cxx b/algo/kfp/KfpV0FinderQa.cxx
index 703f067f93..90b05bb5a5 100644
--- a/algo/kfp/KfpV0FinderQa.cxx
+++ b/algo/kfp/KfpV0FinderQa.cxx
@@ -7,10 +7,10 @@
 /// \brief  A V0 finding algorithm QA (implementation)
 /// \author Sergei Zharko <s.zharko@gsi.de>
 
-#include "kfp/KfpV0FinderQa.h"
+#include "algo/kfp/KfpV0FinderQa.h"
 
-#include "global/RecoResults.h"
-#include "kfp/KfpV0Finder.h"
+#include "algo/global/RecoResults.h"
+#include "algo/kfp/KfpV0Finder.h"
 
 
 using cbm::algo::kfp::V0FinderQa;
diff --git a/algo/kfp/KfpV0FinderQa.h b/algo/kfp/KfpV0FinderQa.h
index 1f941a744a..66f2ebcc67 100644
--- a/algo/kfp/KfpV0FinderQa.h
+++ b/algo/kfp/KfpV0FinderQa.h
@@ -9,7 +9,8 @@
 
 #pragma once
 
-#include "qa/QaTaskHeader.h"
+#include "algo/qa/QaTaskHeader.h"
+
 
 namespace cbm::algo
 {
diff --git a/algo/online/data/CMakeLists.txt b/algo/online/data/CMakeLists.txt
index 0d99f1d5fa..7f045e7fa3 100644
--- a/algo/online/data/CMakeLists.txt
+++ b/algo/online/data/CMakeLists.txt
@@ -52,6 +52,7 @@ target_include_directories(OnlineData
   PUBLIC ${OFFLINE_DATA_DIR}/fsd
   PUBLIC ${OFFLINE_DATA_DIR}/global
   PUBLIC ${OFFLINE_DATA_DIR}/raw
+  #PUBLIC ${OFFLINE_DATA_DIR}/experimental
 )
 
 target_compile_definitions(OnlineData PUBLIC NO_ROOT)
diff --git a/algo/qa/CanvasConfig.cxx b/algo/qa/CanvasConfig.cxx
index 322b082f75..68a78945da 100644
--- a/algo/qa/CanvasConfig.cxx
+++ b/algo/qa/CanvasConfig.cxx
@@ -7,7 +7,7 @@
 /// \brief  A class representing a canvas in the message for the Histogram server (implementation)
 /// \author S.Zharko <s.zharko@gsi.de>
 
-#include "CanvasConfig.h"
+#include "algo/qa/CanvasConfig.h"
 
 #include "AlgoFairloggerCompat.h"
 
diff --git a/algo/qa/CanvasConfig.h b/algo/qa/CanvasConfig.h
index 20088d8b9b..ec25f9f579 100644
--- a/algo/qa/CanvasConfig.h
+++ b/algo/qa/CanvasConfig.h
@@ -9,7 +9,7 @@
 
 #pragma once
 
-#include "PadConfig.h"
+#include "algo/qa/PadConfig.h"
 
 #include <string>
 #include <string_view>
diff --git a/algo/qa/DigiEventQa.cxx b/algo/qa/DigiEventQa.cxx
index 3fb21feca3..d1137f9e01 100644
--- a/algo/qa/DigiEventQa.cxx
+++ b/algo/qa/DigiEventQa.cxx
@@ -2,9 +2,9 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Volker Friese [committer], P.-A. Loizeau */
 
-#include "DigiEventQa.h"
+#include "algo/qa/DigiEventQa.h"
 
-#include "Histogram.h"
+#include "algo/qa/Histogram.h"
 
 #include <functional>
 #include <iomanip>
diff --git a/algo/qa/DigiEventQa.h b/algo/qa/DigiEventQa.h
index 897cda8ebc..9184e0d2c2 100644
--- a/algo/qa/DigiEventQa.h
+++ b/algo/qa/DigiEventQa.h
@@ -6,9 +6,9 @@
 #define ALGO_QA_DIGIEVENTQA_H 1
 
 #include "CbmDefs.h"
-#include "DigiData.h"
-#include "HistogramContainer.h"
-#include "evbuild/EventBuilderConfig.h"
+#include "algo/base/DigiData.h"
+#include "algo/evbuild/EventBuilderConfig.h"
+#include "algo/qa/HistogramContainer.h"
 
 #include <gsl/span>
 #include <unordered_map>
diff --git a/algo/qa/Histo1D.cxx b/algo/qa/Histo1D.cxx
index 80a9d7027a..ff0e44ea7b 100644
--- a/algo/qa/Histo1D.cxx
+++ b/algo/qa/Histo1D.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Volker Friese [committer] */
 
-#include "Histo1D.h"
+#include "algo/qa/Histo1D.h"
 
 #include <cassert>
 #include <cmath>
diff --git a/algo/qa/Histogram.h b/algo/qa/Histogram.h
index 44040934a4..d467a6ef98 100644
--- a/algo/qa/Histogram.h
+++ b/algo/qa/Histogram.h
@@ -9,7 +9,7 @@
 
 #pragma once
 
-#include "Accumulators.h"
+#include "algo/qa/Accumulators.h"
 
 #include <boost/histogram.hpp>
 //#include <boost/histogram/algorithm/sum.hpp>
diff --git a/algo/qa/HistogramContainer.cxx b/algo/qa/HistogramContainer.cxx
index b70cb5f371..bcd499b317 100644
--- a/algo/qa/HistogramContainer.cxx
+++ b/algo/qa/HistogramContainer.cxx
@@ -7,7 +7,7 @@
 /// \brief  A histogram container for the histogram server (header)
 /// \author Sergei Zharko <s.zharko@gsi.de>
 
-#include "HistogramContainer.h"
+#include "algo/qa/HistogramContainer.h"
 
 #include <algorithm>
 
diff --git a/algo/qa/HistogramContainer.h b/algo/qa/HistogramContainer.h
index 3ccdbf263a..ae004fe93a 100644
--- a/algo/qa/HistogramContainer.h
+++ b/algo/qa/HistogramContainer.h
@@ -9,7 +9,7 @@
 
 #pragma once
 
-#include "Histogram.h"  // for H1D, H2D
+#include "algo/qa/Histogram.h"  // for H1D, H2D
 
 #include <boost/serialization/forward_list.hpp>
 
diff --git a/algo/qa/PadConfig.cxx b/algo/qa/PadConfig.cxx
index bd157e04ea..a924ab1c4d 100644
--- a/algo/qa/PadConfig.cxx
+++ b/algo/qa/PadConfig.cxx
@@ -7,7 +7,7 @@
 /// \brief  A class representing a Pad in the message for the Histogram server (implementation)
 /// \author S.Zharko <s.zharko@gsi.de>
 
-#include "PadConfig.h"
+#include "algo/qa/PadConfig.h"
 
 #include "AlgoFairloggerCompat.h"
 
diff --git a/algo/qa/PadConfig.h b/algo/qa/PadConfig.h
index 104b214426..426dc4f970 100644
--- a/algo/qa/PadConfig.h
+++ b/algo/qa/PadConfig.h
@@ -9,7 +9,7 @@
 
 #pragma once
 
-#include "Histogram.h"
+#include "algo/qa/Histogram.h"
 
 #include <string>
 #include <string_view>
diff --git a/algo/qa/QaData.cxx b/algo/qa/QaData.cxx
index 6c42b3a523..308582d91f 100644
--- a/algo/qa/QaData.cxx
+++ b/algo/qa/QaData.cxx
@@ -7,7 +7,7 @@
 /// \brief  A unified data-structure to handle QA objects for the online reconstruction (implementation)
 /// \author Sergei Zharko <s.zharko@gsi.de>
 
-#include "QaData.h"
+#include "algo/qa/QaData.h"
 
 #include <algorithm>
 
diff --git a/algo/qa/QaData.h b/algo/qa/QaData.h
index d8ed271792..9b4a0764f3 100644
--- a/algo/qa/QaData.h
+++ b/algo/qa/QaData.h
@@ -10,10 +10,10 @@
 #pragma once
 
 #include "AlgoFairloggerCompat.h"
-#include "HistogramSender.h"
-#include "qa/CanvasConfig.h"
-#include "qa/HistogramContainer.h"
-#include "qa/TaskProperties.h"
+#include "algo/base/HistogramSender.h"
+#include "algo/qa/CanvasConfig.h"
+#include "algo/qa/HistogramContainer.h"
+#include "algo/qa/TaskProperties.h"
 
 #include <boost/serialization/forward_list.hpp>
 
diff --git a/algo/qa/QaManager.cxx b/algo/qa/QaManager.cxx
index dc831fa2ec..7c636b53cf 100644
--- a/algo/qa/QaManager.cxx
+++ b/algo/qa/QaManager.cxx
@@ -7,7 +7,7 @@
 /// \brief  QA manager for the online data reconstruction
 /// \author Sergei Zharko <s.zharko@gsi.de>
 
-#include "qa/QaManager.h"
+#include "algo/qa/QaManager.h"
 
 using cbm::algo::HistogramSender;
 using cbm::algo::qa::Data;
diff --git a/algo/qa/QaManager.h b/algo/qa/QaManager.h
index 93d587eb39..2f901345be 100644
--- a/algo/qa/QaManager.h
+++ b/algo/qa/QaManager.h
@@ -9,9 +9,9 @@
 
 #pragma once
 
-#include "HistogramSender.h"
-#include "SubChain.h"
-#include "qa/QaData.h"
+#include "algo/base/HistogramSender.h"
+#include "algo/base/SubChain.h"
+#include "algo/qa/QaData.h"
 
 namespace cbm::algo::qa
 {
diff --git a/algo/qa/QaTaskHeader.h b/algo/qa/QaTaskHeader.h
index e910a6a103..210c730cce 100644
--- a/algo/qa/QaTaskHeader.h
+++ b/algo/qa/QaTaskHeader.h
@@ -9,7 +9,7 @@
 
 #pragma once
 
-#include "qa/QaManager.h"
+#include "algo/qa/QaManager.h"
 
 #include <memory>
 
diff --git a/algo/qa/RecoGeneralQa.cxx b/algo/qa/RecoGeneralQa.cxx
index 87687520d5..dd7145d9d9 100644
--- a/algo/qa/RecoGeneralQa.cxx
+++ b/algo/qa/RecoGeneralQa.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: P.-A. Loizeau [committer] */
 
-#include "RecoGeneralQa.h"
+#include "algo/qa/RecoGeneralQa.h"
 
 #include <cmath>
 
diff --git a/algo/qa/RecoGeneralQa.h b/algo/qa/RecoGeneralQa.h
index 2b859e9c6d..880d17522e 100644
--- a/algo/qa/RecoGeneralQa.h
+++ b/algo/qa/RecoGeneralQa.h
@@ -6,8 +6,8 @@
 #define ALGO_QA_RECOGENERALQA_H 1
 
 #include "CbmDefs.h"
-#include "HistogramSender.h"
-#include "QaData.h"
+#include "algo/base/HistogramSender.h"
+#include "algo/qa/QaData.h"
 
 #include <StorableTimeslice.hpp>
 
diff --git a/algo/qa/TaskProperties.h b/algo/qa/TaskProperties.h
index ec012b907c..ab0901534c 100644
--- a/algo/qa/TaskProperties.h
+++ b/algo/qa/TaskProperties.h
@@ -9,7 +9,7 @@
 
 #pragma once
 
-#include "Histogram.h"  // for H1D, H2D
+#include "algo/qa/Histogram.h"  // for H1D, H2D
 
 #include <forward_list>
 #include <string>
diff --git a/algo/qa/hitfind/BmonHitfindQa.cxx b/algo/qa/hitfind/BmonHitfindQa.cxx
index 0bf088900f..9c99adfc59 100644
--- a/algo/qa/hitfind/BmonHitfindQa.cxx
+++ b/algo/qa/hitfind/BmonHitfindQa.cxx
@@ -7,12 +7,12 @@
 /// \since  09.02.2025
 /// \author Sergei Zharko <s.zharko@gsi.de>
 
-#include "qa/hitfind/BmonHitfindQa.h"
+#include "algo/qa/hitfind/BmonHitfindQa.h"
 
 #include "CbmBmonDigi.h"
 #include "CbmTofAddress.h"
-#include "bmon/Hit.h"
-#include "qa/Histogram.h"
+#include "algo/detectors/bmon/Hit.h"
+#include "algo/qa/Histogram.h"
 
 #include <fmt/format.h>
 
diff --git a/algo/qa/hitfind/BmonHitfindQa.h b/algo/qa/hitfind/BmonHitfindQa.h
index b2a8b3e30e..c2640ff1e6 100644
--- a/algo/qa/hitfind/BmonHitfindQa.h
+++ b/algo/qa/hitfind/BmonHitfindQa.h
@@ -11,8 +11,8 @@
 
 #include "PODVector.h"
 #include "PartitionedVector.h"
-#include "qa/QaTaskHeader.h"
-#include "qa/hitfind/BmonHitfindQaParameters.h"
+#include "algo/qa/QaTaskHeader.h"
+#include "algo/qa/hitfind/BmonHitfindQaParameters.h"
 
 class CbmBmonDigi;
 
diff --git a/algo/qa/hitfind/BmonHitfindQaParameters.cxx b/algo/qa/hitfind/BmonHitfindQaParameters.cxx
index aa7f4aadce..92362da81b 100644
--- a/algo/qa/hitfind/BmonHitfindQaParameters.cxx
+++ b/algo/qa/hitfind/BmonHitfindQaParameters.cxx
@@ -7,7 +7,7 @@
 /// \since  10.02.2025
 /// \author Sergei Zharko <s.zharko@gsi.de>
 
-#include "qa/hitfind/BmonHitfindQaParameters.h"
+#include "algo/qa/hitfind/BmonHitfindQaParameters.h"
 
 #include "AlgoFairloggerCompat.h"
 #include "CbmTofAddress.h"
diff --git a/algo/qa/hitfind/BmonHitfindQaParameters.h b/algo/qa/hitfind/BmonHitfindQaParameters.h
index 25f524ba87..19e2f214a2 100644
--- a/algo/qa/hitfind/BmonHitfindQaParameters.h
+++ b/algo/qa/hitfind/BmonHitfindQaParameters.h
@@ -9,8 +9,8 @@
 
 #pragma once
 
-#include "bmon/CalibrateSetup.h"
-#include "bmon/HitfindSetup.h"
+#include "algo/detectors/bmon/CalibrateSetup.h"
+#include "algo/detectors/bmon/HitfindSetup.h"
 
 #include <vector>
 
diff --git a/algo/qa/hitfind/TofHitfindQa.cxx b/algo/qa/hitfind/TofHitfindQa.cxx
index c037dc6764..7e306310b0 100644
--- a/algo/qa/hitfind/TofHitfindQa.cxx
+++ b/algo/qa/hitfind/TofHitfindQa.cxx
@@ -7,11 +7,11 @@
 /// \since  04.03.2025
 /// \author Sergei Zharko <s.zharko@gsi.de>
 
-#include "qa/hitfind/TofHitfindQa.h"
+#include "algo/qa/hitfind/TofHitfindQa.h"
 
 #include "CbmTofAddress.h"
-#include "qa/Histogram.h"
-#include "tof/Hit.h"
+#include "algo/detectors/tof/Hit.h"
+#include "algo/qa/Histogram.h"
 
 #include <fmt/format.h>
 
diff --git a/algo/qa/hitfind/TofHitfindQa.h b/algo/qa/hitfind/TofHitfindQa.h
index 3c630b0b2a..1b89a36282 100644
--- a/algo/qa/hitfind/TofHitfindQa.h
+++ b/algo/qa/hitfind/TofHitfindQa.h
@@ -12,8 +12,8 @@
 
 #include "PODVector.h"
 #include "PartitionedVector.h"
-#include "qa/QaTaskHeader.h"
-#include "qa/hitfind/TofHitfindQaParameters.h"
+#include "algo/qa/QaTaskHeader.h"
+#include "algo/qa/hitfind/TofHitfindQaParameters.h"
 
 namespace cbm::algo
 {
diff --git a/algo/qa/hitfind/TofHitfindQaParameters.cxx b/algo/qa/hitfind/TofHitfindQaParameters.cxx
index 3cb2f35b8c..e6aa2732e5 100644
--- a/algo/qa/hitfind/TofHitfindQaParameters.cxx
+++ b/algo/qa/hitfind/TofHitfindQaParameters.cxx
@@ -7,7 +7,7 @@
 /// \since  10.02.2025
 /// \author Sergei Zharko <s.zharko@gsi.de>
 
-#include "qa/hitfind/TofHitfindQaParameters.h"
+#include "algo/qa/hitfind/TofHitfindQaParameters.h"
 
 #include "AlgoFairloggerCompat.h"
 #include "CbmTofAddress.h"
diff --git a/algo/qa/hitfind/TofHitfindQaParameters.h b/algo/qa/hitfind/TofHitfindQaParameters.h
index f64fe1e9f3..cde3c43c8d 100644
--- a/algo/qa/hitfind/TofHitfindQaParameters.h
+++ b/algo/qa/hitfind/TofHitfindQaParameters.h
@@ -9,7 +9,7 @@
 
 #pragma once
 
-#include "tof/HitfindSetup.h"
+#include "algo/detectors/tof/HitfindSetup.h"
 
 #include <unordered_map>
 #include <vector>
diff --git a/algo/qa/trigger/V0TriggerQa.cxx b/algo/qa/trigger/V0TriggerQa.cxx
index 8422852b61..fd72fd2efd 100644
--- a/algo/qa/trigger/V0TriggerQa.cxx
+++ b/algo/qa/trigger/V0TriggerQa.cxx
@@ -7,9 +7,9 @@
 /// \since  06.03.2025
 /// \author Sergei Zharko <s.zharko@gsi.de>
 
-#include "qa/trigger/V0TriggerQa.h"
+#include "algo/qa/trigger/V0TriggerQa.h"
 
-#include "qa/Histogram.h"
+#include "algo/qa/Histogram.h"
 
 using cbm::algo::evbuild::V0TriggerQa;
 
diff --git a/algo/qa/trigger/V0TriggerQa.h b/algo/qa/trigger/V0TriggerQa.h
index b0f37c3980..bed8b0409c 100644
--- a/algo/qa/trigger/V0TriggerQa.h
+++ b/algo/qa/trigger/V0TriggerQa.h
@@ -9,7 +9,7 @@
 
 #pragma once
 
-#include "qa/QaTaskHeader.h"
+#include "algo/qa/QaTaskHeader.h"
 
 namespace cbm::algo::qa
 {
diff --git a/algo/qa/unpack/QaBase.h b/algo/qa/unpack/QaBase.h
index 4e47eeb277..93e73dad90 100644
--- a/algo/qa/unpack/QaBase.h
+++ b/algo/qa/unpack/QaBase.h
@@ -9,9 +9,9 @@
 
 #pragma once
 
-#include "Definitions.h"
 #include "PODVector.h"
-#include "QaData.h"
+#include "algo/base/Definitions.h"
+#include "algo/qa/QaData.h"
 
 #include <string>
 
diff --git a/algo/qa/unpack/StsDigiQa.cxx b/algo/qa/unpack/StsDigiQa.cxx
index 7c502536c4..6a3001deae 100644
--- a/algo/qa/unpack/StsDigiQa.cxx
+++ b/algo/qa/unpack/StsDigiQa.cxx
@@ -7,7 +7,7 @@
 /// \brief  QA module for STS raw digis (source)
 /// \author Sergei Zharko <s.zharko@gsi.de>
 
-#include "StsDigiQa.h"
+#include "algo/qa/unpack/StsDigiQa.h"
 
 #include "CbmStsAddress.h"
 
diff --git a/algo/qa/unpack/StsDigiQa.h b/algo/qa/unpack/StsDigiQa.h
index 1e70c3d026..b3296d53d6 100644
--- a/algo/qa/unpack/StsDigiQa.h
+++ b/algo/qa/unpack/StsDigiQa.h
@@ -10,9 +10,9 @@
 #pragma once
 
 #include "CbmStsDigi.h"
-#include "Definitions.h"
-#include "QaBase.h"
-#include "sts/Unpack.h"
+#include "algo/base/Definitions.h"
+#include "algo/detectors/sts/Unpack.h"
+#include "algo/qa/unpack/QaBase.h"
 
 #include <unordered_map>
 #include <vector>
diff --git a/algo/test/_GTestChannelMapping.cxx b/algo/test/_GTestChannelMapping.cxx
index 754d3b911b..6041fc663c 100644
--- a/algo/test/_GTestChannelMapping.cxx
+++ b/algo/test/_GTestChannelMapping.cxx
@@ -2,8 +2,8 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: David Gutierrez [committer], Dario Ramirez */
 
-#include "Definitions.h"
-#include "detectors/sts/StsRecoUtils.h"
+#include "algo/base/Definitions.h"
+#include "algo/detectors/sts/StsRecoUtils.h"
 
 #include <array>
 #include <optional>
diff --git a/algo/test/_GTestDigiEventSelector.cxx b/algo/test/_GTestDigiEventSelector.cxx
index c199ab5e18..2d188103ed 100644
--- a/algo/test/_GTestDigiEventSelector.cxx
+++ b/algo/test/_GTestDigiEventSelector.cxx
@@ -2,9 +2,9 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Dominik Smith [committer] */
 
-#include "DigiEventSelector.h"
-#include "DigiEventSelectorConfig.h"
 #include "MicrosliceDescriptor.hpp"
+#include "algo/evselector/DigiEventSelector.h"
+#include "algo/evselector/DigiEventSelectorConfig.h"
 #include "gtest/gtest-spi.h"
 #include "gtest/gtest.h"
 
diff --git a/algo/test/_GTestEventBuilder.cxx b/algo/test/_GTestEventBuilder.cxx
index 1f6a36d9b9..0eec26b523 100644
--- a/algo/test/_GTestEventBuilder.cxx
+++ b/algo/test/_GTestEventBuilder.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Dominik Smith [committer] */
 
-#include "EventBuilder.h"
+#include "algo/evbuild/EventBuilder.h"
 #include "gtest/gtest-spi.h"
 #include "gtest/gtest.h"
 
diff --git a/algo/test/_GTestPartitionedSpan.cxx b/algo/test/_GTestPartitionedSpan.cxx
index 08bd000939..d7836d9ede 100644
--- a/algo/test/_GTestPartitionedSpan.cxx
+++ b/algo/test/_GTestPartitionedSpan.cxx
@@ -2,9 +2,9 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer] */
 
-#include "Definitions.h"
 #include "PartitionedSpan.h"
 #include "PartitionedVector.h"
+#include "algo/base/Definitions.h"
 
 #include <gtest/gtest.h>
 
diff --git a/algo/test/_GTestPartitionedVector.cxx b/algo/test/_GTestPartitionedVector.cxx
index 5eda3d2f97..c26cebc732 100644
--- a/algo/test/_GTestPartitionedVector.cxx
+++ b/algo/test/_GTestPartitionedVector.cxx
@@ -2,9 +2,9 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer] */
 
-#include "Definitions.h"
 #include "PODVector.h"
 #include "PartitionedVector.h"
+#include "algo/base/Definitions.h"
 #include "gtest/gtest.h"
 
 using namespace cbm::algo;
diff --git a/algo/test/_GTestTimeClusterTrigger.cxx b/algo/test/_GTestTimeClusterTrigger.cxx
index 168c614662..4a9e11d858 100644
--- a/algo/test/_GTestTimeClusterTrigger.cxx
+++ b/algo/test/_GTestTimeClusterTrigger.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Dominik Smith [committer] */
 
-#include "TimeClusterTrigger.h"
+#include "algo/trigger/TimeClusterTrigger.h"
 #include "gtest/gtest-spi.h"
 #include "gtest/gtest.h"
 
diff --git a/algo/test/_GTestTrdClusterizer.cxx b/algo/test/_GTestTrdClusterizer.cxx
index 8f51c39204..86fa3527af 100644
--- a/algo/test/_GTestTrdClusterizer.cxx
+++ b/algo/test/_GTestTrdClusterizer.cxx
@@ -3,12 +3,13 @@
    Authors: Axel Puntke [committer] */
 
 #include "CbmTrdDigi.h"
+#include "algo/detectors/trd/Clusterizer.h"
+#include "algo/detectors/trd/HitFinderPars.h"
 #include "gtest/gtest-spi.h"
 #include "gtest/gtest.h"
-#include "trd/Clusterizer.h"
-#include "trd/HitFinderPars.h"
 
 //Charge values to be used for self- and neighbor-triggers
+// FIXME: SZh 16.04.2025: replace global variables with static constexpr constants
 double CHARGE_ST = 1000;
 double CHARGE_NT = 500;
 
diff --git a/algo/trigger/DigiTriggerConfig.cxx b/algo/trigger/DigiTriggerConfig.cxx
index cc844930af..aa42255adf 100644
--- a/algo/trigger/DigiTriggerConfig.cxx
+++ b/algo/trigger/DigiTriggerConfig.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Volker Friese [committer] */
 
-#include "DigiTriggerConfig.h"
+#include "algo/trigger/DigiTriggerConfig.h"
 
 
 namespace cbm::algo::evbuild
diff --git a/algo/trigger/HitMultTrigger.cxx b/algo/trigger/HitMultTrigger.cxx
index 2ffc10d697..80b16abaa3 100644
--- a/algo/trigger/HitMultTrigger.cxx
+++ b/algo/trigger/HitMultTrigger.cxx
@@ -2,8 +2,9 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Volker Friese [committer], Dominik Smith */
 
-#include "HitMultTrigger.h"
+#include "algo/trigger/HitMultTrigger.h"
 
+#include "AlgoFairloggerCompat.h"
 #include "CbmStsHit.h"
 #include "CbmTofHit.h"
 #include "CbmTrdHit.h"
diff --git a/algo/trigger/HitMultTrigger.h b/algo/trigger/HitMultTrigger.h
index 946429c101..2ea54a775e 100644
--- a/algo/trigger/HitMultTrigger.h
+++ b/algo/trigger/HitMultTrigger.h
@@ -4,9 +4,9 @@
 
 #pragma once  // include this header only once per compilation unit
 
-#include "DigiTriggerConfig.h"
-#include "RecoResults.h"
-#include "TimeClusterTrigger.h"
+#include "algo/global/RecoResults.h"
+#include "algo/trigger/DigiTriggerConfig.h"
+#include "algo/trigger/TimeClusterTrigger.h"
 
 #include <utility>
 #include <vector>
diff --git a/algo/trigger/TimeClusterTrigger.cxx b/algo/trigger/TimeClusterTrigger.cxx
index 06b84f364f..4df4624c13 100644
--- a/algo/trigger/TimeClusterTrigger.cxx
+++ b/algo/trigger/TimeClusterTrigger.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Volker Friese [committer], Dominik Smith */
 
-#include "TimeClusterTrigger.h"
+#include "algo/trigger/TimeClusterTrigger.h"
 
 #include <algorithm>
 #include <cassert>
diff --git a/algo/trigger/TimeClusterTrigger.h b/algo/trigger/TimeClusterTrigger.h
index 9e2e0a7df4..842345da74 100644
--- a/algo/trigger/TimeClusterTrigger.h
+++ b/algo/trigger/TimeClusterTrigger.h
@@ -5,8 +5,8 @@
 #ifndef CBM_ALGO_TIMECLUSTERTRIGGER_H
 #define CBM_ALGO_TIMECLUSTERTRIGGER_H 1
 
-#include "Definitions.h"
-#include "DigiTriggerConfig.h"
+#include "algo/base/Definitions.h"
+#include "algo/trigger/DigiTriggerConfig.h"
 
 #include <cstddef>
 #include <cstdint>
diff --git a/algo/trigger/V0Trigger.cxx b/algo/trigger/V0Trigger.cxx
index 4ba866c814..e3c0a08faa 100644
--- a/algo/trigger/V0Trigger.cxx
+++ b/algo/trigger/V0Trigger.cxx
@@ -2,7 +2,9 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Volker Friese [committer], Dominik Smith */
 
-#include "V0Trigger.h"
+#include "algo/trigger/V0Trigger.h"
+
+#include "AlgoFairloggerCompat.h"
 
 #include <iterator>
 #include <sstream>
diff --git a/algo/trigger/V0Trigger.h b/algo/trigger/V0Trigger.h
index 3736b64f23..029fd32ab8 100644
--- a/algo/trigger/V0Trigger.h
+++ b/algo/trigger/V0Trigger.h
@@ -6,8 +6,8 @@
 
 #include "CaTrack.h"
 #include "CaVector.h"
-#include "V0TriggerConfig.h"
-#include "qa/trigger/V0TriggerQa.h"
+#include "algo/qa/trigger/V0TriggerQa.h"
+#include "algo/trigger/V0TriggerConfig.h"
 
 #include <utility>
 #include <vector>
diff --git a/algo/trigger/V0TriggerConfig.cxx b/algo/trigger/V0TriggerConfig.cxx
index 6170756d27..d2548d4c1a 100644
--- a/algo/trigger/V0TriggerConfig.cxx
+++ b/algo/trigger/V0TriggerConfig.cxx
@@ -2,7 +2,7 @@
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Volker Friese [committer] */
 
-#include "V0TriggerConfig.h"
+#include "algo/trigger/V0TriggerConfig.h"
 
 
 namespace cbm::algo::evbuild
diff --git a/algo/unpack/CommonUnpacker.cxx b/algo/unpack/CommonUnpacker.cxx
index ba737260e9..1ccc84a662 100644
--- a/algo/unpack/CommonUnpacker.cxx
+++ b/algo/unpack/CommonUnpacker.cxx
@@ -1,7 +1,7 @@
 /* Copyright (C) 2024 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer], Dominik Smith */
-#include "CommonUnpacker.h"
+#include "algo/unpack/CommonUnpacker.h"
 
 #include <iomanip>
 
diff --git a/algo/unpack/CommonUnpacker.h b/algo/unpack/CommonUnpacker.h
index 3d644c1c9b..f75be9a9fb 100644
--- a/algo/unpack/CommonUnpacker.h
+++ b/algo/unpack/CommonUnpacker.h
@@ -4,13 +4,13 @@
 #pragma once
 
 #include "AlgoFairloggerCompat.h"
-#include "Definitions.h"
 #include "PODVector.h"
 #include "Timeslice.hpp"
-#include "UnpackMSBase.h"
-#include "compat/Algorithm.h"
-#include "compat/OpenMP.h"
-#include "util/StlUtils.h"
+#include "algo/base/Definitions.h"
+#include "algo/base/compat/Algorithm.h"
+#include "algo/base/compat/OpenMP.h"
+#include "algo/base/util/StlUtils.h"
+#include "algo/unpack/UnpackMSBase.h"
 
 #include <cstdint>
 #include <gsl/span>
diff --git a/core/containers/CMakeLists.txt b/core/containers/CMakeLists.txt
index 6de870b63a..71dc351cf3 100644
--- a/core/containers/CMakeLists.txt
+++ b/core/containers/CMakeLists.txt
@@ -1,8 +1,6 @@
 # Library: CbmContainers
 # 
 
-message("!!!! BUILDING CbmContainers")
-
 set(INCLUDE_DIRECTORIES
   ${CMAKE_CURRENT_SOURCE_DIR}
 )
diff --git a/core/qa/CbmQaOnlineInterface.h b/core/qa/CbmQaOnlineInterface.h
index 3b6bed4b08..ac9fc9b8a4 100644
--- a/core/qa/CbmQaOnlineInterface.h
+++ b/core/qa/CbmQaOnlineInterface.h
@@ -11,12 +11,12 @@
 
 #pragma once
 
-#include "Histogram.h"
 #include "Logger.h"
 #include "TH1D.h"
 #include "TH2D.h"
 #include "TProfile.h"
 #include "TProfile2D.h"
+#include "algo/qa/Histogram.h"
 
 //#include <log.hpp>
 #include <type_traits>
diff --git a/core/utility/yaml/BaseTypes.h b/core/utility/yaml/BaseTypes.h
index 1743aace81..f7194da3cb 100644
--- a/core/utility/yaml/BaseTypes.h
+++ b/core/utility/yaml/BaseTypes.h
@@ -5,7 +5,7 @@
 #define CBM_YAML_BASETYPES_H
 #pragma once
 
-#include "Definitions.h"
+#include "algo/base/Definitions.h"
 
 #include <array>
 #include <map>
diff --git a/core/utility/yaml/CMakeLists.txt b/core/utility/yaml/CMakeLists.txt
index 992fcfc5cc..ef611b0c17 100644
--- a/core/utility/yaml/CMakeLists.txt
+++ b/core/utility/yaml/CMakeLists.txt
@@ -16,6 +16,8 @@ target_link_libraries(CbmYamlInterface
             external::yaml-cpp
 )
 
+install(TARGETS CbmYamlInterface DESTINATION lib)
+
 install(
   FILES
     BaseTypes.h
diff --git a/reco/KF/CbmKFV0FinderTask.cxx b/reco/KF/CbmKFV0FinderTask.cxx
index aaf6b26efe..36316e4ff8 100644
--- a/reco/KF/CbmKFV0FinderTask.cxx
+++ b/reco/KF/CbmKFV0FinderTask.cxx
@@ -23,10 +23,10 @@
 #include "FairRunAna.h"
 #include "KFPTrackVector.h"
 #include "KFVertex.h"
-#include "KfpV0FinderConfig.h"
 #include "Logger.h"
 #include "TClonesArray.h"
 #include "TMatrixTSym.h"
+#include "algo/kfp/KfpV0FinderConfig.h"
 #include "yaml/Yaml.h"
 
 #include <boost/filesystem.hpp>
diff --git a/reco/app/cbmreco/main.cxx b/reco/app/cbmreco/main.cxx
index c78dbfe889..f710e83820 100644
--- a/reco/app/cbmreco/main.cxx
+++ b/reco/app/cbmreco/main.cxx
@@ -1,18 +1,18 @@
 /* Copyright (C) 2023 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer] */
-#include "BuildInfo.h"
 #include "CbmDigiEvent.h"
-#include "Exceptions.h"
-#include "Options.h"
-#include "Reco.h"
-#include "RecoResultsInputArchive.h"
-#include "RecoResultsOutputArchive.h"
-#include "System.h"
-#include "compat/Algorithm.h"
-#include "compat/OpenMP.h"
-#include "gpu/DeviceImage.h"
-#include "util/MemoryLogger.h"
+#include "algo/base/BuildInfo.h"
+#include "algo/base/Exceptions.h"
+#include "algo/base/Options.h"
+#include "algo/base/System.h"
+#include "algo/base/compat/Algorithm.h"
+#include "algo/base/compat/OpenMP.h"
+#include "algo/base/gpu/DeviceImage.h"
+#include "algo/base/util/MemoryLogger.h"
+#include "algo/global/Reco.h"
+#include "algo/global/RecoResultsInputArchive.h"
+#include "algo/global/RecoResultsOutputArchive.h"
 
 #include <StorableTimeslice.hpp>
 #include <TimesliceAutoSource.hpp>
diff --git a/reco/app/cbmreco_fairrun/Application.cxx b/reco/app/cbmreco_fairrun/Application.cxx
index 92f063b3bd..73e5c7701f 100644
--- a/reco/app/cbmreco_fairrun/Application.cxx
+++ b/reco/app/cbmreco_fairrun/Application.cxx
@@ -4,7 +4,7 @@
 
 #include "Application.h"
 
-#include "MainConfig.h"
+#include "algo/base/MainConfig.h"
 
 #include <chrono>
 #include <fstream>
diff --git a/reco/detectors/sts/CbmRecoSts.cxx b/reco/detectors/sts/CbmRecoSts.cxx
index 475c230a4e..36ff4809ac 100644
--- a/reco/detectors/sts/CbmRecoSts.cxx
+++ b/reco/detectors/sts/CbmRecoSts.cxx
@@ -21,7 +21,7 @@
 #include "CbmStsPhysics.h"
 #include "CbmStsRecoModule.h"
 #include "CbmStsSetup.h"
-#include "sts/HitfinderPars.h"
+#include "algo/data/sts/HitfinderPars.h"
 
 #include <FairField.h>
 #include <FairRootManager.h>
diff --git a/reco/detectors/sts/CbmRecoSts.h b/reco/detectors/sts/CbmRecoSts.h
index 82205d875e..9c13e994a5 100644
--- a/reco/detectors/sts/CbmRecoSts.h
+++ b/reco/detectors/sts/CbmRecoSts.h
@@ -11,7 +11,7 @@
 #ifndef CBMRECOSTS_H
 #define CBMRECOSTS_H 1
 
-#include "sts/HitfinderChain.h"
+#include "algo/detectors/sts/HitfinderChain.h"
 
 #include <FairTask.h>
 
diff --git a/reco/steer/CbmOnlineParWrite.h b/reco/steer/CbmOnlineParWrite.h
index 35ab63d074..73e851cf0f 100644
--- a/reco/steer/CbmOnlineParWrite.h
+++ b/reco/steer/CbmOnlineParWrite.h
@@ -9,7 +9,7 @@
  * @brief This file contains the declaration of the CbmOnlineParWrite class.
 **/
 
-#include "Definitions.h"
+#include "algo/base/Definitions.h"
 
 #include <TString.h>
 
diff --git a/reco/steer/CbmSourceDigiEvents.h b/reco/steer/CbmSourceDigiEvents.h
index c11954d2d3..a3c7f269b2 100644
--- a/reco/steer/CbmSourceDigiEvents.h
+++ b/reco/steer/CbmSourceDigiEvents.h
@@ -5,8 +5,8 @@
 #pragma once  // include this header only once per compilation unit
 
 #include "CbmDigiEvent.h"
-#include "DigiData.h"
-#include "RecoResultsInputArchive.h"
+#include "algo/base/DigiData.h"
+#include "algo/global/RecoResultsInputArchive.h"
 
 #include <FairSource.h>
 
diff --git a/reco/steer/CbmSourceDigiTimeslice.h b/reco/steer/CbmSourceDigiTimeslice.h
index 023cf816b2..38c9b1c627 100644
--- a/reco/steer/CbmSourceDigiTimeslice.h
+++ b/reco/steer/CbmSourceDigiTimeslice.h
@@ -4,8 +4,8 @@
 
 #pragma once  // include this header only once per compilation unit
 
-#include "DigiData.h"
-#include "RecoResultsInputArchive.h"
+#include "algo/base/DigiData.h"
+#include "algo/global/RecoResultsInputArchive.h"
 
 #include <FairSource.h>
 
diff --git a/reco/steer/CbmSourceRecoTimeslice.h b/reco/steer/CbmSourceRecoTimeslice.h
index 1b2763ab2a..bc934a9087 100644
--- a/reco/steer/CbmSourceRecoTimeslice.h
+++ b/reco/steer/CbmSourceRecoTimeslice.h
@@ -9,7 +9,7 @@
 
 #pragma once
 
-#include "RecoResultsInputArchive.h"
+#include "algo/global/RecoResultsInputArchive.h"
 
 #include <FairSource.h>
 
diff --git a/reco/tasks/CMakeLists.txt b/reco/tasks/CMakeLists.txt
index eff7ad3304..1dc8472452 100644
--- a/reco/tasks/CMakeLists.txt
+++ b/reco/tasks/CMakeLists.txt
@@ -3,9 +3,8 @@
 
 set(INCLUDE_DIRECTORIES
   ${CMAKE_CURRENT_SOURCE_DIR}
-  ${CMAKE_SOURCE_DIR}/algo       # For "algo/qa/*.h"        included as relative "qa/?????.h"   to fit install tree
-  ${CMAKE_SOURCE_DIR}/algo/base  # For "algo/base/yaml/*.h" included as relative "yaml/?????.h" to fit install tree
-  )
+  ${CMAKE_SOURCE_DIR}  # For "algo/qa/*.h"        included as relative "qa/?????.h"   to fit install tree
+)
 
 set(SRCS
   CbmReco.cxx
diff --git a/reco/tasks/CbmReco.cxx b/reco/tasks/CbmReco.cxx
index 84e865f39c..09a23d4960 100644
--- a/reco/tasks/CbmReco.cxx
+++ b/reco/tasks/CbmReco.cxx
@@ -10,8 +10,8 @@
 #include "CbmTaskTriggerDigi.h"
 #include "CbmTaskUnpack.h"
 #include "CbmTsEventHeader.h"
-#include "DigiEventSelector.h"
-#include "DigiEventSelectorConfig.h"
+#include "algo/evselector/DigiEventSelector.h"
+#include "algo/evselector/DigiEventSelectorConfig.h"
 
 #include <FairFileSource.h>
 #include <FairRootFileSink.h>
diff --git a/reco/tasks/CbmReco.h b/reco/tasks/CbmReco.h
index eb51054598..4379b0035b 100644
--- a/reco/tasks/CbmReco.h
+++ b/reco/tasks/CbmReco.h
@@ -19,7 +19,7 @@ namespace cbm
 }
 #endif
 
-#include "evbuild/Config.h"
+#include "algo/evbuild/Config.h"
 
 #include <TString.h>
 
diff --git a/reco/tasks/CbmTaskBuildEvents.h b/reco/tasks/CbmTaskBuildEvents.h
index 843a599823..bf0a8723f0 100644
--- a/reco/tasks/CbmTaskBuildEvents.h
+++ b/reco/tasks/CbmTaskBuildEvents.h
@@ -8,9 +8,9 @@
 #include "CbmDefs.h"
 #include "CbmDigiEvent.h"
 #include "CbmDigiTimeslice.h"
-#include "DigiEventSelector.h"
-#include "DigiEventSelectorConfig.h"
-#include "evbuild/EventBuilder.h"
+#include "algo/evbuild/EventBuilder.h"
+#include "algo/evselector/DigiEventSelector.h"
+#include "algo/evselector/DigiEventSelectorConfig.h"
 
 #include <FairTask.h>
 
diff --git a/reco/tasks/CbmTaskDigiEventQa.cxx b/reco/tasks/CbmTaskDigiEventQa.cxx
index b07b9b49fc..5feedea5c6 100644
--- a/reco/tasks/CbmTaskDigiEventQa.cxx
+++ b/reco/tasks/CbmTaskDigiEventQa.cxx
@@ -5,7 +5,6 @@
 #include "CbmTaskDigiEventQa.h"
 
 #include "CbmReco.h"  // for CbmRecoConfig
-#include "qa/Histo1D.h"
 
 #include <FairRunOnline.h>
 #include <Logger.h>
diff --git a/reco/tasks/CbmTaskDigiEventQa.h b/reco/tasks/CbmTaskDigiEventQa.h
index bf21dd5ca5..4be534e8a7 100644
--- a/reco/tasks/CbmTaskDigiEventQa.h
+++ b/reco/tasks/CbmTaskDigiEventQa.h
@@ -7,9 +7,8 @@
 
 #include "CbmDefs.h"
 #include "CbmDigiEvent.h"
-#include "evbuild/Config.h"
-#include "qa/DigiEventQa.h"
-#include "qa/Histo1D.h"
+#include "algo/evbuild/Config.h"
+#include "algo/qa/DigiEventQa.h"
 
 #include <FairTask.h>
 
diff --git a/reco/tasks/CbmTaskInspectRecoTimeslice.h b/reco/tasks/CbmTaskInspectRecoTimeslice.h
index d1722a851b..3026f5289e 100644
--- a/reco/tasks/CbmTaskInspectRecoTimeslice.h
+++ b/reco/tasks/CbmTaskInspectRecoTimeslice.h
@@ -9,8 +9,8 @@
 
 #pragma once
 
-#include "RecoResults.h"
-#include "StorableRecoResults.h"
+#include "algo/global/RecoResults.h"
+#include "algo/global/StorableRecoResults.h"
 
 #include <FairTask.h>
 
diff --git a/reco/tasks/CbmTaskStsHitFinderParWrite.cxx b/reco/tasks/CbmTaskStsHitFinderParWrite.cxx
index cb27cbcfc7..0e836ac8da 100644
--- a/reco/tasks/CbmTaskStsHitFinderParWrite.cxx
+++ b/reco/tasks/CbmTaskStsHitFinderParWrite.cxx
@@ -13,7 +13,7 @@
 #include "CbmStsPhysics.h"
 #include "CbmStsRecoModule.h"
 #include "CbmStsSetup.h"
-#include "sts/HitfinderPars.h"
+#include "algo/data/sts/HitfinderPars.h"
 #include "yaml/Yaml.h"
 
 #include <FairField.h>
diff --git a/reco/tasks/CbmTaskTofClusterizer.cxx b/reco/tasks/CbmTaskTofClusterizer.cxx
index cbf6ca5aef..3051031be0 100644
--- a/reco/tasks/CbmTaskTofClusterizer.cxx
+++ b/reco/tasks/CbmTaskTofClusterizer.cxx
@@ -25,7 +25,7 @@
 #include "TStopwatch.h"
 
 // C++ Classes and includes
-#include "compat/Filesystem.h"
+#include "algo/base/compat/Filesystem.h"
 #include "yaml/Yaml.h"
 
 #include <iomanip>
diff --git a/reco/tasks/CbmTaskTofClusterizer.h b/reco/tasks/CbmTaskTofClusterizer.h
index 9283cc5008..fe43d43fa1 100644
--- a/reco/tasks/CbmTaskTofClusterizer.h
+++ b/reco/tasks/CbmTaskTofClusterizer.h
@@ -13,9 +13,9 @@ class CbmTsEventHeader;
 
 #include "CbmMatch.h"
 #include "CbmTofDigi.h"
-#include "tof/Calibrate.h"
-#include "tof/Clusterizer.h"
-#include "tof/Hitfind.h"
+#include "algo/detectors/tof/Calibrate.h"
+#include "algo/detectors/tof/Clusterizer.h"
+#include "algo/detectors/tof/Hitfind.h"
 
 // ROOT Classes and includes
 #include "Math/Rotation3D.h"
diff --git a/reco/tasks/CbmTaskTofClusterizerParWrite.cxx b/reco/tasks/CbmTaskTofClusterizerParWrite.cxx
index e8e8df4080..5f5fd702ad 100644
--- a/reco/tasks/CbmTaskTofClusterizerParWrite.cxx
+++ b/reco/tasks/CbmTaskTofClusterizerParWrite.cxx
@@ -20,10 +20,10 @@
 #include "FairRootManager.h"
 #include "FairRunAna.h"
 #include "FairRuntimeDb.h"
-#include "bmon/CalibrateSetup.h"
-#include "bmon/HitfindSetup.h"
-#include "tof/CalibrateSetup.h"
-#include "tof/HitfindSetup.h"
+#include "algo/detectors/bmon/CalibrateSetup.h"
+#include "algo/detectors/bmon/HitfindSetup.h"
+#include "algo/detectors/tof/CalibrateSetup.h"
+#include "algo/detectors/tof/HitfindSetup.h"
 #include "yaml/Yaml.h"
 
 #include <Logger.h>
diff --git a/reco/tasks/CbmTaskTofClusterizerParWrite.h b/reco/tasks/CbmTaskTofClusterizerParWrite.h
index 7e2adcfe8c..bb85d4bcb5 100644
--- a/reco/tasks/CbmTaskTofClusterizerParWrite.h
+++ b/reco/tasks/CbmTaskTofClusterizerParWrite.h
@@ -12,7 +12,7 @@ class CbmTofDigiPar;
 class CbmTofDigiBdfPar;
 class CbmTofCell;
 
-#include "tof/Clusterizer.h"
+#include "algo/detectors/tof/Clusterizer.h"
 
 // ROOT Classes and includes
 #include "Math/Rotation3D.h"
diff --git a/reco/tasks/CbmTaskTofHitFinder.h b/reco/tasks/CbmTaskTofHitFinder.h
index a7afdf0567..a74095dfb7 100644
--- a/reco/tasks/CbmTaskTofHitFinder.h
+++ b/reco/tasks/CbmTaskTofHitFinder.h
@@ -23,7 +23,7 @@ class CbmTofCell;
 class CbmDigiManager;
 class CbmEvent;
 
-#include "tof/HitFinder.h"
+#include "algo/detectors/tof/HitFinder.h"
 
 // FAIR classes and includes
 #include "FairTask.h"
diff --git a/reco/tasks/CbmTaskTrdHitFinder.cxx b/reco/tasks/CbmTaskTrdHitFinder.cxx
index b9785e20b1..895aa73f45 100644
--- a/reco/tasks/CbmTaskTrdHitFinder.cxx
+++ b/reco/tasks/CbmTaskTrdHitFinder.cxx
@@ -12,7 +12,7 @@
 #include <Logger.h>
 
 // C++ Classes and includes
-#include "compat/Filesystem.h"
+#include "algo/base/compat/Filesystem.h"
 #include "yaml/Yaml.h"
 
 #include <TStopwatch.h>
diff --git a/reco/tasks/CbmTaskTrdHitFinder.h b/reco/tasks/CbmTaskTrdHitFinder.h
index 204c5189df..64ca181d0d 100644
--- a/reco/tasks/CbmTaskTrdHitFinder.h
+++ b/reco/tasks/CbmTaskTrdHitFinder.h
@@ -9,8 +9,8 @@
 #include "CbmTrdDigi.h"
 #include "CbmTrdHit.h"
 #include "FairTask.h"
-#include "trd/Hit.h"
-#include "trd/Hitfind.h"
+#include "algo/detectors/trd/Hit.h"
+#include "algo/detectors/trd/Hitfind.h"
 
 #include <gsl/span>
 #include <map>
diff --git a/reco/tasks/CbmTaskTrdHitFinderParWrite.cxx b/reco/tasks/CbmTaskTrdHitFinderParWrite.cxx
index 247f73e738..666b59ef77 100644
--- a/reco/tasks/CbmTaskTrdHitFinderParWrite.cxx
+++ b/reco/tasks/CbmTaskTrdHitFinderParWrite.cxx
@@ -14,8 +14,8 @@
 #include "CbmTrdParSetGeo.h"
 #include "TGeoPhysicalNode.h"
 #include "TVector3.h"
-#include "trd/Hitfind2DSetup.h"
-#include "trd/HitfindSetup.h"
+#include "algo/detectors/trd/Hitfind2DSetup.h"
+#include "algo/detectors/trd/HitfindSetup.h"
 #include "yaml/Yaml.h"
 
 #include <FairRootManager.h>
diff --git a/reco/tasks/CbmTaskTrdHitFinderParWrite.h b/reco/tasks/CbmTaskTrdHitFinderParWrite.h
index 6543c22066..388242aa19 100644
--- a/reco/tasks/CbmTaskTrdHitFinderParWrite.h
+++ b/reco/tasks/CbmTaskTrdHitFinderParWrite.h
@@ -6,11 +6,11 @@
 #define CBMTRDHITFINDERPARWRITE_H
 
 #include "FairTask.h"
-#include "trd/Clusterizer.h"
-#include "trd/Clusterizer2D.h"
-#include "trd/Hit.h"
-#include "trd/HitFinder.h"
-#include "trd/HitFinder2D.h"
+#include "algo/detectors/trd/Clusterizer.h"
+#include "algo/detectors/trd/Clusterizer2D.h"
+#include "algo/detectors/trd/Hit.h"
+#include "algo/detectors/trd/HitFinder.h"
+#include "algo/detectors/trd/HitFinder2D.h"
 
 #include <map>
 #include <set>
diff --git a/reco/tasks/CbmTaskTrdUnpackParWrite.cxx b/reco/tasks/CbmTaskTrdUnpackParWrite.cxx
index 6679dc5995..b0332f2a30 100644
--- a/reco/tasks/CbmTaskTrdUnpackParWrite.cxx
+++ b/reco/tasks/CbmTaskTrdUnpackParWrite.cxx
@@ -10,8 +10,8 @@
 #include "CbmTrdParSetAsic.h"
 #include "CbmTrdParSetDigi.h"
 #include "CbmTrdParSpadic.h"
-#include "trd/ReadoutConfig.h"
-#include "trd2d/ReadoutConfig.h"
+#include "algo/detectors/trd/ReadoutConfig.h"
+#include "algo/detectors/trd2d/ReadoutConfig.h"
 #include "yaml/Yaml.h"
 
 #include <FairParamList.h>
diff --git a/reco/tasks/CbmTaskTrdUnpackParWrite.h b/reco/tasks/CbmTaskTrdUnpackParWrite.h
index 09203a69ff..2d61f8245e 100644
--- a/reco/tasks/CbmTaskTrdUnpackParWrite.h
+++ b/reco/tasks/CbmTaskTrdUnpackParWrite.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include "Definitions.h"
+#include "algo/base/Definitions.h"
 
 #include <FairTask.h>
 
diff --git a/reco/tasks/CbmTaskTriggerDigi.cxx b/reco/tasks/CbmTaskTriggerDigi.cxx
index 4bb45239e7..4d54a64028 100644
--- a/reco/tasks/CbmTaskTriggerDigi.cxx
+++ b/reco/tasks/CbmTaskTriggerDigi.cxx
@@ -14,7 +14,7 @@
 #include "CbmStsDigi.h"
 #include "CbmTofDigi.h"
 #include "CbmTrdDigi.h"
-#include "TimeClusterTrigger.h"
+#include "algo/trigger/TimeClusterTrigger.h"
 
 #include <FairRootManager.h>
 #include <Logger.h>
diff --git a/reco/tasks/CbmTaskTriggerDigi.h b/reco/tasks/CbmTaskTriggerDigi.h
index f80d9149d1..d63c58b126 100644
--- a/reco/tasks/CbmTaskTriggerDigi.h
+++ b/reco/tasks/CbmTaskTriggerDigi.h
@@ -7,7 +7,7 @@
 
 #include "CbmDefs.h"
 #include "CbmDigiBranchBase.h"
-#include "TimeClusterTrigger.h"
+#include "algo/trigger/TimeClusterTrigger.h"
 
 #include <FairTask.h>
 
diff --git a/reco/tasks/CbmTaskUnpack.cxx b/reco/tasks/CbmTaskUnpack.cxx
index a41254d09c..dfcaac0901 100644
--- a/reco/tasks/CbmTaskUnpack.cxx
+++ b/reco/tasks/CbmTaskUnpack.cxx
@@ -20,11 +20,11 @@
 #include "CbmTrdParSpadic.h"
 #include "CbmTsEventHeader.h"
 #include "MicrosliceDescriptor.hpp"
-#include "ParFiles.h"
 #include "System.hpp"
-#include "bmon/ReadoutConfig.h"
-#include "sts/ChannelMaskSet.h"
-#include "tof/ReadoutConfig.h"
+#include "algo/detectors/bmon/ReadoutConfig.h"
+#include "algo/detectors/sts/ChannelMaskSet.h"
+#include "algo/detectors/tof/ReadoutConfig.h"
+#include "algo/global/ParFiles.h"
 #include "yaml/Yaml.h"
 
 #include <FairParAsciiFileIo.h>
diff --git a/reco/tasks/CbmTaskUnpack.h b/reco/tasks/CbmTaskUnpack.h
index ba79d2203f..7dae3dbf72 100644
--- a/reco/tasks/CbmTaskUnpack.h
+++ b/reco/tasks/CbmTaskUnpack.h
@@ -19,16 +19,16 @@ namespace cbm
 }
 #endif
 
-#include "AlgoTraits.h"
-#include "ParFiles.h"
-#include "bmon/Unpack.h"
-#include "evbuild/EventBuilder.h"
-#include "much/Unpack.h"
-#include "rich/Unpack.h"
-#include "sts/Unpack.h"
-#include "tof/Unpack.h"
-#include "trd/Unpack.h"
-#include "trd2d/Unpack.h"
+#include "algo/base/AlgoTraits.h"
+#include "algo/detectors/bmon/Unpack.h"
+#include "algo/detectors/much/Unpack.h"
+#include "algo/detectors/rich/Unpack.h"
+#include "algo/detectors/sts/Unpack.h"
+#include "algo/detectors/tof/Unpack.h"
+#include "algo/detectors/trd/Unpack.h"
+#include "algo/detectors/trd2d/Unpack.h"
+#include "algo/evbuild/EventBuilder.h"
+#include "algo/global/ParFiles.h"
 
 #include <FairTask.h>
 
diff --git a/services/archive_explorer/app/Application.cxx b/services/archive_explorer/app/Application.cxx
index 31d86f4479..eab788562c 100644
--- a/services/archive_explorer/app/Application.cxx
+++ b/services/archive_explorer/app/Application.cxx
@@ -3,11 +3,11 @@
    Authors: Felix Weiglhofer [committer] */
 #include "Application.h"
 
-#include <log.hpp>
-
 #include "Histograms.h"
-#include "RecoResultsInputArchive.h"
 #include "Server.h"
+#include "algo/global/RecoResultsInputArchive.h"
+
+#include <log.hpp>
 
 using namespace cbm::explore;
 using namespace cbm::algo;
diff --git a/services/archive_explorer/app/Histograms.cxx b/services/archive_explorer/app/Histograms.cxx
index 01ef8413c2..2cdc61d64b 100644
--- a/services/archive_explorer/app/Histograms.cxx
+++ b/services/archive_explorer/app/Histograms.cxx
@@ -3,13 +3,13 @@
    Authors: Felix Weiglhofer [committer] */
 #include "Histograms.h"
 
+#include "algo/global/StorableRecoResults.h"
+
 #include <TH1.h>
 
 #include <log.hpp>
 #include <unordered_map>
 
-#include "StorableRecoResults.h"
-
 using namespace cbm::explore;
 
 Histograms::Histograms()
diff --git a/services/archive_explorer/app/Options.h b/services/archive_explorer/app/Options.h
index d8a5f0734c..f6c5f22945 100644
--- a/services/archive_explorer/app/Options.h
+++ b/services/archive_explorer/app/Options.h
@@ -3,9 +3,9 @@
    Authors: Felix Weiglhofer [committer] */
 #pragma once
 
-#include <optional>
+#include "algo/base/compat/Filesystem.h"
 
-#include "compat/Filesystem.h"
+#include <optional>
 
 namespace cbm::explore
 {
diff --git a/services/archive_explorer/lib/Server.h b/services/archive_explorer/lib/Server.h
index 03f0cf2f5c..79ffa782d2 100644
--- a/services/archive_explorer/lib/Server.h
+++ b/services/archive_explorer/lib/Server.h
@@ -3,14 +3,14 @@
    Authors: Felix Weiglhofer [committer] */
 #pragma once
 
+#include "HistogramCollection.h"
+#include "algo/global/RecoResultsInputArchive.h"
+
 #include <Rtypes.h>
 #include <TNamed.h>
 
 #include <memory>
 
-#include "HistogramCollection.h"
-#include "RecoResultsInputArchive.h"
-
 class THttpServer;
 class TH1;
 class TH1F;
diff --git a/services/histserv/app/Application.cxx b/services/histserv/app/Application.cxx
index a4978c303e..37ae3774ff 100644
--- a/services/histserv/app/Application.cxx
+++ b/services/histserv/app/Application.cxx
@@ -6,7 +6,6 @@
 
 #include "CbmFlesCanvasTools.h"
 #include "CbmQaOnlineInterface.h"
-#include "HistogramContainer.h"
 #include "TCanvas.h"
 #include "TEnv.h"
 #include "TFile.h"
@@ -19,6 +18,7 @@
 #include "TProfile2D.h"
 #include "TRootSniffer.h"
 #include "TSystem.h"
+#include "algo/qa/HistogramContainer.h"
 
 #include <Logger.h>
 
diff --git a/services/histserv/app/Application.h b/services/histserv/app/Application.h
index 580e0dba47..0c0efc6247 100644
--- a/services/histserv/app/Application.h
+++ b/services/histserv/app/Application.h
@@ -5,10 +5,10 @@
 #ifndef CBM_SERVICES_HISTSERV_APP_APPLICATION_H
 #define CBM_SERVICES_HISTSERV_APP_APPLICATION_H 1
 
-#include "Histogram.h"
 #include "ProgramOptions.h"
 #include "THttpServer.h"
 #include "TObjArray.h"
+#include "algo/qa/Histogram.h"
 #include "ui_callbacks.h"
 
 #include <csignal>
diff --git a/services/histserv/tester/Application.cxx b/services/histserv/tester/Application.cxx
index 99e9c3deea..d665cb4314 100644
--- a/services/histserv/tester/Application.cxx
+++ b/services/histserv/tester/Application.cxx
@@ -4,11 +4,11 @@
 
 #include "Application.h"
 
-#include "CanvasConfig.h"
 #include "CbmFlesCanvasTools.h"
-#include "Histogram.h"
-#include "PadConfig.h"
-#include "QaData.h"
+#include "algo/qa/CanvasConfig.h"
+#include "algo/qa/Histogram.h"
+#include "algo/qa/PadConfig.h"
+#include "algo/qa/QaData.h"
 #include "ui_callbacks.h"
 
 #include <Logger.h>
diff --git a/services/histserv/tester/Application.h b/services/histserv/tester/Application.h
index ba000e0be4..88913136f1 100644
--- a/services/histserv/tester/Application.h
+++ b/services/histserv/tester/Application.h
@@ -5,8 +5,8 @@
 #ifndef CBM_SERVICES_HISTSERV_TESTER_APPLICATION_H
 #define CBM_SERVICES_HISTSERV_TESTER_APPLICATION_H 1
 
-#include "HistogramSender.h"
 #include "ProgramOptions.h"
+#include "algo/base/HistogramSender.h"
 
 #include <memory>
 
diff --git a/services/online_par_dump/ProgramOptions.h b/services/online_par_dump/ProgramOptions.h
index d3aaa55841..308dbb8c4d 100644
--- a/services/online_par_dump/ProgramOptions.h
+++ b/services/online_par_dump/ProgramOptions.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include "Definitions.h"
+#include "algo/base/Definitions.h"
 
 #include <string>
 
-- 
GitLab