From e813c9b198f757263af58b9cd0fff118d1f594d3 Mon Sep 17 00:00:00 2001
From: sesen <sevda.esen@cern.ch>
Date: Mon, 27 Sep 2021 11:08:43 +0200
Subject: [PATCH 1/2] Move Packing related algorithms to Event/EventPacker

---
 Event/EventPacker/CMakeLists.txt                            | 3 +++
 Event/EventPacker/dict/PackedEventDict.h                    | 2 ++
 .../EventPacker/include/Event/PackedData.h                  | 0
 .../EventPacker/include/Event}/PackedDataBuffer.h           | 6 +++---
 .../EventPacker/src/lib}/PackedDataBuffer.cpp               | 2 +-
 Hlt/HltDAQ/CMakeLists.txt                                   | 1 -
 Hlt/HltDAQ/src/component/HltPackedDataDecoder.cpp           | 4 ++--
 Hlt/HltDAQ/src/component/HltPackedDataWriter.cpp            | 4 ++--
 8 files changed, 13 insertions(+), 9 deletions(-)
 rename Hlt/HltDAQ/src/component/HltPackedData.h => Event/EventPacker/include/Event/PackedData.h (100%)
 rename {Hlt/HltDAQ/src/component => Event/EventPacker/include/Event}/PackedDataBuffer.h (98%)
 rename {Hlt/HltDAQ/src/component => Event/EventPacker/src/lib}/PackedDataBuffer.cpp (98%)

diff --git a/Event/EventPacker/CMakeLists.txt b/Event/EventPacker/CMakeLists.txt
index 7be50dc2741..ab0c83936a0 100644
--- a/Event/EventPacker/CMakeLists.txt
+++ b/Event/EventPacker/CMakeLists.txt
@@ -39,6 +39,7 @@ gaudi_add_library(EventPackerLib
         src/lib/PackedVertex.cpp
         src/lib/PackedWeightsVector.cpp
         src/lib/StandardPacker.cpp
+        src/lib/PackedDataBuffer.cpp
     LINK
         PUBLIC
             Boost::headers
@@ -50,6 +51,8 @@ gaudi_add_library(EventPackerLib
             LHCb::RecEvent
             LHCb::RelationsLib
             LHCb::TrackEvent
+            LHCb::DAQEventLib
+            LHCb::HltEvent
 )
 
 gaudi_add_module(EventPacker
diff --git a/Event/EventPacker/dict/PackedEventDict.h b/Event/EventPacker/dict/PackedEventDict.h
index c0aa6ac5755..13f125926f1 100755
--- a/Event/EventPacker/dict/PackedEventDict.h
+++ b/Event/EventPacker/dict/PackedEventDict.h
@@ -41,6 +41,8 @@
 #include "Event/PackedTwoProngVertex.h"
 #include "Event/PackedVertex.h"
 #include "Event/PackedWeightsVector.h"
+#include "Event/PackedData.h"
+#include "Event/PackedDataBuffer.h"
 
 namespace {
   struct EventPacker_Instantiations {
diff --git a/Hlt/HltDAQ/src/component/HltPackedData.h b/Event/EventPacker/include/Event/PackedData.h
similarity index 100%
rename from Hlt/HltDAQ/src/component/HltPackedData.h
rename to Event/EventPacker/include/Event/PackedData.h
diff --git a/Hlt/HltDAQ/src/component/PackedDataBuffer.h b/Event/EventPacker/include/Event/PackedDataBuffer.h
similarity index 98%
rename from Hlt/HltDAQ/src/component/PackedDataBuffer.h
rename to Event/EventPacker/include/Event/PackedDataBuffer.h
index 736839b5152..2ec0a8d3819 100644
--- a/Hlt/HltDAQ/src/component/PackedDataBuffer.h
+++ b/Event/EventPacker/include/Event/PackedDataBuffer.h
@@ -10,7 +10,7 @@
 \*****************************************************************************/
 #pragma once
 #include "Compression.h"
-#include "HltPackedData.h"
+#include "Event/PackedData.h"
 #include "RVersion.h"
 #include <algorithm>
 #include <cstdint>
@@ -72,7 +72,7 @@ namespace LHCb::Hlt::PackedData {
     /// Initialize from an existing buffer and reset position to zero.
     bool init( const buffer_type& data, bool compressed = false );
     /// Return the internal buffer.
-    const buffer_type& buffer() { return m_buffer; }
+    const buffer_type& buffer() const { return m_buffer; }
     /// Compress the buffer
     bool compress( Compression compression, int level, buffer_type& output ) const;
     /// Reserve size for the buffer
@@ -241,7 +241,7 @@ namespace LHCb::Hlt::PackedData {
     /// Clear the internal byte buffer.
     void clear() { m_buffer.clear(); }
     /// Return a reference to the internal buffer.
-    const std::vector<uint8_t>& buffer() { return m_buffer.buffer(); }
+    const std::vector<uint8_t>& buffer() const { return m_buffer.buffer(); }
     /// Compress the buffer
     bool compress( Compression compression, int level, ByteBuffer::buffer_type& output ) const {
       return m_buffer.compress( compression, level, output );
diff --git a/Hlt/HltDAQ/src/component/PackedDataBuffer.cpp b/Event/EventPacker/src/lib/PackedDataBuffer.cpp
similarity index 98%
rename from Hlt/HltDAQ/src/component/PackedDataBuffer.cpp
rename to Event/EventPacker/src/lib/PackedDataBuffer.cpp
index d715e86f992..9d123220a6c 100644
--- a/Hlt/HltDAQ/src/component/PackedDataBuffer.cpp
+++ b/Event/EventPacker/src/lib/PackedDataBuffer.cpp
@@ -8,7 +8,7 @@
 * granted to it by virtue of its status as an Intergovernmental Organization  *
 * or submit itself to any jurisdiction.                                       *
 \*****************************************************************************/
-#include "PackedDataBuffer.h"
+#include "Event/PackedDataBuffer.h"
 #include "Compression.h"
 #include "RVersion.h"
 #include "RZip.h"
diff --git a/Hlt/HltDAQ/CMakeLists.txt b/Hlt/HltDAQ/CMakeLists.txt
index eba4db9b25d..e1e1c7f5540 100644
--- a/Hlt/HltDAQ/CMakeLists.txt
+++ b/Hlt/HltDAQ/CMakeLists.txt
@@ -55,7 +55,6 @@ gaudi_add_module(HltDAQ
         src/component/HltTrackReportsWriter.cpp
         src/component/HltVertexReportsDecoder.cpp
         src/component/HltVertexReportsWriter.cpp
-        src/component/PackedDataBuffer.cpp
         src/component/PackedDataChecksum.cpp
         src/component/ReportConvertTool.cpp
         src/component/RoutingBitsWriter.cpp
diff --git a/Hlt/HltDAQ/src/component/HltPackedDataDecoder.cpp b/Hlt/HltDAQ/src/component/HltPackedDataDecoder.cpp
index fffea46d633..b6dfc255a7e 100644
--- a/Hlt/HltDAQ/src/component/HltPackedDataDecoder.cpp
+++ b/Hlt/HltDAQ/src/component/HltPackedDataDecoder.cpp
@@ -27,9 +27,9 @@
 #include "Event/PackedVertex.h"
 #include "Event/RawEvent.h"
 #include "GaudiAlg/GaudiAlgorithm.h"
-#include "HltPackedData.h"
+#include "Event/PackedData.h"
+#include "Event/PackedDataBuffer.h"
 #include "HltRawBankDecoderBase.h"
-#include "PackedDataBuffer.h"
 #include "PackedDataChecksum.h"
 #include "RZip.h"
 
diff --git a/Hlt/HltDAQ/src/component/HltPackedDataWriter.cpp b/Hlt/HltDAQ/src/component/HltPackedDataWriter.cpp
index ad467f69306..366814c79ad 100644
--- a/Hlt/HltDAQ/src/component/HltPackedDataWriter.cpp
+++ b/Hlt/HltDAQ/src/component/HltPackedDataWriter.cpp
@@ -25,9 +25,9 @@
 #include "Event/PackedVertex.h"
 #include "Event/RawEvent.h"
 #include "GaudiAlg/MergingTransformer.h"
-#include "HltPackedData.h"
+#include "Event/PackedData.h"
+#include "Event/PackedDataBuffer.h"
 #include "Kernel/IANNSvc.h"
-#include "PackedDataBuffer.h"
 #include "PackedDataChecksum.h"
 #include "RZip.h"
 #include <optional>
-- 
GitLab


From 764c581bccc00286458d50002fa230188390f6d2 Mon Sep 17 00:00:00 2001
From: Gitlab CI <noreply@cern.ch>
Date: Mon, 27 Sep 2021 09:09:46 +0000
Subject: [PATCH 2/2] Fixed formatting

patch generated by https://gitlab.cern.ch/lhcb/LHCb/-/jobs/16521302
---
 Event/EventPacker/dict/PackedEventDict.h          | 4 ++--
 Hlt/HltDAQ/src/component/HltPackedDataDecoder.cpp | 4 ++--
 Hlt/HltDAQ/src/component/HltPackedDataWriter.cpp  | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Event/EventPacker/dict/PackedEventDict.h b/Event/EventPacker/dict/PackedEventDict.h
index 13f125926f1..3275d5d8f37 100755
--- a/Event/EventPacker/dict/PackedEventDict.h
+++ b/Event/EventPacker/dict/PackedEventDict.h
@@ -18,6 +18,8 @@
 #include "Event/PackedCaloDigit.h"
 #include "Event/PackedCaloHypo.h"
 #include "Event/PackedCluster.h"
+#include "Event/PackedData.h"
+#include "Event/PackedDataBuffer.h"
 #include "Event/PackedDecReport.h"
 #include "Event/PackedFlavourTag.h"
 #include "Event/PackedMCCaloHit.h"
@@ -41,8 +43,6 @@
 #include "Event/PackedTwoProngVertex.h"
 #include "Event/PackedVertex.h"
 #include "Event/PackedWeightsVector.h"
-#include "Event/PackedData.h"
-#include "Event/PackedDataBuffer.h"
 
 namespace {
   struct EventPacker_Instantiations {
diff --git a/Hlt/HltDAQ/src/component/HltPackedDataDecoder.cpp b/Hlt/HltDAQ/src/component/HltPackedDataDecoder.cpp
index b6dfc255a7e..7dd152ce752 100644
--- a/Hlt/HltDAQ/src/component/HltPackedDataDecoder.cpp
+++ b/Hlt/HltDAQ/src/component/HltPackedDataDecoder.cpp
@@ -15,6 +15,8 @@
 #include "Event/PackedCaloDigit.h"
 #include "Event/PackedCaloHypo.h"
 #include "Event/PackedCluster.h"
+#include "Event/PackedData.h"
+#include "Event/PackedDataBuffer.h"
 #include "Event/PackedFlavourTag.h"
 #include "Event/PackedMuonPID.h"
 #include "Event/PackedPartToRelatedInfoRelation.h"
@@ -27,8 +29,6 @@
 #include "Event/PackedVertex.h"
 #include "Event/RawEvent.h"
 #include "GaudiAlg/GaudiAlgorithm.h"
-#include "Event/PackedData.h"
-#include "Event/PackedDataBuffer.h"
 #include "HltRawBankDecoderBase.h"
 #include "PackedDataChecksum.h"
 #include "RZip.h"
diff --git a/Hlt/HltDAQ/src/component/HltPackedDataWriter.cpp b/Hlt/HltDAQ/src/component/HltPackedDataWriter.cpp
index 366814c79ad..72d290f3db2 100644
--- a/Hlt/HltDAQ/src/component/HltPackedDataWriter.cpp
+++ b/Hlt/HltDAQ/src/component/HltPackedDataWriter.cpp
@@ -13,6 +13,8 @@
 #include "Event/PackedCaloDigit.h"
 #include "Event/PackedCaloHypo.h"
 #include "Event/PackedCluster.h"
+#include "Event/PackedData.h"
+#include "Event/PackedDataBuffer.h"
 #include "Event/PackedFlavourTag.h"
 #include "Event/PackedMuonPID.h"
 #include "Event/PackedPartToRelatedInfoRelation.h"
@@ -25,8 +27,6 @@
 #include "Event/PackedVertex.h"
 #include "Event/RawEvent.h"
 #include "GaudiAlg/MergingTransformer.h"
-#include "Event/PackedData.h"
-#include "Event/PackedDataBuffer.h"
 #include "Kernel/IANNSvc.h"
 #include "PackedDataChecksum.h"
 #include "RZip.h"
-- 
GitLab